/* =====================================================================
   Tech Profuse Invoice & Renewal Portal -- shared design system
   "Zoho Books" look (books.zoho.in): dark-navy grouped sidebar, white top
   bar with search, light grey canvas, white flat cards, blue primary
   actions, clean tables, coloured status pills, 13px Inter/Roboto type.
   ---------------------------------------------------------------------
   Loaded LAST in every page's <head> (after the page's own <style>), so
   it overrides what should look the same everywhere. It never renames
   classes or IDs; the sidebar grouping + top bar are built at runtime by
   theme.js (html.zb is set there), re-using the page's existing elements.

   DESIGN TOKENS (light / default)
     sidebar bg  #21263c   sidebar hover #2c3249   sidebar text #c3c7d4
     active item #408dfb (accent)                 group text   #e6e8ef
     primary     #408dfb   primary hover #1d72e8   link         #1d72e8
     canvas      #f7f8fb   surface #ffffff         surface-2    #f9fafc
     border      #e3e6ee   border-strong #d4d8e2   row hover    #f4f8ff
     text        #21263c   text-2 #5c6178          text-3       #8a8fa3
     paid/ok     #1f9d63   overdue #f0602b        warn          #d98a0b
     draft       #808599   sent/unpaid #408dfb    danger        #e54242
     font  'Inter','Roboto',system-ui  base 13px  table 13px  h1 20px/500
     radius 4px (inputs/buttons) 6px (cards)  pill 3px  control h 32px
   ===================================================================== */

:root {
  --tp-font-sans: 'Inter', 'Roboto', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --tp-font-heading: var(--tp-font-sans);
  --tp-font-ui: var(--tp-font-sans);
  --tp-font-mono: 'IBM Plex Mono', 'Cascadia Mono', Consolas, ui-monospace, monospace;

  --tp-fs-xs: 11.5px;
  --tp-fs-sm: 12.5px;
  --tp-fs-base: 13px;
  --tp-fs-md: 14px;
  --tp-fs-lg: 15px;
  --tp-fs-xl: 18px;
  --tp-fs-2xl: 20px;

  --tp-radius-sm: 4px;
  --tp-radius: 6px;
  --tp-radius-lg: 8px;

  --z-side: #21263c;
  --z-side-2: #1a1e30;
  --z-side-hover: #2c3249;
  --z-side-text: #c3c7d4;
  --z-side-text-strong: #eef0f5;
  --z-side-line: rgba(255, 255, 255, .07);
  --z-primary: #408dfb;
  --z-primary-hover: #1d72e8;
  --z-sidebar-w: 232px;
  --z-topbar-h: 52px;
}

/* ---------- colour tokens: light (Zoho default) ---------- */
html[data-theme="light"] {
  --bg: #f7f8fb;
  --panel: #ffffff;
  --panel2: #f9fafc;
  --panel3: #eef0f5;
  --glass: #ffffff;
  --border: #e3e6ee;
  --text: #21263c;
  --muted: #5c6178;
  --muted2: #8a8fa3;
  --ok: #1f9d63;
  --warn: #d98a0b;
  --bad: #e54242;
  --unmatched: #808599;
  --ended: #7b61d1;
  --brand: #408dfb;
  --cat4: #26a69a; --cat5: #7e57c2; --cat6: #8bc34a; --cat7: #f4b400; --cat8: #90a4ae; --cat9: #ec6f8b;
  --d-banner: #ffffff; --d-card: #ffffff; --d-line: #e3e6ee; --d-soft: #5c6178; --d-green: #1f9d63;
  --d-amber: #d98a0b; --d-red: #e54242; --d-violet: #7b61d1; --d-tint: #f4f8ff; --d-primary: #408dfb;

  --z-surface: #ffffff;
  --z-th-bg: #f9fafc;
  --z-th-text: #6b7088;
  --z-row-hover: #f4f8ff;
  --z-row-line: #edf0f5;
  --z-input-bg: #ffffff;
  --z-input-border: #d4d8e2;
  --z-link: #1d72e8;
  --z-top-bg: #ffffff;
  --z-top-line: #e3e6ee;
  --z-soft-primary: #eaf2ff;
  --tp-shadow: 0 1px 2px rgba(33, 38, 60, .05);
  --tp-focus: 0 0 0 3px rgba(64, 141, 251, .18);
  color-scheme: light;
}

/* ---------- colour tokens: dark ("night" variant, same structure) ---------- */
html:not([data-theme="light"]) {
  --bg: #15182a;
  --panel: #1e2236;
  --panel2: #232842;
  --panel3: #2c3250;
  --glass: #1e2236;
  --border: #30364f;
  --text: #e4e6ee;
  --muted: #a7acc0;
  --muted2: #868ca3;
  --ok: #3fc08a;
  --warn: #f2b33d;
  --bad: #f2716b;
  --unmatched: #8b91a7;
  --ended: #a995f0;
  --brand: #5c9dfc;
  --cat4: #4db6ac; --cat5: #9575cd; --cat6: #9ccc65; --cat7: #ffca28; --cat8: #90a4ae; --cat9: #f48fb1;
  --d-banner: #1e2236; --d-card: #1e2236; --d-line: #30364f; --d-soft: #a7acc0; --d-green: #3fc08a;
  --d-amber: #f2b33d; --d-red: #f2716b; --d-violet: #a995f0; --d-tint: #232a45; --d-primary: #5c9dfc;

  --z-side: #11131f;
  --z-side-2: #0d0f19;
  --z-side-hover: #1d2033;
  --z-surface: #1e2236;
  --z-th-bg: #232842;
  --z-th-text: #a0a5ba;
  --z-row-hover: #252b47;
  --z-row-line: #2a3049;
  --z-input-bg: #191c2e;
  --z-input-border: #363d58;
  --z-link: #6aa7ff;
  --z-top-bg: #1a1d30;
  --z-top-line: #2a2f47;
  --z-soft-primary: rgba(92, 157, 252, .14);
  --tp-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  --tp-focus: 0 0 0 3px rgba(92, 157, 252, .25);
  color-scheme: dark;
}

/* ---------- base typography ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html body {
  font-family: var(--tp-font-sans) !important;
  font-size: var(--tp-fs-base);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg) !important;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, header.top h1, .stat-val, .eyebrow-title {
  font-family: var(--tp-font-heading) !important;
  letter-spacing: 0;
  line-height: 1.3;
}
.mono, code, kbd, pre, samp { font-family: var(--tp-font-mono) !important; font-size: .92em; }
.material-symbols-outlined { font-family: 'Material Symbols Outlined' !important; letter-spacing: normal; }
::selection { background: rgba(64, 141, 251, .22); }
a { color: var(--z-link); text-underline-offset: 2px; }

/* decorative glows are not part of the Zoho look */
.ambient-glow { display: none !important; }

/* =====================================================================
   SHELL -- sidebar
   ===================================================================== */
html.zb .shell { display: flex; min-height: 100vh; }
html.zb .sidebar {
  width: var(--z-sidebar-w) !important;
  flex: 0 0 var(--z-sidebar-w);
  position: sticky !important;
  top: 0;
  height: 100vh !important;
  background: var(--z-side) !important;
  border-right: 0 !important;
  padding: 0 !important;
  gap: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  color: var(--z-side-text);
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  z-index: 40;
}
html.zb .sidebar .brand {
  height: var(--z-topbar-h);
  flex: 0 0 var(--z-topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px !important;
  margin: 0 !important;
  border-bottom: 1px solid var(--z-side-line) !important;
  background: var(--z-side-2);
}
html.zb .sidebar .brand .icon-badge {
  width: 28px !important; height: 28px !important; border-radius: 6px !important;
  background: var(--z-primary) !important; color: #fff !important; box-shadow: none !important;
}
html.zb .sidebar .brand .icon-badge .material-symbols-outlined { font-size: 18px !important; }
html.zb .sidebar .brand h1 {
  color: #ffffff !important; font-size: 15px !important; font-weight: 600 !important; margin: 0 !important;
  letter-spacing: 0 !important; white-space: nowrap;
}
html.zb .sidebar .brand p { color: #8f94a8 !important; font-size: 11px !important; margin: 0 !important; white-space: nowrap; }

html.zb .sidebar nav {
  flex: 1 1 auto !important;
  min-height: 0;
  overflow-y: auto !important;
  display: block !important;
  padding: 10px 0 12px !important;
  margin: 0 !important;
  scrollbar-color: #3a405a transparent;
}
html.zb .sidebar nav a,
html.zb .sidebar nav .zb-group-head {
  display: flex !important;
  align-items: center;
  gap: 12px !important;
  height: 36px;
  margin: 1px 8px !important;
  padding: 0 10px !important;
  border-radius: 6px !important;
  color: var(--z-side-text) !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 13.5px !important;
  font-weight: 400 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
html.zb .sidebar nav a .material-symbols-outlined,
html.zb .sidebar nav .zb-group-head .material-symbols-outlined {
  font-size: 19px !important; width: 20px; color: #a3a8bb; flex: 0 0 20px;
  font-variation-settings: 'wght' 300;
}
html.zb .sidebar nav a:hover:not(.active),
html.zb .sidebar nav .zb-group-head:hover { background: var(--z-side-hover) !important; color: #fff !important; }
html.zb .sidebar nav a.active {
  background: var(--z-primary) !important;
  color: #ffffff !important;
  font-weight: 500 !important;
}
html.zb .sidebar nav a.active .material-symbols-outlined { color: #fff; }
html.zb .sidebar nav .zb-group-head { color: var(--z-side-text-strong) !important; }
html.zb .sidebar nav .zb-group-head .zb-chev {
  margin-left: auto; font-size: 18px !important; width: auto; flex: 0 0 auto; transition: transform .15s;
}
html.zb .sidebar nav .zb-group.open > .zb-group-head .zb-chev { transform: rotate(180deg); }
html.zb .sidebar nav .zb-group-items { display: none; padding: 2px 0 4px; }
html.zb .sidebar nav .zb-group.open > .zb-group-items { display: block; }
html.zb .sidebar nav .zb-group-items a {
  height: 32px; padding-left: 42px !important; font-size: 13px !important;
}
html.zb .sidebar nav .zb-group.has-active > .zb-group-head { color: #fff !important; }
html.zb .sidebar nav .zb-sep { height: 1px; background: var(--z-side-line); margin: 8px 16px; }

html.zb .sidebar .sidebar-footer {
  flex: 0 0 auto;
  margin: 0 !important;
  padding: 10px 16px !important;
  border-top: 1px solid var(--z-side-line) !important;
  background: var(--z-side-2);
  color: #8f94a8;
  font-size: 11.5px;
}
html.zb .sidebar .sidebar-footer:empty { display: none; }
html.zb .zb-side-org { display: flex; align-items: center; gap: 8px; }
html.zb .zb-side-org b { color: #d7dae4; font-weight: 500; }

/* =====================================================================
   SHELL -- top bar + content area
   ===================================================================== */
html.zb .main-area {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 24px 48px !important;
  position: relative;
  background: var(--bg);
}
html.zb #app { max-width: none !important; margin: 0 !important; padding: 0 !important; }
html.zb .zb-topbar {
  position: sticky; top: 0; z-index: 35;
  height: var(--z-topbar-h);
  margin: 0 -24px 0;
  padding: 0 20px 0 24px;
  display: flex; align-items: center; gap: 14px;
  background: var(--z-top-bg);
  border-bottom: 1px solid var(--z-top-line);
}
html.zb .zb-search {
  position: relative; display: flex; align-items: center;
  width: 360px; max-width: 40vw; height: 32px;
  background: var(--panel2); border: 1px solid var(--border); border-radius: 6px;
  padding: 0 10px 0 8px; gap: 6px; color: var(--muted2);
}
html.zb .zb-search:focus-within { border-color: var(--z-primary); background: var(--z-input-bg); box-shadow: var(--tp-focus); }
html.zb .zb-search .material-symbols-outlined { font-size: 18px; }
html.zb .zb-search input {
  all: unset; flex: 1; font-size: 13px; color: var(--text); font-family: var(--tp-font-sans); min-width: 0;
}
html.zb .zb-search input::placeholder { color: var(--muted2); }
html.zb .zb-search kbd {
  font-family: var(--tp-font-sans) !important; font-size: 11px; color: var(--muted2);
  border: 1px solid var(--border); border-radius: 3px; padding: 0 5px; line-height: 16px;
}
html.zb .zb-search-menu {
  position: absolute; top: 36px; left: 0; right: 0; background: var(--z-surface); border: 1px solid var(--border);
  border-radius: 6px; box-shadow: 0 8px 24px rgba(33, 38, 60, .14); padding: 4px; display: none; z-index: 60;
}
html.zb .zb-search-menu.open { display: block; }
html.zb .zb-search-menu a {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 4px; color: var(--text);
  text-decoration: none; font-size: 13px;
}
html.zb .zb-search-menu a small { color: var(--muted2); margin-left: auto; font-size: 11.5px; }
html.zb .zb-search-menu a.hl, html.zb .zb-search-menu a:hover { background: var(--z-soft-primary); color: var(--z-link); }
html.zb .zb-top-spacer { flex: 1; }
html.zb .zb-org {
  font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
html.zb .zb-org .material-symbols-outlined { font-size: 18px; color: var(--muted2); }
html.zb .zb-top-actions { display: flex; align-items: center; gap: 6px; }
/* theme toggle (moved into the top bar) becomes a round icon button */
html.zb .zb-topbar .theme-toggle-btn {
  width: 32px !important; height: 32px !important; padding: 0 !important; border-radius: 50% !important;
  border: 1px solid transparent !important; background: transparent !important; color: var(--muted) !important;
  display: inline-flex !important; align-items: center; justify-content: center; margin: 0 !important;
}
html.zb .zb-topbar .theme-toggle-btn:hover { background: var(--panel3) !important; }
html.zb .zb-topbar .theme-toggle-btn .theme-btn-content { gap: 0 !important; }
html.zb .zb-topbar .theme-toggle-btn .theme-toggle-label,
html.zb .zb-topbar .theme-toggle-btn .theme-switch-pill { display: none !important; }
html.zb .zb-topbar .theme-toggle-btn .material-symbols-outlined { color: var(--muted) !important; font-size: 19px !important; }
/* the account control (#currentUserName, wrapped into an avatar by auth.js) */
html.zb .zb-user { display: flex !important; align-items: center; gap: 8px !important; margin: 0 !important; }
html.zb .zb-user #currentUserName {
  font-family: var(--tp-font-sans) !important; font-size: 13px !important; color: var(--text) !important; max-width: 160px;
}
html.zb .zb-user #logoutBtn { border-color: var(--border) !important; color: var(--muted) !important; }
html.zb .authum-avatar, .authum-avatar {
  background: var(--z-primary) !important; width: 28px !important; height: 28px !important; font-size: 12.5px !important;
}
html.zb .authum-dropdown {
  border-radius: 6px !important; box-shadow: 0 10px 28px rgba(33, 38, 60, .16) !important; background: var(--z-surface) !important;
}
html.zb .authum-dropdown .authum-username { color: var(--text) !important; font-size: 13.5px !important; }
html.zb .authum-dropdown button.authum-link { color: var(--z-link) !important; font-size: 13px !important; font-weight: 500 !important; }
html.zb .authum-dropdown button.authum-link.authum-danger { color: var(--bad) !important; }
.authum-btn.primary { background: var(--z-primary) !important; }

/* =====================================================================
   PAGE HEADER  (title strip like Zoho's "All Invoices ▾   [+ New]")
   ===================================================================== */
html.zb header.top, html.zb .dsh-banner {
  background: var(--z-surface) !important;
  color: var(--text) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 -24px 20px !important;
  padding: 14px 24px 14px !important;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px;
  min-height: 64px;
  position: relative;
}
html.zb header.top > div:first-child:not(.eyebrow) { min-width: 0; }
html.zb header.top h1, html.zb .dsh-banner h1 {
  font-size: 20px !important; font-weight: 500 !important; color: var(--text) !important; margin: 0 !important;
  letter-spacing: 0 !important; flex-basis: auto;
}
html.zb header.top .eyebrow, html.zb .dsh-banner .dsh-eyebrow {
  color: var(--muted2) !important; font-size: 11px !important; font-weight: 500 !important; letter-spacing: .06em !important;
  text-transform: uppercase; margin: 0 0 2px !important;
}
html.zb header.top .sub, html.zb .dsh-banner .dsh-sub {
  color: var(--muted) !important; font-size: 12.5px !important; line-height: 1.5 !important; margin: 3px 0 0 !important; max-width: 980px;
}
/* headers without a wrapper div: eyebrow/h1/sub stack full-width */
html.zb header.top > .eyebrow, html.zb header.top > h1, html.zb header.top > .sub,
html.zb .dsh-banner > * { flex: 1 1 100%; }

/* =====================================================================
   SURFACES -- cards, panels, stats
   ===================================================================== */
html.zb :is(.panel, .card, .table-wrap, .al-table-card, .su-wrap, .customer, .chart-card, .dsh-card, .dsh-table-card,
  .lookup-panel, .pdf-upload-box, .breakdown-panel, .al-side, .tbl-wrap, .upload-card, .box, .section) {
  background: var(--z-surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--tp-radius) !important;
  box-shadow: var(--tp-shadow) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html.zb :is(.panel, .card, .dsh-card) h2, html.zb .panel > h2, html.zb section h2 {
  font-size: 15px !important; font-weight: 600 !important; color: var(--text) !important;
}
html.zb .chart-card h3 { font-size: 13.5px !important; font-weight: 600 !important; color: var(--text) !important; }

/* KPI tiles: Zoho dashboard widgets -- white, thin border, small grey caption */
html.zb :is(.stat, .dsh-kpi) {
  background: var(--z-surface) !important;
  border: 1px solid var(--border) !important;
  border-left: 3px solid var(--border) !important;
  border-radius: var(--tp-radius) !important;
  box-shadow: var(--tp-shadow) !important;
  backdrop-filter: none !important;
  transform: none !important;
}
html.zb .stat:hover { transform: none !important; border-color: #cfd5e3 !important; }
html.zb .stat.ok, html.zb .stat.green { border-left-color: var(--ok) !important; }
html.zb .stat.warn, html.zb .stat.amber { border-left-color: var(--warn) !important; }
html.zb .stat.bad, html.zb .stat.red { border-left-color: var(--bad) !important; }
html.zb .stat.ended { border-left-color: var(--ended) !important; }
html.zb .stat.active, html.zb .stat.selected { border-color: var(--z-primary) !important; box-shadow: 0 0 0 1px var(--z-primary) !important; }
/* The tile stays white when selected, so undo any page's own white-on-blue
   selected text (new_recurring_profile.html) -- otherwise it's invisible. */
html.zb .stat.selected .stat-label { color: var(--muted) !important; }
html.zb .stat.selected .stat-val { color: var(--z-primary) !important; }
html.zb :is(.stat-label, .stat .l, .csum-l) {
  color: var(--muted) !important; font-size: 11.5px !important; font-weight: 500 !important;
  letter-spacing: .03em !important; text-transform: uppercase;
}
html.zb :is(.stat-val, .stat .n, .csum-n) {
  font-size: 20px !important; font-weight: 500 !important; color: var(--text);
  font-variant-numeric: tabular-nums lining-nums;
}

/* =====================================================================
   TABLES -- Zoho list view
   ===================================================================== */
html.zb table { font-variant-numeric: tabular-nums; border-collapse: collapse; }
html.zb table:not(.inv-items):not(.inv-paper table):not(.zb-plain) th {
  background: var(--z-th-bg) !important;
  color: var(--z-th-text) !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  letter-spacing: .04em !important;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border) !important;
  border-top: 0 !important;
  padding: 10px 12px !important;
  white-space: nowrap;
}
html.zb table:not(.inv-items):not(.inv-paper table):not(.zb-plain) td {
  font-size: 13px !important;
  color: var(--text);
  border-bottom: 1px solid var(--z-row-line) !important;
  padding: 10px 12px !important;
  line-height: 1.45;
  background-color: transparent;
}
html.zb table:not(.inv-items):not(.inv-paper table):not(.zb-plain) > tbody > tr:nth-child(even) > td { background-color: transparent; }
html.zb table:not(.inv-items):not(.inv-paper table):not(.zb-plain):not(.items-table) > tbody > tr:hover > td { background-color: var(--z-row-hover) !important; }
html.zb table:not(.inv-items):not(.inv-paper table) td a { color: var(--z-link); text-decoration: none; }
html.zb table:not(.inv-items):not(.inv-paper table) td a:hover { text-decoration: underline; }
/* first data column reads as the record link, like Zoho's blue invoice# */
html.zb :is(table.datatable, table.al-table, table.dsh-table) > tbody > tr > td:first-child { color: var(--z-link); }
html.zb :where(.table-wrap, .su-wrap, .al-table-card, .tbl-wrap, .table-scroll) :where(thead th) {
  position: sticky; top: 0; z-index: 2;
}
td.tp-num, th.tp-num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* =====================================================================
   STATUS PILLS -- Draft grey, Sent/Unpaid blue, Overdue orange, Paid green
   ===================================================================== */
html.zb :is(.status-pill, .al-tag, .badge, .pill:not(button), .tag, .chip) {
  display: inline-flex; align-items: center;
  font-size: 11px !important; font-weight: 600 !important; letter-spacing: .04em !important;
  text-transform: uppercase; border-radius: 3px !important; padding: 2px 7px !important; line-height: 16px !important;
  border: 0 !important; white-space: nowrap;
}
html.zb :is(.status-pill, .badge, .al-tag) { background: #eef0f4; color: #6b7088; }
html.zb :is(.status-pill, .badge, .al-tag):is(.paid, .ok, .green, .active, .success, .ACTIVE, .PAID, .RAISED, .Paid) { background: #e3f5ec !important; color: #13834f !important; }
html.zb :is(.status-pill, .badge, .al-tag):is(.overdue, .bad, .red, .danger, .OVERDUE, .Overdue, .suspended) { background: #fdece5 !important; color: #d4501d !important; }
html.zb :is(.status-pill, .badge, .al-tag):is(.unpaid, .sent, .blue, .info, .SENT, .Unpaid, .open) { background: #e8f1ff !important; color: #1d6fe0 !important; }
html.zb :is(.status-pill, .badge, .al-tag):is(.warn, .amber, .partial, .pending, .DRAFT, .draft) { background: #fdf3e0 !important; color: #b36b00 !important; }
html.zb :is(.status-pill, .badge, .al-tag):is(.ended, .violet, .ENDED) { background: #efeafd !important; color: #6a4fc4 !important; }
html:not([data-theme="light"]).zb :is(.status-pill, .badge, .al-tag) { filter: saturate(1.1) brightness(.92); }

/* =====================================================================
   BUTTONS
   ===================================================================== */
html.zb :is(button, .btn, input, select, textarea) { font-family: var(--tp-font-sans) !important; }
html.zb :is(.btn, .al-btn, .dsh-btn, .toolbar-btn, .rt-btn, .pill-tab, .add-row-btn, .preview-btn, .export-link, .icon-btn,
  .confirm-cancel, .authum-btn.secondary, .view-tab-btn, .sub-toggle-btn, .dsh-pill, .al-pill, .pill-btn, .filter-pill) {
  height: auto; min-height: 30px;
  padding: 6px 12px !important;
  border-radius: 4px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.3 !important;
  border: 1px solid var(--z-input-border) !important;
  background: var(--z-surface) !important;
  color: var(--text) !important;
  box-shadow: none !important;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
html.zb :is(.btn, .al-btn, .dsh-btn, .toolbar-btn, .rt-btn, .pill-tab, .add-row-btn, .preview-btn, .export-link, .icon-btn,
  .view-tab-btn, .sub-toggle-btn, .dsh-pill, .al-pill, .pill-btn, .filter-pill):hover:not(:disabled) {
  background: var(--panel2) !important; border-color: #b9c0d0 !important;
}
/* primary: the main action on a page (Zoho "+ New" / "Save and Send") */
html.zb :is(.btn:not(.secondary):not(.danger):not(.small), .btn.primary, .toolbar-btn, .preview-download-btn, .inv-send-btn,
  .confirm-send, #raiseBtn, #loginBtn, .actions-row > button:first-child, .modal-actions .primary, header.top > .btn,
  header.top .btn:not(.secondary)) {
  background: var(--z-primary) !important;
  border: 1px solid var(--z-primary) !important;
  color: #ffffff !important;
  border-radius: 4px !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  padding: 7px 14px !important;
  box-shadow: none !important;
}
html.zb :is(.btn:not(.secondary):not(.danger):not(.small), .btn.primary, .toolbar-btn, .preview-download-btn, .inv-send-btn,
  .confirm-send, #raiseBtn, #loginBtn, .actions-row > button:first-child):hover:not(:disabled) {
  background: var(--z-primary-hover) !important; border-color: var(--z-primary-hover) !important; color: #fff !important;
}
html.zb :is(.btn.danger, .su-btn-red, .icon-btn.del) { color: var(--bad) !important; }
html.zb .btn.danger { border-color: #f3c2c2 !important; }
html.zb .su-btn-green { color: var(--ok) !important; }
/* active tabs / pills: blue underline-ish Zoho tab */
html.zb :is(.rt-btn, .pill-tab, .view-tab-btn, .sub-toggle-btn, .dsh-pill, .al-pill, .pill-btn, .filter-pill, .al-btn).active,
html.zb .al-btn.on {
  background: var(--z-soft-primary) !important; border-color: var(--z-primary) !important; color: var(--z-link) !important;
}
html.zb :is(.dsh-pill, .al-pill) span { color: inherit; }
button:disabled, .btn:disabled { cursor: not-allowed; opacity: .55; }
html.zb .modal-close, html.zb .preview-close, html.zb .pc-close, html.zb .gws-modal-x, html.zb .end-domain-modal-close {
  border-radius: 4px !important;
}

/* =====================================================================
   FORM CONTROLS
   ===================================================================== */
.field-row > *, .form-grid > *, .grid > * { min-width: 0; }
.field-row select, .field-row input, .field-row textarea { max-width: 100%; }
html.zb :is(input[type="text"], input[type="search"], input[type="email"], input[type="number"], input[type="password"],
  input[type="date"], input[type="tel"], input[type="url"], input:not([type]), select, textarea):not(.zb-raw) {
  background-color: var(--z-input-bg) !important;
  border: 1px solid var(--z-input-border) !important;
  border-radius: 4px !important;
  color: var(--text) !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
  min-height: 32px;
  padding: 6px 10px !important;
  box-shadow: none;
}
html.zb textarea { min-height: 60px; }
html.zb .zb-search input { min-height: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; }
/* A search box with its magnifier icon inside it (.search-wrap, e.g. Recurring
   Profiles): the input padding above would put the text under the icon. */
html.zb body .search-wrap input:not(.zb-raw) { padding-left: 36px !important; min-height: 36px; }
html.zb .search-wrap .material-symbols-outlined { left: 11px !important; font-size: 18px !important; pointer-events: none; z-index: 1; }
html.zb :is(input, select, textarea):hover:not(:focus):not(:disabled) { border-color: #b9c0d0 !important; }
html.zb :is(input, select, textarea):focus, html.zb :is(input, select, textarea):focus-visible {
  outline: none !important; border-color: var(--z-primary) !important; box-shadow: var(--tp-focus) !important;
}
html.zb ::placeholder { color: var(--muted2) !important; opacity: 1; }
html.zb input[type="checkbox"], html.zb input[type="radio"] { accent-color: var(--z-primary); min-height: 0 !important; }
html.zb label, html.zb .field > label, html.zb .lbl {
  font-size: 12.5px !important; color: var(--muted) !important; text-transform: none !important;
  letter-spacing: 0 !important; font-weight: 500 !important;
}
html.zb .field label[for] .req, html.zb .req { color: var(--bad); }
button:focus-visible, a:focus-visible, .btn:focus-visible { outline: 2px solid var(--z-primary); outline-offset: 2px; }

/* card-style forms in modals: Zoho "label left / input right" rows */
@media (min-width: 900px) {
  html.zb :is(.modal-box, .form-card) .field:not(.autocomplete):has(> label + :is(input, select, textarea)) {
    display: grid !important; grid-template-columns: minmax(96px, 34%) 1fr; align-items: center; column-gap: 12px;
  }
  html.zb :is(.modal-box, .form-card) .field:has(> label + textarea) { align-items: start; }
  html.zb :is(.modal-box, .form-card) .field:has(> label + textarea) > label { padding-top: 7px; }
  html.zb :is(.modal-box, .form-card) .field > label { margin: 0 !important; }
  /* fields placed side by side (.field-row.three, e.g. the three price boxes)
     are too narrow for label-left -- stack the label above the input there */
  html.zb :is(.modal-box, .form-card) .field-row.three > .field:not(.autocomplete) {
    display: flex !important; flex-direction: column; align-items: stretch; gap: 5px;
  }
  html.zb :is(.modal-box, .form-card) .field-row.three > .field > label { line-height: 1.3; }
}

/* =====================================================================
   MODALS / POPUPS
   ===================================================================== */
html.zb :is(.modal-overlay, .authum-overlay, .confirm-overlay) { background: rgba(20, 24, 40, .45) !important; backdrop-filter: none !important; }
html.zb :is(.modal-box, .confirm-box, .authum-box) {
  border-radius: 6px !important; border: 1px solid var(--border) !important;
  box-shadow: 0 16px 48px rgba(20, 24, 40, .22) !important; backdrop-filter: none !important;
}
html.zb .modal-head { border-bottom: 1px solid var(--border); }
html.zb .modal-head h2, html.zb .modal-head h3 { font-size: 17px !important; font-weight: 500 !important; }

/* =====================================================================
   MISC
   ===================================================================== */
html.zb :is(.empty, .empty-hint, .al-empty) { color: var(--muted) !important; font-size: 13px !important; }
html.zb :is(.note, .form-note, .panel-note, .al-note, .lookup-hint) { font-size: 12.5px !important; }
html.zb .settings-link, html.zb .agent-link { color: var(--z-link) !important; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: #c9ceda transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c9ceda; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
html:not([data-theme="light"]) * { scrollbar-color: #3a405a transparent; }

/* =====================================================================
   LOGIN -- Zoho Accounts style sign-in card
   ===================================================================== */
html.zb-login body { background: #f1f3f8 !important; overflow: auto !important; }
html.zb-login:not([data-theme="light"]) body { background: var(--bg) !important; }
html.zb-login .login-card {
  max-width: 420px !important; padding: 40px 40px 34px !important; border-radius: 8px !important;
  background: var(--z-surface) !important; border: 1px solid var(--border) !important;
  box-shadow: 0 2px 30px rgba(33, 38, 60, .08) !important;
}
html.zb-login .login-card .brand { margin-bottom: 28px !important; }
html.zb-login .login-card .brand .icon-badge { background: var(--z-primary) !important; border-radius: 8px !important; }
html.zb-login .login-card h2 { font-size: 22px !important; font-weight: 500 !important; margin-bottom: 4px !important; }
html.zb-login .login-card .sub { color: var(--muted) !important; font-size: 13.5px !important; }
html.zb-login .login-card .field input { min-height: 42px !important; font-size: 14px !important; padding: 9px 12px !important; }
html.zb-login .login-card .field label { font-size: 12.5px !important; text-transform: none !important; }
html.zb-login #loginBtn { width: 100%; min-height: 42px; font-size: 14px !important; margin-top: 10px !important; border-radius: 6px !important; }
html.zb-login .zb-login-foot { text-align: center; color: var(--muted2); font-size: 12px; margin-top: 22px; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1100px) {
  html.zb .zb-org { display: none; }
}
@media (max-width: 860px) {
  html.zb .shell { flex-direction: column; }
  html.zb .sidebar { position: relative !important; width: 100% !important; height: auto !important; flex-basis: auto; }
  html.zb .sidebar nav { max-height: 50vh; }
  html.zb .main-area { padding: 0 14px 40px !important; }
  html.zb .zb-topbar, html.zb header.top, html.zb .dsh-banner { margin-left: -14px !important; margin-right: -14px !important; }
  html.zb .zb-search { width: auto; flex: 1; max-width: none; }
  .table-wrap, .su-wrap, .al-table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
@media print {
  .sidebar, .ambient-glow, .zb-topbar { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
}

/* =====================================================================
   PAGE TUNING -- dashboard (Zoho "Home" widgets)
   ===================================================================== */
html.zb .dsh-hero { margin: 0 0 20px !important; gap: 14px !important; }
html.zb .dsh-grid-3 { gap: 14px !important; }
html.zb .dsh-card { padding: 16px 18px !important; }
html.zb .dsh-card.tint { background: var(--z-surface) !important; border-top: 3px solid var(--z-primary) !important; }
html.zb .dsh-card.selected { border: 1px solid var(--z-primary) !important; box-shadow: 0 0 0 1px var(--z-primary) !important; padding: 16px 18px !important; }
html.zb .dsh-card.clickable:hover { border-color: #b9c0d0 !important; }
html.zb .dsh-num { font-size: 24px !important; font-weight: 500 !important; }
html.zb .dsh-num.big { font-size: 24px !important; }
html.zb .dsh-label { font-size: 11.5px !important; font-weight: 600 !important; letter-spacing: .05em !important; margin-top: 6px !important; color: var(--muted) !important; }
html.zb .dsh-detail { font-size: 12.5px !important; margin-top: 6px !important; }
html.zb .dsh-h2 { font-size: 13px !important; font-weight: 600 !important; text-transform: uppercase; letter-spacing: .05em; color: var(--muted) !important; margin: 26px 0 10px !important; }
html.zb .dsh-h2 small { font-size: 12px !important; text-transform: none; letter-spacing: 0; color: var(--muted2) !important; }
html.zb .dsh-progress-title { font-size: 14px !important; font-weight: 600 !important; }
html.zb .dsh-progress-title span { font-size: 13px !important; }
html.zb .dsh-bar { height: 8px !important; background: #fdf0d5 !important; border: 0 !important; }
html.zb .dsh-bar > div { background: var(--z-primary) !important; }
html.zb .dsh-foot { font-size: 12px !important; }
html.zb .dsh-toolbar { margin-bottom: 14px !important; }
html.zb .dsh-pills { gap: 6px !important; }
html.zb .dsh-pill span { font-weight: 600 !important; }

/* customers list: compact Zoho contact rows */
html.zb .customer { margin-bottom: 10px !important; }
html.zb .customer .cname { font-size: 14.5px !important; font-weight: 600 !important; color: var(--z-link) !important; }
html.zb .customer .agent-chip, html.zb .agent-chip, html.zb .domains-line, html.zb .customer .head { font-size: 12.5px !important; }
html.zb .customer-summary .csum-n { font-size: 16px !important; }
html.zb .customer-summary .csum-l { font-size: 10.5px !important; }

/* recurring profiles / generic record lists */
html.zb .profile-name { color: var(--z-link) !important; font-weight: 500 !important; }
html.zb .preview-btn { white-space: nowrap; padding: 5px 10px !important; font-size: 12.5px !important; color: var(--z-link) !important; }
html.zb .group-detail-inner { background: var(--panel2) !important; border-radius: 4px; }

/* =====================================================================
   ON-SCREEN INVOICE PREVIEW -- mirrors the Zoho Books PDF (PI261314.pdf):
   one thin-ruled frame, logo + company block left, light "PROFORMA
   INVOICE" title right, meta grid, grey "Bill To / Ship To" bars, ruled
   item table with grey header, words/notes left + totals box right.
   ===================================================================== */
html.zb .modal-box:has(.inv-paper) { max-width: 1000px !important; border-radius: 4px !important; }
html.zb .inv-paper { font-family: 'Roboto', 'Inter', Arial, sans-serif !important; color: #000 !important; font-size: 12.5px !important; padding: 18px 22px !important; background: #fff; }
html.zb .inv-paper * { font-family: inherit; }
html.zb .inv-paper table td, html.zb .inv-paper table th { background-color: transparent; }
html.zb .inv-page-frame { border: 1px solid #9e9e9e !important; border-radius: 0 !important; padding: 0 !important; background: #fff; }
html.zb .inv-header {
  border-bottom: 1px solid #9e9e9e !important; padding: 16px 18px !important; margin: 0 !important; align-items: center !important;
}
html.zb .inv-company { gap: 16px !important; align-items: center; }
html.zb .inv-company img { width: 88px !important; height: 88px !important; border-radius: 50% !important; }
html.zb .inv-company-name { font-size: 16px !important; font-weight: 700 !important; color: #000 !important; }
html.zb .inv-company-details { font-size: 11.5px !important; color: #222 !important; line-height: 1.45 !important; }
html.zb .inv-title {
  font-size: 30px !important; font-weight: 400 !important; text-transform: uppercase; letter-spacing: .01em !important;
  color: #000 !important; text-align: right; line-height: 1.25 !important; white-space: normal !important; max-width: 220px;
}
html.zb .inv-meta-box { border: 0 !important; border-bottom: 1px solid #9e9e9e !important; border-radius: 0 !important; margin: 0 !important; }
html.zb .inv-meta-col { padding: 6px 8px !important; }
html.zb .inv-meta-col:first-child { border-right: 1px solid #9e9e9e !important; }
html.zb .inv-meta-col table td { font-size: 12px !important; padding: 2px 4px !important; border: 0 !important; color: #000 !important; }
html.zb .inv-meta-col table td:first-child { color: #333 !important; width: 42%; }
html.zb .inv-meta-col table td + td { font-weight: 700; }
html.zb .inv-billto-box { border: 0 !important; border-bottom: 1px solid #9e9e9e !important; border-radius: 0 !important; margin: 0 !important; }
html.zb .inv-billto-header { background: #f0f0f0 !important; border-bottom: 1px solid #9e9e9e !important; }
html.zb .inv-billto-header > div { padding: 4px 8px !important; }
html.zb .inv-billto-header > div:first-child, html.zb .inv-billto-col:first-child { border-right: 1px solid #9e9e9e !important; }
html.zb .inv-billto-label { font-size: 12px !important; font-weight: 700 !important; text-transform: none !important; letter-spacing: 0 !important; color: #000 !important; }
html.zb .inv-billto-col { padding: 6px 8px !important; }
html.zb .inv-billto-name { font-size: 13px !important; font-weight: 700 !important; color: #000 !important; }
html.zb .inv-billto-addr { font-size: 12px !important; color: #111 !important; }
html.zb .inv-items-wrap { margin: 0 !important; border-bottom: 1px solid #9e9e9e; }
html.zb .inv-items-wrap > div { padding: 6px 8px 2px; }
html.zb table.inv-items { font-size: 12px !important; min-width: 820px; }
html.zb table.inv-items th {
  background: #f0f0f0 !important; color: #000 !important; text-transform: none !important; font-size: 11.5px !important;
  font-weight: 700 !important; letter-spacing: 0 !important; padding: 5px 6px !important; border: 1px solid #9e9e9e !important;
  border-top: 0 !important; text-align: center !important; white-space: normal !important; vertical-align: bottom;
}
html.zb table.inv-items th:first-child, html.zb table.inv-items td:first-child { border-left: 0 !important; }
html.zb table.inv-items th:last-child, html.zb table.inv-items td:last-child { border-right: 0 !important; }
html.zb table.inv-items td { font-size: 12px !important; padding: 5px 6px !important; border: 1px solid #c4c4c4 !important; border-top: 0 !important; border-bottom: 0 !important; color: #000 !important; }
html.zb table.inv-items tbody tr:last-child td { padding-bottom: 14px !important; }
html.zb table.inv-items .inv-item-name { font-weight: 400 !important; }
html.zb table.inv-items .inv-item-domain { color: #333 !important; font-size: 11.5px !important; }
html.zb .inv-bottom-row { gap: 0 !important; flex-wrap: nowrap !important; align-items: stretch; }
html.zb .inv-bottom-left { padding: 10px 8px 12px !important; font-size: 11.5px !important; color: #111 !important; line-height: 1.5 !important; }
html.zb .inv-bottom-left .inv-words-label { font-size: 12px !important; color: #333 !important; }
html.zb .inv-bottom-left .inv-words { font-size: 12px !important; }
html.zb .inv-totals { width: 340px !important; border-left: 1px solid #9e9e9e; padding: 8px 10px 0 !important; font-size: 12px !important; display: flex; flex-direction: column; }
html.zb .inv-totals-row { border: 0 !important; padding: 3px 0 !important; justify-content: flex-end !important; gap: 0; }
html.zb .inv-totals-row > span:first-child { flex: 1; text-align: right; padding-right: 18px; color: #222; }
html.zb .inv-totals-row > span:last-child { min-width: 96px; text-align: right; }
html.zb .inv-totals-row.grand { font-size: 12.5px !important; border-top: 0 !important; margin: 0 !important; padding-top: 3px !important; }
html.zb .inv-totals-row.balance { font-size: 14px !important; background: #f0f0f0; margin: 4px -10px 0; padding: 6px 10px !important; }
html.zb .inv-sign-box { width: auto !important; margin: auto -10px 0 !important; border: 0 !important; border-top: 1px solid #9e9e9e !important; border-radius: 0 !important; padding: 10px 10px 6px !important; }
html.zb .inv-sign-box .sign-caption { border-top: 0 !important; font-size: 11.5px !important; }
html.zb .inv-ribbon { border-radius: 3px !important; font-size: 11px !important; }
html.zb .preview-toolbar { background: var(--panel2) !important; border-bottom: 1px solid var(--border) !important; border-radius: 4px 4px 0 0 !important; }
html.zb .inv-send-row { padding: 14px 0 2px !important; }
html.zb .inv-send-note { font-size: 12.5px !important; }

/* =====================================================================
   PAGE TUNING -- "banner" pages (console renewals, purchase data,
   renewal consents, sales database): same white Zoho title strip
   ===================================================================== */
html.zb header.banner {
  background: var(--z-surface) !important; color: var(--text) !important;
  margin: 0 -24px 20px !important; padding: 14px 24px 14px !important;
  border-bottom: 1px solid var(--border) !important;
}
html.zb header.banner .eyebrow { font-size: 11px !important; font-weight: 600 !important; letter-spacing: .08em !important; color: var(--muted2) !important; margin-bottom: 4px !important; }
html.zb header.banner h1 { font: 500 20px/1.3 var(--tp-font-sans) !important; color: var(--text) !important; margin: 0 0 4px !important; }
html.zb header.banner .sub, html.zb header.banner .meta { color: var(--muted) !important; font-size: 12.5px !important; line-height: 1.5 !important; margin: 0 !important; }
html.zb header.banner .meta b { color: var(--text) !important; }
html.zb .main-area > .page { padding: 0 !important; }
html.zb .hero { margin: 0 0 20px !important; gap: 14px !important; }
html.zb .hero .card { padding: 14px 16px !important; border-radius: 6px !important; box-shadow: none !important; }
html.zb .hero .card.tint { background: var(--z-surface) !important; border-top: 3px solid var(--z-primary) !important; }
html.zb .hero .card.selected { border: 1px solid var(--z-primary) !important; box-shadow: 0 0 0 1px var(--z-primary) !important; padding: 14px 16px !important; }
html.zb .hero .card .num { font: 500 22px/1.2 var(--tp-font-sans) !important; }
html.zb .hero .card .label { font-size: 11.5px !important; font-weight: 600 !important; letter-spacing: .05em !important; margin-top: 6px !important; color: var(--muted) !important; }
html.zb header.banner .sub b, html.zb header.banner b { color: var(--text) !important; }
