:root {
  --bg: #020617;
  --panel: #07111f;
  --panel-2: #0f172a;
  --border: #1e3a5f;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #0ea5e9;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
}

html[data-theme="light"] {
  --bg: #eef7fb;
  --panel: #ffffff;
  --panel-2: #e7f1f7;
  --border: #a9c7d6;
  --text: #132033;
  --muted: #52677c;
  --shadow: 0 12px 34px rgba(28, 63, 82, 0.14);
}

html[data-theme="light"] .estimation-header {
  background: rgba(255, 255, 255, 0.96);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.estimation-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.08), transparent 28%),
    var(--bg);
}

.estimation-header {
  height: 58px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.96);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 132px;
  height: 40px;
  object-fit: contain;
}

.brand h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.15;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.back-link {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 7px 10px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 12px;
}

.back-link:hover {
  border-color: var(--accent);
}

.estimation-page {
  height: calc(100vh - 60px);
  overflow: hidden;
}

/* Workflow Stepper */

.workflow-steps {
  display: flex;
  align-items: stretch;
  margin-bottom: 14px;
  overflow-x: auto;
  padding: 2px 0 10px;
}

.step {
  position: relative;
  min-width: 175px;
  height: 42px;
  padding: 0 24px 0 30px;
  border: 0;
  background: #111827;
  color: #cbd5e1;
  font-weight: 700;
  font-size: 13px;
  clip-path: polygon(
    0 0,
    calc(100% - 18px) 0,
    100% 50%,
    calc(100% - 18px) 100%,
    0 100%,
    18px 50%
  );
  margin-left: -12px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.step:first-child {
  margin-left: 0;
  clip-path: polygon(
    0 0,
    calc(100% - 18px) 0,
    100% 50%,
    calc(100% - 18px) 100%,
    0 100%
  );
  border-radius: 10px 0 0 10px;
}

.step:last-child {
  clip-path: polygon(
    0 0,
    100% 0,
    100% 100%,
    0 100%,
    18px 50%
  );
  border-radius: 0 10px 10px 0;
}

.step:hover {
  background: #172033;
  color: #ffffff;
}

.step.active {
  background: linear-gradient(135deg, #0891b2, #0f766e);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.18);
  z-index: 2;
}

/* Old tab support */

.estimation-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.tab-btn {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  border-radius: 11px;
  padding: 8px 14px;
  font-weight: 700;
}

.tab-btn.active {
  color: white;
  border-color: var(--accent);
  background: linear-gradient(135deg, #075985, #0f766e);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.card,
.placeholder-card,
.action-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.98));
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.card {
  padding: 14px 18px;
}

.card h2,
.placeholder-card h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.card p,
.placeholder-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.card-header.compact {
  align-items: center;
}

.placeholder-card {
  padding: 22px;
  min-height: 220px;
}

.btn {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 11px;
  padding: 9px 14px;
  font-weight: 700;
}

.btn:hover {
  border-color: var(--accent);
}

.btn-primary {
  background: linear-gradient(135deg, #0891b2, #0f766e);
  border: 1px solid #22d3ee;
  color: white;
}

.btn-full {
  width: 100%;
}

.status-text {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.status-text.success {
  color: var(--success);
}

.status-text.error {
  color: var(--danger);
}

.workflow-steps::-webkit-scrollbar {
  height: 6px;
}

.workflow-steps::-webkit-scrollbar-track {
  background: transparent;
}

.workflow-steps::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 999px;
}

.workflow-steps::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

@media (max-width: 1100px) {
  .estimation-header {
    height: auto;
    align-items: flex-start;
    gap: 10px;
    flex-direction: column;
  }

  .workflow-steps,
  .estimation-tabs {
    overflow-x: auto;
  }

  .step {
    min-width: 160px;
  }
}

#projectName {
  height: 38px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #2a3a5a;
  background: #0f1c35;
  color: #ffffff;
  font-size: 14px;
  width: 240px;
  outline: none;
}

#projectName::placeholder {
  color: #8fa2c0;
}

#projectName:focus {
  border-color: #4da3ff;
  box-shadow: 0 0 4px rgba(77,163,255,0.6);
}
