:root {
  --navy: #0f2340;
  --gold: #b08d3c;
  --bg: #f4f2ec;
  --card-bg: #ffffff;
  --border: #ddd6c4;
  --text: #262420;
  --muted: #7a756a;
  --danger: #a3312a;
  --ok: #2e6b3e;
  --warn: #9a6b12;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header.top {
  background: var(--navy);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

header.top a { color: #fff; text-decoration: none; }
header.top .brand { font-weight: 700; letter-spacing: .04em; }
header.top .brand small { display: block; font-weight: 400; color: var(--gold); font-size: .75em; letter-spacing: .08em; }

.topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* Two separate rows, deliberately not one wrapping flex row: the certificate-desk/software
   tabs always come first, the app's own tabs (App Customers, Notice Board, etc.) always sit
   on their own second row below a divider, so the two are never visually mixed together. */
nav.tabs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
nav.tabs a {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: .92em;
}
nav.tabs a:hover, nav.tabs a.active { background: rgba(255,255,255,.12); }
nav.tabs-app { border-top: 1px solid rgba(255,255,255,.18); padding-top: 8px; }
.tabs-label { color: var(--gold); font-size: .78em; letter-spacing: .08em; text-transform: uppercase; margin-right: 4px; }
/* Accounts row + the employee Accounts switch (14/11/2026) */
.emp-card-head .acct-switch { margin-left: auto; }
.acct-pill { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 6px 14px 6px 6px;
             font-weight: 600; font-size: .9em; border: 1px solid #b08a3e; cursor: pointer; }
.acct-pill.acct-on { background: #7d5419; color: #fff; }
.acct-pill.acct-off { background: #fff8e8; color: #5a3a0f; }
span.acct-pill { cursor: default; padding-left: 14px; }
.acct-knob { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 1px solid #b08a3e; }
.acct-pill.acct-off .acct-knob { background: #e8dcc3; }
.acct-pill:focus-visible { outline: 3px solid #c9a227; outline-offset: 2px; }

.subtabs { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 2px solid var(--border); }
.subtabs a {
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  font-size: .92em;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  background: var(--bg);
  position: relative;
  top: 2px;
}
.subtabs a:hover { color: var(--text); background: #fff; }
.subtabs a.active {
  background: var(--card-bg);
  color: var(--navy);
  border-color: var(--border);
  border-bottom: 2px solid var(--card-bg);
  box-shadow: 0 -2px 0 var(--gold) inset;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

h1 { font-size: 1.4em; margin: 0 0 4px; }
h2 { font-size: 1.1em; margin: 24px 0 10px; color: var(--navy); }
p.sub { color: var(--muted); margin-top: 0; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat {
  flex: 1 1 120px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
}
.stat .n { font-size: 1.8em; font-weight: 700; color: var(--navy); }
.stat .label { color: var(--muted); font-size: .82em; text-transform: uppercase; letter-spacing: .04em; }

.spot-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.spot-box {
  flex: 1 1 160px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
}
.spot-box .head {
  background: var(--navy);
  color: #fff;
  font-size: .78em;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 7px 8px;
}
.spot-box .n { font-size: 1.5em; font-weight: 700; color: var(--navy); padding: 14px 8px 4px; }
.spot-box .sub { color: var(--muted); font-size: .78em; padding-bottom: 10px; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 4px; }

.pw-field { position: relative; display: inline-block; width: 100%; }
.pw-field input { width: 100%; padding-right: 32px; }
.pw-toggle {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 1.05em; line-height: 1; padding: 4px;
}

.btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 7px;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  font-size: .92em;
  text-decoration: none;
}
.btn:hover { opacity: .9; }
.btn.secondary { background: #fff; color: var(--navy); }
.btn.danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn.gold { background: #96661f; border-color: #96661f; }   /* white text 5.0:1 (rule: >= 4.5, 21/11/2026) */
.btn:disabled { background: #ece4d3; color: #4a3a1f; border-color: #cdbd9c; cursor: not-allowed; opacity: 1; }
.btn:disabled:hover { opacity: 1; }

table { width: 100%; border-collapse: collapse; font-size: .93em; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; white-space: pre-line; }
th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: .78em; letter-spacing: .03em; }
tr:last-child td { border-bottom: none; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--navy); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 100px; font-size: .78em; font-weight: 600; text-transform: uppercase; }
.badge.draft { background: #eee; color: #555; }
.badge.rendered { background: #fdf1d6; color: var(--warn); }
.badge.approved { background: #e0efe2; color: var(--ok); }
.badge.uploaded { background: #dcebf5; color: #1c5a86; }
.badge.rejected, .badge.revoked { background: #f6dedb; color: var(--danger); }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: .93em; }
.flash.ok { background: #e0efe2; color: var(--ok); border: 1px solid #bfe0c6; }
.flash.error { background: #f6dedb; color: var(--danger); border: 1px solid #eabdb6; }

.customer-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 20;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  margin-top: 2px; max-height: 220px; overflow-y: auto;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
}
.customer-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; cursor: pointer; }
.customer-row:hover { background: var(--bg); }
.customer-row-name { font-size: .92em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-row-del {
  border: none; background: none; color: var(--muted); font-size: 1.1em; line-height: 1;
  padding: 2px 6px; border-radius: 4px; cursor: pointer; flex-shrink: 0;
}
.customer-row-del:hover { background: var(--danger); color: #fff; }

label { display: block; font-size: .85em; color: var(--muted); margin-bottom: 4px; margin-top: 10px; }
input[type=text], input[type=tel], input[type=email], input[type=search], input[type=number], input[type=date], textarea, select, input[type=file] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .95em;
  font-family: inherit;
  background: #fff;
}
textarea { resize: vertical; min-height: 60px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.item-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px 18px;
  margin-bottom: 14px;
  position: relative;
  background: #fbfaf6;
}
.item-block .item-title { font-weight: 600; color: var(--navy); font-size: .9em; }
.item-block .duplicate-item {
  position: absolute; top: 12px; right: 80px;
  background: none; border: none; color: var(--navy); cursor: pointer; font-size: .85em;
}
.item-block .remove-item {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; color: var(--danger); cursor: pointer; font-size: .85em;
}

.proof-layout { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.proof-layout img.card-proof { width: 340px; max-width: 100%; border: 1px solid var(--border); border-radius: 10px; }
.proof-layout .details { flex: 1 1 320px; min-width: 280px; }

.warn-box { background: #fdf1d6; border: 1px solid #f0dba5; color: var(--warn); padding: 10px 14px; border-radius: 8px; font-size: .88em; margin-bottom: 14px; }

.empty { color: var(--muted); font-style: italic; padding: 10px 0; }

form.inline { display: inline; }
.review-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.review-actions form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.review-actions input[type=text] { width: 200px; }

.emp-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 14px;
}
.emp-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.emp-number {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85em;
}
.emp-card-title { display: flex; align-items: center; gap: 10px; font-size: 1.05em; font-weight: 600; color: var(--navy); }
.emp-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  border-top: 1px solid var(--border);
  margin-top: 14px;
  padding-top: 12px;
}

.print-header { display: none; }
@media print {
  header.top, .no-print { display: none !important; }
  .print-header { display: block !important; margin-bottom: 16px; }
  .print-header h1 { margin: 0 0 4px; }
  .print-header p { margin: 0; color: var(--muted); font-size: .85em; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  table { font-size: .85em; }
  a[href]:after { content: ""; }
  .print-break { page-break-before: always; }
}

/* Manage Branches: Zoho Books per branch (05/11/2026) */
.zoho-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.zoho-row .zoho-tick { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-weight: 600; }
.zoho-row .zoho-tick input { width: auto; margin: 0; }
.zoho-row .zoho-org { min-width: 200px; }
.zoho-row .zoho-org input { margin: 0; }

/* Accounts pages (Daily, Dues, Zoho, customer account) in the IGJI gold / brown theme - no black and
   no red in the accounts (user, 10/11/2026). Every text/background pair below has contrast >= 4.5. */
.acct { --navy: #7d5419; --danger: #7d5419; --text: #3a2a12; color: var(--text); }
.acct h1, .acct h2 { color: #7d5419; }
body:has(.acct) .flash.error { background: #f6ead3; color: #5c3b08; border-color: #e2c48f; }
.acct a:not(.btn) { color: #7d5419; }

/* "Update" tab: a newer Desk is on the plugged-in drive (11/11/2026) - IGJI gold, readable */
nav.tabs a.tab-update { background: #c9a227; color: #2b1d05; font-weight: 600; }
nav.tabs a.tab-update:hover, nav.tabs a.tab-update.active { background: #e0bb3c; color: #2b1d05; }
.update-box { max-width: 640px; padding: 16px 20px; border: 1px solid #d8c08a; border-radius: 8px; background: #fbf6ec; }
.update-versions th { text-align: left; padding: 4px 16px 4px 0; font-weight: 600; }

/* Vikky, the built-in helper (11/11/2026) - IGJI gold / brown, readable text, no black or red */
.vikky { position: fixed; right: 18px; bottom: 18px; z-index: 900; font-size: 14px; }
.vk-face { position: relative; width: 62px; height: 62px; border-radius: 50%; border: 0; padding: 3px; cursor: pointer;
           background: #fbf6ec; box-shadow: 0 3px 10px rgba(90, 58, 15, .35); }
.vk-face svg, .vk-face img { display: block; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #b8902e; }
.vk-badge { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; border-radius: 11px; padding: 0 6px;
            background: #7d5419; color: #fff; font: 600 12px/22px "Segoe UI", sans-serif; }
.vk-panel { position: absolute; right: 0; bottom: 74px; width: min(440px, calc(100vw - 32px)); height: min(580px, calc(100vh - 120px));
            display: flex; flex-direction: column; background: #fffaf0; border: 1px solid #d8c08a; border-radius: 12px;
            box-shadow: 0 8px 28px rgba(90, 58, 15, .28); overflow: hidden; }
.vk-panel[hidden] { display: none; }
.vk-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #7d5419; color: #fff; }
.vk-head small { display: block; font-size: 11.5px; color: #f3e3bf; }
.vk-mini svg, .vk-mini img { width: 36px; height: 36px; display: block; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #e6c869; }
.vk-close { margin-left: auto; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; }
.vk-log { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.vk-msg { max-width: 92%; padding: 8px 10px; border-radius: 10px; color: #3a2a12; line-height: 1.4; white-space: pre-wrap; }
.vk-bot { background: #f3e8d0; align-self: flex-start; border-bottom-left-radius: 2px; }
.vk-me { background: #fff; border: 1px solid #e3cf9f; align-self: flex-end; border-bottom-right-radius: 2px; }
.vk-table { overflow-x: auto; margin-top: 6px; }
.vk-table table { border-collapse: collapse; font-size: 12.5px; background: #fffaf0; white-space: normal; }
.vk-table th, .vk-table td { border: 1px solid #e3cf9f; padding: 3px 6px; text-align: left; vertical-align: top; }
.vk-table th { background: #f7ecd2; color: #5a3a0f; }
.vk-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.vk-btnwrap { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.vk-btn { background: #7d5419; color: #fff; border: 1px solid #7d5419; border-radius: 6px; padding: 5px 10px; cursor: pointer;
          font-size: 13px; text-decoration: none; display: inline-block; }
.vk-btn.quiet { background: #fff; color: #5a3a0f; border-color: #c9ad6c; }
.vk-btn:disabled { background: #e8dcc4; color: #4a300c; border-color: #d8c08a; cursor: default; }
.vk-reason { padding: 5px 8px; border: 1px solid #c9ad6c; border-radius: 6px; min-width: 210px; font-size: 13px; }
.vk-send { display: flex; gap: 6px; padding: 8px; border-top: 1px solid #e3cf9f; background: #fbf6ec; }
.vk-input { flex: 1; padding: 7px 9px; border: 1px solid #c9ad6c; border-radius: 6px; font-size: 14px; }
.vk-form { display: grid; gap: 6px; margin-top: 8px; }
.vk-form label { display: grid; gap: 2px; font-size: 12.5px; color: #5a3a0f; }
.vk-form input, .vk-form select { padding: 5px 7px; border: 1px solid #c9ad6c; border-radius: 6px; font-size: 13px; }
@media print { .vikky { display: none !important; } }

/* Vikky animation (11/11/2026). Level 1: breathing, greeting, hover glow + tilt, typing dots, nod, pulse
   for waiting requests. Level 2: living-portrait loop on hover. Level 3: drawn face - eyes, blink, smile.
   Off for "reduce motion" and while the browser tab is hidden. */
.vk-face { animation: vk-breathe 4.5s ease-in-out infinite; transition: box-shadow .25s, transform .25s; overflow: visible; }
.vk-face:hover, .vikky.open .vk-face { animation: none; transform: rotate(-6deg) scale(1.06);
               box-shadow: 0 0 0 3px #e6c869, 0 4px 14px rgba(184, 144, 46, .55); }
@keyframes vk-breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px) scale(1.015); } }
.vikky .vk-face.vk-nod { animation: vk-nod .7s ease-in-out 1; }
@keyframes vk-nod { 0%, 100% { transform: rotate(0); } 30% { transform: translateY(3px) rotate(4deg); } 60% { transform: translateY(-1px) rotate(-3deg); } }
.vikky.vk-waiting .vk-face::after { content: ""; position: absolute; inset: -4px; border-radius: 50%;
               border: 2px solid #c9a227; animation: vk-pulse 1.8s ease-out infinite; pointer-events: none; }
@keyframes vk-pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
.vk-greet { position: absolute; right: 70px; bottom: 14px; width: max-content; max-width: 260px; background: #fffaf0; color: #3a2a12;
            border: 1px solid #d8c08a; border-radius: 12px 12px 2px 12px; padding: 8px 12px; font-size: 13.5px;
            box-shadow: 0 4px 14px rgba(90, 58, 15, .22); cursor: pointer; animation: vk-pop .35s ease-out; }
@keyframes vk-pop { from { opacity: 0; transform: translateY(6px) scale(.95); } to { opacity: 1; transform: none; } }
.vk-dots { display: inline-flex; gap: 4px; padding: 4px 2px; }
.vk-dots i { width: 7px; height: 7px; border-radius: 50%; background: #9a7a3e; animation: vk-dot 1.1s infinite ease-in-out; }
.vk-dots i:nth-child(2) { animation-delay: .15s; } .vk-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes vk-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-5px); opacity: 1; } }
/* level 2: the living loop sits on the still picture and shows while it plays */
.vk-face, .vk-mini { position: relative; }
.vk-live { position: absolute; inset: 3px; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; opacity: 0;
           transition: opacity .25s; pointer-events: none; }
.vk-mini .vk-live { inset: 0; width: 36px; height: 36px; }
.vk-live.on { opacity: 1; }
/* level 3: the drawn face */
.vk-drawn { display: block; width: 56px; height: 56px; }
.vk-mini .vk-drawn { width: 36px; height: 36px; }
.vk-drawn .vk-pupil { transition: transform .12s ease-out; }
.vk-drawn .vk-lid { transition: transform .09s ease-in; }
.vk-drawn.blink .vk-lid { transform: scaleY(1) !important; }
.vk-drawn .vk-mouth, .vk-drawn .vk-mouth-big { transition: opacity .2s; }
.vk-face:hover .vk-drawn .vk-mouth, .vikky.open .vk-drawn .vk-mouth { opacity: 0; }
.vk-face:hover .vk-drawn .vk-mouth-big, .vikky.open .vk-drawn .vk-mouth-big { opacity: 1; }
.vk-style-pick { display: grid; gap: 6px; margin: 6px 0 18px; }
.vk-style-pick label { color: #3a2a12; }
.vikky.vk-hidden-tab *, .vikky.vk-hidden-tab *::after { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  .vikky *, .vikky *::after { animation: none !important; transition: none !important; }
}

/* Disha's full figure (12/11/2026): stands in the corner (170 px), greets, dances, celebrates; "–" makes her small */
.vikky.vk-style-figure .vk-face { width: auto; height: auto; padding: 0; background: none; box-shadow: none;
            border-radius: 0; animation: none; transform: none; }
.vikky.vk-style-figure .vk-face:hover, .vikky.vk-style-figure.open .vk-face { transform: none; box-shadow: none; }
.vk-fig { display: block; height: 170px; width: auto; filter: drop-shadow(0 6px 6px rgba(90, 58, 15, .28));
          transition: transform .25s; transform-origin: 50% 100%; }
.vikky.vk-style-figure .vk-face:hover .vk-fig { transform: scale(1.04); }
.vk-round { display: none; }
.vikky.vk-style-figure .vk-face .vk-round { width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
            box-shadow: 0 0 0 2px #b8902e, 0 3px 10px rgba(90, 58, 15, .35); }
.vikky.vk-style-figure.vk-compact .vk-fig { display: none; }
.vikky.vk-style-figure.vk-compact .vk-face .vk-round { display: block; }
.vikky.vk-style-figure .vk-panel { bottom: 182px; }
.vikky.vk-style-figure.vk-compact .vk-panel { bottom: 74px; }
.vikky.vk-style-figure .vk-greet { right: 96px; bottom: 120px; }
.vikky.vk-style-figure.vk-compact .vk-greet { right: 70px; bottom: 14px; }
.vikky.vk-style-figure .vk-badge { top: 2px; right: 6px; }
.vikky.vk-style-figure.vk-waiting .vk-face::after { display: none; }
.vikky.vk-style-figure.vk-waiting .vk-badge { animation: vk-pulse-badge 1.6s ease-in-out infinite; }
@keyframes vk-pulse-badge { 50% { box-shadow: 0 0 0 6px rgba(201, 162, 39, .35); } }
.vk-fig-hide { position: absolute; right: -6px; bottom: 150px; z-index: 2; width: 22px; height: 22px; border-radius: 50%;
               border: 1px solid #c9ad6c; background: #fffaf0; color: #5a3a0f; font: 600 14px/18px "Segoe UI", sans-serif;
               cursor: pointer; opacity: 0; transition: opacity .2s; }
.vikky:hover .vk-fig-hide, .vk-fig-hide:focus { opacity: 1; }
.vikky.vk-compact .vk-fig-hide { bottom: 46px; right: -6px; }
/* (figure) win over the round-face picture rules above */
.vikky.vk-style-figure .vk-face img.vk-fig { display: block; width: auto; height: 170px; border-radius: 0;
            object-fit: contain; box-shadow: none; }
.vikky.vk-style-figure .vk-face img.vk-round { display: none; }
.vikky.vk-style-figure.vk-compact .vk-face img.vk-fig { display: none; }
.vikky.vk-style-figure.vk-compact .vk-face img.vk-round { display: block; }
.vikky.vk-style-figure .vk-panel { height: min(560px, calc(100vh - 212px)); }
.vikky.vk-style-figure.vk-compact .vk-panel { height: min(580px, calc(100vh - 120px)); }

/* Helpers tab (12/11/2026) */
.hl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 18px; }
.hl-card { display: flex; gap: 12px; padding: 12px; border: 1px solid #e3cf9f; border-radius: 10px; background: #fffaf0; }
.hl-card.hl-default { border-color: #b8902e; box-shadow: 0 0 0 1px #b8902e inset; }
.hl-pics { display: flex; align-items: flex-end; gap: 6px; min-width: 120px; }
.hl-round { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #b8902e; }
.hl-fig { height: 110px; width: auto; }
.hl-info { display: grid; gap: 6px; align-content: start; color: #3a2a12; }
.hl-tag { justify-self: start; width: max-content; font-size: 11.5px; background: #7d5419; color: #fff; border-radius: 8px; padding: 1px 7px; }
.hl-note { font-size: 13px; color: #5a3a0f; }
.hl-bad { color: #7d5419; font-weight: 600; }
.hl-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.hl-add { display: grid; gap: 8px; max-width: 640px; }
.hl-add label { display: grid; gap: 3px; color: #3a2a12; }
.hl-consent { display: flex !important; gap: 8px; align-items: flex-start; }
/* milestone celebration bubble */
.vk-cheer { position: absolute; right: 96px; bottom: 60px; width: max-content; max-width: 280px; padding: 10px 14px;
            background: #7d5419; color: #fff; border-radius: 14px 14px 2px 14px; font: 600 14.5px/1.4 "Segoe UI", sans-serif;
            box-shadow: 0 6px 18px rgba(90, 58, 15, .35); animation: vk-pop .35s ease-out; cursor: pointer; }
.vikky.vk-compact .vk-cheer, .vikky:not(.vk-style-figure) .vk-cheer { right: 70px; bottom: 10px; }

/* the helper's AI brain (12/11/2026): photo button, "AI brain on" bar, photo thumbnail */
.vk-attach { display: inline-flex; align-items: center; justify-content: center; width: 34px; border: 1px solid #c9ad6c;
             border-radius: 6px; background: #fff; cursor: pointer; font-size: 17px; }
.vk-ai-bar { display: flex; justify-content: space-between; align-items: center; padding: 3px 10px 6px; font-size: 12px;
             color: #5a3a0f; background: #fbf6ec; }
.vk-newchat { border: 0; background: none; color: #7d5419; text-decoration: underline; cursor: pointer; font-size: 12px; }
.vk-thumb { display: block; max-width: 140px; max-height: 110px; margin-top: 6px; border-radius: 6px; }

/* teach the helper (Helper log, 12/11/2026) */
.teach-card { border: 1px solid #e3cf9f; border-radius: 10px; background: #fffaf0; padding: 10px 12px; margin: 8px 0;
              color: #3a2a12; display: grid; gap: 6px; }
.teach-card summary { cursor: pointer; }
.teach-answer { margin-top: 4px; color: #5a3a0f; white-space: pre-wrap; }
.teach-form { display: grid; gap: 6px; }
.teach-form textarea, .teach-form input { padding: 6px 8px; border: 1px solid #c9ad6c; border-radius: 6px; font: inherit; }

/* milestone party: the full figure pops up beside a round-face helper, dances, cheers, goes (12/11/2026) */
.vk-party { position: absolute; right: -6px; bottom: 68px; height: 170px; width: auto; pointer-events: none; z-index: 3;
            animation: vk-party-in .35s ease-out; filter: drop-shadow(0 6px 10px rgba(90, 58, 15, .25)); }
.vk-party.vk-party-out { animation: vk-party-go .5s ease-in forwards; }
.vikky .vk-cheer { z-index: 4; }
@keyframes vk-party-in { from { transform: translateY(40px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes vk-party-go { to { transform: translateY(30px) scale(.7); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .vk-party { display: none; } }

/* milestone surprises - a bigger one at each milestone (12/11/2026). Colours: dark text on light gold / white on
   brown, contrast >= 4.5 */
.vk-cheer .vk-tease { display: block; margin-top: 4px; font-weight: 500; font-size: 12.5px; color: #fff3d6; }
.ms-badge { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 12px; font: 700 12.5px/1.5 "Segoe UI", sans-serif;
            background: #f3d27a; color: #3a2a12; box-shadow: 0 0 0 1px #b8902e inset; vertical-align: middle; }
.ms-badge.ms-tier4 { background: #fbe7a8; color: #3a2a12; }
.ms-badge.ms-tier5 { background: linear-gradient(90deg, #f3d27a, #fff1c2, #f3d27a); color: #3a2a12; animation: ms-shine 2.5s linear infinite; background-size: 200% 100%; }
@keyframes ms-shine { to { background-position: -200% 0; } }
.ms-fx { position: fixed; inset: 0; pointer-events: none; z-index: 950; }
.ms-confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: ms-fall linear forwards; }
@keyframes ms-fall { to { top: 105vh; transform: rotate(720deg) translateX(40px); } }
.ms-burst { position: absolute; width: 0; height: 0; animation: ms-pop 1.4s ease-out both; }
.ms-burst i { position: absolute; width: 6px; height: 6px; border-radius: 50%;
              animation: ms-spark 1.4s ease-out both; animation-delay: inherit; transform: rotate(var(--a)) translateX(0); }
@keyframes ms-spark { 0% { transform: rotate(var(--a)) translateX(0); opacity: 1; }
                      100% { transform: rotate(var(--a)) translateX(110px); opacity: 0; } }
@keyframes ms-pop { 0% { opacity: 0; } 5% { opacity: 1; } 100% { opacity: 1; } }
.ms-card, .ms-banner { pointer-events: auto; cursor: pointer; inset: auto; left: 50%; transform: translateX(-50%);
                       display: grid; gap: 4px; justify-items: center; text-align: center; padding: 18px 28px; border-radius: 16px;
                       background: #fffaf0; color: #3a2a12; border: 2px solid #b8902e; box-shadow: 0 14px 40px rgba(60, 40, 10, .35);
                       font: 600 15px/1.4 "Segoe UI", sans-serif; animation: vk-pop .4s ease-out; }
.ms-card { top: 30vh; font-size: 30px; }
.ms-card b { font-size: 20px; color: #5a3a0f; } .ms-card span { font-size: 14px; font-weight: 500; color: #3a2a12; }
.ms-trophy { font-size: 54px; }
.ms-banner { top: 14vh; background: #7d5419; color: #fff; border-color: #e3c46b; font-size: 22px; }
.ms-banner b { font-size: 26px; color: #fff; } .ms-banner span { font-size: 15px; font-weight: 500; color: #fff8e6; }
.ms-finale { z-index: 890; inset: auto 300px 0 0; height: 200px; display: flex; justify-content: center; align-items: flex-end; gap: 10px; }
.ms-finale img { height: 180px; animation: vk-party-in .5s ease-out both; filter: drop-shadow(0 6px 10px rgba(90, 58, 15, .25)); }
.ms-finale.ms-out { animation: vk-party-go .5s ease-in forwards; }
@media (prefers-reduced-motion: reduce) { .ms-fx { display: none; } }

/* Dues: Zoho and the Desk disagree (12/11/2026) - IGJI gold / brown, never red */
.zoho-check { border: 2px solid #b8902e; background: #fff6df; color: #3a2a12; border-radius: 10px; padding: 10px 14px;
              margin: 10px 0 14px; }
.zoho-check strong { color: #5a3a0f; }
.zoho-check table { margin-top: 8px; }

/* Dashboard: yesterday's cash balance, admin only (13/11/2026) - IGJI gold / brown, never red */
.ycash { border: 1px solid #e3cf9f; background: #fffaf0; border-radius: 12px; padding: 10px 14px 12px; margin: 6px 0 18px; }
.ycash h2 { margin-top: 4px; color: #5a3a0f; }
.ycash .num { text-align: right; white-space: nowrap; }
.ycash-diff { color: #7d5419; font-weight: 700; }
.ycash-total td { border-top: 2px solid #b8902e; }

/* Day book closing and lock (13/11/2026) - IGJI gold / brown, never red; text contrast >= 4.5 */
.dbk-box { border: 1px solid #c9ad6c; background: #fff8e8; color: #3a2a12; border-radius: 10px; padding: 10px 14px; margin: 8px 0 14px; }
.dbk-warn { border: 2px solid #b8902e; }
.dbk-box a { color: #5a3a0f; font-weight: 600; }
.dbk-form { display: grid; gap: 8px; max-width: 520px; }
.dbk-form label { display: grid; gap: 4px; }
.dbk-st { display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: 12.5px; font-weight: 700; }
.dbk-open { background: #eef3e6; color: #2f4a17; }
.dbk-reopened { background: #fdf0d2; color: #5a3a0f; }
.dbk-closed { background: #e9e3d6; color: #3a2a12; }
.dbk-overdue { background: #7d5419; color: #fff; }
.dbk-changed { background: #f3d27a; color: #3a2a12; margin-left: 4px; }
.dbk-list .num, .dbk-sum .num { text-align: right; white-space: nowrap; }
.dbk-sum { max-width: 560px; }
.dbk-total td { border-top: 2px solid #b8902e; }
.dbk-reopen { display: inline-flex; gap: 4px; margin-left: 6px; }
.dbk-reopen input { min-width: 150px; }
.dbk-audit .dbk-val { max-width: 260px; word-break: break-word; font-size: 12.5px; }

/* tidy photo row on New Order / Edit (15/11/2026): one joined group + the Photo Studio button */
.pp-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 6px; margin: 0 0 4px;
          border: 1px dashed #d8c89f; border-radius: 10px; background: #fffaf0; }
.pp-row.pp-over { border-color: #7d5419; background: #fff1d6; }
.pp-row { position: relative; }
input[type=file].pp-file { position: absolute; left: 0; top: 0; width: 1px; height: 1px; min-width: 0; padding: 0;
  border: 0; margin: 0; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }   /* 22/11/2026 */
.pp-ways { display: inline-flex; border: 1px solid #b08a3e; border-radius: 8px; overflow: hidden; }
.pp-ways button { border: 0; border-right: 1px solid #e3cf9f; background: #fff; color: #3a2a12; padding: 7px 12px;
                  font: inherit; font-size: .92em; cursor: pointer; white-space: nowrap; }
.pp-ways button:last-child { border-right: 0; }
.pp-ways button:hover, .pp-ways button:focus-visible { background: #fff1d6; outline: none; }
.pp-ways button:focus-visible { box-shadow: inset 0 0 0 2px #c9a227; }
.pp-row .studio-btn { margin-left: auto; }
.pp-name { font-size: .82em; min-height: 1em; margin: 0 0 4px; color: #5a3a0f; }

/* Logo Library (15/11/2026) */
.logo-pick { display: flex; flex-wrap: wrap; gap: 6px; max-height: 220px; overflow-y: auto; padding: 2px; }
.lp-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 104px;
           min-height: 72px; padding: 6px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
           cursor: pointer; font-weight: 400; font-size: .8em; text-align: center; color: #3a2a12; margin: 0; }
.lp-item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lp-item[hidden] { display: none; }            /* only the customer's logos / search matches (15/11/2026) */
.lp-item img { max-width: 88px; max-height: 40px; object-fit: contain;
               background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 10px 10px; }
.lp-item:has(input:checked) { border: 2px solid #7d5419; background: #fff8e8; font-weight: 600; }
.lp-item:has(input:focus-visible) { outline: 3px solid #c9a227; outline-offset: 2px; }
.lp-none span { color: #5a3a0f; }
.lp-mine-tag { display: none; font-style: normal; font-size: .85em; color: #5a3a0f; background: #f3e3bf; border-radius: 100px; padding: 0 6px; }
.lp-item.lp-mine .lp-mine-tag { display: inline-block; }
.lp-upload summary { cursor: pointer; font-size: .9em; color: #7d5419; margin-top: 6px; }
.logo-card { display: grid; grid-template-columns: 200px 1fr; gap: 14px; background: #fff; border: 1px solid var(--border);
             border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.logo-card.removed { opacity: .75; }
.logo-pics { display: flex; flex-direction: column; gap: 6px; }
.logo-pics figure { margin: 0; text-align: center; font-size: .8em; color: #5a3a0f; }
.logo-pics img { max-width: 190px; max-height: 90px; object-fit: contain; border-radius: 6px;
                 background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 12px 12px; padding: 4px; }
.logo-pics figure.in-use img { outline: 2px solid #7d5419; }
.logo-card form { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 6px 6px 0; }
.logo-cust { display: inline-flex; align-items: center; gap: 4px; background: #fff8e8; border: 1px solid #e3cf9f;
             border-radius: 100px; padding: 2px 4px 2px 10px; margin: 0 4px 4px 0; font-size: .9em; }
.logo-cust form { margin: 0; }
.logo-cust button { border: 0; background: none; color: #5a3a0f; cursor: pointer; padding: 0 4px; font-size: .95em; }
@media (max-width: 640px) { .logo-card { grid-template-columns: 1fr; } }

/* Dues: joined customers (14/11/2026) - gold/brown, readable */
.join-box { margin-top: 4px; padding: 4px 8px; background: #fff8e8; border-left: 3px solid #b08a3e; border-radius: 4px; }
.join-tag { display: inline-block; font-size: .75em; font-weight: 700; color: #5a3a0f; background: #f3e3bf; padding: 1px 8px; border-radius: 100px; }
.join-hint { margin-top: 3px; color: #7d5419; }
.cid { font-size: .8em; color: #5a3a0f; }
.join-undo { display: inline; margin-left: 6px; }
.join-undo .btn { padding: 2px 8px; font-size: .85em; }
.join-form summary { cursor: pointer; font-size: .85em; color: #7d5419; margin-top: 3px; }
.join-form form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.join-form input[name=reason] { min-width: 260px; }

/* New Order: the button while certificates are being made (14/11/2026) - readable, contrast > 4.5 */
#order-submit:disabled, #order-submit:disabled:hover { background: #e8dcc3; color: #3a2a12; border-color: #b08a3e; opacity: 1; cursor: progress; }

/* every amount box shows at least 10 digits + 2 decimals in full, e.g. 1234567890.12 (user, 21/11/2026) */
input[inputmode="decimal"] { min-width: 15ch; box-sizing: border-box; }

/* phones (user, 22/11/2026: "user friendly"): a wide table scrolls inside its own box instead of making the whole
   page wider than the screen; long words and links wrap */
@media (max-width: 760px) {
  main table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .stat-row > * { min-width: 0; }
}

/* the menu under 5 headings (user, 22/11/2026) */
nav.tabs-menu { position: relative; }
details.menu-group { position: relative; }
details.menu-group > summary { list-style: none; cursor: pointer; padding: 7px 14px; border-radius: 6px; font-size: .92em;
  color: #fff; user-select: none; }
details.menu-group > summary::-webkit-details-marker { display: none; }
details.menu-group > summary::after { content: " ▾"; color: var(--gold); }
details.menu-group[open] > summary::after { content: " ▴"; }
details.menu-group > summary:hover, details.menu-group[open] > summary, details.menu-group.here > summary {
  background: rgba(255,255,255,.12); }
details.menu-group > summary:focus-visible { outline: 3px solid #c9a227; outline-offset: 2px; }
.menu-here { color: var(--gold); font-size: .9em; }
.menu-panel { position: absolute; top: calc(100% + 4px); left: 0; z-index: 50; min-width: 220px; display: flex;
  flex-direction: column; gap: 2px; padding: 6px; background: #13234a; border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.28); }
.menu-panel a { padding: 9px 12px; border-radius: 6px; color: #fff; text-decoration: none; white-space: nowrap; }
.menu-panel a:hover, .menu-panel a.active { background: rgba(255,255,255,.14); }
.menu-panel a.active { box-shadow: inset 3px 0 0 var(--gold); }
@media (max-width: 760px) {
  nav.tabs-menu { gap: 2px; }
  nav.tabs-menu > a, details.menu-group > summary { padding: 8px 10px; }
  details.menu-group { position: static; }
  .menu-panel { left: 0; right: 0; top: calc(100% + 4px); min-width: 0; display: grid;     /* below the whole menu */
    grid-template-columns: 1fr 1fr; }
  .menu-panel a { white-space: normal; }
  .menu-here { display: none; }
}
.menu-toggle { display: none; }
@media (max-width: 640px) {                       /* phones (29/11/2026): the menu opens from one button */
  .menu-toggle { display: inline-flex; align-items: center; gap: 4px; margin: 6px 0 2px; padding: 9px 14px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.08); color: #fff; font: 600 1em/1.2 inherit; cursor: pointer;
    max-width: 100%; }
  .menu-toggle:focus-visible { outline: 3px solid #c9a227; outline-offset: 2px; }
  .menu-toggle-here { color: var(--gold); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  nav.tabs-menu { display: none; }
  nav.tabs-menu.open { display: flex; }
}
@media print { nav.tabs-menu, .menu-toggle { display: none; } }

/* New Order tidy (22/11/2026) */
.brand-stack { display: flex; flex-direction: column; gap: 10px; }
.pp-name:empty { display: none; }
.quick-preview-wrap { display: block !important; line-height: 0; }
.quick-preview-wrap .photo-preview { margin-top: 6px; }
.quick-enhance { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; }
.quick-enhance select { width: auto; min-width: 180px; margin: 0; }
details.more-details { margin: 10px 0 4px; border: 1px dashed var(--border); border-radius: 8px; padding: 0 10px; }
details.more-details > summary { cursor: pointer; padding: 8px 0; color: #6b4e16; font-weight: 600; }
details.more-details[open] > summary { border-bottom: 1px dashed var(--border); margin-bottom: 6px; }
.more-count { font-weight: 400; color: var(--muted); }

/* Area 1 tidy (22/11/2026): list tables on one line per row, buttons in line */
table.flow td { white-space: normal; vertical-align: middle; }
table.flow td .btn, table.flow td form.inline { margin: 0; }
.row-acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.cert-desc { color: var(--muted); }
.review-top { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; margin: 0 0 14px; }
.review-top form { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.review-top input[name=note] { min-width: 260px; margin: 0; }
/* Employees on a phone (22/11/2026): the Accounts switch drops under the name instead of off the screen */
.emp-card-head { flex-wrap: wrap; }
@media (max-width: 560px) { .emp-card-head .acct-switch { margin-left: 0; flex-basis: 100%; } }
.subtabs { flex-wrap: wrap; row-gap: 4px; }

/* Employees: one line each, Edit opens the form (22/11/2026) */
details.emp-edit > summary { list-style: none; display: inline-block; cursor: pointer; }
details.emp-edit > summary::-webkit-details-marker { display: none; }
details.emp-edit[open] > summary { margin-bottom: 12px; }
.cert-desc { color: var(--muted); }

/* Presets: one line each (22/11/2026) */
.preset-line { padding: 10px 14px; margin-bottom: 8px; }
.preset-line details.emp-edit > summary { display: flex; gap: 12px; align-items: center; width: 100%; }
.preset-line .preset-name { font-weight: 600; min-width: 180px; }
.preset-line summary .btn { margin-left: auto; }

/* 24/11/2026: New Order - Save and make certificate celebrates like an upload (vikky.js) */
/* celebrate.js message (24/11/2026) */
.cel-msg-pop { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); background: #0f2340; color: #fff;
  border: 2px solid #b08d3c; border-radius: 12px; padding: 12px 22px; font: 700 17px Georgia, serif; z-index: 960;
  box-shadow: 0 6px 24px rgba(15, 35, 64, .3); max-width: calc(100vw - 32px); text-align: center; cursor: pointer; }
