/* LeadFlow, wearing Single Tab's skin.
 *
 * Loaded AFTER styles.css and only overrides it — delete the <link> to this
 * file in index.html to get the old look back instantly.
 *
 * The form comes from Single Tab (apps/dashboard/app/globals.css): a floating
 * window, a dark workspace on the left (icon rail + a workspace column), light
 * frosted glass on the right, pill controls, Poppins, line icons, and a glass
 * scroll pill instead of the browser scrollbar. The COLOURS stay LeadFlow's:
 * black + white, the sky->royal blue gradient as the accent, and a hint of
 * green. To switch to Single Tab's exact lilac/peach palette, change the
 * accent tokens in the first block below — nothing else needs to move.
 */

:root {
  color-scheme: light;

  /* light side */
  --paper: #f5f5f8;
  --line: #e7e7ee;
  --ink: #141418;
  --ink-2: #5d6070;
  --ink-3: #9497a6;

  /* dark side */
  --night: #0f0f12;
  --night-2: #18181d;
  --night-3: #23232a;
  --night-line: rgba(255, 255, 255, 0.08);
  --moon: #f4f4f6;
  --moon-2: #a2a4b0;
  --moon-3: #6c6e7a;

  /* LeadFlow accents (swap these to restyle the whole skin) */
  --accent-a: #29d6ff;          /* sky   — top of the Skyline Blue gradient */
  --accent-b: #0057e7;          /* royal — bottom of it */
  --accent-soft: #e3effb;
  --accent-green: #1f8a57;
  --accent-green-soft: #e2f4ec;
  --warm: #e8875f;              /* "overdue" — same peach Single Tab uses */
  --warm-soft: #fcebe3;
  --glow: linear-gradient(120deg, #d3f1ff 0%, #cfdcff 100%);

  --r-window: 30px;
  --r-card: 22px;

  /* remap the legacy tokens so every old rule picks up the new feel */
  --bg: #ffffff;
  --surface: #f3f4f9;
  --surface-2: #eceef6;
  --border: #e3e5ee;
  --text: var(--ink);
  --muted: var(--ink-2);
  --radius: 14px;
  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, 1), 0 1px 2px rgba(40, 40, 80, 0.04), 0 10px 30px rgba(60, 60, 120, 0.08);
  --shadow-float: 0 24px 60px rgba(30, 30, 70, 0.2);
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-heading: var(--font-body);
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
}

body {
  background: #0b0b0e;
  font-family: var(--font-body);
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.005em; }
h2 { font-size: 1.25rem; letter-spacing: -0.015em; }

/* ------------------------------------------------------------ icons */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 18px; height: 18px; }

/* ------------------------------------------------------------ window (desktop) */
@media (min-width: 900px) {
  html, body { height: 100%; overflow: hidden; }

  .app-shell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    height: 100vh;
    min-height: 560px;
    overflow: hidden;
    /* a black frame: the dark side wraps the light panel like a bezel */
    background: linear-gradient(180deg, #121216 0%, #0b0b0e 100%);
  }

  /* dark workspace: icon rail + workspace column */
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 72px 290px;
    width: auto;
    height: auto;
    min-height: 0;
    overflow: visible;
    justify-content: normal;
    background: transparent;
    border: 0;
    color: var(--moon);
  }
  .rail {
    display: flex; flex-direction: column; align-items: center; gap: 22px;
    padding: 20px 0; border-right: 1px solid var(--night-line); min-height: 0;
  }
  .rail-logo {
    flex: none; width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
    background: var(--glow); border: 0; cursor: pointer; padding: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  }
  .rail-logo img { width: 24px; height: 24px; object-fit: contain; display: block; }
  .rail-nav { display: flex; flex-direction: column; gap: 10px; }
  .rail-link {
    position: relative; width: 44px; height: 44px; border-radius: 50%; padding: 0;
    display: grid; place-items: center; color: var(--moon-2); cursor: pointer;
    background: var(--night-3); border: 1px solid var(--night-line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: background 0.15s, color 0.15s;
  }
  .rail-link:hover { color: var(--moon); background: #2d2d36; }
  .rail-link.active {
    background: var(--glow); color: var(--ink); border-color: transparent;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 6px 16px rgba(41, 140, 255, 0.28);
  }
  .rail-link:focus-visible { outline: 2px solid var(--accent-a); outline-offset: 2px; }
  .rail-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  [data-tip] { position: relative; }
  .rail-link[data-tip]:hover::after {
    content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
    background: var(--ink); color: #fff; font-size: 12px; padding: 5px 10px; border-radius: 8px; white-space: nowrap; z-index: 30;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  }
  .rail-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; }
  .avatar {
    width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent-a), var(--accent-b)); color: #fff; font-weight: 600; font-size: 13px;
  }

  .dark-col {
    display: flex; flex-direction: column; gap: 16px; padding: 22px 18px; min-height: 0; min-width: 0; overflow: hidden;
    background:
      radial-gradient(280px 240px at 20% 0%, rgba(41, 214, 255, 0.14), transparent 70%),
      radial-gradient(260px 260px at 90% 100%, rgba(0, 87, 231, 0.12), transparent 70%);
  }
  .tenant strong { display: block; font-size: 16px; font-weight: 600; color: var(--moon); }
  .tenant-sub { color: var(--moon-3); font-size: 12px; }

  .tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile {
    display: flex; flex-direction: column; justify-content: space-between; gap: 18px; text-align: left;
    padding: 14px; border-radius: 18px; min-height: 104px; cursor: pointer; color: var(--moon); font-family: inherit;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025));
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 20px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    transition: border-color 0.15s;
  }
  .tile:hover { border-color: rgba(255, 255, 255, 0.22); }
  .tile-top { display: flex; gap: 8px; align-items: flex-start; color: var(--moon-2); font-size: 12.5px; line-height: 1.3; }
  .tile-value { align-self: flex-end; font-size: 30px; font-weight: 500; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
  .tile.alert .tile-value { color: #ffb292; }

  .worklist-head { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 500; margin-top: 4px; color: var(--moon); }
  .worklist-head .count { background: var(--night-3); color: var(--moon-2); border-radius: 999px; padding: 1px 9px; font-size: 12px; }
  .worklist { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 0; padding-right: 2px; scrollbar-width: thin; scrollbar-color: #33333c transparent; }
  .work-card {
    display: flex; flex-direction: column; gap: 3px; padding: 13px 14px; border-radius: 18px; text-align: left; cursor: pointer;
    font-family: inherit; color: var(--moon); flex: none;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025));
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 20px rgba(0, 0, 0, 0.25);
    transition: border-color 0.15s;
  }
  .work-card:hover { border-color: rgba(255, 255, 255, 0.2); }
  .work-card.featured { background: var(--glow); color: var(--ink); border-color: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 10px 26px rgba(41, 140, 255, 0.25); }
  .work-top { display: flex; justify-content: space-between; align-items: center; color: var(--moon-3); }
  .work-card.featured .work-top { color: #55586a; }
  .work-code { font-family: var(--mono); font-size: 11.5px; }
  .work-title { font-weight: 500; font-size: 14px; line-height: 1.35; }
  .work-sub { font-size: 12px; color: var(--moon-2); }
  .work-card.featured .work-sub { color: #4b4e5e; }
  .work-foot {
    display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px;
    padding: 7px 8px 7px 12px; border-radius: 12px; border: 1px solid var(--night-line); font-size: 12px; color: var(--moon-2);
  }
  .work-card.featured .work-foot { border-color: rgba(20, 20, 24, 0.12); color: #3f4252; background: rgba(255, 255, 255, 0.35); }
  .dark-empty { color: var(--moon-3); margin: 0; font-size: 13px; }
  .pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
  .pill-peach { background: var(--warm); color: #2b130a; }
  .pill-sky { background: rgba(255, 255, 255, 0.14); color: #cfe9ff; }
  .work-card.featured .pill-sky { background: rgba(255, 255, 255, 0.7); color: #0b3a8a; }

  /* the light panel — floats inside the black frame */
  .main-col.light-wrap {
    position: relative; min-width: 0; min-height: 0; display: block;
    margin: 6px 6px 6px 0; border-radius: 18px; overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  }
  .light {
    height: 100%; min-width: 0; min-height: 0; overflow-y: auto; padding: 0;
    /* the native scrollbar is hidden; the glass pill (initGlassScroll) shows position instead */
    scrollbar-width: none;
  }
  .light::-webkit-scrollbar { display: none; }
}

/* LeadFlow's tables need room: below ~1260px the workspace column folds away and
   only the icon rail stays (its numbers are all on Home anyway). */
@media (max-width: 1259px) and (min-width: 900px) {
  .sidebar { grid-template-columns: 72px; }
  .dark-col { display: none; }
}

/* the light surface itself (desktop panel and mobile sheet share it).
   PERFORMANCE: the haze lives on a pseudo-element that does NOT scroll, painted once and
   composited, instead of `background-attachment: local` on the scroller — that made the
   browser rasterise (and re-rasterise) the gradients across the page's whole scrolling
   height, which is costly on a phone for long lists. */
.light-wrap { background: linear-gradient(180deg, #fafafc, #f2f2f6); }
.light-wrap::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(620px 460px at 4% 0%, rgba(41, 214, 255, 0.28), transparent 70%),
    radial-gradient(640px 480px at 98% 14%, rgba(0, 87, 231, 0.20), transparent 70%),
    radial-gradient(700px 480px at 55% 100%, rgba(31, 138, 87, 0.14), transparent 70%),
    radial-gradient(560px 420px at 0% 72%, rgba(41, 214, 255, 0.14), transparent 70%),
    radial-gradient(520px 380px at 70% 55%, rgba(0, 87, 231, 0.09), transparent 70%);
}
.light { position: relative; z-index: 1; background: transparent; }

/* glass scroll pill */
.glass-thumb {
  position: absolute; right: 5px; width: 7px; border-radius: 999px; z-index: 40; cursor: grab;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(190, 205, 232, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(40, 70, 130, 0.12), 0 4px 14px rgba(40, 80, 150, 0.22);
  backdrop-filter: blur(10px) saturate(160%); -webkit-backdrop-filter: blur(10px) saturate(160%);
  opacity: 0.9; transition: opacity 0.2s, width 0.15s, right 0.15s; touch-action: none;
}
.light-wrap:hover .glass-thumb, .glass-thumb.active { opacity: 1; }
.glass-thumb:hover, .glass-thumb:active { width: 9px; right: 4px; }
.glass-thumb:active { cursor: grabbing; }

/* ------------------------------------------------------------ top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 14px 34px;
  background: rgba(250, 250, 253, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.topbar-brand { display: none; font-weight: 600; letter-spacing: -0.01em; }
.topbar-actions { gap: 0.5rem; }
.btn.btn-icon {
  width: 38px; height: 38px; padding: 0; border-radius: 50%; display: inline-grid; place-items: center;
  background: rgba(255, 255, 255, 0.75); color: var(--ink-2);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 1px 0 #fff, 0 1px 3px rgba(40, 40, 80, 0.08);
}
.btn.btn-icon:hover { color: var(--ink); background: #fff; }
.btn.topbar-create-icon {
  width: 38px; height: 38px; padding: 0; border-radius: 50%; display: inline-grid; place-items: center;
}
.btn.topbar-create-icon .ico { width: 20px; height: 20px; stroke-width: 2.2; }
#app { max-width: none; padding: 26px 34px 56px; }

.global-search-panel {
  left: 34px; right: 34px; top: calc(100% + 8px); border-radius: var(--r-card); padding: 1rem 1.25rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.95); box-shadow: inset 0 1px 0 #fff, var(--shadow-float);
  backdrop-filter: blur(26px) saturate(170%); -webkit-backdrop-filter: blur(26px) saturate(170%);
}

/* ------------------------------------------------------------ glass cards */
.dash-card, .lead-card, .kanban-column, .stat-card, .report-card, .info-panel, .contacts-panel,
.pipeline-panel, .comments-panel, .leads-filter-panel, .leads-table-wrap, .insights-card,
.modal-content, .login-card, .account-menu, .order-card, .plan-today-panel, .plan-batch {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.72) 100%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}
.kanban-column { padding: 10px; background: linear-gradient(160deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.25)); }
.kanban-card, .mini-row, .contact-row, .plan-call-row, .plan-lead-row, .bulk-scan-card-row, .comment-item, .alert-item {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.62));
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 #fff, 0 4px 14px rgba(60, 60, 120, 0.06);
}
.stat-card { padding: 1rem 1.1rem; }
.stat-card .stat-value { color: var(--ink); font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-card .stat-label { color: var(--ink-2); }
.stat-card.stat-alert .stat-value { color: var(--warm); }
.stat-card.clickable:hover { background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.7)); box-shadow: 0 1px 2px rgba(20, 20, 40, 0.04), 0 14px 32px rgba(30, 30, 60, 0.1); }
.dash-card-header h3, .dash-subhead { font-weight: 600; }

/* ------------------------------------------------------------ controls */
.btn { border-radius: 999px; font-weight: 500; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b)); color: #fff;
  box-shadow: 0 6px 16px -6px rgba(0, 87, 231, 0.5);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-secondary {
  background: rgba(255, 255, 255, 0.7); color: var(--ink); border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 1px 0 #fff, 0 1px 3px rgba(40, 40, 80, 0.08);
}
.btn-secondary:hover { background: #fff; box-shadow: 0 2px 8px rgba(20, 20, 40, 0.1); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: rgba(20, 20, 24, 0.05); color: var(--ink); }
.btn-danger { background: var(--warm); color: #2b130a; }

input, select, textarea {
  font-family: var(--font-body); color: var(--ink); border-radius: 12px;
  background: rgba(255, 255, 255, 0.72); border: 1px solid var(--border);
  box-shadow: inset 0 1px 2px rgba(40, 40, 80, 0.05);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent-b); box-shadow: 0 0 0 3px rgba(0, 87, 231, 0.14); }
input::placeholder { color: var(--ink-3); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent-b); }

.view-toggle {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; overflow: visible;
  background: rgba(255, 255, 255, 0.5); border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 2px rgba(40, 40, 80, 0.05);
}
.view-toggle-btn { background: transparent; border-radius: 999px; color: var(--ink-2); font-weight: 500; padding: 0.4rem 0.95rem; }
.view-toggle-btn + .view-toggle-btn { border-left: 0; }
.view-toggle-btn.active { background: #fff; color: var(--ink); box-shadow: inset 0 1px 0 #fff, 0 2px 8px rgba(40, 40, 80, 0.12); }

.status-pill { border-radius: 999px; font-weight: 500; }
.data-table th { color: var(--ink-3); font-weight: 500; font-size: 12px; }
.data-table td, .data-table th { border-bottom-color: var(--line); }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.6); }
.tag-overdue { color: var(--warm); }

/* progress bars keep LeadFlow's blue */
.bar-fill, .funnel-bar-fill { background: linear-gradient(90deg, rgba(41, 214, 255, 0.55), var(--accent-b)); }
.bar-track, .funnel-bar-track {
  background-color: #f1f1f5;
  background-image: repeating-linear-gradient(135deg, rgba(150, 150, 170, 0.22) 0 1px, transparent 1px 6px);
}

/* ------------------------------------------------------------ modals, menus, toasts */
.modal { background: rgba(10, 10, 14, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-content { background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.86)); box-shadow: inset 0 1px 0 #fff, var(--shadow-float); }
.account-menu { background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.86)); box-shadow: inset 0 1px 0 #fff, var(--shadow-float); }
.account-menu-item:hover { background: rgba(20, 20, 24, 0.05); }
.toast { background: var(--ink); color: #fff; border-radius: 999px; }

/* ------------------------------------------------------------ login */
.login-shell { background: linear-gradient(180deg, #121216 0%, #0b0b0e 100%); }
.login-card { background: #fafafc; border-color: transparent; box-shadow: var(--shadow-float); }

/* ------------------------------------------------------------ mobile */
@media (max-width: 899px) {
  html, body { height: 100%; overflow: hidden; background: #0b0b0e; }
  /* A fixed, rounded window (like desktop) with the content scrolling INSIDE it, so the
     corners stay curved top and bottom however far you scroll — instead of the whole page
     scrolling and the sheet's curved edge scrolling away. */
  .app-shell { display: block; position: relative; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; background: linear-gradient(180deg, #121216 0%, #0b0b0e 100%); }
  .main-col.light-wrap {
    position: absolute; inset: calc(6px + env(safe-area-inset-top)) 6px 6px 6px; margin: 0;
    border-radius: 26px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  }
  .light { height: 100%; min-height: 0; overflow-y: auto; border-radius: 26px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .light::-webkit-scrollbar { display: none; }
  .glass-thumb { display: none; }
  .topbar { padding: 12px 14px 10px; border-radius: 26px 26px 0 0; }
  .topbar-brand { display: inline; margin-right: auto; margin-left: 8px; }
  #app { padding: 14px 12px 7rem; }
  .global-search-panel { left: 10px; right: 10px; }

  /* the bottom bar: a dark floating pill with the same line icons */
  .tabbar {
    left: 14px; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom));
    padding: 6px; border-radius: 26px;
    background: rgba(24, 24, 29, 0.88); border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
  .tab-btn {
    flex-direction: column; gap: 3px; padding: 8px 2px 6px; border-radius: 20px; color: var(--moon-2); opacity: 1;
    font-size: 10.5px; font-weight: 500;
  }
  .tab-btn:not(.active) { opacity: 1; }
  .tab-btn .tab-label { font-size: 10.5px; line-height: 1; }
  .tab-btn.active { background: var(--glow); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 6px 16px rgba(41, 140, 255, 0.25); }
}

/* ------------------------------------------------------------ polish pass 1 */
/* thin, quiet scrollbars for inner scroll areas (the main panel uses the glass pill) */
* { scrollbar-width: thin; scrollbar-color: rgba(110, 120, 165, 0.35) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(110, 120, 165, 0.35); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(110, 120, 165, 0.55); background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }
@media (min-width: 900px) {
  .light { scrollbar-width: none; }
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------ polish pass 2 */
/* When the light panel is narrower than ~1100px (with the workspace column showing that
   is windows 1260-1467px wide; with it folded away, 900-1177px) the filter panel becomes a
   horizontal bar above the table instead of eating a quarter of its width. */
@media (min-width: 900px) and (max-width: 1177px), (min-width: 1260px) and (max-width: 1467px) {
  .leads-layout { flex-direction: column; align-items: stretch; gap: 0.9rem; }
  .leads-filter-panel { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem 0.8rem; padding: 0.8rem 1rem; }
  .leads-filter-panel h3 { display: none; }
  .leads-filter-panel .filter-field { flex: 1 1 150px; min-width: 130px; }
  .leads-filter-panel .checkbox-label { flex: 0 0 auto; padding-bottom: 0.55rem; }
  .clients-upcoming-buttons { flex-direction: row; flex: 1 1 100%; }
  .clients-upcoming-btn { width: auto; flex: 1 1 0; }
  .clients-search-field { max-width: none; }
}

/* ------------------------------------------------------------ polish pass 3 */
/* panel/section titles: plain ink like Single Tab's (were LeadFlow royal blue) */
.info-panel h3, .contacts-panel h3, .pipeline-panel h3, .comments-panel h3, .report-card h3,
.insights-card h3, .form-section-heading, .pipeline-panel-header h3, .dash-card-header h3, .leads-filter-panel h3 {
  color: var(--ink);
}
.account-menu-item { color: var(--ink); gap: 0.7rem; }
.account-menu-item .ico { color: var(--ink-2); }
.account-menu-item:hover .ico { color: var(--ink); }
.account-menu-email { color: var(--ink-3); }

/* calendar: the grid sits in a rounded glass frame instead of bare white */
#calendar-body {
  border-radius: 18px; overflow: hidden;
  background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 1px 0 #fff, 0 10px 30px rgba(60, 60, 120, 0.08);
}
.calendar-day-header { background: rgba(240, 242, 250, 0.7); }
.plan-batch h3, .comments-panel h3 { color: var(--ink); }


/* ------------------------------------------------------------ tap feedback */
/* No square flash when a button is tapped on a phone (the browser's default tap highlight
   ignores the rounded shape) — the pills and glows are the feedback. Keyboard focus rings
   still show for :focus-visible. */
* { -webkit-tap-highlight-color: transparent; }
.tab-btn, .rail-link, .btn, .tile, .work-card { outline: none; }
.tab-btn:focus-visible, .rail-link:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent-a); outline-offset: 2px; }
.tab-btn { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }


/* ------------------------------------------------------------ performance pass */
/* Blur (backdrop-filter) is kept only on a handful of single surfaces — the top bar, the tab
   bar, popups and the dark column's tiles. Every card/row is plain translucent white: on a
   light haze it looks the same, but costs nothing to draw while scrolling. */
.view-toggle, .btn-secondary { backdrop-filter: none; -webkit-backdrop-filter: none; }

/* Long lists: let the browser skip laying out and painting cards that are off screen. */
.lead-card, .kanban-card, .mini-row, .contact-row, .order-card, .lead-story-item {
  content-visibility: auto;
  contain-intrinsic-size: auto 84px;
}
.kanban-card { contain-intrinsic-size: auto 96px; }

@media (max-width: 899px) {
  /* a lighter top bar blur on phones, and no fancy saturate filter */
  .topbar { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .tabbar { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  /* scrolling hint to the compositor */
  .light { will-change: scroll-position; }
}


/* ------------------------------------------------------------ glass icon chips (Home card headers) */
.dash-card-header h3 { display: flex; align-items: center; gap: 0.65rem; }
.card-ico {
  flex: none; width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center;
  background: var(--glow); color: var(--accent-b);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 6px 14px rgba(41, 140, 255, 0.22);
}
.card-ico.warm {
  background: linear-gradient(120deg, #ffe3d3 0%, #ffd2cf 100%); color: #c4512f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 6px 14px rgba(232, 135, 95, 0.26);
}

/* ------------------------------------------------------------ pickers (static/pickers.js) */
/* Our own dropdown lists and date/time cards, in place of the phone's built-in ones. */
.pk-overlay {
  position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(10, 10, 14, 0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.pk-overlay.pk-anchored { display: block; padding: 0; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.pk-panel {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.95); border-radius: 24px; color: var(--ink);
  box-shadow: inset 0 1px 0 #fff, var(--shadow-float); font-family: var(--font-body);
}
.pk-title { padding: 1rem 1.2rem 0.4rem; font-weight: 600; font-size: 1rem; }

/* dropdown list */
.pk-list { width: min(420px, 100%); max-height: min(78vh, 560px); max-height: min(78dvh, 560px); display: flex; flex-direction: column; overflow: hidden; }
.pk-anchored .pk-list { position: fixed; border-radius: 18px; }
.pk-search { margin: 0.7rem 0.7rem 0.2rem; width: calc(100% - 1.4rem); flex: none; }
.pk-options { overflow-y: auto; padding: 0.4rem; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.pk-option {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; text-align: left;
  padding: 0.8rem 0.9rem; border: 0; border-radius: 14px; background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.pk-option:hover { background: rgba(20, 20, 24, 0.05); }
.pk-option[aria-selected="true"] { background: var(--accent-soft); font-weight: 600; }
.pk-option:disabled { opacity: 0.4; cursor: default; }
.pk-mark { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink-3); }
.pk-option[aria-selected="true"] .pk-mark { border-color: var(--accent-b); background: var(--accent-b); box-shadow: inset 0 0 0 3px #fff; }
.pk-empty { padding: 1rem; color: var(--ink-2); text-align: center; }

/* date / date-time card */
.pk-date { width: min(344px, 100%); padding: 0.9rem 0.9rem 0.8rem; max-height: 94vh; max-height: 94dvh; overflow-y: auto; }
.pk-date .pk-title { padding: 0.1rem 0.4rem 0.6rem; }
.pk-head { display: flex; align-items: center; gap: 0.15rem; margin-bottom: 0.4rem; }
.pk-month { flex: 1; text-align: center; font-weight: 600; }
.pk-nav {
  position: relative; flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(20, 20, 24, 0.05); color: var(--ink);
}
.pk-nav:hover { background: rgba(20, 20, 24, 0.1); }
.pk-nav::before, .pk-nav::after {
  content: ""; position: absolute; top: 50%; width: 7px; height: 7px; border: solid currentColor; border-width: 0 0 2px 2px;
}
.pk-prev::before, .pk-prev-year::before, .pk-prev-year::after { transform: translate(-50%, -50%) rotate(45deg); left: 50%; }
.pk-next::before, .pk-next-year::before, .pk-next-year::after { transform: translate(-50%, -50%) rotate(-135deg); left: 50%; }
.pk-prev::after, .pk-next::after { display: none; }
.pk-prev-year::before { left: 40%; } .pk-prev-year::after { left: 62%; }
.pk-next-year::before { left: 38%; } .pk-next-year::after { left: 60%; }
.pk-week, .pk-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.pk-week span { text-align: center; font-size: 0.75rem; color: var(--ink-3); padding: 0.3rem 0; font-weight: 500; }
.pk-grid { gap: 2px; }
.pk-day {
  aspect-ratio: 1; min-height: 38px; border: 0; border-radius: 50%; background: transparent; color: var(--ink);
  font: inherit; font-size: 0.9rem; cursor: pointer; position: relative;
}
.pk-day:hover { background: rgba(20, 20, 24, 0.06); }
.pk-day.out { color: var(--ink-3); opacity: 0.55; }
.pk-day.today { box-shadow: inset 0 0 0 2px var(--accent-b); }
.pk-day.sel { background: linear-gradient(135deg, var(--accent-a), var(--accent-b)); color: #fff; box-shadow: 0 6px 14px -6px rgba(0, 87, 231, 0.6); opacity: 1; }
.pk-time { display: flex; align-items: center; justify-content: center; gap: 0.6rem; margin: 0.8rem 0 0.2rem; }
.pk-time-wrap { text-align: center; }
.pk-time-label { font-size: 0.72rem; color: var(--ink-3); margin-bottom: 0.25rem; font-weight: 500; }
.pk-time-col {
  position: relative; width: 74px; height: 150px; overflow-y: auto; padding: 4px; border-radius: 16px;
  background: rgba(20, 20, 24, 0.04); overscroll-behavior: contain; scrollbar-width: none;
}
.pk-time-col::-webkit-scrollbar { display: none; }
.pk-time-item { display: block; width: 100%; padding: 0.45rem 0; border: 0; border-radius: 12px; background: transparent; color: var(--ink-2); font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; }
.pk-time-item:hover { background: rgba(20, 20, 24, 0.06); }
.pk-time-item.sel { background: linear-gradient(135deg, var(--accent-a), var(--accent-b)); color: #fff; font-weight: 600; }
.pk-colon { font-weight: 600; margin-top: 1.1rem; color: var(--ink-2); }
.pk-foot { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.9rem; }
.pk-foot .btn { width: auto; }
.pk-spacer { flex: 1; }
.pk-panel [hidden] { display: none !important; }

/* type-ahead suggestions under a text box */
.pk-suggest { position: fixed; z-index: 3000; overflow-y: auto; padding: 0.3rem; border-radius: 16px; overscroll-behavior: contain; }
.pk-suggest .pk-option { padding: 0.6rem 0.8rem; font-size: 0.92rem; }

/* Money totals in the Insights "Client business" cards: shrink with the screen and stay on one line,
   so ₹83.25 Lacs / ₹1.86 Cr never wrap onto a second line inside a phone-width card. */
#client-business-stat-grid .stat-value { font-size: clamp(1rem, 4.6vw, 1.7rem); white-space: nowrap; }

/* Fonts only: the sign-in title is set in Cormorant Garamond (class "display-heading" does the same elsewhere). */
.display-heading, .login-card h1 { font-family: var(--font-display); }

/* Sign-up cards (login screen) */
.login-note { margin: 0; font-size: 0.88rem; color: var(--muted); line-height: 1.45; }
.login-note strong { color: var(--text, #141418); }
.login-alt { margin: 0.2rem 0 0; font-size: 0.85rem; color: var(--muted); }
.login-alt a { color: #0057e7; text-decoration: none; font-weight: 600; }
.login-card label.checkbox-label { flex-direction: row; align-items: flex-start; gap: 0.55rem; line-height: 1.35; }
.login-card input[type="checkbox"] { width: auto; margin-top: 0.15rem; flex: none; }
.login-card label.checkbox-label a { color: #0057e7; }
button.btn.btn-google { cursor: pointer; font-family: inherit; font-size: inherit; }

/* Sign in with Google (login screen) */
.login-or { display: flex; align-items: center; gap: 0.7rem; color: var(--muted); font-size: 0.8rem; margin: 0.2rem 0 0.8rem; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--border, rgba(20, 20, 24, 0.12)); }
.btn.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  width: 100%; background: #fff; color: #1f1f24; text-decoration: none;
  border: 1px solid rgba(20, 20, 24, 0.18); font-weight: 600;
}
.btn.btn-google:hover { background: #f6f7fb; }
