/* Modern look (owner request 2026-10-15). Loaded after app.css: same layout as the Salesgent-style screens,
   refreshed surface — soft grey canvas, white rounded cards with gentle shadows, Inter type, clearer hierarchy,
   pill status tags, calmer tables, refined buttons, inputs, menus and dialogs. Remove this file to go back. */

:root {
  --canvas: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --line: #eceef3;
  --line-strong: #dde1e9;
  --text: #121826;
  --text-2: #4b5565;
  --text-3: #8a93a5;
  --th-bg: #f8f9fc;
  --row-hover: #f5f7fd;
  --head-bg: transparent;
  --header-bg: rgba(255, 255, 255, .86);
  --brand: #2f5bff;
  --brand-rgb: 47, 91, 255;
  --brand-hover: #4a70ff;
  --brand-active: #1f45e0;
  --brand-soft: #eef2ff;
  --sider-bg: #0b1226;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .06), 0 2px 4px rgba(16, 24, 40, .04);
  --shadow-lg: 0 20px 40px -12px rgba(16, 24, 40, .18), 0 8px 16px -8px rgba(16, 24, 40, .08);
  --ring: 0 0 0 3px rgba(47, 91, 255, .16);
  --bs-body-font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-font-size: 14px;
  --bs-border-radius: 8px;
  --bs-border-radius-lg: 12px;
}
[data-bs-theme="dark"] {
  --canvas: #0b0f19;
  --surface: #131a2a;
  --surface-2: #182033;
  --line: #222b3f;
  --line-strong: #2d384f;
  --text: #e7ebf3;
  --text-2: #aab3c5;
  --text-3: #79849a;
  --th-bg: #182033;
  --row-hover: #1a2337;
  --header-bg: rgba(19, 26, 42, .86);
  --brand-soft: #18234a;
  --sider-bg: #070b16;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, .35);
  --bs-body-bg: var(--canvas);
}

body { background: var(--canvas); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; letter-spacing: -.003em; }
.main { background: var(--canvas); }
.content { padding: 0 24px 32px; }
::selection { background: rgba(47, 91, 255, .18); }

/* ---------- sidebar ---------- */
.sider { background: linear-gradient(180deg, #0f1730 0%, var(--sider-bg) 60%); box-shadow: 1px 0 0 rgba(255, 255, 255, .04); }
.logo-mark { border-radius: 12px; background: linear-gradient(135deg, #4a70ff, #2f5bff 55%, #6d3bff);
  box-shadow: 0 6px 16px rgba(47, 91, 255, .45); }
.sider-item { color: rgba(255, 255, 255, .72); border-radius: 12px; transition: background .15s, color .15s; }
.sider-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sider-group.active > .sider-item { background: linear-gradient(135deg, #4a70ff, #2f5bff); color: #fff;
  box-shadow: 0 6px 18px rgba(47, 91, 255, .4); }
.nav-wide .sider-group.active:not(.single) > .sider-item { box-shadow: none; color: #fff; }
.sider-sub { border-radius: 0 14px 14px 0; padding: 8px; background: #111a33; box-shadow: 12px 12px 32px rgba(0, 0, 0, .35); }
.sider-link { border-radius: 8px; }
.sider-link a { color: rgba(255, 255, 255, .82); }
.sider-link.active { background: rgba(74, 112, 255, .22); }
.sider-link.active a { color: #fff; font-weight: 500; }
.sider-trigger { background: rgba(255, 255, 255, .04); color: rgba(255, 255, 255, .7); border-top: 1px solid rgba(255, 255, 255, .06); }
.sider-trigger:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* ---------- top bar ---------- */
.topbar { background: var(--header-bg); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line); }
.topbar-row { padding: 10px 24px 4px; }
.quick-links { padding: 4px 24px 10px; gap: 6px; }
.quick-links a { padding: 4px 10px; border-radius: 999px; color: var(--text-2); font-size: 13px; transition: background .15s, color .15s; }
.quick-links a:hover { background: var(--brand-soft); }
.search { height: 38px; border-radius: 10px; border-color: var(--line-strong); background: var(--surface-2); transition: box-shadow .15s, border-color .15s; }
.search:focus-within { background: var(--surface); border-color: var(--brand); box-shadow: var(--ring); }
.create-btn { width: 30px; height: 30px; background: var(--brand); box-shadow: 0 4px 10px rgba(47, 91, 255, .35); }
.create-btn:hover { background: var(--brand-hover); }
.icon-btn { border-radius: 10px; }
.avatar { background: linear-gradient(135deg, #4a70ff, #6d3bff); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px rgba(47, 91, 255, .25); }

/* ---------- page header ---------- */
.page-head { background: transparent; border-bottom: 0; margin: 0 -24px 8px; padding: 20px 24px 12px; min-height: 0; }
.page-head h1 { font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.crumbs, .crumbs a { font-size: 13px; }
.page-head > a.btn-link { width: 32px; height: 32px; border-radius: 10px; display: inline-grid; place-items: center;
  background: var(--surface); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.page-head > .text-body-secondary { font-size: 13px; }
.page-head .btn-sm { min-height: 34px; }

/* ---------- buttons ---------- */
.btn { --bs-btn-border-radius: 10px; --bs-btn-font-weight: 500; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn-sm { --bs-btn-border-radius: 8px; --bs-btn-padding-x: 12px; }
.btn:active { transform: translateY(1px); }
.btn-primary { box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 4px 12px -2px rgba(47, 91, 255, .45); }
.btn-primary:hover { box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 6px 16px -2px rgba(47, 91, 255, .5); }
.btn-outline-secondary { --bs-btn-border-color: var(--line-strong); --bs-btn-hover-bg: var(--surface-2);
  --bs-btn-hover-color: var(--text); --bs-btn-hover-border-color: var(--line-strong); --bs-btn-active-color: var(--text);
  --bs-btn-active-bg: var(--line); box-shadow: var(--shadow-sm); }
.btn-outline-primary { --bs-btn-bg: var(--surface); }
.btn-outline-danger { --bs-btn-bg: var(--surface); }
.btn-link { --bs-btn-font-weight: 500; }
.btn:focus-visible { box-shadow: var(--ring); }

/* ---------- inputs ---------- */
.form-control, .form-select { border-radius: 10px; min-height: 38px; padding: 6px 12px; border-color: var(--line-strong);
  background-color: var(--surface); transition: border-color .15s, box-shadow .15s; }
.form-control-sm, .form-select-sm { min-height: 30px; border-radius: 8px; padding: 2px 9px; }
.form-control:hover, .form-select:hover { border-color: #b9c1d0; }
[data-bs-theme="dark"] .form-control:hover, [data-bs-theme="dark"] .form-select:hover { border-color: #3d4a66; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: var(--ring); }
.form-control-plaintext { min-height: 0; }
.form-label { font-size: 13px; font-weight: 550; color: var(--text-2); margin-bottom: 6px; }
.form-text { font-size: 12px; }
.form-check-input { border-color: #c4cad6; }
.form-check-input:focus { box-shadow: var(--ring); }
.form-switch .form-check-input { width: 2.2em; }
.input-group-text { border-radius: 10px; background: var(--surface-2); border-color: var(--line-strong); color: var(--text-3); }
.form-section { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3);
  border-bottom: 1px dashed var(--line-strong); }

/* ---------- cards, panels ---------- */
.card { --bs-card-border-radius: var(--radius); --bs-card-inner-border-radius: calc(var(--radius) - 1px);
  --bs-card-border-color: var(--line); box-shadow: var(--shadow-sm); }
.card-header { padding: 14px 18px; font-size: 14px; font-weight: 650; }
.card-body { padding: 18px; }
.dl { border-radius: 10px; }
.dl dt { color: var(--text-2); font-weight: 550; }
.product-strip { border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); padding: 14px 20px; }
.product-strip span { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.product-strip strong { font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
.mini-stat { border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.addr-box { border-radius: 10px; background: var(--surface-2); }
.balance-head { font-size: 18px; }
.balance-head strong { font-size: 22px; letter-spacing: -.02em; }
.summary-bar > div { padding: 12px 18px; }
.summary-bar strong { font-weight: 650; }

/* Lists: the table and pager sit on a white card. */
.content > .table-responsive { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); }
.content > .table-responsive > .table thead th:first-child { border-top-left-radius: var(--radius); }
.content > .table-responsive > .table thead th:last-child { border-top-right-radius: var(--radius); }
.list-tools { padding: 4px 0 12px; }
.list-tools .search-box input { border-radius: 10px; background: var(--surface); }

/* ---------- tables ---------- */
.table { font-size: 13.5px; }
.table > :not(caption) > * > * { padding: 10px 12px; }
.table-sm > :not(caption) > * > * { padding: 6px 10px; }
.table thead th { background: var(--th-bg); color: var(--text-3); font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.table thead th + th::before { display: none; }
.table thead th a { color: var(--text-3); }
.table thead th a:hover { color: var(--brand); }
.table tbody tr:last-child > * { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--row-hover); }
tr.clickable td:first-child a { font-weight: 550; }
.table tfoot td { background: var(--surface-2); }

/* ---------- status tags: soft pills ---------- */
.tag { border-radius: 999px; padding: 0 10px; line-height: 22px; font-weight: 550; font-size: 12px; border-color: transparent; }
.tag::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  margin-right: 6px; vertical-align: 1px; opacity: .85; }
.tag-default { background: #f1f3f7; color: #4b5565; }
.tag-green { background: #e8f7ee; color: #18794e; }
.tag-blue { background: #eaf1ff; color: #2350d8; }
.tag-cyan { background: #e6f7f8; color: #0b7a82; }
.tag-gold { background: #fff6e0; color: #a86b00; }
.tag-volcano { background: #fff0e8; color: #c2410c; }
.tag-red { background: #fdecec; color: #c42b2b; }
.tag-orange { background: #fff3e4; color: #b45309; }
.tag-purple { background: #f3edff; color: #6d3bd6; }
[data-bs-theme="dark"] .tag { border-color: transparent; }

/* ---------- pager ---------- */
.content > .pager { padding: 14px 4px; }
.pager a, .pager span.page { border-radius: 8px; }
.pager span.page.current { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 10px -2px rgba(47, 91, 255, .45); }

/* ---------- tabs ---------- */
.doc-tabs > .nav-tabs .nav-link, .balance-card .nav-link { text-transform: none; font-size: 13.5px; font-weight: 550; letter-spacing: 0; color: var(--text-2); }
.doc-tabs > .nav-tabs .nav-link.active, .balance-card .nav-link.active { color: var(--brand); }
.nav-tabs:not(.doc-tabs > .nav-tabs) { --bs-nav-tabs-border-color: var(--line); }
.nav-tabs .nav-link { border-radius: 8px 8px 0 0; }

/* ---------- menus, dialogs, alerts, toasts ---------- */
.dropdown-menu { --bs-dropdown-border-radius: 12px; --bs-dropdown-border-color: var(--line); padding: 6px; box-shadow: var(--shadow-lg);
  --bs-dropdown-bg: var(--surface); }
.dropdown-item { border-radius: 8px; padding: 7px 12px; }
.dropdown-item:hover { background: var(--surface-2); }
.dropdown-header { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.modal-content { border-radius: 16px; box-shadow: var(--shadow-lg); background: var(--surface); }
.modal-header, .adv-head { background: var(--surface); color: var(--text); border-bottom: 1px solid var(--line); padding: 16px 20px; }
.modal-header .btn-close, .adv-head .btn-close { filter: none; }
[data-bs-theme="dark"] .modal-header .btn-close { filter: invert(1) grayscale(1) brightness(1.6); }
.modal-title { font-weight: 650; letter-spacing: -.01em; }
.modal-footer { border-top-color: var(--line); background: var(--surface-2); }
.modal-backdrop.show { opacity: .35; backdrop-filter: blur(2px); }
.alert { border-radius: var(--radius); border-width: 1px; }
.toast-msg { border-radius: 12px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.popover { border-radius: 12px; border-color: var(--line); box-shadow: var(--shadow-lg); }
.popover-header { background: var(--surface-2); font-weight: 600; border-radius: 12px 12px 0 0; }

/* ---------- dashboard ---------- */
.stat .label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 600; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.hero .value { font-size: 36px; }

/* ---------- bits ---------- */
.badge { border-radius: 999px; font-weight: 600; }
.btn-advance { border-radius: 10px; box-shadow: 0 6px 14px -4px rgba(109, 59, 255, .55); }
.col-filter-btn { opacity: .55; transition: opacity .15s, color .15s; }
th:hover .col-filter-btn, .col-filter-btn.active { opacity: 1; }
.col-filter-menu { border-radius: 12px; }
.report .report-group th { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.report .report-grand td { font-weight: 700; }
hr { border-color: var(--line-strong); opacity: 1; }
:focus-visible { outline: none; }
a:focus-visible, button:focus-visible { box-shadow: var(--ring); border-radius: 6px; }

@media (max-width: 767.98px) {
  .content { padding: 0 16px 24px; }
  .page-head { margin: 0 -16px 8px; padding: 16px 16px 10px; }
  .page-head h1 { font-size: 19px; }
  .topbar-row { padding: 8px 16px 2px; }
  .quick-links { padding: 4px 16px 8px; }
}
@media print { body, .main { background: #fff; } .card, .content > .table-responsive { box-shadow: none; } }

/* List rows stay on one line (the list scrolls sideways on narrow screens) and stay compact. */
.content > .table-responsive > .table > tbody > tr > td { white-space: nowrap; padding-top: 9px; padding-bottom: 9px; }
.content > .table-responsive > .table > :not(caption) > * > * { padding-left: 10px; padding-right: 10px; }
.content > .table-responsive .select-col { width: 40px; }

/* Info grids that sit directly on the page (invoice / order header) get the card surface too. */
.dl { background: var(--surface); }
.dl:not(.card .dl) { box-shadow: var(--shadow-sm); border-radius: var(--radius); }
.dl dt { background: var(--surface-2); }
