/* Countova ERP - white-label design tokens. Loaded on every desk + web + print page.
   These mirror brand.py COLORS. Keep the two in sync (brand.py is the source of truth).
   We override Frappe's CSS variables so the WHOLE UI (buttons, links, sidebar, forms,
   list views) recolours without touching Frappe source - and stays responsive. */

:root {
  /* Pounamu primary */
  --countova-pounamu-900: #062E31;
  --countova-pounamu-700: #0A464B;
  --countova-pounamu-600: #0D5C63;
  --countova-pounamu-500: #12747C;
  --countova-pounamu-300: #6FB3B8;
  --countova-pounamu-100: #D6EAEC;
  /* Kōwhai accent */
  --countova-kowhai-600: #DB9422;
  --countova-kowhai-500: #F4A72C;
  --countova-kowhai-100: #FCEBCB;
  /* Neutrals + semantic */
  --countova-ink: #0B1F24;
  --countova-slate: #5B6B70;
  --countova-bg: #F5F8F8;
  --countova-surface: #FFFFFF;
  --countova-border: #E1E8E9;
  --countova-success: #1E9E6A;
  --countova-warning: #E8A500;
  --countova-danger: #D64545;
  --countova-info: #2D7DD2;

  /* --- Map onto Frappe's own tokens so components inherit the brand --- */
  --primary: var(--countova-pounamu-600);
  --primary-color: var(--countova-pounamu-600);
  --btn-primary: var(--countova-pounamu-600);
  --text-on-primary: #ffffff;
  --brand-color: var(--countova-pounamu-600);
  --sidebar-select-color: var(--countova-pounamu-100);
  --bg-color: var(--countova-bg);
}

/* Primary buttons + key CTAs use pounamu; the accent gold is reserved for
   high-intent actions (Pay, Submit) so it stays meaningful. */
.btn-primary {
  background-color: var(--countova-pounamu-600);
  border-color: var(--countova-pounamu-600);
}
.btn-primary:hover { background-color: var(--countova-pounamu-700); border-color: var(--countova-pounamu-700); }

.btn-countova-accent {
  background-color: var(--countova-kowhai-500);
  border-color: var(--countova-kowhai-500);
  color: var(--countova-ink);
}
.btn-countova-accent:hover { background-color: var(--countova-kowhai-600); }

a { color: var(--countova-pounamu-600); }

/* Financial legibility: tabular figures so currency columns align on the decimal.
   Critical for an accounting product. */
.dt-cell--col--amount, [data-fieldtype="Currency"], [data-fieldtype="Float"], .indicator-pill {
  font-feature-settings: "tnum" 1, "lnum" 1;
}

/* Hide upstream wordmarks that leak into the UI (white-label). */
.navbar-brand .app-logo { visibility: hidden; }
.splash { background-image: none; }

/* Print / invoice letterhead accents. */
.print-format .countova-letterhead { border-bottom: 3px solid var(--countova-pounamu-600); }
.print-format .countova-total-row { background: var(--countova-pounamu-100); font-weight: 600; }

/* Responsive is inherited from Frappe's grid; this just tightens the mobile navbar
   brand so the Countova wordmark never truncates on small screens. */
@media (max-width: 767px) {
  .navbar-brand { max-width: 60vw; overflow: hidden; text-overflow: ellipsis; }
}

/* ------------------------------------------------------------------
   Accessibility + full-width desk (Countova): bigger, clearer type and use
   the whole desktop width so laypeople and older users read it easily,
   without losing the depth accountants need.
   ------------------------------------------------------------------ */
:root {
  --text-base: 15px;
  --text-md: 15px;
  --text-sm: 14px;
  --text-lg: 17px;
}
body, .page-body, .layout-main { font-size: 15px; line-height: 1.6; }

/* Use the full desktop width instead of a narrow centred column. */
@media (min-width: 992px) {
  .container, .page-body .container, .layout-main-section-wrapper,
  .workspace-container, .ce-block__content, .layout-main {
    max-width: 100% !important;
  }
}

/* Larger, more legible form controls, lists and reports. */
.form-control, .input-with-feedback, .like-disabled-input,
.control-value, .list-row, .report-body, .dt-cell__content { font-size: 15px; }
.control-label, .list-row-col .list-subject, th, .grid-heading-row { font-size: 14px; }

/* Make the home numbers and headings clearly readable. */
.number-card .number-card-value, .number-card .number { font-size: 2.1rem; font-weight: 800; }
.number-card .h6.text-muted, .number-card-label { font-size: 15px; }
.workspace-title, .title-area .title-text, h1.ellipsis { font-size: 1.7rem; }
.ce-header span { font-size: 1.25rem; font-weight: 700; color: var(--countova-pounamu-900); }

/* Quick-action shortcut tiles: bigger tap targets. */
.widget.shortcut-widget-box { min-height: 84px; }
.widget.shortcut-widget-box .widget-head .label { font-size: 15px; font-weight: 600; }

/* ------------------------------------------------------------------
   Colour + highlighting (Countova).

   Frappe's shortcut widget only colours a small count pill, and only when the
   count is non-zero:  `let color = this.color && count ? ... : "gray"`.
   On a new tenant every count is 0, so the whole dashboard renders grey and
   nothing stands out. We colour the TILE itself instead, cycling a fixed
   accessible palette, so the board reads clearly from day one.

   Every pairing below is dark ink or white on its own tint, kept at or above
   the WCAG AA 4.5:1 contrast ratio for body text.
   ------------------------------------------------------------------ */
:root {
  --cv-a1: #0D5C63;  --cv-a1-bg: #E4F1F2;
  --cv-a2: #B4761A;  --cv-a2-bg: #FBEED6;
  --cv-a3: #2D7DD2;  --cv-a3-bg: #E3EFFB;
  --cv-a4: #1E7F57;  --cv-a4-bg: #E2F3EC;
  --cv-a5: #5E45A8;  --cv-a5-bg: #ECE7F8;
  --cv-a6: #B03A5B;  --cv-a6-bg: #FAE6EB;
}

.widget.shortcut-widget-box {
  border-left: 4px solid var(--cv-tile, var(--cv-a1));
  background: var(--cv-tile-bg, var(--cv-a1-bg));
  transition: transform .12s ease, box-shadow .12s ease;
}
.widget.shortcut-widget-box .widget-head .label { color: var(--countova-ink); }
.widget.shortcut-widget-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(11, 31, 36, .14);
}

/* Cycle the palette so neighbouring tiles never share a colour.
   The cycle MUST key off .ce-block, not the tile: a v15 workspace is an editor.js document and
   every widget sits alone inside its own block wrapper, so `.shortcut-widget-box:nth-child(n)`
   matches :nth-child(1) every single time and the whole board renders one colour. */
.ce-block:nth-child(6n + 1) .widget { --cv-tile: var(--cv-a1); --cv-tile-bg: var(--cv-a1-bg); }
.ce-block:nth-child(6n + 2) .widget { --cv-tile: var(--cv-a2); --cv-tile-bg: var(--cv-a2-bg); }
.ce-block:nth-child(6n + 3) .widget { --cv-tile: var(--cv-a3); --cv-tile-bg: var(--cv-a3-bg); }
.ce-block:nth-child(6n + 4) .widget { --cv-tile: var(--cv-a4); --cv-tile-bg: var(--cv-a4-bg); }
.ce-block:nth-child(6n + 5) .widget { --cv-tile: var(--cv-a5); --cv-tile-bg: var(--cv-a5-bg); }
.ce-block:nth-child(6n + 6) .widget { --cv-tile: var(--cv-a6); --cv-tile-bg: var(--cv-a6-bg); }

/* Semantic colour for the actions people reach for most, so colour carries meaning rather than
   just decoration: money in is green, money out is amber, records are blue. */
.shortcut-widget-box[data-widget-name="New invoice"] { --cv-tile: var(--cv-a4); --cv-tile-bg: var(--cv-a4-bg); }
.shortcut-widget-box[data-widget-name="Bills to pay"] { --cv-tile: var(--cv-a2); --cv-tile-bg: var(--cv-a2-bg); }
.shortcut-widget-box[data-widget-name="Customers"] { --cv-tile: var(--cv-a3); --cv-tile-bg: var(--cv-a3-bg); }
.shortcut-widget-box[data-widget-name="Products"] { --cv-tile: var(--cv-a1); --cv-tile-bg: var(--cv-a1-bg); }
.shortcut-widget-box[data-widget-name="Run payroll"] { --cv-tile: var(--cv-a5); --cv-tile-bg: var(--cv-a5-bg); }
.shortcut-widget-box[data-widget-name="Reports"] { --cv-tile: var(--cv-a6); --cv-tile-bg: var(--cv-a6-bg); }

/* A zero count currently renders a washed-out grey pill that reads as broken.
   Give it real contrast and let it say what it means. */
.shortcut-widget-box .indicator-pill.gray,
.shortcut-widget-box .indicator-pill.grey {
  background: #FFFFFF;
  color: var(--countova-slate);
  border: 1px solid var(--countova-border);
  font-weight: 600;
}
.shortcut-widget-box .indicator-pill { font-size: 13px; }

/* Number cards: a coloured rule and a tinted value strip so the figures lead the page. */
.widget.number-widget-box {
  border-top: 4px solid var(--cv-tile, var(--countova-pounamu-600));
  border-left: none;
  background: var(--countova-surface);
}
.widget.number-widget-box .widget-head .widget-label,
.widget.number-widget-box .widget-title {
  color: var(--countova-slate);
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}
.number-card .number-card-value, .number-card .number,
.widget.number-widget-box .number,
.widget.number-widget-box .widget-body .number {
  color: var(--cv-tile, var(--countova-pounamu-900));
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

/* "You are here" in the sidebar was a faint grey fill. Make it unmistakable. */
.desk-sidebar .sidebar-item-container.selected > .desk-sidebar-item,
.desk-sidebar .desk-sidebar-item.selected {
  background: var(--countova-pounamu-100);
  border-left: 3px solid var(--countova-pounamu-600);
  font-weight: 600;
  color: var(--countova-pounamu-900);
}

/* Keyboard accessibility: the tiles are tabbable (role=link, tabindex=0) but
   ship with no visible focus state. Without this, keyboard and screen-magnifier
   users cannot tell where they are. */
.shortcut-widget-box:focus-visible,
.widget:focus-visible,
a:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.desk-sidebar-item:focus-visible {
  outline: 3px solid var(--countova-kowhai-500);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Section headings carry the brand instead of blending into the body copy. */
.widget-group .widget-group-head .widget-group-title,
.workspace-container .ce-header span { color: var(--countova-pounamu-900); font-weight: 700; }

/* Respect a user's reduced-motion preference. */
@media (prefers-reduced-motion: reduce) {
  .widget.shortcut-widget-box { transition: none; }
  .widget.shortcut-widget-box:hover { transform: none; }
}

/* --- Readability and polish (2026-11-02) ---------------------------------------------- */
/* Page titles were truncated on phones ("Countov..."): let them wrap instead. */
.page-head .page-title .title-text,
.page-head .title-area .title-text { max-width: none !important; white-space: normal !important; overflow: visible !important; text-overflow: clip !important; line-height: 1.2; }
/* Slightly larger, calmer text for everyday reading. */
.desk-sidebar .sidebar-item-container .item-anchor .sidebar-item-label { font-size: 14.5px; }
.desk-sidebar .standard-sidebar-section .section-title,
.desk-sidebar .sidebar-label { font-size: 12.5px; letter-spacing: .02em; }
.frappe-control .control-label, .frappe-control label { font-size: 13.5px; }
.form-section .section-head { font-size: 15px; }
.list-row .level-item, .list-row-col { font-size: 14px; }
/* Neutral shortcut tiles everywhere (no rainbow tints). */
.widget.shortcut-widget-box { background: var(--card-bg) !important; border: 1px solid var(--border-color) !important; box-shadow: none !important; min-height: 0 !important; }
.widget.shortcut-widget-box .widget-title { font-size: 14.5px; }
/* Room for the floating Getting started button so it never covers content. */
.layout-main-section-wrapper, .page-body { padding-bottom: 72px; }
/* The sidebar's "Public" group heading is internal jargon. */
.desk-sidebar .standard-sidebar-section .standard-sidebar-label { display: none !important; }
/* Login / set-password / portal pages */
.page-card, .for-login .page-card, .for-forgot .page-card { border: 1px solid var(--countova-border); border-radius: 14px; box-shadow: 0 8px 30px rgba(6,46,49,.08); padding: 28px; }
.page-card .page-card-head h4, .page-card-head .h4 { font-size: 22px; font-weight: 700; color: var(--countova-pounamu-900); }
.btn-primary, .btn.btn-primary, .page-card .btn-primary { background: var(--countova-pounamu-600) !important; border-color: var(--countova-pounamu-600) !important; color: #fff !important; }
.btn-primary:hover { background: var(--countova-pounamu-700) !important; }
.web-footer .footer-subscribe, .web-footer form.subscribe { display: none !important; }
.web-footer .footer-powered { display: none !important; }

/* Grid / List toggle (list_grid.js) */
.cv-viewtoggle{display:inline-flex;border:1px solid var(--border-color);border-radius:8px;overflow:hidden;margin-right:8px;background:var(--card-bg,#fff);vertical-align:middle}
.cv-viewtoggle button{border:0;background:transparent;padding:5px 9px;line-height:0;color:var(--text-muted);cursor:pointer}
.cv-viewtoggle button+button{border-left:1px solid var(--border-color)}
.cv-viewtoggle button.active{background:var(--control-bg,#f3f3f3);color:var(--text-color)}
.cv-viewtoggle svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.cv-grid .frappe-list .result{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:14px;padding:14px;background:var(--subtle-fg,transparent)}
.cv-grid .frappe-list .list-row-head{grid-column:1/-1;border-radius:8px}
.cv-grid .frappe-list .list-row-head .level-left .list-row-col:not(:first-child),.cv-grid .frappe-list .list-row-head .level-right{display:none!important}
.cv-grid .frappe-list .list-row-container{border:1px solid var(--border-color)!important;border-radius:12px;background:var(--card-bg,#fff);overflow:hidden;transition:box-shadow .15s,border-color .15s}
.cv-grid .frappe-list .list-row-container:hover{border-color:var(--gray-400);box-shadow:0 4px 14px rgba(0,0,0,.06)}
.cv-grid .frappe-list .list-row{display:flex;flex-direction:row;flex-wrap:wrap;align-items:flex-start;gap:12px;height:auto!important;padding:14px!important;border:0!important}
.cv-grid .frappe-list .list-row .level-left{flex:1;min-width:0;display:flex;flex-direction:column;align-items:stretch!important;gap:3px;max-width:none!important}
.cv-grid .frappe-list .list-row .level-right{flex:0 0 100%!important;max-width:none!important;display:flex;justify-content:flex-end;border-top:1px solid var(--border-color);padding-top:8px;margin-top:2px}
.cv-grid .frappe-list .list-row .list-row-col.cv-empty{display:none!important}
.cv-grid .frappe-list .list-row .level-right .list-row-activity{font-size:12px}
.cv-grid .frappe-list .list-row-container{position:relative}
.cv-grid .frappe-list .list-row .list-row-col{max-width:none!important;width:auto!important;flex:none!important;margin:0!important;display:flex!important;gap:6px;font-size:13.5px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cv-grid .frappe-list .list-row .list-row-col.hidden-xs,.cv-grid .frappe-list .list-row .list-row-col.hidden-md{display:flex!important}
.cv-grid .frappe-list .list-row .list-row-col[data-label]::before{content:attr(data-label) ":";color:var(--text-light,#999);flex:none}
.cv-grid .frappe-list .list-row .list-row-col[data-label] *{overflow:hidden;text-overflow:ellipsis}
.cv-grid .frappe-list .list-row .list-subject{font-size:15.5px!important;font-weight:600;color:var(--text-color);white-space:normal!important}
.cv-grid .frappe-list .list-row .list-subject a{color:var(--text-color)!important}
.cv-thumb{flex:none;width:52px;height:52px;border-radius:10px;overflow:hidden;background:var(--control-bg,#f3f3f3);display:none}
.cv-grid .cv-thumb{display:flex;align-items:center;justify-content:center}
.cv-thumb img{width:100%;height:100%;object-fit:cover}
.cv-initials{font-weight:600;font-size:17px;color:var(--text-muted)}
.cv-grid .frappe-list .list-row .list-row-checkbox{display:none}
.cv-grid .frappe-list .list-row-head .list-row-checkbox{display:inline-block}
@media (max-width:600px){.cv-grid .frappe-list .result{grid-template-columns:1fr;padding:10px}}
.cv-grid .frappe-list .list-row .level-left .list-row-col.cv-empty,.cv-grid .frappe-list .list-row .level-left .list-row-col.tag-col.hide{display:none!important}

/* Odoo-style smart buttons: the form's Connections become compact stat buttons */
.form-dashboard .form-links .document-link{display:inline-flex;align-items:center;gap:8px;border:1px solid var(--border-color);border-radius:10px;padding:6px 10px;margin:0 8px 8px 0;background:var(--card-bg,#fff);min-width:150px}
.form-dashboard .form-links .document-link:hover{border-color:var(--primary)}
.form-dashboard .form-links .document-link .count{font-weight:700;font-size:15px;color:var(--text-color)}
.form-dashboard .form-links .document-link-badge{font-size:13.5px}
.form-dashboard .form-links .row{display:flex;flex-wrap:wrap}
.form-dashboard .form-links .form-link-title{display:none}
.form-dashboard .form-links .col-md-4{width:auto;flex:0 0 auto;padding:0}
/* Kanban cards: wrap rather than cut off dates and amounts */
.kanban-card-doc .text-truncate{white-space:normal!important;overflow:visible!important}
.kanban-card-doc{font-size:14px;line-height:1.5}

/* Stage bar (countova_ui.js): Odoo-style chevrons, quiet greys with one accent for "now" */
.cv-stagebar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:0 0 14px}
.cv-steps{display:inline-flex;flex-wrap:wrap;filter:drop-shadow(0 1px 0 var(--border-color))}
.cv-step{position:relative;border:0;background:var(--control-bg,#f1f3f4);color:var(--text-muted);font-size:13.5px;font-weight:500;padding:8px 18px 8px 26px;margin-right:2px;line-height:1.2;clip-path:polygon(0 0,calc(100% - 12px) 0,100% 50%,calc(100% - 12px) 100%,0 100%,12px 50%);cursor:default;transition:background .15s,color .15s}
.cv-step:first-child{padding-left:16px;border-radius:8px 0 0 8px;clip-path:polygon(0 0,calc(100% - 12px) 0,100% 50%,calc(100% - 12px) 100%,0 100%)}
.cv-step:last-child{border-radius:0 8px 8px 0;clip-path:polygon(0 0,100% 0,100% 100%,0 100%,12px 50%);padding-right:16px}
.cv-step.done{color:var(--text-color);background:var(--gray-200,#e9ecef)}
.cv-step.current{background:var(--primary);color:#fff;font-weight:600}
.cv-step:not([disabled]){cursor:pointer}
.cv-step:not([disabled]):not(.current):hover{background:var(--gray-300,#dee2e6);color:var(--text-color)}
.cv-flag{font-size:13px;font-weight:600;padding:5px 12px;border-radius:999px;background:var(--red-50,#fff1f0);color:var(--red-600,#c0392b);border:1px solid var(--red-100,#ffd6d2)}

/* Smart buttons moved above the tabs */
.cv-smart{margin:0 0 16px;padding:0;border:0}
.cv-smart .section-head{display:none}
.cv-smart .form-documents,.cv-smart .section-body{padding:0!important}
.cv-smart .document-link{box-shadow:0 1px 2px rgba(0,0,0,.04)}
@media (max-width:600px){.cv-step{font-size:12.5px;padding:7px 14px 7px 20px}}
/* Smart buttons, Odoo-style: one tidy row, only links that have records, count above the label */
.cv-smart .row,.cv-smart .form-documents .row{display:flex!important;flex-wrap:wrap;gap:10px;margin:0!important}
.cv-smart .col-md-4,.cv-smart .document-link-group,.cv-smart .form-link-title{display:contents}
.cv-smart .form-link-title{display:none!important}
.cv-smart .document-link{display:none!important}
.cv-smart .document-link.cv-has{display:inline-flex!important;flex-direction:row;align-items:center;gap:10px;min-width:0;margin:0!important;padding:8px 14px!important;border:1px solid var(--border-color);border-radius:10px;background:var(--card-bg,#fff)}
.cv-smart .document-link.cv-has:hover{border-color:var(--primary)}
.cv-smart .document-link .document-link-badge{background:transparent!important;padding:0!important;display:flex;align-items:center;gap:8px;font-size:14px;color:var(--text-color)}
.cv-smart .document-link .count{font-size:16px;font-weight:700;color:var(--primary);background:transparent!important;padding:0!important;min-width:0}
.cv-smart .document-link .open-notification{font-size:12px;border-radius:999px;padding:1px 7px;background:var(--orange-50,#fff4e5);color:var(--orange-700,#b45309)}
.cv-smart .document-link .btn-new{display:none!important}

/* Barcode Scanner page */
.cvs{max-width:860px;margin:0 auto;font-size:15px}
.cvs-ops{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin-bottom:16px}
.cvs-op{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;border:1px solid var(--border-color);background:var(--card-bg,#fff);border-radius:12px;padding:12px 14px;cursor:pointer;transition:border-color .15s,box-shadow .15s}
.cvs-op b{font-size:15px;color:var(--text-color)}
.cvs-op span{font-size:12.5px;color:var(--text-muted)}
.cvs-op.active{border-color:var(--primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--primary) 18%,transparent)}
.cvs-op.active b{color:var(--primary)}
.cvs-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:4px 14px}
.cvs-scan{display:flex;gap:10px;margin:6px 0 18px}
.cvs-input{flex:1;font-size:18px;padding:14px 16px;border:2px solid var(--primary);border-radius:12px;background:var(--card-bg,#fff);color:var(--text-color);outline:none}
.cvs-scan .btn{border-radius:12px;padding:0 18px;font-size:15px}
.cvs-sub{font-size:12.5px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--text-muted);margin:14px 0 8px}
.cvs-exp{display:flex;justify-content:space-between;padding:9px 14px;border:1px solid var(--border-color);border-radius:10px;margin-bottom:6px;background:var(--card-bg,#fff)}
.cvs-exp.part{border-color:var(--orange-300,#f6c27b)}
.cvs-exp.full{border-color:var(--green-400,#5fbf86);background:var(--green-50,#effaf3)}
.cvs-line{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border:1px solid var(--border-color);border-radius:12px;margin-bottom:8px;background:var(--card-bg,#fff)}
.cvs-name{display:flex;flex-direction:column;min-width:0}
.cvs-name b{font-size:15.5px}
.cvs-name span{font-size:13px;color:var(--text-muted)}
.cvs-qty{display:flex;align-items:center;gap:12px}
.cvs-qty b{font-size:18px;min-width:28px;text-align:center;font-variant-numeric:tabular-nums}
.cvs-q{width:38px;height:38px;border-radius:10px;border:1px solid var(--border-color);background:var(--control-bg,#f3f3f3);font-size:20px;line-height:1;cursor:pointer}
.cvs-empty{color:var(--text-muted);padding:18px 0}
.cvs-foot{display:flex;justify-content:flex-end;gap:10px;margin-top:16px;position:sticky;bottom:12px}
.cvs-foot .btn{border-radius:12px;padding:10px 22px;font-size:15px}
@media (max-width:700px){.cvs-ops{grid-template-columns:repeat(2,minmax(0,1fr))}.cvs-op:last-child{grid-column:1/-1}}

/* Pivot analysis (/app/pivot) */
.cvp{padding:4px 0 24px}
.cvp-bar{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:flex-end;margin-bottom:14px}
.cvp-field{min-width:150px;flex:1 1 150px;max-width:230px}
.cvp-field .frappe-control{margin-bottom:0}
.cvp-meta{color:var(--text-muted);font-size:12.5px;margin:2px 0 8px}
.cvp-chart{margin-bottom:6px}
.cvp-table{overflow-x:auto;border:1px solid var(--border-color);border-radius:10px;background:var(--card-bg,#fff)}
.cvp-table table{width:100%;border-collapse:collapse;font-size:13px}
.cvp-table th,.cvp-table td{padding:8px 12px;border-bottom:1px solid var(--border-color);white-space:nowrap;text-align:left}
.cvp-table thead th{background:var(--subtle-fg,#f7f7f8);font-weight:500;position:sticky;top:0}
.cvp-table tbody tr:hover{background:var(--subtle-accent,#fafafa)}
.cvp-table .num{text-align:right;font-variant-numeric:tabular-nums}
.cvp-table td.zero{color:var(--text-light,#b0b4ba)}
.cvp-table td.tot,.cvp-table tfoot th{font-weight:600}
.cvp-table tfoot th{background:var(--subtle-fg,#f7f7f8);border-bottom:0}
.cvp-empty{padding:40px;text-align:center;color:var(--text-muted)}

/* Variant grid entry (Add sizes / colours) */
.cv-vgrid{overflow-x:auto;margin-top:6px}
.cv-vgrid table{border-collapse:collapse;font-size:13px}
.cv-vgrid th,.cv-vgrid td{padding:6px 8px;border-bottom:1px solid var(--border-color);text-align:center}
.cv-vgrid tr>th:first-child{text-align:left;font-weight:500;padding-right:16px}
.cv-vgrid thead th,.cv-vgrid tr:first-child th{font-weight:500;color:var(--text-muted)}
.cv-vgrid input.cv-vq{width:76px;text-align:right;height:30px;padding:4px 8px}
.cv-vgrid .cv-vna{color:var(--text-light,#b0b4ba)}

/* Check in (/app/check-in) */
.cvc{max-width:440px;margin:24px auto;text-align:center}
.cvc-who{text-align:left;margin-bottom:12px}
.cvc-card{border:1px solid var(--border-color);border-radius:16px;background:var(--card-bg,#fff);padding:28px 24px;display:flex;flex-direction:column;gap:12px;align-items:center}
.cvc-name{font-size:18px;font-weight:600}
.cvc-clock{font-size:44px;font-weight:600;font-variant-numeric:tabular-nums;letter-spacing:.02em}
.cvc-btn{min-width:220px;padding:14px 20px;font-size:17px;border-radius:12px}
.cvc-hours{color:var(--text-muted)}
.cvc-logs{display:flex;flex-wrap:wrap;gap:6px;justify-content:center}
.cvc-log{font-size:12px;border-radius:999px;padding:3px 10px;background:var(--control-bg,#f3f4f6)}
.cvc-log.in{background:#ecfdf5;color:#047857}.cvc-log.out{background:#fef2f2;color:#b91c1c}

/* Sweep 3 Nov: things customers should never see */
.frappe-control .tooltip-content{display:none!important}                 /* developer field-name tooltip ("undefined" on filters) */
.list-sidebar .sidebar-section:has(> a[href*="frappe.io"]){display:none!important}  /* Frappe CRM / Helpdesk / Insights upsells */

/* Phones and tablets: nothing pushes the page sideways */
.form-tabs-list{overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none}
.form-tabs-list .nav,.form-tabs-list .form-tabs{flex-wrap:nowrap}
.form-tabs-list .nav-item{flex:0 0 auto}
.timeline-actions,.timeline-content.action-buttons{flex-wrap:wrap;max-width:100%;row-gap:6px}
.chart-container,.frappe-chart{max-width:100%}
.chart-container{overflow-x:auto}
/* Touch screens: controls big enough to tap (44px target, visual size unchanged where possible) */
@media (pointer:coarse){
  .list-row-checkbox,.list-check-all,.grid-row-check,.frappe-control input[type=checkbox],.form-check-input{width:20px;height:20px;min-width:20px}
  .navbar .nav-link,.navbar .btn-reset,.sidebar-toggle-btn,.page-head .btn-reset{min-width:40px;min-height:40px;display:inline-flex;align-items:center;justify-content:center}
}
/* Phones: long page titles (Point of Sale) stay on one line beside their buttons */
@media (max-width:575px){.page-head .page-title .title-text{font-size:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:60vw}}
/* Phones: related-record buttons wrap; wide item tables scroll inside themselves, not the page */
.form-dashboard .form-links .col-md-4{max-width:100%;display:flex;flex-wrap:wrap;min-width:0}
@media (max-width:767px){
  .form-grid-container,.frappe-control[data-fieldtype=Table] .form-grid-container{overflow-x:auto;max-width:100%;-webkit-overflow-scrolling:touch}
  .form-tabs-list{max-width:100%}
  .list-row-checkbox,.list-check-all{height:20px!important;width:20px!important}
}
@media (max-width:767px){.grid-footer{flex-wrap:wrap;gap:6px}.grid-bulk-actions{max-width:100%;flex-wrap:wrap}}
/* Product photos strip (products.py) */
.cv-photos{border:1px solid var(--border-color);border-radius:12px;padding:12px 14px;margin:0 0 14px;background:var(--card-bg,#fff)}
.cv-ph-head{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.cv-ph-head .text-muted{flex:1;min-width:180px;font-size:12.5px}
.cv-ph-row{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}
.cv-ph{position:relative;width:104px;height:104px;border:1px solid var(--border-color);border-radius:10px;overflow:hidden;background:#f7f9f8}
.cv-ph.main{border:2px solid var(--primary)}.cv-ph img{width:100%;height:100%;object-fit:cover}
.cv-ph .cv-badge{position:absolute;left:6px;top:6px;background:#fff;border-radius:999px;font-size:11px;padding:1px 8px;border:1px solid var(--border-color)}
.cv-ph .cv-main{position:absolute;left:6px;bottom:6px;font-size:11px;padding:1px 6px}
.cv-ph .cv-del{position:absolute;right:6px;top:6px;padding:0 7px;line-height:20px;border-radius:999px}
/* Files strip on business documents */
.cv-files{border:1px solid var(--border-color);border-radius:10px;padding:10px 14px;margin:0 0 12px;background:var(--card-bg,#fff)}
.cv-files-head{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center}.cv-files-head>b{font-size:13px;font-weight:600;letter-spacing:.01em;color:var(--heading-color,var(--text-color))}.cv-files-head .text-muted{flex:1;min-width:160px;font-size:12.5px;line-height:1.45}.cv-files-head .btn{margin-left:auto}
.cv-files-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.cv-file{display:inline-flex;gap:6px;align-items:center;max-width:260px;padding:4px 10px;border:1px solid var(--border-color);border-radius:6px;font-size:12.5px;color:var(--text-color)}.cv-file span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cv-file .cv-ico{width:14px;height:14px;flex:0 0 14px;color:var(--countova-pounamu-600)}
/* Your brand page */
.cvb{display:grid;grid-template-columns:minmax(0,380px) minmax(0,1fr);gap:24px;align-items:start;padding:8px 0}
@media (max-width:900px){.cvb{grid-template-columns:minmax(0,1fr)}}
.cvb-logo{display:flex;gap:14px;align-items:center;margin-bottom:10px}.cvb-logo .btn{margin-top:8px;margin-right:6px}
.cvb-logo-img{width:150px;height:72px;border:1px dashed var(--border-color);border-radius:10px;display:flex;align-items:center;justify-content:center;background:#fff;flex:0 0 auto;overflow:hidden}
.cvb-logo-img img{max-width:100%;max-height:100%}.cvb-logo-img span{color:var(--text-muted);font-size:12px}
.cvb-preview{border:1px solid var(--border-color);border-radius:12px;background:#fff;overflow:hidden}
.cvb-ph{padding:8px 14px;font-size:12px;color:var(--text-muted);border-bottom:1px solid var(--border-color)}
.cvb-frame{width:100%;height:1000px;border:0;display:block}
/* Desk chat panel: Countova's name for it, not the upstream app's */
.raven-chat .raven-logo{font-size:0!important;letter-spacing:0}
.raven-chat .raven-logo::before{content:"Team chat";font-size:16px;font-weight:600;font-family:var(--font-stack,inherit);color:var(--heading-color,#1f2933)}
/* Activities strip */
.cv-acts{border:1px solid var(--border-color);border-radius:10px;padding:10px 14px;margin:0 0 12px;background:var(--card-bg,#fff)}
.cv-act{display:flex;gap:12px;align-items:center;padding:9px 12px;margin-top:8px;border-radius:8px;background:#f7f9f9;border:1px solid var(--border-color);border-left:3px solid #9aa5ad}
.cv-act.cv-due-red{border-left-color:var(--countova-danger);background:#fdf5f5}.cv-act.cv-due-amber{border-left-color:var(--countova-kowhai-600);background:#fdf8ee}.cv-act.cv-due-green{border-left-color:var(--countova-success)}
.cv-act-main{flex:1;min-width:0;font-size:13px;line-height:1.45}.cv-act-main b{font-weight:600}
.cv-act-icon{flex:0 0 30px;width:30px;height:30px;border-radius:8px;display:flex;align-items:center;justify-content:center;background:var(--countova-pounamu-100);color:var(--countova-pounamu-600)}
.cv-due-red .cv-act-icon,.cv-act-exc .cv-act-icon{background:#fbe3e3;color:var(--countova-danger)}.cv-due-amber .cv-act-icon{background:var(--countova-kowhai-100);color:#9a6410}
.cv-act-icon .cv-ico{width:16px;height:16px}

/* Order exceptions (exceptions.py) */
.cv-act.cv-act-exc{border-left-color:var(--countova-danger);background:#fdf5f5}
.cv-exc-badge{margin-left:6px;display:inline-flex;vertical-align:-2px;color:var(--countova-danger)}.cv-exc-badge .cv-ico{width:14px;height:14px}
.cv-sup-compare{margin:8px 0 16px}.cv-sup-compare table{font-size:12px;margin:0}.cv-sup-compare tr.cv-sup-best td{background:#f1f8f4}
.cvr-intro{max-width:760px}.cvr-note{background:#fdf6ea;border-radius:8px;padding:8px 12px;margin-bottom:12px;font-size:13px}.cvr-note .btn{margin-left:8px}.cvr-grid td{vertical-align:middle}.cvr-grid .cvr-qty{width:90px}.cvr-sup{min-width:180px}.cvr-sup .frappe-control{margin:0}.cvr-empty{padding:32px;text-align:center;background:#fafbfc;border-radius:8px}
.cv-prices{margin:4px 0 14px}.cv-prices table{font-size:12px;margin:0}.cv-prices .cv-files-head a{margin-left:auto}

/* Line icons (countova_ui.js cv_icon) */
.cv-ico{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}
/* Navbar brand: the business logo, else the Countova mark + name */
.navbar-brand.cv-brand{display:inline-flex!important;align-items:center;gap:9px;padding:0;margin-right:16px;max-width:none;overflow:visible;text-decoration:none!important}
.cv-brand .cv-brand-logo{height:30px;max-width:150px;object-fit:contain;display:block}
.cv-brand .cv-brand-mark{width:28px;height:28px;display:block}
.cv-brand .cv-brand-word{font-family:Outfit,Inter,var(--font-stack,sans-serif);font-size:17px;font-weight:500;letter-spacing:-.01em;color:var(--countova-ink)}
.cv-brand .cv-brand-alt{display:none}.cv-brand.cv-brand-fallback .cv-brand-logo{display:none}.cv-brand.cv-brand-fallback .cv-brand-alt{display:block}
@media (max-width:767px){.navbar-brand.cv-brand{margin-right:8px}.cv-brand .cv-brand-word{display:none}.cv-brand .cv-brand-logo{height:26px;max-width:96px}}

/* Phones: lists open on the rows, not a stack of filter boxes (the Filter button keeps them all);
   long record titles stay on two lines */
@media (max-width:767px){
  .page-form .standard-filter-section>.frappe-control:not(:first-child){display:none!important}
  .page-head .page-title .title-text{font-size:17px;line-height:1.3;white-space:normal}
}
/* Customer portal: My Account keeps only what a customer needs */
.my-account-container a[href="/third_party_apps"], a.list-group-item[href="/third_party_apps"], .account-info a[href*="third_party_apps"]{display:none!important}
/* Portal order / invoice lines: no grey letter tiles for products without a photo */
.order-image-col:has(.no-image-cart-item){display:none}
.order-image-col:has(.no-image-cart-item)+div{flex:0 0 100%;max-width:100%}
/* Receipts and bills page (receipts.py) */
.cvrc{max-width:1100px}.cvrc-drop{display:flex;gap:16px;align-items:center;flex-wrap:wrap;border:1px dashed #6FB3B8;border-radius:12px;padding:18px 20px;background:#fff;margin-bottom:16px}
.cvrc-drop>div:nth-child(2){flex:1;min-width:220px}.cvrc-ico{width:44px;height:44px;border-radius:10px;background:var(--countova-pounamu-100);color:var(--countova-pounamu-600);display:flex;align-items:center;justify-content:center}
.cvrc-ico .cv-ico{width:22px;height:22px}.cvrc-pick{margin:0;cursor:pointer}
.cvrc-card{border:1px solid var(--border-color);border-radius:12px;background:#fff;padding:14px 16px;margin-bottom:14px}
.cvrc-h{display:flex;gap:10px;align-items:baseline;flex-wrap:wrap;margin-bottom:10px}.cvrc-h .cvrc-st{font-size:12.5px}
.cvrc-grid{display:grid;grid-template-columns:minmax(0,340px) minmax(0,1fr);gap:18px}
.cvrc-prev{border:1px solid var(--border-color);border-radius:8px;overflow:hidden;background:#f7f9f9;min-height:220px;max-height:520px}
.cvrc-prev img{width:100%;height:100%;object-fit:contain;display:block;max-height:520px}.cvrc-prev iframe{width:100%;height:520px;border:0}
.cvrc-act{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}.cvrc-ok{display:inline-flex;gap:6px;align-items:center;color:var(--countova-success);font-weight:600}
@media (max-width:767px){.cvrc-grid{grid-template-columns:minmax(0,1fr)}.cvrc-prev{max-height:280px}.cvrc-prev iframe{height:280px}}
/* Bill beside its fields (Purchase Invoice with an attached PDF or photo) */
.cv-billview{border:1px solid var(--border-color);border-radius:10px;background:#fff;margin:0 0 12px;overflow:hidden}
.cv-billview .cv-files-head{padding:8px 14px}.cv-billview iframe,.cv-billview img{width:100%;height:560px;border:0;display:block;object-fit:contain;background:#f7f9f9}
@media (max-width:767px){.cv-billview iframe,.cv-billview img{height:360px}}
.cvrc-mail{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:-6px 0 16px;padding:10px 14px;border-radius:10px;background:#f7f9f9;border:1px solid var(--border-color);font-size:13px}
.cvrc-mail .cv-ico{color:var(--countova-pounamu-600)}.cvrc-mail span{flex:1;min-width:220px}.cvrc-addr{user-select:all;word-break:break-all}
