/* ============================================================
   TIRANGA CRM 2.0 — Design System
   Theme: Warm travel SaaS · Saffron primary · compact/data-dense
   ============================================================ */

@import url('fonts/fonts.css');

:root{
  /* ---- Brand: Saffron ---- */
  --brand:        oklch(0.68 0.165 52);   /* saffron orange */
  --brand-600:    oklch(0.63 0.175 50);
  --brand-700:    oklch(0.56 0.165 48);
  --brand-50:     oklch(0.97 0.022 60);
  --brand-100:    oklch(0.94 0.045 60);
  --brand-200:    oklch(0.89 0.075 58);
  --brand-soft:   oklch(0.96 0.03 60);
  --brand-ink:    oklch(0.42 0.12 48);

  /* ---- Tricolor nods (semantic) ---- */
  --green:        oklch(0.62 0.13 155);
  --green-50:     oklch(0.96 0.03 155);
  --green-100:    oklch(0.92 0.06 155);
  --green-ink:    oklch(0.45 0.11 155);

  /* ---- Status palette ---- */
  --blue:    oklch(0.60 0.13 250);  --blue-50: oklch(0.96 0.025 250);  --blue-100: oklch(0.92 0.05 250);
  --purple:  oklch(0.58 0.16 300);  --purple-50: oklch(0.96 0.03 300); --purple-100: oklch(0.93 0.06 300);
  --amber:   oklch(0.74 0.15 75);   --amber-50: oklch(0.96 0.035 75);  --amber-100: oklch(0.92 0.07 75);
  --red:     oklch(0.59 0.20 25);   --red-50: oklch(0.96 0.03 25);     --red-100: oklch(0.92 0.06 25);
  --teal:    oklch(0.64 0.10 200);  --teal-50: oklch(0.96 0.025 200);  --teal-100: oklch(0.92 0.05 200);

  /* ---- Warm neutrals ---- */
  --bg:        oklch(0.985 0.004 70);   /* app canvas */
  --surface:   oklch(1 0 0);            /* cards */
  --surface-2: oklch(0.975 0.005 70);   /* subtle fills */
  --surface-3: oklch(0.955 0.006 70);
  --line:      oklch(0.915 0.006 70);   /* borders */
  --line-2:    oklch(0.88 0.008 70);
  --ink:       oklch(0.26 0.012 60);    /* primary text */
  --ink-2:     oklch(0.45 0.012 60);    /* secondary text */
  --ink-3:     oklch(0.60 0.012 60);    /* muted */
  --ink-4:     oklch(0.72 0.010 60);    /* faint */

  /* ---- Sidebar (deep warm charcoal) ---- */
  --side:      oklch(0.27 0.018 55);
  --side-2:    oklch(0.31 0.020 55);
  --side-line: oklch(0.36 0.018 55);
  --side-ink:  oklch(0.86 0.012 60);
  --side-ink-2:oklch(0.66 0.012 60);

  /* ---- Shape ---- */
  --r-xs: 5px; --r-sm: 7px; --r: 9px; --r-lg: 13px; --r-xl: 18px;
  --shadow-sm: 0 1px 2px rgba(40,30,15,.06), 0 1px 1px rgba(40,30,15,.04);
  --shadow:    0 2px 6px rgba(40,30,15,.07), 0 1px 2px rgba(40,30,15,.05);
  --shadow-md: 0 8px 24px -8px rgba(40,30,15,.16), 0 2px 6px rgba(40,30,15,.06);
  --shadow-lg: 0 24px 60px -16px rgba(40,30,15,.28);

  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family:var(--font);
  background:var(--bg);
  color:var(--ink);
  font-size:13px;
  line-height:1.45;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
a{ color:inherit; text-decoration:none; }
button{ font-family:inherit; cursor:pointer; }
::selection{ background:var(--brand-200); }

/* default icon size — sized parents (.btn .ico, .nav-item .ico) override this */
svg.ico{ width:16px; height:16px; flex:none; vertical-align:middle; }
.form-section-title svg.ico, .form-section-title svg{ width:15px; height:15px; }

/* number/code feel */
.mono{ font-family:var(--mono); font-feature-settings:"tnum"; letter-spacing:-.02em; }
.tnum{ font-variant-numeric:tabular-nums; }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app{ display:grid; grid-template-columns:230px 1fr; min-height:100vh; }
.app.collapsed{ grid-template-columns:62px 1fr; }

/* ---- Sidebar ---- */
.sidebar{
  background:var(--side); color:var(--side-ink);
  display:flex; flex-direction:column;
  position:sticky; top:0; height:100vh; overflow:hidden;
  border-right:1px solid var(--side-line);
}
.side-brand{
  display:flex; align-items:center; gap:10px;
  padding:14px 16px; border-bottom:1px solid var(--side-line);
  min-height:52px;
}
.side-brand .logo-mark{
  width:30px; height:30px; border-radius:8px; flex:none;
  background:linear-gradient(135deg, var(--brand) 0%, var(--brand-700) 100%);
  display:grid; place-items:center; color:#fff; font-weight:800; font-size:15px;
  box-shadow:0 2px 8px -2px var(--brand);
}
.side-brand .logo-word{ display:flex; flex-direction:column; line-height:1.05; }
.side-brand .logo-word b{ font-size:14.5px; font-weight:800; letter-spacing:-.01em; color:#fff; }
.side-brand .logo-word span{ font-size:9.5px; color:var(--side-ink-2); letter-spacing:.14em; text-transform:uppercase; font-weight:600; }
.app.collapsed .logo-word{ display:none; }

.side-scroll{ flex:1; overflow-y:auto; padding:8px 8px 20px; }
.side-scroll::-webkit-scrollbar{ width:6px; }
.side-scroll::-webkit-scrollbar-thumb{ background:var(--side-line); border-radius:3px; }

.nav-group-label{
  font-size:9.5px; font-weight:700; letter-spacing:.13em; text-transform:uppercase;
  color:var(--side-ink-2); padding:14px 10px 5px;
}
.app.collapsed .nav-group-label{ opacity:0; height:8px; padding:6px 0 0; }

.nav-item{
  display:flex; align-items:center; gap:10px;
  padding:7px 10px; border-radius:var(--r-sm); color:var(--side-ink);
  font-size:12.5px; font-weight:500; position:relative; white-space:nowrap;
  transition:background .12s, color .12s;
}
.nav-item:hover{ background:var(--side-2); color:#fff; }
.nav-item.active{ background:var(--brand); color:#fff; font-weight:600; box-shadow:0 2px 8px -3px var(--brand); }
.nav-item .ico{ width:17px; height:17px; flex:none; stroke-width:1.9; }
.nav-item .nav-badge{
  margin-left:auto; font-size:10px; font-weight:700; background:var(--side-2);
  color:var(--side-ink); padding:1px 6px; border-radius:20px; font-variant-numeric:tabular-nums;
}
.nav-item.active .nav-badge{ background:rgba(255,255,255,.22); color:#fff; }
.app.collapsed .nav-item span.label, .app.collapsed .nav-badge{ display:none; }
.app.collapsed .nav-item{ justify-content:center; padding:8px; }

/* ---- Main column ---- */
.main{ display:flex; flex-direction:column; min-width:0; }
.topbar{
  height:52px; background:var(--surface); border-bottom:1px solid var(--line);
  display:flex; align-items:center; gap:14px; padding:0 18px; position:sticky; top:0; z-index:30;
}
.topbar .burger{ width:32px; height:32px; border-radius:var(--r-sm); border:1px solid var(--line);
  background:var(--surface); display:grid; place-items:center; color:var(--ink-2); }
.topbar .burger:hover{ background:var(--surface-2); }
.crumbs{ display:flex; align-items:center; gap:7px; font-size:12.5px; color:var(--ink-3); }
.crumbs b{ color:var(--ink); font-weight:600; }
.crumbs .sep{ color:var(--ink-4); }

.topsearch{ margin-left:8px; position:relative; width:300px; max-width:32vw; }
.topsearch input{
  width:100%; height:34px; border:1px solid var(--line); border-radius:var(--r); background:var(--surface-2);
  padding:0 12px 0 34px; font-size:12.5px; color:var(--ink); font-family:inherit;
}
.topsearch input:focus{ outline:none; border-color:var(--brand); background:var(--surface); box-shadow:0 0 0 3px var(--brand-100); }
.topsearch .si{ position:absolute; left:11px; top:9px; color:var(--ink-4); }

.topbar .spacer{ flex:1; }
.top-btn{ width:34px; height:34px; border-radius:var(--r); border:1px solid var(--line); background:var(--surface);
  display:grid; place-items:center; color:var(--ink-2); position:relative; }
.top-btn:hover{ background:var(--surface-2); color:var(--ink); }
.top-btn .dot{ position:absolute; top:6px; right:7px; width:7px; height:7px; border-radius:50%; background:var(--red); border:2px solid var(--surface); }
.top-user{ display:flex; align-items:center; gap:9px; padding:4px 6px 4px 4px; border-radius:30px; border:1px solid var(--line); }
.top-user:hover{ background:var(--surface-2); }
.top-user .av{ width:28px; height:28px; border-radius:50%; }
.top-user .nm{ font-size:12px; font-weight:600; line-height:1.1; }
.top-user .rl{ font-size:10px; color:var(--ink-3); }

.content{ padding:18px 22px 60px; max-width:1560px; width:100%; margin:0 auto; }

/* ============================================================
   PRIMITIVES
   ============================================================ */
.avatar{ border-radius:50%; object-fit:cover; flex:none; background:var(--surface-3); }
.av-init{ border-radius:50%; display:grid; place-items:center; color:#fff; font-weight:700; flex:none; font-size:11px; }

/* page header */
.page-head{ display:flex; align-items:flex-start; gap:16px; margin-bottom:16px; flex-wrap:wrap; }
.page-head .ph-l{ min-width:0; }
.page-title{ font-size:21px; font-weight:800; letter-spacing:-.02em; margin:0; display:flex; align-items:center; gap:10px; }
.page-sub{ color:var(--ink-3); font-size:12.5px; margin-top:3px; }
.page-head .ph-actions{ margin-left:auto; display:flex; gap:8px; align-items:center; }

/* buttons */
.btn{ display:inline-flex; align-items:center; gap:7px; height:34px; padding:0 13px; border-radius:var(--r);
  border:1px solid var(--line); background:var(--surface); color:var(--ink); font-size:12.5px; font-weight:600;
  transition:background .12s,border-color .12s,box-shadow .12s; white-space:nowrap; }
.btn:hover{ background:var(--surface-2); }
.btn .ico{ width:15px; height:15px; stroke-width:2; }
.btn-primary{ background:var(--brand); border-color:var(--brand); color:#fff; box-shadow:0 2px 8px -3px var(--brand); }
.btn-primary:hover{ background:var(--brand-600); }
.btn-dark{ background:var(--ink); border-color:var(--ink); color:#fff; }
.btn-dark:hover{ background:var(--side); }
.btn-ghost{ border-color:transparent; background:transparent; }
.btn-ghost:hover{ background:var(--surface-3); }
.btn-sm{ height:28px; padding:0 10px; font-size:11.5px; border-radius:var(--r-sm); }
.btn-icon{ width:34px; padding:0; justify-content:center; }
.btn-icon.btn-sm{ width:28px; }

/* cards */
.card{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--shadow-sm); }
.card-pad{ padding:16px; }
.card-head{ display:flex; align-items:center; gap:10px; padding:13px 16px; border-bottom:1px solid var(--line); }
.card-head h3{ margin:0; font-size:13.5px; font-weight:700; letter-spacing:-.01em; }
.card-head .ch-sub{ font-size:11px; color:var(--ink-3); }
.card-head .spacer{ flex:1; }

/* badges */
.badge{ display:inline-flex; align-items:center; gap:5px; height:21px; padding:0 8px; border-radius:6px;
  font-size:11px; font-weight:600; line-height:1; white-space:nowrap; }
.badge .bdot{ width:6px; height:6px; border-radius:50%; background:currentColor; }
.badge-gray{ background:var(--surface-3); color:var(--ink-2); }
.badge-amber{ background:var(--amber-50); color:var(--amber); }
.badge-blue{ background:var(--blue-50); color:var(--blue); }
.badge-purple{ background:var(--purple-50); color:var(--purple); }
.badge-green{ background:var(--green-50); color:var(--green-ink); }
.badge-red{ background:var(--red-50); color:var(--red); }
.badge-teal{ background:var(--teal-50); color:var(--teal); }
.badge-brand{ background:var(--brand-50); color:var(--brand-ink); }
.badge-soft{ background:var(--surface-2); color:var(--ink-3); border:1px solid var(--line); }

/* priority pills */
.pri{ display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:700; }
.pri::before{ content:""; width:7px; height:7px; border-radius:50%; }
.pri-hot::before{ background:var(--red); box-shadow:0 0 0 3px var(--red-50); }
.pri-warm::before{ background:var(--amber); box-shadow:0 0 0 3px var(--amber-50); }
.pri-cold::before{ background:var(--blue); box-shadow:0 0 0 3px var(--blue-50); }

/* chips */
.chip{ display:inline-flex; align-items:center; gap:5px; height:22px; padding:0 8px; border-radius:6px;
  background:var(--surface-2); border:1px solid var(--line); font-size:11px; font-weight:600; color:var(--ink-2); }
.chip .x{ color:var(--ink-4); margin-left:2px; }
.chip .x:hover{ color:var(--red); }

/* tables */
.tbl-wrap{ overflow-x:auto; }
table.tbl{ width:100%; border-collapse:separate; border-spacing:0; font-size:12px; }
.tbl thead th{
  text-align:left; font-weight:600; color:var(--ink-3); font-size:10.5px; letter-spacing:.06em; text-transform:uppercase;
  padding:9px 12px; background:var(--surface-2); border-bottom:1px solid var(--line); white-space:nowrap; position:sticky; top:0;
}
.tbl thead th:first-child{ border-top-left-radius:var(--r); }
.tbl thead th:last-child{ border-top-right-radius:var(--r); }
.tbl tbody td{ padding:9px 12px; border-bottom:1px solid var(--line); vertical-align:middle; }
.tbl tbody tr:hover{ background:var(--brand-50); }
.tbl tbody tr:last-child td{ border-bottom:none; }
.tbl .num{ text-align:right; font-variant-numeric:tabular-nums; font-family:var(--mono); font-size:11.5px; }
.tbl .ctr{ text-align:center; }
.cell-main{ font-weight:600; color:var(--ink); }
.cell-sub{ font-size:11px; color:var(--ink-3); }
.row-link{ cursor:pointer; }

/* checkbox */
.ck{ width:16px; height:16px; border-radius:5px; border:1.5px solid var(--line-2); background:var(--surface);
  display:inline-grid; place-items:center; cursor:pointer; flex:none; }
.ck.on{ background:var(--brand); border-color:var(--brand); color:#fff; }

/* forms */
.field{ display:flex; flex-direction:column; gap:5px; }
.field > label{ font-size:11.5px; font-weight:600; color:var(--ink-2); display:flex; gap:5px; align-items:center; }
.field .req{ color:var(--red); }
.field .hint{ font-size:10.5px; color:var(--ink-3); font-weight:500; }
.input, .select, .textarea{
  height:34px; border:1px solid var(--line-2); border-radius:var(--r-sm); background:var(--surface);
  padding:0 11px; font-size:12.5px; color:var(--ink); font-family:inherit; width:100%;
}
.textarea{ height:auto; padding:9px 11px; resize:vertical; min-height:64px; line-height:1.5; }
.input:focus,.select:focus,.textarea:focus{ outline:none; border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-100); }
.input::placeholder,.textarea::placeholder{ color:var(--ink-4); }
.select{ appearance:none; background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%238a8276' stroke-width='2' viewBox='0 0 24 24'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat:no-repeat; background-position:right 9px center; padding-right:30px; }
.input-group{ position:relative; }
.input-group .ig-pre{ position:absolute; left:11px; top:9px; color:var(--ink-3); font-size:12.5px; font-weight:600; }
.input-group .input{ padding-left:26px; }

.form-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:13px 16px; }
.form-grid.c3{ grid-template-columns:repeat(3,1fr); }
.form-grid.c4{ grid-template-columns:repeat(4,1fr); }
.col-span-2{ grid-column:span 2; }
.col-span-full{ grid-column:1/-1; }
.form-section-title{ font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--brand-ink);
  display:flex; align-items:center; gap:8px; margin:4px 0 2px; }
.form-section-title::after{ content:""; flex:1; height:1px; background:var(--line); }

/* toggle */
.switch{ width:36px; height:21px; border-radius:20px; background:var(--line-2); position:relative; transition:background .15s; flex:none; cursor:pointer; }
.switch::after{ content:""; position:absolute; width:17px; height:17px; border-radius:50%; background:#fff; top:2px; left:2px; transition:left .15s; box-shadow:var(--shadow-sm); }
.switch.on{ background:var(--brand); }
.switch.on::after{ left:17px; }

/* tabs */
.tabs{ display:flex; gap:4px; border-bottom:1px solid var(--line); overflow-x:auto; }
.tab{ appearance:none; -webkit-appearance:none; background:transparent; border:0; border-bottom:2px solid transparent;
  margin-bottom:-1px; padding:10px 14px; font:inherit; font-size:12.5px; font-weight:600; color:var(--ink-3);
  white-space:nowrap; display:flex; align-items:center; gap:7px; cursor:pointer; border-radius:8px 8px 0 0; transition:.15s; }
.tab .ico{ width:15px; height:15px; opacity:.85; }
.tab:hover{ color:var(--ink); background:var(--surface-2); }
.tab.active{ color:var(--brand-ink); border-bottom-color:var(--brand); }
.tab.active .ico{ opacity:1; }
.tab .tab-count{ font-size:10px; line-height:1.6; background:var(--surface-3); color:var(--ink-2); padding:1px 7px; border-radius:20px; font-weight:700; }
.tab.active .tab-count{ background:var(--brand-100); color:var(--brand-ink); }

/* segmented control */
.seg{ display:inline-flex; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r); padding:2px; gap:2px; }
.seg button{ height:26px; padding:0 11px; border:none; background:transparent; border-radius:var(--r-xs); font-size:11.5px; font-weight:600; color:var(--ink-3); display:flex; align-items:center; gap:6px; }
.seg button.on{ background:var(--surface); color:var(--ink); box-shadow:var(--shadow-sm); }

/* KPI */
.kpi{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); padding:14px; position:relative; overflow:hidden; box-shadow:var(--shadow-sm); }
.kpi .kpi-top{ display:flex; align-items:center; justify-content:space-between; }
.kpi .kpi-ico{ width:32px; height:32px; border-radius:9px; display:grid; place-items:center; }
.kpi .kpi-label{ font-size:11px; color:var(--ink-3); font-weight:600; }
.kpi .kpi-val{ font-size:25px; font-weight:800; letter-spacing:-.03em; margin-top:9px; line-height:1; font-variant-numeric:tabular-nums; }
.kpi .kpi-foot{ display:flex; align-items:center; gap:6px; margin-top:8px; font-size:11px; }
.delta{ display:inline-flex; align-items:center; gap:2px; font-weight:700; padding:1px 5px; border-radius:5px; }
.delta-up{ color:var(--green-ink); background:var(--green-50); }
.delta-down{ color:var(--red); background:var(--red-50); }

/* misc */
.stat-row{ display:flex; align-items:center; justify-content:space-between; padding:7px 0; border-bottom:1px solid var(--line); }
.stat-row:last-child{ border-bottom:none; }
.divider{ height:1px; background:var(--line); margin:14px 0; }
.empty{ text-align:center; padding:40px 20px; color:var(--ink-3); }
.muted{ color:var(--ink-3); }
.scrolly{ overflow-y:auto; }
.scrolly::-webkit-scrollbar{ width:8px; height:8px; }
.scrolly::-webkit-scrollbar-thumb{ background:var(--line-2); border-radius:4px; }

/* progress */
.prog{ height:7px; border-radius:10px; background:var(--surface-3); overflow:hidden; }
.prog > i{ display:block; height:100%; border-radius:10px; background:var(--brand); }

/* dropdown menu */
.menu{ position:absolute; background:var(--surface); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow-md); padding:5px; min-width:178px; z-index:60; }
.menu button{ display:flex; align-items:center; gap:9px; width:100%; text-align:left; padding:7px 9px; border:none; background:transparent; border-radius:var(--r-sm); font-size:12px; color:var(--ink); font-weight:500; }
.menu button:hover{ background:var(--surface-2); }
.menu button.danger{ color:var(--red); }
.menu button.danger:hover{ background:var(--red-50); }
.menu .menu-sep{ height:1px; background:var(--line); margin:4px 0; }
.menu .menu-label{ font-size:10px; text-transform:uppercase; letter-spacing:.08em; color:var(--ink-4); padding:5px 9px 2px; font-weight:700; }

/* toast */
.toast-wrap{ position:fixed; bottom:20px; right:20px; z-index:200; display:flex; flex-direction:column; gap:8px; }
.toast{ background:var(--ink); color:#fff; padding:11px 15px; border-radius:var(--r); font-size:12.5px; font-weight:600; box-shadow:var(--shadow-lg); display:flex; align-items:center; gap:9px; animation:toastIn .25s; }
@keyframes toastIn{ from{ opacity:0; transform:translateY(8px);} }

/* button loader */
.btn.is-loading{ pointer-events:none; opacity:.85; }
.btn .spin{ display:inline-block; width:15px; height:15px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:spin .6s linear infinite; }
@keyframes spin{ to{ transform:rotate(360deg); } }

/* modal */
.modal-back{ position:fixed; inset:0; background:rgba(35,25,12,.42); backdrop-filter:blur(2px); z-index:120; display:grid; place-items:center; padding:24px; animation:fade .15s; }
@keyframes fade{ from{opacity:0;} }
.modal{ background:var(--surface); border-radius:var(--r-xl); box-shadow:var(--shadow-lg); width:100%; max-width:540px; max-height:88vh; overflow:hidden; display:flex; flex-direction:column; animation:pop .18s; }
@keyframes pop{ from{ opacity:0; transform:scale(.97) translateY(6px);} }
.modal-head{ display:flex; align-items:center; gap:10px; padding:15px 18px; border-bottom:1px solid var(--line); }
.modal-head h3{ margin:0; font-size:15px; font-weight:700; }
.modal-body{ padding:18px; overflow-y:auto; }
.modal-foot{ display:flex; gap:9px; justify-content:flex-end; padding:13px 18px; border-top:1px solid var(--line); background:var(--surface-2); }

/* helpers */
.flex{ display:flex; } .items-center{ align-items:center; } .gap-2{ gap:8px; } .gap-3{ gap:12px; }
.grid{ display:grid; } .hidden{ display:none !important; }
.g-2col{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:14px; }
.g-3col{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.g-4col{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.g-2col>*,.g-3col>*,.g-4col>*{ min-width:0; }
.text-r{ text-align:right; } .text-c{ text-align:center; }
.fw7{ font-weight:700; } .fw8{ font-weight:800; }
.t-xs{ font-size:11px; } .t-sm{ font-size:12px; } .t-lg{ font-size:15px; }
.pos-rel{ position:relative; }

@media (max-width:1100px){
  .app{ grid-template-columns:62px 1fr; }
  .app .logo-word, .app .nav-item span.label, .app .nav-badge, .app .nav-group-label{ display:none; }
  .g-4col{ grid-template-columns:repeat(2,1fr); }
}

/* ============ Cmd-K command palette ============ */
.cmdk-back{ position:fixed; inset:0; background:rgba(35,25,12,.46); backdrop-filter:blur(3px); z-index:200; display:flex; justify-content:center; align-items:flex-start; padding-top:11vh; animation:fade .14s; }
.cmdk{ width:100%; max-width:600px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-xl); box-shadow:var(--shadow-lg); overflow:hidden; animation:pop .16s; display:flex; flex-direction:column; max-height:70vh; }
.cmdk-in{ display:flex; align-items:center; gap:10px; padding:14px 16px; border-bottom:1px solid var(--line); }
.cmdk-in .ico{ color:var(--ink-3); width:18px; height:18px; flex:none; }
.cmdk-input{ flex:1; border:none; outline:none; background:none; font-size:15px; font-family:var(--font); color:var(--ink); }
.cmdk-esc{ font-size:10px; font-weight:700; color:var(--ink-4); border:1px solid var(--line-2); border-radius:5px; padding:2px 6px; }
.cmdk-list{ flex:1; overflow-y:auto; padding:7px; }
.cmdk-item{ display:flex; align-items:center; gap:11px; padding:9px 11px; border-radius:var(--r); cursor:pointer; }
.cmdk-item.on{ background:var(--brand-50); }
.cmdk-ic{ width:30px; height:30px; border-radius:8px; background:var(--surface-2); display:grid; place-items:center; flex:none; color:var(--ink-2); }
.cmdk-item.on .cmdk-ic{ background:var(--brand); color:#fff; }
.cmdk-ic .ico{ width:16px; height:16px; }
.cmdk-txt{ flex:1; min-width:0; display:flex; flex-direction:column; }
.cmdk-l{ font-size:13px; font-weight:600; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cmdk-s{ font-size:11px; color:var(--ink-3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cmdk-tag{ font-size:10px; font-weight:700; letter-spacing:.03em; text-transform:uppercase; color:var(--ink-4); border:1px solid var(--line); border-radius:20px; padding:2px 8px; flex:none; }
.cmdk-item.on .cmdk-tag{ color:var(--brand-ink); border-color:var(--brand-200); }
.cmdk-empty{ padding:34px 16px; text-align:center; color:var(--ink-3); font-size:13px; }
.cmdk-foot{ display:flex; gap:16px; padding:9px 14px; border-top:1px solid var(--line); background:var(--surface-2); font-size:11px; color:var(--ink-3); }
.cmdk-foot kbd{ font-family:var(--mono); background:var(--surface); border:1px solid var(--line-2); border-radius:4px; padding:1px 5px; margin-right:2px; }

/* ============ AI itinerary assistant ============ */
.ai-spark{ width:30px; height:30px; border-radius:8px; display:grid; place-items:center; background:linear-gradient(135deg,#8B5CF6,#C9961F); color:#fff; }
.ai-spark .ico, .ai-run-spark .ico{ width:17px; height:17px; }
.ai-lbl{ display:block; font-size:11px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--ink-3); margin-bottom:7px; }
.ai-brief{ width:100%; border:1px solid var(--line-2); border-radius:var(--r); padding:11px 13px; font-size:14px; font-family:var(--font); resize:vertical; outline:none; color:var(--ink); }
.ai-brief:focus{ border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-50); }
.ai-chips{ display:flex; flex-wrap:wrap; gap:7px; margin-top:11px; }
.ai-chip{ padding:6px 11px; border-radius:20px; border:1px solid var(--line); background:var(--surface-2); font-size:12px; font-weight:600; color:var(--ink-2); cursor:pointer; }
.ai-chip:hover{ border-color:var(--brand-200); color:var(--brand-ink); }
.ai-chip.on{ background:var(--brand); color:#fff; border-color:var(--brand); }
.ai-run{ display:flex; gap:14px; padding:14px 4px; }
.ai-run-spark{ width:38px; height:38px; border-radius:10px; flex:none; display:grid; place-items:center; background:linear-gradient(135deg,#8B5CF6,#C9961F); color:#fff; animation:aipulse 1.1s ease-in-out infinite; }
@keyframes aipulse{ 0%,100%{ transform:scale(1); opacity:1; } 50%{ transform:scale(1.07); opacity:.82; } }
.ai-steps{ flex:1; display:flex; flex-direction:column; gap:9px; padding-top:3px; }
.ai-step{ display:flex; align-items:center; gap:9px; font-size:13px; color:var(--ink); animation:fade .3s; }
.ai-step-dot{ width:8px; height:8px; border-radius:50%; background:var(--brand); flex:none; animation:aipulse .9s ease-in-out infinite; }
.ai-step.done{ color:var(--ink-3); } .ai-step.done .ai-step-dot{ background:var(--green); animation:none; }
.ai-res-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:13px; }
.ai-res-title{ font-size:16px; font-weight:800; letter-spacing:-.01em; }
.ai-days{ display:flex; flex-direction:column; gap:7px; max-height:230px; overflow-y:auto; padding-right:4px; }
.ai-day{ display:flex; gap:11px; padding:9px 11px; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r); }
.ai-day-n{ width:24px; height:24px; border-radius:6px; background:var(--brand); color:#fff; font-weight:800; font-size:12px; display:grid; place-items:center; flex:none; }
.ai-day-t{ font-size:11px; font-weight:700; color:var(--ink-3); text-transform:uppercase; letter-spacing:.04em; }
.ai-day-d{ font-size:13px; color:var(--ink); margin-top:1px; }
.ai-cost{ margin-top:14px; border:1px solid var(--line); border-radius:var(--r); overflow:hidden; }
.ai-cost-row{ display:flex; justify-content:space-between; padding:9px 13px; font-size:13px; border-bottom:1px solid var(--line); }
.ai-cost-row:last-child{ border-bottom:none; }
.ai-cost-row.tot{ background:var(--surface-2); font-weight:700; }
.ai-cost-row.mar{ background:var(--green-50); color:var(--green-ink); font-weight:700; }
.topsearch .search-kbd{ position:absolute; right:9px; top:7px; font-family:var(--mono); font-size:10px; font-weight:700; color:var(--ink-4); background:var(--surface-2); border:1px solid var(--line-2); border-radius:5px; padding:2px 6px; pointer-events:none; }

/* ============ Payment link modal ============ */
.pl-rzp{ width:30px; height:30px; border-radius:8px; display:grid; place-items:center; background:#0E9AA7; color:#fff; }
.pl-rzp .ico{ width:17px; height:17px; }
.pl-amt{ display:flex; justify-content:space-between; align-items:center; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r); padding:13px 15px; }
.pl-amt-v{ font-size:21px; font-weight:800; letter-spacing:-.01em; }
.pl-link{ display:flex; align-items:center; gap:9px; margin-top:11px; border:1px dashed var(--line-2); border-radius:var(--r); padding:9px 12px; font-family:var(--mono); font-size:13px; color:var(--brand-ink); }
.pl-link .ico{ width:15px; height:15px; flex:none; } .pl-link span{ flex:1; }
.pl-chs{ display:flex; gap:8px; }
.pl-ch{ flex:1; display:flex; align-items:center; justify-content:center; gap:7px; padding:9px; border:1px solid var(--line); border-radius:var(--r); background:var(--surface); font-size:12px; font-weight:600; color:var(--ink-2); cursor:pointer; }
.pl-ch .ico{ width:15px; height:15px; }
.pl-ch.on{ border-color:var(--brand); background:var(--brand-50); color:var(--brand-ink); }
.pl-sched{ display:flex; flex-direction:column; gap:0; }
.pl-step{ display:flex; gap:12px; align-items:flex-start; padding-bottom:13px; position:relative; }
.pl-step:not(:last-child)::before{ content:""; position:absolute; left:5px; top:13px; bottom:0; width:2px; background:var(--line); }
.pl-step-dot{ width:12px; height:12px; border-radius:50%; border:2px solid var(--line-2); background:var(--surface); flex:none; margin-top:2px; z-index:1; }
.pl-step-dot.now{ border-color:var(--brand); background:var(--brand); }
.pl-step b{ font-size:13px; display:block; }
.pl-step span{ font-size:12px; color:var(--ink-3); }

/* ============ Mobile / responsive polish ============ */
.nav-scrim{ display:none; }
@media (max-width:760px){
  .app{ grid-template-columns:1fr !important; }
  /* sidebar becomes an off-canvas drawer */
  .sidebar{ position:fixed; top:0; left:0; bottom:0; width:248px; z-index:131; transform:translateX(-100%); transition:transform .26s cubic-bezier(.4,0,.2,1); box-shadow:none; }
  .app.mnav .sidebar{ transform:translateX(0); box-shadow:var(--shadow-lg); }
  /* re-show full labels inside the drawer (override the 1100px icon-rail rule) */
  .app .logo-word, .app .nav-item span.label, .app .nav-badge, .app .nav-group-label{ display:revert !important; opacity:1 !important; height:auto !important; }
  .app .nav-item{ justify-content:flex-start !important; padding:8px 12px !important; }
  .nav-scrim{ display:block; position:fixed; inset:0; background:rgba(35,25,12,.4); backdrop-filter:blur(1px); z-index:130; opacity:0; pointer-events:none; transition:opacity .22s; }
  .app.mnav .nav-scrim{ opacity:1; pointer-events:auto; }
  /* topbar slims down */
  .topsearch{ display:none; }
  .topbar{ padding:9px 12px; gap:7px; }
  .top-user span:not(.av-init){ display:none; }
  .top-user{ padding:3px; }
  .topbar .btn-primary span, .top-btn[title="Help"]{ display:none; }
  .crumbs{ font-size:12px; }
  /* content breathing room */
  .content{ padding:14px 13px 60px; }
  .page-head{ gap:10px; }
  .page-head .ph-actions{ margin-left:0; width:100%; flex-wrap:wrap; }
  .page-title{ font-size:19px; }
  /* generic grids stack */
  .g-2col, .g-3col, .g-4col{ grid-template-columns:1fr; }
  .tbl-wrap{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .modal-back{ padding:12px; align-items:flex-end; }
  .modal{ max-height:92vh; }
  .cmdk-back{ padding:12px; padding-top:8vh; }
}
@media (max-width:460px){
  .page-head .ph-actions .btn{ flex:1; justify-content:center; }
}

/* ============ Compliance note (invoices) ============ */
.compliance{ display:flex; gap:8px; margin-top:11px; padding:10px 11px; border-radius:var(--r); background:var(--amber-50); border:1px solid #f3e0b8; font-size:11.5px; line-height:1.5; color:#7a5800; }
.compliance.ok{ background:var(--green-50); border-color:#bfe6cf; color:var(--green-ink); }
.compliance .ico{ width:15px; height:15px; flex:none; margin-top:1px; }

/* ============ 3D module icons (sidebar nav) ============ */
.nav-item img.nav3d{ width:21px; height:21px; object-fit:contain; flex:none; filter:saturate(1.05); }
.app.collapsed .nav-item img.nav3d{ width:22px; height:22px; }

/* ============ 3D KPI / tile icons ============ */
.kpi-ico img.kpi3d{ width:75%; height:75%; object-fit:contain; display:block; }
.kpi-ico:has(img.kpi3d){ background:transparent !important; box-shadow:none !important; padding:0; }
