/* ─────────────────────────────────────────────────────────────────────────────
   Alder — App Stylesheet
   Design tokens match the landing page exactly.
───────────────────────────────────────────────────────────────────────────── */

:root {
  --bg: #0a0f0d;
  --bg-alt: #111916;
  --fg: #e8ede9;
  --fg-muted: #8b9e90;
  --accent: #4ade80;
  --accent-dim: #22613d;
  --accent-glow: rgba(74, 222, 128, 0.12);
  --danger: #f87171;
  --danger-dim: #7f1d1d;
  --warning: #fbbf24;
  --warning-dim: #78350f;
  --card-bg: #151d19;
  --card-border: #1e2b24;
  --input-bg: #0f1a14;
  --radius: 12px;
  --radius-sm: 8px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1,h2,h3,h4,h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ────────────────────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-alt);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  padding: var(--space-sm) 0;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
}

.sidebar-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  padding: 0.75rem var(--space-sm) 1.5rem;
  letter-spacing: -0.02em;
}

.sidebar-logo span {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--fg-muted);
  display: block;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 1px;
}

.sidebar nav {
  flex: 1;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.6rem var(--space-sm);
  color: var(--fg-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
  border-radius: 0;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  color: var(--fg);
  background: var(--accent-glow);
  text-decoration: none;
}

.sidebar nav a.active {
  color: var(--accent);
  border-left: 2px solid var(--accent);
}

.sidebar-icon { font-style: normal; font-size: 1rem; width: 18px; text-align: center; }

.sidebar-footer {
  padding: var(--space-sm);
  border-top: 1px solid var(--card-border);
}

.sidebar-footer .user-info {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-bottom: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Main content ──────────────────────────────────────────────────────────── */
.main-content {
  margin-left: 220px;
  flex: 1;
  padding: var(--space-md);
  max-width: calc(100vw - 220px);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  gap: var(--space-sm);
}

.page-title { font-size: 1.5rem; }
.page-subtitle { color: var(--fg-muted); font-size: 0.9rem; margin-top: 0.25rem; }

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: var(--space-sm);
}

.card-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
}

/* ── Stat cards ────────────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.stat-box {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: var(--space-sm);
}

.stat-box .label {
  font-size: 0.78rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.stat-box .value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1;
}

.stat-box .value.accent { color: var(--accent); }
.stat-box .value.danger { color: var(--danger); }
.stat-box .value.warning { color: var(--warning); }

/* ── Grid layout ───────────────────────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm); }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-sm); }

/* ── Tables ────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th {
  text-align: left;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--card-border);
}

td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(30,43,36,0.5);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: rgba(74,222,128,0.03); }

.empty-state {
  text-align: center;
  padding: var(--space-lg) var(--space-sm);
  color: var(--fg-muted);
}

.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 0.9rem; }

/* ── Badges / status pills ─────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-green  { background: var(--accent-dim); color: var(--accent); }
.badge-red    { background: var(--danger-dim); color: var(--danger); }
.badge-yellow { background: var(--warning-dim); color: var(--warning); }
.badge-muted  { background: #1a2620; color: var(--fg-muted); }
.badge-blue   { background: #1e2b44; color: #60a5fa; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  text-decoration: none;
}

.btn:hover { opacity: 0.88; text-decoration: none; }
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--accent); color: #0a0f0d; }
.btn-ghost   { background: transparent; color: var(--fg-muted); border: 1px solid var(--card-border); }
.btn-ghost:hover { color: var(--fg); }
.btn-danger  { background: var(--danger-dim); color: var(--danger); border: 1px solid var(--danger); }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.78rem; }

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-control {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  padding: 0.55rem 0.8rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-dim);
}

textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
}

/* ── Alert banners ─────────────────────────────────────────────────────────── */
.alert {
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: var(--space-sm);
}
.alert-error   { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(248,113,113,0.2); }
.alert-success { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(74,222,128,0.2); }

/* ── Drawer / modal ────────────────────────────────────────────────────────── */
.drawer-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
}

.drawer-overlay.open { display: block; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 400px;
  background: var(--bg-alt);
  border-left: 1px solid var(--card-border);
  padding: var(--space-sm);
  z-index: 201;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.drawer-overlay.open .drawer {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.drawer-title { font-family: var(--font-display); font-size: 1.1rem; }
.drawer-close {
  background: none; border: none; color: var(--fg-muted);
  font-size: 1.2rem; cursor: pointer;
}
.drawer-close:hover { color: var(--fg); }

/* ── Auth pages ────────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background:
    radial-gradient(ellipse 60% 50% at 20% 80%, var(--accent-glow), transparent),
    var(--bg);
}

.auth-box {
  width: 100%;
  max-width: 400px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: var(--space-md);
}

.auth-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--space-md);
  display: block;
}

.auth-title {
  font-size: 1.1rem;
  margin-bottom: var(--space-sm);
}

.auth-switch {
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.85rem;
  margin-top: var(--space-sm);
}

/* ── Timeline / meeting list ───────────────────────────────────────────────── */
.meeting-timeline { display: flex; flex-direction: column; gap: 0.5rem; }

.meeting-item {
  display: flex;
  gap: var(--space-sm);
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  align-items: flex-start;
  transition: border-color 0.15s;
}

.meeting-item:hover { border-color: var(--accent-dim); }

.meeting-time {
  flex-shrink: 0;
  width: 64px;
  text-align: right;
}

.meeting-time .date {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
}

.meeting-time .time {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
}

.meeting-divider {
  width: 1px;
  background: var(--card-border);
  flex-shrink: 0;
}

.meeting-body { flex: 1; }
.meeting-title { font-weight: 600; font-size: 0.9rem; }
.meeting-client { font-size: 0.78rem; color: var(--fg-muted); margin-top: 2px; }

/* ── Invoice list items ────────────────────────────────────────────────────── */
.inv-list { display: flex; flex-direction: column; gap: 0.4rem; }

.inv-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--fg);
  transition: border-color 0.15s;
}

.inv-item:hover { border-color: var(--accent-dim); text-decoration: none; }
.inv-item .inv-number { font-family: var(--font-display); font-size: 0.8rem; font-weight: 600; }
.inv-item .inv-client { font-size: 0.8rem; color: var(--fg-muted); }
.inv-item .inv-total { font-family: var(--font-display); font-weight: 700; }
.inv-item .inv-due { font-size: 0.75rem; color: var(--fg-muted); }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-logo span, .sidebar nav a span { display: none; }
  .main-content { margin-left: 60px; max-width: calc(100vw - 60px); }
  .two-col, .form-row { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr; }
  .drawer { width: 100%; }
}

/* ── Section spacing ───────────────────────────────────────────────────────── */
.section { margin-bottom: var(--space-md); }

/* ── Landing page overrides (keep existing hero styles working) ─────────────── */
.hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  padding: 6rem 2rem; position: relative; overflow: hidden;
  background: radial-gradient(ellipse 60% 50% at 20% 80%, var(--accent-glow), transparent),
              radial-gradient(ellipse 40% 40% at 80% 20%, rgba(74,222,128,0.05), transparent), var(--bg); }
.hero-inner { max-width: 720px; }
.hero-badge { display: inline-block; padding: 6px 16px; background: var(--accent-dim); color: var(--accent);
  font-family: var(--font-display); font-size: 13px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; border-radius: 100px; margin-bottom: 2rem; }
.hero h1 { font-size: clamp(2.8rem,6vw,4.5rem); margin-bottom: 2rem; color: var(--fg); }
.hero-accent { color: var(--accent); }
.hero-sub { font-size: 1.15rem; color: var(--fg-muted); max-width: 540px; line-height: 1.7; }
.hero-visual { display: flex; gap: 1rem; margin-top: 4rem; flex-wrap: wrap; }
.stat-card { display: flex; align-items: center; gap: 12px; background: var(--card-bg);
  border: 1px solid var(--card-border); border-radius: var(--radius); padding: 1rem 1.25rem; }
.stat-icon { font-size: 1.5rem; }
.stat-num { display: block; font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.75rem; color: var(--fg-muted); }
.hero-cta { display: flex; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }
.cta-primary { background: var(--accent); color: #0a0f0d; padding: 0.8rem 2rem;
  border-radius: var(--radius-sm); font-family: var(--font-display); font-weight: 700;
  font-size: 1rem; text-decoration: none; transition: opacity 0.15s; }
.cta-primary:hover { opacity: 0.88; text-decoration: none; }
.cta-secondary { border: 1px solid var(--card-border); color: var(--fg-muted);
  padding: 0.8rem 1.5rem; border-radius: var(--radius-sm); font-weight: 500;
  font-size: 0.95rem; text-decoration: none; transition: color 0.15s; }
.cta-secondary:hover { color: var(--fg); text-decoration: none; }

/* problem, capabilities, how, closing, footer — keep original template working */
.problem { padding: 6rem 2rem; background: var(--bg-alt); }
.problem-inner { max-width: 900px; margin: 0 auto; }
.problem h2 { font-size: clamp(2rem,4vw,3rem); margin-bottom: 2rem; }
.problem em { color: var(--accent); font-style: normal; }
.problem-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 2rem; margin-bottom: 2rem; }
.problem-number { font-family: var(--font-display); font-size: 3rem; font-weight: 700; color: var(--accent); }
.problem-statement { color: var(--fg-muted); max-width: 680px; }
.capabilities { padding: 6rem 2rem; }
.cap-inner { max-width: 1000px; margin: 0 auto; }
.cap-inner h2 { font-size: clamp(2rem,4vw,3rem); margin-bottom: 2rem; }
.cap-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1.5rem; }
.cap-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 1.5rem; }
.cap-role { font-family: var(--font-display); font-size: 0.8rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--accent); margin-bottom: 0.5rem; }
.cap-card p { color: var(--fg-muted); font-size: 0.9rem; }
.how { padding: 6rem 2rem; background: var(--bg-alt); }
.how-inner { max-width: 900px; margin: 0 auto; }
.how-inner h2 { font-size: clamp(2rem,4vw,3rem); margin-bottom: 2rem; }
.how-steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 2rem; }
.how-step { }
.step-num { font-family: var(--font-display); font-size: 2.5rem; font-weight: 700; color: var(--accent-dim);
  margin-bottom: 0.5rem; }
.how-step h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.how-step p { color: var(--fg-muted); font-size: 0.9rem; }
.closing { padding: 6rem 2rem; text-align: center; }
.closing h2 { font-size: clamp(2rem,4vw,3rem); margin-bottom: 1rem; }
.closing p { color: var(--fg-muted); max-width: 560px; margin: 0 auto 2rem; }
footer { padding: 2rem; text-align: center; color: var(--fg-muted); font-size: 0.8rem;
  border-top: 1px solid var(--card-border); }
