/* Eonn Command: same shell and tokens as the Eonn platform (frontend/src/app/globals.css). */
:root {
  --shell-window: #f9f9f9;
  --shell-sidebar: #fcfcfc;
  --shell-main: #ffffff;
  --shell-glass: rgba(255, 255, 255, .68);
  --shell-glass-border: rgba(255, 255, 255, .75);
  --shell-border: rgba(0, 0, 0, .08);
  --shell-hover: rgba(0, 0, 0, .05);
  --shell-active: rgba(0, 0, 0, .065);
  --shell-text: #0d0d0d;
  --shell-muted: #6f6f6f;
  --shell-icon: #2f2f2f;
  --shell-tray: #f7f7f7;
  --border: #e5e5e5;
  --blue-50: #f3f8fe; --blue-100: #e5f0fd; --blue-200: #cae1fb; --blue-500: #5b9be6; --blue-600: #3f7ccc; --blue-950: #1a2d44;
  --green: #16a34a; --green-bg: #e8f7ee;
  --amber: #b45309; --amber-bg: #fff4e0;
  --red: #dc2626; --red-bg: #fdecec;
  --violet: #6d4fd8; --violet-bg: #f0ecfd;
  --font: ui-sans-serif, -apple-system, system-ui, "SF Pro Text", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--shell-window); color: var(--shell-text); -webkit-font-smoothing: antialiased; font-size: 14.5px; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.tiny { width: 14px; height: 14px; color: var(--shell-muted); }
[hidden] { display: none !important; }
.muted { color: var(--shell-muted); }

/* ---------- sign in ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(60% 50% at 10% 0%, var(--blue-100), transparent 70%), radial-gradient(50% 50% at 100% 100%, #e7f5ee, transparent 70%), var(--shell-window); }
.login-card { width: 100%; max-width: 380px; background: var(--shell-main); border-radius: 22px; padding: 36px 30px 30px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 0 0 1px var(--shell-border), 0 20px 60px -20px rgba(0,0,0,.18); }
.logo-tile { width: 44px; height: 44px; border-radius: 12px; background: #1a1b21; display: grid; place-items: center; }
.logo-tile svg { width: 30px; height: 30px; }
.login-card h1 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; }
.login-card p { margin-top: -8px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--shell-muted); }
input, select, textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 9px 12px; font-size: 14.5px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(91,155,230,.18); }
textarea { resize: vertical; min-height: 72px; }
.form-error { color: var(--red); font-size: 13px; min-height: 18px; }

.btn-dark, .btn-line, .btn-soft { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 500; white-space: nowrap; transition: opacity .15s, background .15s; }
.btn-dark { background: #1a1a1a; color: #fff; }
.btn-dark:hover { opacity: .85; }
.btn-line { box-shadow: inset 0 0 0 1px var(--border); background: #fff; }
.btn-line:hover, .btn-soft:hover { background: var(--shell-hover); }
.btn-soft { background: var(--shell-tray); }
.btn-dark svg, .btn-line svg, .btn-soft svg { width: 15px; height: 15px; }
.btn-dark.wide { height: 42px; margin-top: 4px; }
.btn-danger { color: var(--red); }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--shell-icon); }
.icon-btn:hover { background: var(--shell-hover); }

/* ---------- shell ---------- */
.shell { display: flex; height: 100dvh; overflow: hidden; }
.rail { width: 60px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 0; position: relative; }
.rail-btn { position: relative; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--shell-icon); }
.rail-btn:hover { background: var(--shell-hover); }
.rail-btn.on { background: #fff; box-shadow: 0 0 0 1px var(--shell-border), 0 1px 3px rgba(0,0,0,.06); color: var(--shell-text); }
.rail-badge { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px; background: #3b82f6; color: #fff; font: 600 10px/16px var(--font); font-style: normal; text-align: center; }
.rail-badge:empty { display: none; }
.avatar { margin-top: auto; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #f9a8d4, #ec6fae); color: #fff; font-size: 12px; font-weight: 600; }
.menu { position: absolute; left: 56px; bottom: 10px; z-index: 60; width: 240px; padding: 6px; border-radius: 16px; background: var(--shell-glass);
  -webkit-backdrop-filter: blur(24px) saturate(190%); backdrop-filter: blur(24px) saturate(190%); border: 1px solid var(--shell-glass-border);
  box-shadow: 0 16px 48px rgba(0,0,0,.14), 0 2px 6px rgba(0,0,0,.05); }
.menu-head { padding: 6px 10px; display: flex; flex-direction: column; }
.menu-head span { color: var(--shell-muted); font-size: 13px; }
.menu hr { border: 0; height: 1px; background: var(--shell-border); margin: 4px 0; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border-radius: 10px; }
.menu-item:hover { background: var(--shell-hover); }

.card-wrap { flex: 1; min-width: 0; display: flex; padding: 8px 8px 8px 0; }
.card-wrap > .sidebar, .card-wrap > .main, .card-wrap > .panel { min-height: 0; }
.sidebar { width: 260px; flex: none; background: radial-gradient(90% 160px at 10% 100%, rgba(202,225,251,.55), transparent 70%) no-repeat bottom / 100% 200px, radial-gradient(80% 160px at 90% 100%, rgba(214,239,230,.6), transparent 70%) no-repeat bottom / 100% 200px, var(--shell-sidebar); background-attachment: local, local, scroll; border-radius: 16px 0 0 16px; padding: 0 8px 12px; overflow-y: auto; position: relative;
  box-shadow: 0 0 0 1px var(--shell-border); }
.sb-head { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 2px 0 8px; position: sticky; top: 0; background: var(--shell-sidebar); z-index: 2; }
.sb-head b { display: flex; align-items: center; gap: 4px; font-size: 19px; font-weight: 600; letter-spacing: -.015em; }
#sbClose { display: none; }
.sb-item { height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: 10px; font-size: 14.5px; }
.sb-item svg { width: 17px; height: 17px; }
.sb-item:hover { background: var(--shell-hover); }
.sb-item.on { background: var(--shell-active); }
.sb-count { margin-left: auto; font-size: 12px; color: #3b82f6; font-weight: 600; }
.sb-label { padding: 18px 10px 4px; font-size: 13.5px; color: var(--shell-muted); }
.sb-sub { height: 34px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: 10px; font-size: 14.5px; width: 100%; text-align: left; }
.sb-sub:hover { background: var(--shell-hover); }
.sb-sub.on { background: var(--shell-active); }
.sb-sub .num { margin-left: auto; color: var(--shell-muted); font-size: 13px; }
.sb-recent { display: block; padding: 8px 10px; border-radius: 10px; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-recent:hover { background: var(--shell-hover); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--shell-main); border-radius: 0 16px 16px 0; box-shadow: 0 0 0 1px var(--shell-glass-border), 0 10px 40px rgba(0,0,0,.07); overflow: hidden; }
.titlebar { height: 52px; flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 10px 0 16px; }
.tb-left { display: flex; align-items: center; gap: 4px; }
.tb-title { font-size: 15px; font-weight: 600; }
.tb-right { display: flex; justify-content: flex-end; }
.seg { display: flex; background: #f1f1f2; border-radius: 999px; padding: 3px; }
.seg button { height: 30px; padding: 0 16px; border-radius: 999px; font-size: 14px; color: var(--shell-muted); }
.seg button.on { background: #fff; color: var(--shell-text); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.view { flex: 1; overflow-y: auto; padding: 8px 32px 48px; }
.mobile-only { display: none; }

/* detail panel docked on the right, like the Eonn panel */
.panel { width: 400px; flex: none; margin-left: 8px; background: var(--shell-main); border-radius: 16px; box-shadow: 0 0 0 1px var(--shell-glass-border), 0 10px 40px rgba(0,0,0,.07); overflow-y: auto; }
.panel-head { position: sticky; top: 0; background: var(--shell-main); z-index: 2; display: flex; align-items: flex-start; gap: 10px; padding: 16px 12px 12px 20px; border-bottom: 1px solid var(--shell-border); }
.panel-head h2 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.panel-head p { color: var(--shell-muted); font-size: 13.5px; margin-top: 2px; }
.panel-head .icon-btn { margin-left: auto; }
.panel-body { padding: 16px 20px 28px; display: flex; flex-direction: column; gap: 18px; }
.panel-sec h3 { font-size: 13px; font-weight: 500; color: var(--shell-muted); margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 112px 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--shell-muted); }
.kv dd { word-break: break-word; }
.kv a { color: var(--blue-600); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.timeline { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.timeline li { display: grid; grid-template-columns: 8px 1fr; gap: 10px; font-size: 13.5px; }
.timeline li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #c8ccd3; margin-top: 6px; }
.timeline time { display: block; color: var(--shell-muted); font-size: 12.5px; }
.note { background: var(--shell-tray); border-radius: 12px; padding: 10px 12px; font-size: 14px; white-space: pre-wrap; }
.note time { display: block; color: var(--shell-muted); font-size: 12px; margin-bottom: 2px; }
.meet-box { background: var(--blue-50); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.meet-box b { font-size: 15px; }

/* ---------- content ---------- */
.home-h { font-size: 28px; font-weight: 600; letter-spacing: -.02em; margin: 24px 0 4px; }
.home-sub { color: var(--shell-muted); margin-bottom: 24px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { border: 1px solid var(--border); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.stat-top { display: flex; align-items: center; gap: 10px; color: var(--shell-muted); font-size: 13.5px; }
.hic { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border); display: grid; place-items: center; color: var(--shell-icon); flex: none; }
.hic svg { width: 16px; height: 16px; }
.stat b { font-size: 28px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat small { color: var(--shell-muted); font-size: 12.5px; }
.grid2 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 12px; margin-top: 12px; }
.card { border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.card-h b { font-size: 15px; font-weight: 600; }
.card-h a, .card-h button.link { margin-left: auto; color: var(--shell-muted); font-size: 13.5px; display: flex; align-items: center; gap: 2px; }
.card-h a:hover, .card-h button.link:hover { color: var(--shell-text); }
.empty { color: var(--shell-muted); text-align: center; padding: 28px 12px; font-size: 14px; }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-top: 1px solid #f1f1f1; border-radius: 10px; cursor: pointer; }
.li:first-of-type { border-top: 0; }
.li:hover { background: var(--shell-hover); border-top-color: transparent; }
.li + .li:hover, .li:hover + .li { border-top-color: transparent; }
.li .who { min-width: 0; flex: 1; }
.li .who b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .who span { color: var(--shell-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.li .when { color: var(--shell-muted); font-size: 13px; white-space: nowrap; }
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; background: var(--blue-100); color: var(--blue-950); }
.chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 10px; }
.chart div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart i { width: 100%; max-width: 34px; border-radius: 6px 6px 3px 3px; background: var(--blue-200); min-height: 3px; }
.chart div:last-child i { background: var(--blue-500); }
.chart span { font-size: 11px; color: var(--shell-muted); }

.toolbar { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--shell-muted); }
.search input { padding-left: 34px; border-radius: 999px; background: var(--shell-tray); border-color: transparent; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13.5px; color: var(--shell-muted); box-shadow: inset 0 0 0 1px var(--border); background: #fff; }
.chip.on { background: #1a1a1a; color: #fff; box-shadow: none; }
.toolbar .btn-dark { margin-left: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--shell-muted); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid #f2f2f2; vertical-align: middle; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: #fafafa; }
tbody tr.sel td { background: var(--blue-50); }
td .sub { display: block; color: var(--shell-muted); font-size: 13px; }
.table-wrap { border: 1px solid var(--border); border-radius: 16px; overflow: auto; }
.table-wrap table th:first-child, .table-wrap table td:first-child { padding-left: 16px; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap; background: #f1f1f2; color: #555; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.new { background: var(--blue-100); color: var(--blue-600); }
.pill.contacted { background: var(--amber-bg); color: var(--amber); }
.pill.meeting { background: var(--violet-bg); color: var(--violet); }
.pill.won, .pill.active { background: var(--green-bg); color: var(--green); }
.pill.lost, .pill.churned { background: var(--red-bg); color: var(--red); }
.pill.onboarding { background: var(--blue-100); color: var(--blue-600); }
.pill.paused { background: var(--amber-bg); color: var(--amber); }

.status-select { display: flex; flex-wrap: wrap; gap: 6px; }
.status-select button { height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; box-shadow: inset 0 0 0 1px var(--border); color: var(--shell-muted); }
.status-select button.on { background: #1a1a1a; color: #fff; box-shadow: none; }

.meet-group { margin: 20px 0 8px; font-size: 13.5px; color: var(--shell-muted); }

/* ---------- modal + toast ---------- */
.modal { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.12); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; overflow-y: auto; }
.modal-card { width: 100%; max-width: 520px; background: var(--shell-glass); -webkit-backdrop-filter: blur(24px) saturate(190%); backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid var(--shell-glass-border); border-radius: 22px; box-shadow: 0 16px 48px rgba(0,0,0,.14); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-card h2 { font-size: 18px; font-weight: 600; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; background: #1a1a1a; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }

/* ---------- small screens: rail hides, sidebar and panel become sheets ---------- */
@media (max-width: 1100px) {
  .panel { position: fixed; z-index: 70; top: 8px; right: 8px; bottom: 8px; width: min(420px, calc(100vw - 16px)); margin: 0; box-shadow: 0 0 0 1px var(--shell-border), 0 20px 60px rgba(0,0,0,.2); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .rail { display: none; }
  .card-wrap { padding: 0; }
  .main { border-radius: 0; box-shadow: none; }
  .sidebar { position: fixed; z-index: 70; inset: 0 auto 0 0; width: 290px; border-radius: 0 20px 20px 0; transform: translateX(-105%); transition: transform .25s; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
  .sidebar.open { transform: none; }
  #sbClose, .mobile-only { display: grid; }
  .scrim { position: fixed; inset: 0; z-index: 65; background: rgba(0,0,0,.15); }
  .view { padding: 4px 16px 40px; }
  .titlebar { padding: 0 8px; }
  .seg { display: none; }
  .home-h { font-size: 24px; }
  .stats { gap: 8px; }
  .stat b { font-size: 24px; }
  .hide-sm { display: none; }
  .panel { top: auto; right: 0; left: 0; bottom: 0; width: 100%; max-height: 88dvh; border-radius: 20px 20px 0 0; }
}
