/* ============================================================
   Diageo Flow — Static demo design system
   Mirrors aikido-flow-saas/static/css/app.css
   ============================================================ */

:root {
  --bg: #F7F6F1;
  --bg-2: #FFFFFF;
  --bg-3: #EFEDE5;
  --bg-4: #E6E3D8;
  --ink: #15140F;
  --ink-2: #3A3830;
  --ink-3: #76736A;
  --ink-4: #A6A299;
  --line: #E6E3D8;
  --line-2: #D6D2C4;
  --accent-h: 125;
  --accent: oklch(82% 0.21 var(--accent-h));
  --accent-ink: oklch(28% 0.09 var(--accent-h));
  --accent-bg: oklch(94% 0.09 var(--accent-h));
  --amber: oklch(80% 0.16 75);
  --amber-bg: oklch(95% 0.06 75);
  --amber-ink: oklch(38% 0.12 60);
  --rose: oklch(68% 0.2 20);
  --rose-bg: oklch(95% 0.05 20);
  --rose-ink: oklch(42% 0.15 25);
  --green: oklch(70% 0.15 150);
  --green-ink: oklch(42% 0.14 150);
  --green-bg: oklch(96% 0.05 150);
  --blue: oklch(70% 0.14 240);
  --blue-ink: oklch(40% 0.14 240);
  --blue-bg: oklch(95% 0.04 240);
}

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

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Geist', system-ui, sans-serif;
  font-feature-settings: "ss01","cv11";
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100vh; }

.mono { font-family: 'Geist Mono', ui-monospace, monospace; font-feature-settings: "tnum"; }
.serif { font-family: 'Instrument Serif', serif; font-weight: 400; font-style: italic; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---- APP SHELL ---- */
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}

/* ---- SIDEBAR ---- */
.side {
  background: var(--ink);
  color: #E9E7DF;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.logo { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent);
  display: grid; place-items: center;
  color: var(--accent-ink);
  font-weight: 700; font-size: 13px; letter-spacing: -0.02em;
  flex-shrink: 0;
}
.logo-text { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
.logo-text em { display: block; font-style: normal; font-size: 11px; color: #8A877E; font-weight: 400; margin-top: 1px; letter-spacing: 0; }

.workspace {
  background: #24221D; border: 1px solid #2E2B24; border-radius: 10px;
  padding: 10px 12px; display: flex; align-items: center; gap: 10px; cursor: pointer;
}
.workspace-avatar {
  width: 22px; height: 22px; border-radius: 5px;
  background: linear-gradient(135deg, oklch(75% 0.15 40), oklch(65% 0.18 340));
  flex-shrink: 0;
}
.workspace-text { font-size: 12px; flex: 1; min-width: 0; }
.workspace-text b { font-weight: 500; display: block; }
.workspace-text span { color: #8A877E; font-size: 10.5px; }
.workspace-chev { color: #676459; flex-shrink: 0; }

.nav-section { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: #676459; padding: 0 10px 6px; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-group-parent {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: 7px;
  color: #C9C6BC; font-size: 13px; font-weight: 400;
  text-decoration: none; transition: background 0.15s;
}
.nav-group-parent:hover { background: #24221D; color: #E9E7DF; }
.nav-group-parent.active { background: #24221D; color: #fff; }
.nav-sub {
  display: flex; align-items: center;
  padding: 6px 10px 6px 34px;
  border-radius: 7px; color: #8A877E;
  font-size: 12px; font-weight: 400;
  text-decoration: none; position: relative;
  transition: background 0.15s;
}
.nav-sub::before {
  content: ''; position: absolute; left: 18px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 3px; border-radius: 50%; background: #3A372F;
}
.nav-sub:hover { background: #24221D; color: #C9C6BC; }
.nav-sub.active { color: #E9E7DF; }
.nav-sub.active::before { background: var(--accent); width: 4px; height: 4px; }

.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: 7px;
  color: #C9C6BC; font-size: 13px; text-decoration: none; font-weight: 400;
  transition: background 0.15s;
}
.nav a:hover { background: #24221D; color: #E9E7DF; }
.nav a.active { background: #24221D; color: #fff; }
.nav a .count { margin-left: auto; font-size: 11px; color: #8A877E; font-family: 'Geist Mono', monospace; }
.nav a.active .count { color: var(--accent); }
.nav-icon { width: 16px; height: 16px; stroke-width: 1.5; color: currentColor; flex-shrink: 0; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 6px; border-top: 1px solid #2E2B24;
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: oklch(70% 0.15 260);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600; color: #fff; flex-shrink: 0;
}
.user-meta { font-size: 12px; min-width: 0; flex: 1; }
.user-meta b { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta span { font-size: 10.5px; color: #8A877E; }
.user-logout {
  flex-shrink: 0; display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 5px;
  color: #8A877E; background: none; border: none;
  transition: background 0.15s, color 0.15s;
}
.user-logout:hover { background: #24221D; color: #fff; }

/* ---- MAIN ---- */
.main { min-width: 0; padding: 0; }

.msgs { padding: 14px 32px 0; display: flex; flex-direction: column; gap: 8px; }
.msg {
  padding: 10px 14px; border-radius: 8px; font-size: 13px;
  background: var(--accent-bg); color: var(--accent-ink);
  border: 1px solid var(--accent);
  display: flex; align-items: center; gap: 10px;
}
.msg.success { background: var(--green-bg); color: var(--green-ink); border-color: var(--green); }
.msg.error { background: var(--rose-bg); color: var(--rose-ink); border-color: var(--rose); }
.msg-close { margin-left: auto; background: none; border: none; color: currentColor; cursor: pointer; font-size: 18px; line-height: 1; }

.page-hd {
  padding: 18px 32px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.page-hd-title { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; color: var(--ink); }
.page-hd-actions { display: flex; gap: 8px; align-items: center; }

/* ---- AVATARS ---- */
.av {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: oklch(65% 0.15 var(--av-h, 260));
  color: #fff; font-weight: 600; font-size: 11px; flex-shrink: 0;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--ink);
  text-decoration: none; cursor: pointer; transition: filter 0.1s;
}
.btn:hover { background: var(--bg-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.05); background: var(--accent); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark:hover { background: #2A2823; }
.btn.danger { background: var(--rose-bg); border-color: var(--rose); color: var(--rose-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--bg-3); }

/* ---- TOPBAR (project detail) ---- */
.topbar {
  padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--line);
}
.crumbs { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-3); }
.crumbs .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); }

/* ---- FORM ---- */
.form-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-field label { font-size: 11px; font-weight: 500; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.form-field input, .form-field textarea, .form-field select {
  border: 1px solid var(--line-2); border-radius: 8px; padding: 9px 11px;
  background: var(--bg-2); font: inherit; font-size: 13px; color: var(--ink); outline: none;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: var(--ink); }

/* ---- TOAST ---- */
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px;
  font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  display: flex; align-items: center; gap: 8px; min-width: 240px;
  animation: toastIn 0.25s ease;
}
.toast.success { background: var(--green-ink); }
.toast.danger  { background: var(--rose-ink); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---- BADGES ---- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500;
  padding: 3px 9px; border-radius: 99px;
  background: var(--bg-3); color: var(--ink-2);
}
.badge.green { background: var(--green-bg); color: var(--green-ink); }
.badge.amber { background: var(--amber-bg); color: var(--amber-ink); }
.badge.rose  { background: var(--rose-bg); color: var(--rose-ink); }
.badge.accent { background: var(--accent-bg); color: var(--accent-ink); }

/* ---- CARDS ---- */
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.card.dark { background: var(--ink); color: #E9E7DF; border-color: var(--ink); }

/* ---- DEMO BANNER ---- */
.demo-banner {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 11px; padding: 6px 14px;
  border-radius: 99px; font-family: 'Geist Mono', monospace;
  letter-spacing: 0.06em; text-transform: uppercase; z-index: 50;
  box-shadow: 0 4px 18px rgba(0,0,0,0.25);
  opacity: 0.92;
}
.demo-banner span { color: var(--accent); }

@media (max-width: 1100px) {
  .app { grid-template-columns: 1fr; }
  .side { position: relative; height: auto; }
}
