:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #f0ede5;
  --text: #171717;
  --muted: #6f6b62;
  --line: #ded8cc;
  --accent: #111111;
  --gold: #d6b35a;
  --danger: #b84a4a;
  --shadow: 0 16px 40px rgba(22, 33, 31, 0.08);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; color: var(--text); background: var(--bg); font-family: Inter, Arial, Helvetica, sans-serif; }
button, input, select, textarea { font: inherit; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
textarea { min-height: 100px; resize: vertical; }
.login-screen { position: fixed; inset: 0; z-index: 10; display: none; place-items: center; padding: 20px; background: rgba(17,17,17,.88); }
.login-screen.active { display: grid; }
.login-card { display: grid; gap: 16px; width: min(440px, 100%); padding: 24px; border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.microcopy, .muted { color: var(--muted); font-size: 13px; line-height: 1.5; }
.sidebar { position: sticky; top: 0; min-height: 100vh; padding: 24px 18px; background: #111; color: #fff; }
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 28px; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; background: var(--gold); color: #111; font-weight: 800; }
.brand small, .user-card small { display: block; color: #c9c2b2; margin-top: 3px; }
.nav { display: grid; gap: 8px; }
.nav-item { width: 100%; padding: 12px 14px; border: 0; border-radius: 8px; color: #eee; background: transparent; text-align: left; cursor: pointer; }
.nav-item.active, .nav-item:hover { background: rgba(255,255,255,.1); }
.user-card { display: grid; gap: 10px; margin-top: 30px; padding: 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; }
.app { min-width: 0; padding: 26px; }
.topbar { display: grid; grid-template-columns: 1fr auto minmax(260px, 420px); gap: 20px; align-items: center; margin-bottom: 22px; }
.eyebrow { margin: 0 0 5px; color: var(--accent); font-size: 12px; font-weight: 800; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 30px; }
h2 { margin-bottom: 0; font-size: 18px; }
.status-strip { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.status-pill, .badge { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: 12px; font-weight: 800; }
.badge.red { background: #f7dfdf; color: #963c3c; }
.badge.green { background: #dff3ed; color: #116451; }
.badge.gold { background: #fff1c9; color: #765313; }
.view { display: none; }
.view.active { display: block; }
.executive-summary, .panel, .metric, .card, .column, .table-wrap { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.executive-summary { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 18px; padding: 22px; background: linear-gradient(135deg, #fff, #f7f1df); }
.summary-actions, .toolbar, .panel-head, .card-actions, .modal-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric { padding: 18px; }
.metric span { display: block; color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 10px; font-size: 28px; }
.split, .integration { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel { padding: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 800px; border-collapse: collapse; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); background: var(--surface-2); font-size: 13px; }
.cards-grid { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 14px; }
.compact-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
.card { padding: 16px; }
.kanban-board { display: grid; grid-template-columns: repeat(5, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; }
.column { min-height: 520px; padding: 12px; }
.kanban-card { margin-bottom: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfc; }
.bar-chart { display: grid; gap: 12px; }
.bar-row header { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; font-weight: 800; }
.bar-track { height: 12px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.bar-fill { display: block; height: 100%; background: #111; }
.primary, .secondary, .danger, .tiny-button { min-height: 36px; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.primary { border: 1px solid #111; background: #111; color: #fff; }
.secondary, .tiny-button { border: 1px solid var(--line); background: #fff; color: var(--text); }
.danger { border: 1px solid var(--danger); background: #fff7f7; color: var(--danger); }
.compact, .tiny-button { min-height: 28px; padding: 5px 8px; font-size: 13px; }
.email-panel { margin-top: 18px; }
.modal { width: min(720px, calc(100vw - 32px)); border: 0; padding: 0; background: transparent; }
.modal::backdrop { background: rgba(17,17,17,.5); }
.modal-card { padding: 18px; border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field.full { grid-column: 1 / -1; }
.field label, .login-card label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; font-weight: 800; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
@media (max-width: 980px) {
  body { grid-template-columns: 1fr; padding-bottom: 92px; }
  .sidebar { position: fixed; right: 12px; bottom: 12px; left: 12px; z-index: 8; min-height: auto; padding: 10px; border-radius: 12px; }
  .brand, .user-card { display: none; }
  .nav { grid-template-columns: repeat(6, 1fr); gap: 4px; }
  .nav-item { min-height: 48px; padding: 8px 6px; text-align: center; font-size: 12px; }
  .topbar, .executive-summary, .split, .integration { display: grid; grid-template-columns: 1fr; }
  .metrics, .cards-grid, .compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .app { padding: 16px; }
  .metrics, .cards-grid, .compact-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .nav { overflow-x: auto; grid-template-columns: repeat(6, minmax(82px, 1fr)); }
}
