:root {
  --indigo-deep: #0F172A;
  --indigo-mid: #1E293B;
  --amber: #FBBF24;
  --amber-hover: #F59E0B;
  --canvas: #F8F7F4;
  --paper: #FFFFFF;
  --elevated: #F1F3F8;
  --border: #E2E8F0;
  --text: #0F172A;
  --muted: #475569;
  --positive: #15803D;
  --warning: #B45309;
  --danger: #B91C1C;
  --info: #1D4ED8;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--canvas);
  color: var(--text);
  line-height: 1.5;
}

.hidden { display: none !important; }
.small { font-size: 0.85rem; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  background: var(--indigo-deep);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--amber);
}
.brand-wrap { display: flex; align-items: center; gap: 12px; }
.brand-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(251,191,36,0.2); }
.brand-title { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em; }
.brand-sub { font-size: 0.78rem; color: #94A3B8; }
.topbar-right { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; }

.demo-banner {
  background: #FEF3C7;
  color: #92400E;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.86rem;
  border-bottom: 1px solid #FDE68A;
}

.banner {
  max-width: 980px;
  width: calc(100% - 32px);
  margin: 14px auto 0;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.92rem;
  border: 1px solid var(--border);
  background: #EFF6FF;
  color: var(--info);
}
.banner.error { background: #FEF2F2; color: var(--danger); border-color: #FECACA; }
.banner.success { background: #F0FDF4; color: var(--positive); border-color: #BBF7D0; }

.auth-wrap { flex: 1; display: grid; place-items: center; padding: 28px 16px; }
.auth-card { max-width: 440px; width: 100%; }

.workspace { max-width: 980px; width: 100%; margin: 0 auto; padding: 16px; flex: 1; }

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 9px 14px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.tab.active {
  background: var(--indigo-deep);
  color: #fff;
}

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 16px;
}

.hero-card {
  background: linear-gradient(135deg, var(--indigo-deep), var(--indigo-mid));
  color: #fff;
  border: 1px solid rgba(251,191,36,0.35);
}
.hero-clock { font-size: 2.75rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.progress-track { height: 8px; border-radius: 99px; background: rgba(255,255,255,0.18); overflow: hidden; margin: 10px 0; }
.progress-fill { height: 100%; background: var(--amber); border-radius: 99px; transition: width 0.3s ease; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(251,191,36,0.18);
  color: #92400E;
}
.hero-card .badge { background: rgba(255,255,255,0.14); color: var(--amber); }
.badge.green { background: rgba(21,128,61,0.14); color: var(--positive); }
.hero-card .badge.green { background: rgba(74,222,128,0.2); color: #4ADE80; }
.badge.red { background: rgba(185,28,28,0.14); color: var(--danger); }

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-full { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 0.84rem; }
.btn-primary { background: var(--amber); color: var(--indigo-deep); }
.btn-primary:hover:not(:disabled) { background: var(--amber-hover); }
.btn-dark { background: #000; color: #fff; }
.btn-outline { background: var(--paper); color: var(--text); border-color: var(--border); }
.btn-ghost { background: var(--elevated); color: var(--text); }
.btn-danger { background: #FEE2E2; color: var(--danger); border-color: #FECACA; }

.field { display: flex; flex-direction: column; gap: 5px; font-size: 0.88rem; font-weight: 500; }
.field input, .field select, .field textarea {
  font: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--text);
}

.divider {
  display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.8rem; margin: 4px 0;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.kpi { padding: 14px; background: var(--elevated); border-radius: 14px; }
.kpi-label { font-size: 0.78rem; color: var(--muted); }
.kpi-val { font-size: 1.45rem; font-weight: 700; margin-top: 2px; }

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); }
th { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }

.chip {
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--elevated); font-size: 0.84rem; font-weight: 600; cursor: pointer;
}

.legal-footer {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 18px; font-size: 0.8rem;
}
.legal-footer a { color: var(--muted); text-decoration: none; }
.legal-footer a:hover { text-decoration: underline; }

@media print {
  .topbar, .tabs, .demo-banner, .banner, .no-print { display: none !important; }
  body { background: #fff; }
  .card { border: none; padding: 0; }
}
