/* ezza crm — design tokens + base styles */

:root {
  /* surfaces */
  --bg: oklch(0.965 0.012 250);
  --bg-tint-a: oklch(0.94 0.025 245);   /* soft sky wash */
  --bg-tint-b: oklch(0.95 0.022 100);   /* cream wash */
  --bg-tint-c: oklch(0.94 0.028 320);   /* lavender wash */

  --card: oklch(0.995 0.003 250 / 0.62);
  --card-solid: oklch(0.995 0.003 250);
  --card-border: oklch(1 0 0 / 0.65);
  --card-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 24px 48px -28px rgba(20,30,60,.18), 0 6px 14px -8px rgba(20,30,60,.08);

  /* ink */
  --ink: oklch(0.20 0.012 255);
  --ink-soft: oklch(0.36 0.012 255);
  --ink-muted: oklch(0.55 0.012 255);
  --ink-faint: oklch(0.72 0.012 255);
  --ink-line: oklch(0.88 0.012 255);

  --black: oklch(0.16 0.008 255);

  /* accents — chroma ≈ 0.08, lightness ≈ 0.85 */
  --acc-blue: oklch(0.78 0.10 250);
  --acc-blue-strong: oklch(0.55 0.16 250);
  --acc-yellow: oklch(0.92 0.13 95);
  --acc-pink: oklch(0.82 0.09 18);
  --acc-mint: oklch(0.88 0.08 160);
  --acc-lav: oklch(0.83 0.07 295);
  --acc-teal: oklch(0.82 0.07 200);

  /* status */
  --ok: oklch(0.65 0.13 155);
  --warn: oklch(0.74 0.15 75);
  --danger: oklch(0.62 0.18 25);

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: 34px;

  --font-ui: "Manrope", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display: "Instrument Serif", "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(1100px 700px at 8% -10%, var(--bg-tint-a) 0%, transparent 55%),
    radial-gradient(900px 700px at 110% 10%, var(--bg-tint-c) 0%, transparent 55%),
    radial-gradient(900px 700px at 60% 110%, var(--bg-tint-b) 0%, transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  letter-spacing: -0.005em;
}

/* ─── app shell ─────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 72px 1fr;
  height: 100vh;
  gap: 14px;
  padding: 14px;
}

/* sidebar */
.sidebar {
  background: oklch(0.16 0.01 255);
  border-radius: 999px;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: oklch(0.85 0 0);
}
.sidebar .sb-logo {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  margin-bottom: 8px;
}
.sidebar .sb-logo img {
  width: 40px; height: 40px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.sb-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: oklch(0.7 0 0);
  cursor: default;
  transition: background .15s, color .15s;
  position: relative;
}
.sb-btn:hover { background: oklch(0.22 0.01 255); color: white; }
.sb-btn.active { background: white; color: var(--black); }
.sb-btn .sb-dot {
  position: absolute; top: 8px; right: 8px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--acc-pink);
}
.sb-spacer { flex: 1; }

/* main column */
.main {
  display: grid;
  grid-template-rows: 64px 1fr;
  gap: 14px;
  min-width: 0;
  min-height: 0;
}

/* top nav */
.topnav {
  background: var(--card);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 0.5px solid var(--card-border);
  border-radius: 999px;
  padding: 8px 10px 8px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--card-shadow);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.brand .brand-img {
  width: 32px; height: 32px;
  object-fit: contain;
}
.brand-name { font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: 26px; letter-spacing: -0.01em; }
.brand-name em { font-style: normal; font-family: var(--font-ui); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; color: var(--ink-muted); margin-left: 4px; vertical-align: 2px;}

.tabs {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: center;
}
.tab {
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: default;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.tab:hover { background: rgba(0,0,0,.04); color: var(--ink); }
.tab.active {
  background: var(--black);
  color: white;
  font-weight: 600;
}

.tn-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: oklch(0.97 0.01 250);
  color: var(--ink-soft);
  cursor: default;
  position: relative;
  border: 0.5px solid oklch(1 0 0 / 0.8);
}
.icon-btn:hover { background: white; color: var(--ink); }
.icon-btn .badge-dot {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid white;
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
  box-shadow: 0 0 0 1px oklch(0.85 0.01 255);
}

/* page */
.page {
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.12) transparent;
}
.page::-webkit-scrollbar { width: 8px; }
.page::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12); border-radius: 4px; }

.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 8px 4px 16px;
}
.page-title {
  display: flex; align-items: center; gap: 14px;
}
.page-title h1 {
  margin: 0;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
}
.page-title h1 em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--ink-soft);
}
.page-sub {
  font-size: 13px; color: var(--ink-muted);
  margin-top: 4px;
}
.back-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: oklch(0.97 0.01 250 / 0.7);
  border: 0.5px solid oklch(1 0 0 / 0.8);
  display: grid; place-items: center;
  color: var(--ink);
  cursor: default;
}
.back-btn:hover { background: white; }

/* ─── cards (with style variants via .card-* on root) ───────── */
.card {
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
}
/* default: glass */
.cs-glass .card {
  background: var(--card);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 0.5px solid var(--card-border);
  box-shadow: var(--card-shadow);
}
.cs-flat .card {
  background: var(--card-solid);
  border: 0;
  box-shadow: none;
}
.cs-outlined .card {
  background: transparent;
  border: 1px solid oklch(0.86 0.012 255);
  box-shadow: none;
}

/* generic card head */
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  display: flex; align-items: center; gap: 10px;
}
.card-actions { display: flex; gap: 6px; }
.mini-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: oklch(0.97 0.01 250 / 0.8);
  border: 0.5px solid oklch(1 0 0 / 0.8);
  display: grid; place-items: center;
  color: var(--ink-soft);
  cursor: default;
}
.mini-btn:hover { background: white; color: var(--ink); }

/* pill / chip */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: oklch(0.95 0.01 250);
  color: var(--ink-soft);
}
.pill-blue { background: oklch(0.92 0.06 250); color: oklch(0.36 0.13 250); }
.pill-yellow { background: oklch(0.94 0.10 95); color: oklch(0.38 0.13 80); }
.pill-pink { background: oklch(0.93 0.06 18); color: oklch(0.40 0.15 18); }
.pill-mint { background: oklch(0.93 0.07 160); color: oklch(0.36 0.12 160); }
.pill-lav { background: oklch(0.93 0.05 295); color: oklch(0.36 0.13 295); }
.pill-dark { background: var(--black); color: white; }

/* avatar stack */
.av-stack { display: flex; }
.av-stack img {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid white;
  margin-left: -8px;
  object-fit: cover;
  background: oklch(0.9 0.01 255);
}
.av-stack img:first-child { margin-left: 0; }
.av-more {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid white;
  margin-left: -8px;
  background: var(--acc-pink);
  color: oklch(0.32 0.15 18);
  display: grid; place-items: center;
  font-size: 10.5px;
  font-weight: 700;
}

/* small button rows */
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; }

/* placeholder image */
.ph-img {
  background:
    repeating-linear-gradient(45deg,
      oklch(0.92 0.012 250) 0 6px,
      oklch(0.95 0.012 250) 6px 12px);
  border-radius: var(--radius-md);
  display: grid; place-items: center;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* table */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td {
  text-align: left;
  padding: 12px 12px;
  border-bottom: 1px solid oklch(0.92 0.012 255);
}
.tbl th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  border-bottom-color: transparent;
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: oklch(0.97 0.01 250 / 0.5); }

/* misc utilities */
.muted { color: var(--ink-muted); }
.faint { color: var(--ink-faint); }
.money { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.serif { font-family: var(--font-display); font-style: italic; font-weight: 400; }
.divider { height: 1px; background: oklch(0.9 0.01 255); margin: 14px 0; }

/* ─── shared buttons + switch ─────────────────────────────────── */
.btn-primary {
  background: var(--black);
  color: white;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  display: inline-flex; align-items: center; gap: 8px;
  cursor: default;
  white-space: nowrap;
}
.btn-primary:hover { background: oklch(0.28 0.01 255); }
.btn-primary.btn-sm { padding: 8px 14px; font-size: 12px; }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: default;
  white-space: nowrap;
}
.btn-ghost:hover { color: var(--ink); background: oklch(0.94 0.01 250); }

.switch {
  width: 38px; height: 22px;
  border-radius: 999px;
  background: oklch(0.85 0.01 250);
  position: relative;
  transition: background .15s;
  cursor: default;
  flex-shrink: 0;
  border: 0;
  padding: 0;
}
.switch-knob {
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .15s;
}
.switch-on { background: oklch(0.55 0.18 295); }
.switch-on .switch-knob { transform: translateX(16px); }

button { font-family: inherit; }

/* ─── dropdown menu items (shared across screens) ─────────── */
.pipe-dd-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: default;
}
.pipe-dd-item + .pipe-dd-item { margin-top: 2px; }
.pipe-dd-item:hover { background: oklch(0.96 0.012 250); }
.pipe-dd-item-on { background: var(--black); color: white; font-weight: 600; }
.pipe-dd-item-on:hover { background: var(--black); color: white; }
.pipe-dd-check { display: inline-flex; }

/* anim */
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.screen { animation: fadein .25s ease; }

/* ─── modals (global so any screen can use) ───────────────── */
.modal-wrap {
  position: fixed; inset: 0;
  background: oklch(0.18 0.01 255 / 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: grid; place-items: center;
  animation: fadein .2s ease;
  padding: 24px;
}
.modal-card {
  width: 560px; max-width: 100%;
  max-height: 92vh; overflow-y: auto;
  background: oklch(1 0 0) !important;
}
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.modal-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.modal-title em { font-family: var(--font-display); font-style: italic; font-weight: 400; color: var(--ink-soft); }
.modal-sub { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; margin-top: 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid oklch(0.93 0.01 255); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-full { grid-column: 1 / -1; }
.field-lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--ink-muted); }

.ezz-input {
  background: oklch(0.97 0.01 250);
  border: 0.5px solid oklch(0.90 0.01 250);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  width: 100%;
  transition: border-color .15s;
}
.ezz-input:focus { border-color: oklch(0.55 0.16 250); }

/* Dark mode modal fixes */
html.theme-dark .modal-wrap { background: oklch(0.06 0.01 255 / 0.75); }
html.theme-dark .modal-card { background: oklch(0.24 0.012 255) !important; }
html.theme-dark .modal-actions { border-color: oklch(0.32 0.012 255); }

/* ─── shared buttons (global so overlays from any tab work) ──── */
.btn-primary {
  background: var(--black);
  color: white;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  display: inline-flex; align-items: center; gap: 8px;
  cursor: default;
  white-space: nowrap;
}
.btn-primary:hover { background: oklch(0.28 0.01 255); }
.btn-primary.btn-sm { padding: 8px 14px; font-size: 12px; }
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: default;
}
.btn-ghost:hover { background: oklch(0.96 0.012 250); color: var(--ink); }

.switch { width: 40px; height: 22px; border-radius: 999px; background: oklch(0.85 0.01 250); position: relative; transition: background .15s; cursor: default; flex-shrink: 0; }
.switch-knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch-on { background: oklch(0.55 0.18 295); }
.switch-on .switch-knob { transform: translateX(18px); }

/* ─── topnav overlays ─────────────────────────────────────────── */

/* command palette */
.cmdk-wrap {
  position: fixed; inset: 0; z-index: 200;
  background: oklch(0.18 0.01 255 / 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: grid; place-items: flex-start center;
  padding-top: 14vh;
  animation: fadein .2s ease;
}
.cmdk {
  width: 640px; max-width: calc(100vw - 32px);
  background: oklch(0.99 0.005 250);
  border: 0.5px solid oklch(0.92 0.01 250);
  border-radius: 22px;
  box-shadow: 0 24px 60px -16px rgba(20,30,60,.3);
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: 70vh;
}
.cmdk-input {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 22px;
  border-bottom: 0.5px solid oklch(0.93 0.01 250);
}
.cmdk-input input {
  flex: 1;
  border: 0; outline: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
}
.cmdk-kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  background: oklch(0.95 0.01 250);
  border: 0.5px solid oklch(0.88 0.01 250);
  border-radius: 6px;
  padding: 3px 7px;
  color: var(--ink-muted);
}
.cmdk-kbd-wide { padding: 3px 10px; }
.cmdk-body { flex: 1; overflow-y: auto; padding: 8px; }
.cmdk-group { margin-bottom: 6px; }
.cmdk-group-lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 10px 12px 6px;
}
.cmdk-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: default;
}
.cmdk-item:hover  { background: oklch(0.96 0.012 250); }
.cmdk-item-sel    { background: oklch(0.94 0.025 250) !important; }
.cmdk-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.cmdk-ic-action { background: oklch(0.95 0.05 295); color: oklch(0.45 0.16 295); }
.cmdk-ic-lead   { background: oklch(0.95 0.05 250); color: oklch(0.45 0.16 250); }
.cmdk-ic-case   { background: oklch(0.95 0.05 18);  color: oklch(0.45 0.16 18); }
.cmdk-av { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.cmdk-title { font-size: 13.5px; font-weight: 600; letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-sub { font-size: 11.5px; margin-top: 1px; }
.cmdk-arrow { opacity: 0.4; }
.cmdk-empty { padding: 32px; text-align: center; font-size: 13px; }
.cmdk-foot {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px;
  border-top: 0.5px solid oklch(0.93 0.01 250);
  background: oklch(0.97 0.01 250);
}

/* shared popover */
.pp-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 0.5px solid oklch(0.93 0.01 250);
}
.pp-title { font-size: 17px; font-weight: 700; letter-spacing: -0.015em; }
.pp-sub { font-size: 11.5px; margin-top: 2px; }
.pp-tabs {
  display: flex; gap: 4px;
  padding: 8px 12px;
  border-bottom: 0.5px solid oklch(0.93 0.01 250);
}
.pp-tab {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: default;
  display: inline-flex; gap: 6px; align-items: center;
}
.pp-tab:hover { background: oklch(0.96 0.012 250); color: var(--ink); }
.pp-tab span {
  font-size: 10px;
  background: oklch(0.93 0.01 250);
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 700;
}
.pp-tab-on { background: var(--black); color: white; }
.pp-tab-on span { background: oklch(1 0 0 / 0.18); color: white; }
.pp-list { flex: 1; overflow-y: auto; padding: 6px; }
.pp-foot {
  display: flex; gap: 8px;
  padding: 12px 14px;
  border-top: 0.5px solid oklch(0.93 0.01 250);
  background: oklch(0.97 0.01 250 / 0.5);
}

/* message row */
.pp-msg {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px;
  border-radius: 14px;
  cursor: default;
  position: relative;
}
.pp-msg:hover { background: oklch(0.96 0.012 250); }
.pp-msg img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.pp-msg-name { font-size: 13px; font-weight: 600; }
.pp-msg-when { font-size: 10.5px; font-family: var(--font-mono); }
.pp-msg-snip { font-size: 12px; color: var(--ink-muted); margin-top: 3px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pp-msg-unread { color: var(--ink); font-weight: 500; }
.pp-unread-dot { position: absolute; top: 14px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: oklch(0.55 0.18 250); }

/* notif row */
.pp-notif {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px;
  border-radius: 14px;
  cursor: default;
  position: relative;
}
.pp-notif:hover { background: oklch(0.96 0.012 250); }
.pp-notif-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.pp-notif-mint   { background: oklch(0.93 0.07 160); color: oklch(0.36 0.14 160); }
.pp-notif-blue   { background: oklch(0.93 0.06 250); color: oklch(0.36 0.16 250); }
.pp-notif-yellow { background: oklch(0.94 0.10 95);  color: oklch(0.40 0.13 80); }
.pp-notif-pink   { background: oklch(0.93 0.07 18);  color: oklch(0.40 0.15 18); }
.pp-notif-lav    { background: oklch(0.93 0.06 295); color: oklch(0.40 0.15 295); }
.pp-notif-line   { font-size: 12.5px; line-height: 1.4; }
.pp-notif-extra  { font-size: 11px; margin-top: 2px; }
.pp-notif-when   { font-size: 10.5px; font-family: var(--font-mono); margin-top: 4px; }

/* profile menu */
.profile-head {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 18px 18px 14px;
  border-bottom: 0.5px solid oklch(0.93 0.01 250);
}
.profile-head img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.profile-name { font-size: 15px; font-weight: 700; letter-spacing: -0.015em; }
.profile-email { font-size: 11.5px; margin-top: 2px; }

.profile-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: oklch(0.93 0.01 250);
}
.profile-stat { background: oklch(0.99 0.005 250); padding: 12px 16px; }
.profile-stat-val { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.profile-stat-lbl { font-size: 10.5px; color: var(--ink-muted); margin-top: 2px; }

.profile-menu { padding: 8px; }
.pmi {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 10px;
  border-radius: 10px;
  cursor: default;
}
.pmi:hover { background: oklch(0.96 0.012 250); }
.pmi-ic { color: var(--ink-soft); }
.pmi-lbl { font-size: 13px; font-weight: 500; }
.pmi-hint { font-size: 11px; margin-top: 1px; }
.pmi-danger { color: var(--danger); }
.pmi-danger:hover { background: oklch(0.96 0.04 18); }
.pmi-danger .pmi-ic { color: var(--danger); }

.profile-divider { height: 1px; background: oklch(0.93 0.01 250); margin: 6px 8px; }
.profile-foot { font-size: 11px; padding: 10px 18px 14px; border-top: 0.5px solid oklch(0.93 0.01 250); }


/* ───────────────────────────────────────────────────────────────
   DARK MODE — ativada via .theme-dark no container .app
   Inverte tokens principais; acentos pastéis ganham mais croma.
   ─────────────────────────────────────────────────────────────── */
.theme-dark {
  --bg: oklch(0.20 0.012 255);
  --bg-tint-a: oklch(0.24 0.04 250);
  --bg-tint-b: oklch(0.22 0.03 100);
  --bg-tint-c: oklch(0.23 0.04 320);

  --card: oklch(0.27 0.012 255 / 0.72);
  --card-solid: oklch(0.26 0.012 255);
  --card-border: oklch(1 0 0 / 0.06);
  --card-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 24px 48px -28px rgba(0,0,0,.5), 0 6px 14px -8px rgba(0,0,0,.4);

  --ink: oklch(0.96 0.01 255);
  --ink-soft: oklch(0.85 0.012 255);
  --ink-muted: oklch(0.70 0.012 255);
  --ink-faint: oklch(0.55 0.012 255);
  --ink-line: oklch(0.36 0.012 255);

  --black: oklch(0.10 0.008 255);
}
html.theme-dark body, html.theme-dark .app {
  background:
    radial-gradient(1100px 700px at 8% -10%, oklch(0.26 0.05 245) 0%, transparent 55%),
    radial-gradient(900px 700px at 110% 10%, oklch(0.24 0.05 320) 0%, transparent 55%),
    radial-gradient(900px 700px at 60% 110%, oklch(0.24 0.04 100) 0%, transparent 55%),
    var(--bg);
}
.theme-dark .topnav,
.theme-dark .card { background: var(--card); border-color: var(--card-border); }
.theme-dark .cs-flat .card,
.theme-dark .cs-outlined .card { background: var(--card-solid); }
.theme-dark .cs-outlined .card { border-color: var(--ink-line); }

.theme-dark .pop { background: oklch(0.24 0.012 255); border-color: var(--ink-line); color: var(--ink); }
.theme-dark .pop-item:hover, .theme-dark .pop-menu-item:hover { background: oklch(0.30 0.012 255); }
.theme-dark .pop-divider, .theme-dark .pop-head { border-color: var(--ink-line); background: transparent; }

.theme-dark .icon-btn, .theme-dark .mini-btn { background: oklch(0.28 0.012 255); color: var(--ink-soft); }
.theme-dark .icon-btn:hover, .theme-dark .mini-btn:hover { background: oklch(0.34 0.012 255); }
.theme-dark .icon-btn-on, .theme-dark .mini-btn-on { background: var(--ink) !important; color: var(--bg) !important; }
.theme-dark .icon-btn-on svg, .theme-dark .mini-btn-on svg { stroke: var(--bg) !important; }

.theme-dark .pill { background: oklch(0.28 0.012 255); color: var(--ink-soft); }
.theme-dark .pill-dark { background: var(--ink); color: var(--bg); }

.theme-dark .tab.active { background: var(--ink); color: var(--bg); }

.theme-dark input, .theme-dark textarea, .theme-dark .ezz-input { background: oklch(0.26 0.012 255); color: var(--ink); border-color: var(--ink-line); }
.theme-dark .ezz-input::placeholder, .theme-dark input::placeholder, .theme-dark textarea::placeholder { color: var(--ink-faint); }

.theme-dark .btn-primary { background: var(--ink); color: var(--bg); }
.theme-dark .btn-ghost { background: oklch(0.28 0.012 255); color: var(--ink); }

.theme-dark table.tbl thead { color: var(--ink-muted); }
.theme-dark table.tbl tbody tr { border-color: var(--ink-line); }

.theme-dark .sidebar { background: oklch(0.10 0.008 255); }

.theme-dark .toast { background: oklch(0.95 0.01 255); color: var(--bg); }
.theme-dark .toast-ic { background: oklch(0.65 0.13 155); }


/* Dark mode — fixes para componentes com cores claras hardcoded */
html.theme-dark .jcol-blue   { background: linear-gradient(180deg, oklch(0.30 0.06 245) 0%, oklch(0.24 0.012 255) 100%); }
html.theme-dark .jcol-yellow { background: linear-gradient(180deg, oklch(0.32 0.07 95)  0%, oklch(0.24 0.012 255) 100%); }
html.theme-dark .jcol-pink   { background: linear-gradient(180deg, oklch(0.30 0.06 18)  0%, oklch(0.24 0.012 255) 100%); }
html.theme-dark .jcol-lav    { background: linear-gradient(180deg, oklch(0.30 0.06 295) 0%, oklch(0.24 0.012 255) 100%); }
html.theme-dark .jrow, html.theme-dark .jpill { background: oklch(0.28 0.012 255); color: var(--ink); }
html.theme-dark .jpill-pinned { background: oklch(0.92 0.01 255); color: var(--bg); }
html.theme-dark .jcol-count { background: oklch(0.32 0.012 255); color: var(--ink-soft); }

html.theme-dark .op-kan-col-blue   { background: linear-gradient(180deg, oklch(0.28 0.06 245) 0%, oklch(0.24 0.012 255) 100%); }
html.theme-dark .op-kan-col-yellow { background: linear-gradient(180deg, oklch(0.30 0.07 95)  0%, oklch(0.24 0.012 255) 100%); }
html.theme-dark .op-kan-col-pink   { background: linear-gradient(180deg, oklch(0.28 0.06 18)  0%, oklch(0.24 0.012 255) 100%); }
html.theme-dark .op-kan-col-mint   { background: linear-gradient(180deg, oklch(0.28 0.06 160) 0%, oklch(0.24 0.012 255) 100%); }
html.theme-dark .op-kan-card { background: oklch(0.30 0.012 255); }

html.theme-dark .h1 em, html.theme-dark h1 em { color: var(--ink); }

html.theme-dark .wday { background: oklch(0.28 0.012 255); }
html.theme-dark .wday-sel { background: oklch(0.95 0.01 255); color: var(--bg); }
html.theme-dark .hour-row { border-color: oklch(0.32 0.012 255); color: var(--ink-faint); }
html.theme-dark .events-col, html.theme-dark .events-col::before { border-color: oklch(0.32 0.012 255); }

html.theme-dark .crow:hover { background: oklch(0.30 0.012 255); }
html.theme-dark .crow-sel { background: oklch(0.30 0.012 255); }

html.theme-dark .dl-row { border-color: var(--ink-line); }

html.theme-dark .tasks li { border-color: var(--ink-line); }


/* Dark mode — cards opacos (sem backdrop-filter) para evitar mistura com gradient */
html.theme-dark .card {
  background: oklch(0.26 0.012 255) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-color: oklch(0.32 0.012 255) !important;
}
html.theme-dark .topnav {
  background: oklch(0.26 0.012 255) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-color: oklch(0.32 0.012 255);
}


/* ═══════════════════════════════════════════════════════════════
   MICRO-INTERAÇÕES & POLISH
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Screen entry — suave com scale ──────────────────────── */
@keyframes screen-in {
  from { opacity: 0; transform: translateY(10px) scale(0.994); }
  to   { opacity: 1; transform: none; }
}
.screen { animation: screen-in .30s cubic-bezier(.22,.8,.2,1); }

/* ── 2. Button press feedback (:active scale) ───────────────── */
.btn-primary { transition: background .15s, transform .08s; }
.btn-primary:active { transform: scale(0.96); }

.btn-ghost { transition: background .15s, color .15s, transform .08s; }
.btn-ghost:active { transform: scale(0.96); }

.mini-btn { transition: background .15s, color .15s, transform .08s; }
.mini-btn:active { transform: scale(0.88); }

.icon-btn { transition: background .15s, color .15s, transform .08s; }
.icon-btn:active { transform: scale(0.88); }

.back-btn { transition: background .15s, transform .08s; }
.back-btn:active { transform: scale(0.88); }

.sb-btn { transition: background .15s, color .15s, transform .10s; }
.sb-btn:active { transform: scale(0.86); }

.tab { transition: background .15s, color .15s, transform .08s; }
.tab:active { transform: scale(0.97); }

.cmdk-item { transition: background .10s, transform .08s; }
.cmdk-item:active { transform: scale(0.98); }

/* ── 3. Input focus glow ────────────────────────────────────── */
.ezz-input {
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.ezz-input:focus {
  border-color: oklch(0.55 0.16 250);
  background: white;
  box-shadow: 0 0 0 3px oklch(0.55 0.16 250 / 0.12);
}
.theme-dark .ezz-input:focus {
  background: oklch(0.30 0.012 255);
  box-shadow: 0 0 0 3px oklch(0.55 0.16 250 / 0.20);
}

/* ── 4. Notification badge pulse ─────────────────────────────── */
@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0   oklch(0.62 0.18 25 / 0.55); }
  55%       { box-shadow: 0 0 0 5px oklch(0.62 0.18 25 / 0.00); }
}
.badge-dot { animation: badge-pulse 2.6s ease-in-out infinite; }

@keyframes sb-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0   oklch(0.62 0.18 25 / 0.55); }
  55%       { box-shadow: 0 0 0 4px oklch(0.62 0.18 25 / 0.00); }
}
.sb-dot { animation: sb-dot-pulse 2.6s ease-in-out 1.3s infinite; }

/* ── 5. Sidebar tooltip (CSS-only, usa data-tip) ────────────── */
.sb-btn { position: relative; }
.sb-btn::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) scale(0.92) translateX(-4px);
  background: oklch(0.10 0.008 255);
  color: white;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
  padding: 5px 11px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s cubic-bezier(.2,.8,.2,1);
  z-index: 200;
  box-shadow: 0 4px 14px -4px rgba(0,0,0,.35);
}
.sb-btn::before {
  content: '';
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%) scale(0.8);
  border: 5px solid transparent;
  border-right-color: oklch(0.10 0.008 255);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s cubic-bezier(.2,.8,.2,1);
  z-index: 200;
}
.sb-btn:hover::after {
  opacity: 1;
  transform: translateY(-50%) scale(1) translateX(0);
}
.sb-btn:hover::before {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}
/* Não mostrar tooltip no botão ativo */
.sb-btn.active::after,
.sb-btn.active::before { opacity: 0 !important; }

/* ── 6. Avatar stack hover zoom ─────────────────────────────── */
.av-stack img {
  transition: transform .15s cubic-bezier(.2,.8,.2,1), z-index 0s;
}
.av-stack img:hover {
  transform: scale(1.2) translateY(-3px);
  z-index: 5;
  position: relative;
}

/* ── 7. Pill hover ───────────────────────────────────────────── */
.pill {
  transition: filter .12s, transform .10s;
}
.pill:hover { filter: brightness(0.93); }

/* ── 8. Table row transition ─────────────────────────────────── */
.tbl tr { transition: background .10s; }

/* ── 9. Stat-inline hover lift ───────────────────────────────── */
.stat-inline {
  border-radius: 10px;
  transition: background .15s, transform .15s;
}
.stat-inline:hover {
  background: oklch(0.93 0.02 250 / 0.6);
  transform: translateY(-1px);
}

/* ── 10. Skeleton shimmer (utilitário reutilizável) ─────────── */
@keyframes shimmer {
  from { background-position: -600px 0; }
  to   { background-position:  600px 0; }
}
.skeleton {
  background: linear-gradient(
    90deg,
    oklch(0.92 0.01 250) 25%,
    oklch(0.97 0.01 250) 50%,
    oklch(0.92 0.01 250) 75%
  );
  background-size: 600px 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: 6px;
  color: transparent !important;
}
.skeleton * { visibility: hidden; }

/* ── 11. Hover suave em itens de lista / pop-over ─────────────── */
.pmi         { transition: background .10s; }
.pp-msg      { transition: background .10s; }
.pp-notif    { transition: background .10s; }
.pop-item    { transition: background .10s; }
.pop-menu-item { transition: background .10s; }
.cmdk-item   { transition: background .10s; }
.pipe-dd-item { transition: background .10s; }


/* dark mode overrides com !important pra vencer estilos inline-css do React */
html.theme-dark .jrow { background: oklch(0.30 0.012 255) !important; color: var(--ink) !important; }
html.theme-dark .jrow-title, html.theme-dark .jrow-due { color: var(--ink) !important; }
html.theme-dark .jrow-due { color: var(--ink-muted) !important; }
html.theme-dark .jpill { background: oklch(0.30 0.012 255) !important; color: var(--ink) !important; }
html.theme-dark .jpill-pinned { background: oklch(0.95 0.01 255) !important; color: oklch(0.18 0.008 255) !important; }
html.theme-dark .jcol-name { color: var(--ink) !important; }
html.theme-dark .jcol-sub { color: var(--ink-muted) !important; }
html.theme-dark .jcol-count { background: oklch(0.34 0.012 255) !important; color: var(--ink-soft) !important; }
html.theme-dark .jhero-title { color: var(--ink) !important; }
html.theme-dark .jhero-sub { color: var(--ink-muted) !important; }
html.theme-dark .op-kan-card { background: oklch(0.30 0.012 255) !important; }
html.theme-dark .op-kan-card * { color: var(--ink); }
html.theme-dark .op-kan-count { background: oklch(0.95 0.01 255); color: var(--bg); }
html.theme-dark .stat-ic { color: oklch(0.18 0.008 255); }

/* ── Responsivo — notebooks pequenos ──────────────────────────────── */

/* 1280px: compacta tabs e topnav ligeiramente */
@media (max-width: 1280px) {
  .tab { padding: 8px 12px; font-size: 13px; }
  .topnav { gap: 8px; }
}

/* 1150px: esconde brand-name, mantém só logo */
@media (max-width: 1150px) {
  .brand-name { display: none; }
  .tab { padding: 7px 10px; font-size: 12.5px; }
  .topnav { gap: 6px; padding: 8px 10px 8px 12px; }
}

/* 1060px: layout crítico — sidebar compacta, tabs reduzem, grids empilham */
@media (max-width: 1060px) {
  /* app shell: sidebar menor */
  .app { grid-template-columns: 58px 1fr; gap: 10px; padding: 10px; }
  .sidebar { padding: 10px 6px; }
  .sb-btn { width: 38px; height: 38px; }
  .sidebar .sb-logo { width: 38px; height: 38px; }

  /* topnav: oculta Oportunidades e Calendário (sidebar já tem os ícones) */
  .tab[data-id="oportunidades"],
  .tab[data-id="calendario"] { display: none; }

  /* page padding menor */
  .page { padding: 12px 12px 0 !important; }
  .main { gap: 10px; }

  /* painel stats: 2×2 grid */
  .painel-stats { grid-template-columns: repeat(2, 1fr) !important; }

  /* painel grids: coluna única */
  .painel-grid,
  .painel-grid-2 { grid-template-columns: 1fr !important; }

  /* interactions: 2 colunas */
  .interactions { grid-template-columns: repeat(2, 1fr) !important; }

  /* pipe kanban: scroll horizontal */
  .pipe-kanban { min-width: 700px; }
  .pipe-layout { overflow-x: auto; }
}

/* Garante sem overflow horizontal em qualquer tela */
.screen { overflow-x: hidden; }
.page   { overflow-x: hidden; }
