/* ============================================================
   Sheladiya Diamond — premium theme (navy · gold · ivory)
   ============================================================ */
:root {
  --ink: #0d1829;
  --ink-2: #14233a;
  --ink-3: #1d3150;
  --gold: #c6a15b;
  --gold-2: #e4cc96;
  --gold-soft: #f7f0e1;
  --bg: #f4f3ef;
  --surface: #ffffff;
  --line: #e6e3dc;
  --line-2: #efede8;
  --text: #1a2231;
  --muted: #6d7384;
  --success: #1e7a55;
  --warning: #a86a12;
  --info: #25609e;
  --danger: #b4332a;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(13, 24, 41, .04), 0 4px 16px rgba(13, 24, 41, .05);
  --sb-w: 256px;

  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-color: var(--text);
  --bs-body-bg: var(--bg);
  --bs-border-color: var(--line);
  --bs-link-color-rgb: 29, 49, 80;
  --bs-link-hover-color-rgb: 166, 128, 58;
  --bs-primary-rgb: 13, 24, 41;
}
body { font-size: .9rem; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
.serif { font-family: "Cormorant Garamond", Georgia, serif; }

/* ---------------- Sidebar ---------------- */
.sidebar { --bs-offcanvas-width: var(--sb-w); --bs-offcanvas-bg: var(--ink); color: #c9cfdb; }
@media (min-width: 992px) {
  .sidebar.offcanvas-lg { position: fixed; inset: 0 auto 0 0; width: var(--sb-w); background: var(--ink) !important; z-index: 1030; display: flex; flex-direction: column; }
  .app-main { margin-left: var(--sb-w); }
}
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 1.1rem;
  background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--ink); box-shadow: 0 4px 14px rgba(198,161,91,.35); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.45rem; font-weight: 700; letter-spacing: .3px; color: #fff; }
.brand-sub { font-size: .62rem; letter-spacing: .42em; color: var(--gold-2); margin-top: 3px; }
.sidebar-nav { padding: 10px 12px 24px; overflow-y: auto; flex: 1; }
.side-section { font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; color: #6f7a8f; padding: 16px 10px 6px; }
.side-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; margin: 1px 0; border-radius: 9px; color: #c3cad8; font-weight: 500; position: relative; transition: background .15s, color .15s; }
.side-link i { font-size: 1rem; width: 18px; text-align: center; color: #8893a8; transition: color .15s; }
.side-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.side-link:hover i { color: var(--gold-2); }
.side-link.active { background: linear-gradient(90deg, rgba(198,161,91,.18), rgba(198,161,91,.04)); color: #fff; }
.side-link.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.side-link.active i { color: var(--gold-2); }
.side-badge { margin-left: auto; background: var(--gold); color: var(--ink); font-size: .68rem; font-weight: 700; border-radius: 20px; padding: 1px 7px; }

/* section switch under the logo: Sale & Purchase | Manufacturing */
.module-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 12px 12px 2px; padding: 4px; border-radius: 12px; background: rgba(255,255,255,.05); }
.module-switch a { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 4px; border-radius: 9px; font-size: .74rem; font-weight: 600;
  color: #aab4c6; text-align: center; line-height: 1.15; }
.module-switch a:hover { color: #fff; background: rgba(255,255,255,.05); }
.module-switch a.active { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--ink); box-shadow: 0 2px 8px rgba(198,161,91,.3); }

/* drop-down groups */
.side-group { margin: 2px 0; }
.side-group-btn { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent;
  color: #dfe4ee; font-weight: 600; font-size: .86rem; text-align: left; transition: background .15s, color .15s; }
.side-group-btn > i:first-child { font-size: 1rem; width: 18px; text-align: center; color: #8893a8; }
.side-group-btn:hover { background: rgba(255,255,255,.05); color: #fff; }
.side-group-btn:hover > i:first-child, .side-group.open > .side-group-btn > i:first-child { color: var(--gold-2); }
.side-group-btn .side-badge + .side-caret { margin-left: 6px; }
.side-caret { margin-left: auto; font-size: .72rem; color: #6f7a8f; transition: transform .2s; }
.side-group.open > .side-group-btn { color: #fff; }
.side-group.open .side-caret { transform: rotate(180deg); }
.side-group-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s ease; }
.side-group.open .side-group-body { grid-template-rows: 1fr; }
.side-group-body > .side-inner { min-height: 0; overflow: hidden; padding-left: 10px; }
.side-group-body .side-link { padding: 6px 10px; font-size: .84rem; }
.side-group-body .side-link.active::before { left: 0; }
.side-sub { font-size: .62rem; text-transform: uppercase; letter-spacing: .14em; color: #5f6a80; padding: 8px 10px 3px; }
.side-key { margin-left: auto; font: 600 .62rem/1 "Inter", sans-serif; color: #7c879b; background: rgba(255,255,255,.06); border-radius: 5px; padding: 3px 5px; box-shadow: none; white-space: nowrap; }
.side-link:hover .side-key { color: var(--gold-2); }
.side-pop { font-size: .72rem !important; width: auto !important; color: #5f6a80 !important; }
.sidebar-foot { padding: 10px 12px 14px; border-top: 1px solid rgba(255,255,255,.06); }
.side-foot-btn { width: 100%; display: flex; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.03); color: #aab4c6;
  border-radius: 9px; padding: 7px 10px; font-size: .8rem; }
.side-foot-btn:hover { color: #fff; border-color: rgba(198,161,91,.5); }
.side-foot-btn kbd { margin-left: auto; font-size: .62rem; background: rgba(255,255,255,.08); color: #aab4c6; box-shadow: none; }

/* transaction pop-up window */
.popup-body .app-main { margin-left: 0; }
.popup-bar { padding: 10px 22px; }
.popup-title { font-weight: 700; font-size: 1rem; }
.brand-mark.sm { width: 30px; height: 30px; border-radius: 9px; font-size: .9rem; }
.popup-body .content { max-width: none; padding-top: 18px; }
kbd { background: #eceae4; color: #3b4254; font: 600 .7rem/1 "Inter", sans-serif; padding: 3px 6px; border-radius: 5px; box-shadow: inset 0 -1px 0 rgba(13,24,41,.15); }
.new-menu .dropdown-item { display: flex; align-items: center; gap: 4px; min-width: 250px; }
.new-menu kbd { margin-left: auto; font-size: .64rem; }

/* the entry just saved, marked in its register */
@keyframes rowNew { from { background-color: rgba(198,161,91,.45); } to { background-color: rgba(198,161,91,.14); } }
.row-new, .row-new > td { animation: rowNew 2.5s ease-out forwards; }
tr.row-new > td:first-child { box-shadow: inset 3px 0 0 var(--gold); }

/* Dashboard */
.dash-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.seg.seg-sm a { padding: 5px 12px; font-size: .8rem; }
.kpi { color: var(--text); transition: box-shadow .15s, transform .15s; }
.kpi:hover { color: var(--text); box-shadow: 0 2px 4px rgba(13,24,41,.05), 0 10px 26px rgba(13,24,41,.09); transform: translateY(-1px); }
.kpi .card-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.kpi-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 600; }
.kpi-label i { color: var(--gold); margin-right: 4px; }
.kpi-value { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.kpi-value small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.kpi-sub { font-size: .8rem; color: var(--muted); }
.kpi-split { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: #aab4c6; }
.kpi-split b { color: #fff; font-weight: 600; }
.kpi-flag { margin-top: auto; padding-top: 6px; font-size: .78rem; font-weight: 600; }
.kpi-flag.ok { color: #1e7a55; } .kpi-flag.warn { color: #9a6200; } .kpi-flag.down { color: var(--danger); } .kpi-flag.muted { color: var(--muted); font-weight: 500; }
.card.kpi-hero { background: linear-gradient(135deg, var(--ink) 0%, var(--ink-3) 100%); border: 0; color: #fff; }
.kpi-hero:hover { color: #fff; }
.kpi-hero .kpi-label { color: var(--gold-2); } .kpi-hero .kpi-label i { color: var(--gold-2); }
.kpi-hero .kpi-value small, .kpi-hero .kpi-sub { color: #aab4c6; }
.chart { position: relative; width: 100%; min-height: 60px; }
.chart svg { display: block; overflow: visible; font-family: "Inter", system-ui, sans-serif; max-width: 100%; height: auto; }
.chart svg [tabindex]:focus { outline: none; }
.chart-empty { display: grid; place-items: center; height: 100%; min-height: 120px; color: var(--muted); font-size: .85rem; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .78rem; color: var(--muted); margin-bottom: 8px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.chart-tip { position: fixed; z-index: 3000; display: none; pointer-events: none; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(13,24,41,.14); padding: 8px 11px; font-size: .8rem; max-width: 280px; }
.chart-tip .ct-val { font-weight: 700; color: var(--text); font-size: .88rem; display: flex; align-items: center; gap: 7px; }
.chart-tip .ct-line { display: inline-block; width: 12px; height: 3px; border-radius: 2px; }
.chart-tip .ct-sub { color: #545b6b; }
.chart-tip .ct-key { color: var(--muted); margin-top: 2px; }
.age-late { color: var(--danger); font-weight: 600; white-space: nowrap; }

/* Manufacturing */
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }
.list-group-item.active-soft { background: var(--gold-soft); border-left: 3px solid var(--gold); }
tr.grp-row td { background: #faf8f3; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); font-weight: 700; padding-top: 10px; }
.rate-box { max-height: 420px; overflow-y: auto; }
.rate-proc > summary { padding: 9px 18px; font-weight: 600; cursor: pointer; border-top: 1px solid var(--line-2); }
.rate-proc > summary:hover { background: #faf8f3; }
.rate-proc table td { padding-left: 18px; vertical-align: middle; }
#lines tr:not(.row-on):not(.adj-row) td { color: var(--muted); }
#lines tr.row-on td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
#lines input.qty-main { border-color: #d8c49b; background: #fffdf8; }
#lines tr.adj-row td { background: #fbfaf7; }
#sal tr.row-on td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.bill-sum td { padding: 6px 4px; }

/* Party ledger */
.ledger th, .ledger td { vertical-align: middle; }
.ledger thead tr.grp th { font-size: .66rem; letter-spacing: .12em; color: var(--gold); border-bottom: 0; padding-bottom: 0; }
.ledger .bl { border-left: 1px solid var(--line); }
.ledger tr.ledger-sub td { background: #faf8f3; font-weight: 600; color: #545b6b; }
.ledger tr.ledger-total td { background: var(--gold-soft); font-weight: 700; border-top: 2px solid #e6d6b3; }
@media print { .ledger { font-size: 10px; } .ledger .badge { border: 1px solid #ccc; } }

/* "Go to" search (Ctrl+K) */
.palette-wrap { position: fixed; inset: 0; z-index: 2000; background: rgba(13,24,41,.45); display: none; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; }
.palette-wrap.show { display: flex; }
.palette { width: 100%; max-width: 640px; background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(13,24,41,.35); overflow: hidden; }
.palette-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.palette-in i { color: var(--muted); }
.palette-in input { flex: 1; border: 0; outline: none; font-size: 1rem; min-width: 0; }
.palette-list { max-height: 55vh; overflow-y: auto; padding: 6px; }
.palette-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; border-radius: 9px; padding: 8px 10px; text-align: left; color: var(--text); }
.palette-item > i:first-child { width: 18px; text-align: center; color: var(--muted); }
.palette-item.on, .palette-item:hover { background: var(--gold-soft); }
.palette-item.on > i:first-child { color: var(--gold); }
.pl-label { font-weight: 500; }
.pl-group { margin-left: auto; font-size: .74rem; color: var(--muted); white-space: nowrap; }
.palette-empty { padding: 16px; color: var(--muted); text-align: center; }
.palette-foot { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 8px 14px; border-top: 1px solid var(--line); font-size: .74rem; color: var(--muted); background: #faf9f6; }
.palette-foot a { margin-left: auto; }
@media (max-width: 575px) { .pl-group { display: none; } }

/* Help page */
.help-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; }
.help-toc { position: sticky; top: 84px; }
.help-toc a { display: block; padding: 6px 10px; border-radius: 8px; color: #445; font-size: .85rem; }
.help-toc a:hover, .help-toc a.on { background: var(--gold-soft); color: var(--ink); }
.help-sec { scroll-margin-top: 84px; margin-bottom: 18px; }
.help-sec h2 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 700; font-size: 1.45rem; margin: 0 0 4px; }
.help-sec h3 { font-size: .95rem; font-weight: 700; margin: 18px 0 6px; }
.help-sec ol, .help-sec ul { padding-left: 1.2rem; margin-bottom: .6rem; }
.help-sec li { margin-bottom: 4px; }
.help-sec:target { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(198,161,91,.2); }
.help-tip { background: var(--gold-soft); border-radius: 10px; padding: 10px 14px; font-size: .86rem; margin: 10px 0; }
.help-keys td:first-child { white-space: nowrap; width: 1%; }
@media (max-width: 991px) { .help-layout { grid-template-columns: 1fr; } .help-toc { position: static; display: flex; flex-wrap: wrap; gap: 4px; } }

/* ---------------- Topbar ---------------- */
.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 12px; padding: 12px 28px;
  background: rgba(244,243,239,.86); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line); }
.top-search { flex: 1; max-width: 520px; position: relative; }
.top-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.top-search input { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 30px; padding: 8px 16px 8px 38px; font-size: .88rem; outline: none; transition: border-color .15s, box-shadow .15s; }
.top-search input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(198,161,91,.15); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 4px 6px; border-radius: 30px; }
.user-chip:hover { background: rgba(13,24,41,.05); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; color: var(--gold-2); background: var(--ink-2); }
.user-name { font-weight: 600; font-size: .85rem; line-height: 1.1; }
.user-role { font-size: .72rem; color: var(--muted); }
.btn-icon { border: 1px solid var(--line); background: #fff; border-radius: 10px; width: 38px; height: 38px; display: grid; place-items: center; font-size: 1.2rem; }

.content { padding: 26px 28px 48px; max-width: 1600px; }
@media (max-width: 575px) { .content { padding: 18px 16px 40px; } .topbar { padding: 10px 16px; } }

/* ---------------- Page head ---------------- */
.page-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.page-title { font-size: 1.55rem; font-weight: 700; letter-spacing: -.01em; margin: 0; font-family: "Cormorant Garamond", Georgia, serif; }
.page-title .badge { font-family: "Inter", sans-serif; vertical-align: middle; }
.page-sub { color: var(--muted); margin-top: 2px; font-size: .86rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.eyebrow { font-size: .68rem; text-transform: uppercase; letter-spacing: .16em; color: var(--gold); font-weight: 600; }

/* ---------------- Cards ---------------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--line-2); padding: 14px 18px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-header .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
.card-body { padding: 18px; }
.card > .table-responsive > .table, .card > .table { margin-bottom: 0; }
.section-icon { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--gold-soft); color: var(--gold); margin-right: 8px; }

.stat { position: relative; overflow: hidden; }
.stat .card-body { padding: 18px 20px; }
.stat-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.stat-sub { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.stat-icon { position: absolute; right: 16px; top: 16px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.15rem; }
.stat-icon.gold { background: var(--gold-soft); color: var(--gold); }
.stat-icon.navy { background: #e8edf5; color: var(--ink-3); }
.stat-icon.green { background: #e5f3ec; color: var(--success); }
.stat-icon.amber { background: #fbf0dc; color: var(--warning); }
.stat.hero { background: linear-gradient(135deg, var(--ink) 0%, var(--ink-3) 100%); color: #fff; border: 0; }
.stat.hero .stat-label { color: var(--gold-2); }
.stat.hero .stat-sub, .stat.hero .stat-value small { color: #aab4c6; }
.stat.hero::after { content: "\F2A2"; font-family: "bootstrap-icons"; position: absolute; right: -18px; bottom: -40px; font-size: 9rem; color: rgba(255,255,255,.05); }

/* ---------------- Buttons ---------------- */
.btn { border-radius: 10px; font-weight: 500; }
.btn-sm { border-radius: 8px; }
.btn-primary { --bs-btn-bg: var(--ink); --bs-btn-border-color: var(--ink); --bs-btn-hover-bg: var(--ink-3); --bs-btn-hover-border-color: var(--ink-3);
  --bs-btn-active-bg: var(--ink-2); --bs-btn-active-border-color: var(--ink-2); --bs-btn-disabled-bg: var(--ink-3); --bs-btn-disabled-border-color: var(--ink-3); }
.btn-outline-primary { --bs-btn-color: var(--ink-3); --bs-btn-border-color: #cfd5df; --bs-btn-hover-bg: var(--ink); --bs-btn-hover-border-color: var(--ink); --bs-btn-hover-color: #fff; }
.btn-gold { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--ink); border: 0; font-weight: 600; box-shadow: 0 3px 10px rgba(198,161,91,.3); }
.btn-gold:hover, .btn-gold:focus { color: var(--ink); filter: brightness(1.04); box-shadow: 0 5px 16px rgba(198,161,91,.4); }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--line); --bs-btn-hover-bg: #f7f6f2; --bs-btn-hover-border-color: #d9d5cb; }
.btn-soft-warning { background: #fbf0dc; color: var(--warning); border: 1px solid #f1dfbb; }
.btn-soft-warning:hover { background: #f7e5c2; color: var(--warning); }
.btn-wa { background: #1faa59; color: #fff; border: 0; }
.btn-wa:hover { background: #178a48; color: #fff; }
.btn-wa-outline { border: 1px solid #1faa59; color: #178a48; background: #fff; }
.btn-wa-outline:hover { background: #e9f8ef; color: #178a48; }

/* ---------------- Forms ---------------- */
.form-label { font-size: .76rem; font-weight: 600; color: #4b5263; margin-bottom: 5px; letter-spacing: .01em; }
.form-control, .form-select { border-radius: var(--radius-sm); border-color: #dcd9d1; font-size: .88rem; padding-top: .45rem; padding-bottom: .45rem; }
.form-control-sm, .form-select-sm { border-radius: 8px; font-size: .82rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(198,161,91,.15); }
.form-control[readonly] { background: #f6f5f1; }
.form-check-input:checked { background-color: var(--ink); border-color: var(--ink); }
.form-text { font-size: .75rem; }
.req::after { content: " *"; color: var(--danger); }

/* ---------------- Tables ---------------- */
.table { --bs-table-bg: transparent; --bs-table-hover-bg: #faf8f3; margin-bottom: 0; }
.table > thead th { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; background: #fbfaf7; border-bottom: 1px solid var(--line); padding: .7rem .75rem; white-space: nowrap; }
.table > tbody td { padding: .62rem .75rem; border-color: var(--line-2); vertical-align: middle; }
.table > tfoot td { padding: .7rem .75rem; font-weight: 600; background: #fbfaf7; border-top: 1px solid var(--line); border-bottom: 0; }
.table-sm > tbody td { padding: .45rem .6rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.row-done td { color: #a1a6b1; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px !important; }
.empty i { display: block; font-size: 1.8rem; color: #c9c4b8; margin-bottom: 6px; }

.table-entry td { padding: .3rem .3rem !important; }
.table-entry .form-control, .table-entry .form-select { min-width: 70px; }
.table-entry .avail { font-size: .75rem; white-space: nowrap; }

/* ---------------- Badges ---------------- */
.badge { font-weight: 600; letter-spacing: .02em; border-radius: 20px; padding: .35em .7em; }
.badge-nat { background: #e8eef8; color: #274c85; }
.badge-lgd { background: #e3f4ea; color: #1d6b45; }
.badge-soft-success { background: #e3f4ea; color: var(--success); }
.badge-soft-warning { background: #fbf0dc; color: var(--warning); }
.badge-soft-info { background: #e3edf8; color: var(--info); }
.badge-soft-secondary { background: #ecebe7; color: #5b6070; }
.badge-soft-danger { background: #f9e5e3; color: var(--danger); }
.badge-gold { background: var(--gold-soft); color: #8a6a2c; }

/* ---------------- Tabs / pills ---------------- */
.seg { display: inline-flex; background: #ebe9e3; border-radius: 12px; padding: 4px; gap: 2px; }
.seg a { padding: 7px 16px; border-radius: 9px; color: #545b6b; font-weight: 600; font-size: .86rem; }
.seg a.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(13,24,41,.12); }
.seg a.active i { color: var(--gold); }

.alert { border-radius: 12px; border: 0; }
.alert-success { background: #e3f4ea; color: #155c3f; }
.alert-danger { background: #f9e5e3; color: #8c2820; }
.alert-warning { background: #fbf0dc; color: #7c4f0c; }
.alert-info { background: #e3edf8; color: #1c4a7a; }
.note { background: var(--gold-soft); border: 1px solid #efe2c4; border-radius: 12px; padding: 12px 16px; font-size: .84rem; color: #5b4a25; }

/* ---------------- Auth ---------------- */
.auth-body { background: var(--ink); min-height: 100vh; }
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { position: relative; overflow: hidden; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; color: #fff;
  background: radial-gradient(1200px 600px at -10% -10%, rgba(198,161,91,.22), transparent 60%), radial-gradient(900px 500px at 120% 120%, rgba(71,108,168,.35), transparent 55%), var(--ink); }
.auth-art .gem-art { position: absolute; right: -60px; top: 50%; transform: translateY(-50%); width: 520px; opacity: .9; }
.auth-art h2 { font-family: "Cormorant Garamond", Georgia, serif; font-size: 3rem; line-height: 1.05; font-weight: 600; max-width: 440px; }
.auth-art p { color: #aab4c6; max-width: 380px; }
.auth-form { background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-family: "Cormorant Garamond", Georgia, serif; font-size: 2.2rem; font-weight: 700; }
@media (max-width: 991px) { .auth { grid-template-columns: 1fr; } .auth-art { display: none; } }

/* ---------------- Slip ---------------- */
.slip { background: #fff; max-width: 1000px; margin: 0 auto; padding: 34px 38px; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.slip::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, var(--ink), var(--ink-3) 60%, var(--gold)); }
.slip-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.slip-brand { display: flex; gap: 14px; align-items: center; }
.slip-mark { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: var(--ink); color: var(--gold-2); }
.slip-company { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.8rem; font-weight: 700; line-height: 1; color: var(--ink); }
.slip-company-sub { font-size: .76rem; color: var(--muted); letter-spacing: .04em; margin-top: 4px; }
.slip-title { font-size: .68rem; text-transform: uppercase; letter-spacing: .16em; color: var(--gold); font-weight: 700; }
.slip-no { font-size: 1.35rem; font-weight: 700; color: var(--ink); letter-spacing: .02em; }
.slip-date { color: var(--muted); font-size: .85rem; }
.slip-parties { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding: 14px 16px; background: #faf8f3; border-radius: 12px; }
.slip-label { font-size: .64rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 600; }
.slip-party { font-weight: 700; font-size: 1rem; }
.slip-table { font-size: .84rem; }
.slip-terms { font-size: .74rem; color: var(--muted); margin-top: 10px; font-style: italic; }
.slip-sign { display: flex; justify-content: space-between; margin-top: 60px; font-size: .8rem; color: var(--muted); }
.slip-sign div { border-top: 1px solid #cfcac0; padding-top: 6px; min-width: 180px; text-align: center; }
.slip-watermark { background: #fbf0dc; color: var(--warning); text-align: center; font-weight: 600; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; padding: 8px; border-radius: 10px; margin-bottom: 16px; }

/* ---------------- Misc ---------------- */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 20px; }
.kv .k { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.kv .v { font-weight: 500; margin-top: 2px; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.list-activity .list-group-item { border-color: var(--line-2); padding: 11px 18px; font-size: .83rem; }
.list-activity .time { color: var(--muted); font-size: .74rem; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; background: #f1efe9; font-size: .8rem; margin: 2px; }
.chip form { display: inline; }
.chip button { border: 0; background: transparent; color: #999; padding: 0; line-height: 1; }
.chip button:hover { color: var(--danger); }
.chip.off { opacity: .5; text-decoration: line-through; }
.dropdown-menu { border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(13,24,41,.12); padding: 6px; }
.dropdown-item { border-radius: 8px; padding: 7px 12px; font-size: .86rem; }
.dropdown-item:active { background: var(--ink); }
.pagination { --bs-pagination-active-bg: var(--ink); --bs-pagination-active-border-color: var(--ink); --bs-pagination-color: var(--ink-3); }

/* ---------------- Page pieces ---------------- */
.badge-live { background: #e3f4ea; color: var(--success); display: inline-flex; align-items: center; gap: 6px; font-size: .62rem; letter-spacing: .12em; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 rgba(30,122,85,.5); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(30,122,85,0); } 100% { box-shadow: 0 0 0 0 rgba(30,122,85,0); } }
.seg-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: rgba(13,24,41,.08); font-size: .72rem; text-align: center; }
.seg a.active .seg-count { background: var(--gold-soft); color: #8a6a2c; }
.save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 0; margin-top: 4px;
  background: linear-gradient(180deg, rgba(244,243,239,0), var(--bg) 35%); }
.hero-search { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 8px 8px 8px 18px; box-shadow: var(--shadow); }
.hero-search > i { color: var(--gold); font-size: 1.1rem; }
.hero-search input { flex: 1; border: 0; outline: none; font-size: .98rem; background: transparent; min-width: 0; }
.stat-foot { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(128,128,128,.18); font-size: .78rem; color: var(--muted); }
.stat.hero .stat-foot { color: #aab4c6; border-top-color: rgba(255,255,255,.1); }
.today-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.today-grid div { display: flex; flex-direction: column; }
.today-grid b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.today-grid span { font-size: .72rem; color: var(--muted); }
.card-attention { border-color: #f1dfbb; box-shadow: 0 0 0 3px rgba(198,161,91,.12), var(--shadow); }
.shape-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.shape-pill { flex: 0 0 auto; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; color: var(--text); }
.shape-pill:hover { border-color: var(--gold); color: var(--text); }
.shape-pill .n { font-weight: 600; font-size: .84rem; }
.shape-pill .v { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.grade-title { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
tr.row-link { cursor: pointer; }
.table-entry thead th.th-ret { background: #eef3fa; }
.table-entry thead th.th-sale { background: #eaf5ef; }

/* ---------------- Memo lines ---------------- */
.line-top { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; flex-wrap: wrap; }
.mini-seg { display: inline-flex; background: #ebe9e3; border-radius: 8px; padding: 2px; gap: 2px; }
.mini-seg button, .mini-seg label span { border: 0; background: transparent; padding: 3px 10px; border-radius: 6px; font-size: .74rem; font-weight: 600; color: #545b6b; cursor: pointer; display: inline-block; }
.mini-seg button.active, .mini-seg input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(13,24,41,.14); }
.mini-seg label { margin: 0; }
.mini-seg input { display: none; }
.cert-act input[value="return"]:checked + span { color: var(--info); }
.cert-act input[value="sale"]:checked + span { color: var(--success); }
.avail { font-size: .76rem; color: var(--muted); }
.avail i { color: var(--gold); }
.spec { display: grid; grid-template-columns: repeat(5, minmax(86px, 1fr)); gap: 4px; }
.spec .form-select { min-width: 0 !important; color: var(--muted); }
.spec .form-select.is-set { color: var(--text); font-weight: 500; border-color: #cdbf9f; }
tr[data-type="parcel"] .cert-only, tr[data-type="cert"] .parcel-only { display: none !important; }
tr.row-over td { background: #fbeceb !important; }
.quick { position: relative; }
.quick i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--gold); }
.quick input { padding-left: 30px; min-width: 250px; }

/* ---------------- Recovery code ---------------- */
.recovery-box { background: var(--gold-soft); border: 1px dashed #d9c08b; border-radius: 12px; padding: 14px 16px; }
.recovery-code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.35rem; font-weight: 700; letter-spacing: .12em; color: var(--ink); }

/* ---------------- Rap price ---------------- */
.price-preview { background: #faf8f3; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 14px; font-size: .86rem; min-height: 42px; font-variant-numeric: tabular-nums; }
.pp-k { color: var(--muted); font-size: .78rem; }
.price-steps { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.price-steps > i { color: var(--gold); }
.price-steps .k { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.price-steps .v { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.price-steps .v small { font-size: .78rem; font-weight: 500; color: var(--muted); }
.price-total { margin-left: auto; text-align: right; padding-left: 18px; border-left: 1px solid var(--line); }
.price-total .v { color: var(--ink); font-size: 1.5rem; }
.bracket-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.bracket { padding: 5px 11px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: #545b6b; font-size: .8rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.bracket.filled { border-color: #d9c08b; background: var(--gold-soft); color: #7a5d24; }
.bracket.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.rap-grid th { text-align: center; }
.rap-grid tbody th { background: #fbfaf7; font-weight: 700; color: var(--ink); width: 44px; }
.rap-grid td { padding: 3px !important; }
.rap-grid input { text-align: center; min-width: 58px; padding-left: 4px; padding-right: 4px; font-variant-numeric: tabular-nums; }
.rap-grid input:not(:placeholder-shown) { background: #fffdf7; }

/* ---------------- Size tree ---------------- */
.size-indent { padding-left: calc(var(--d, 0) * 22px); display: inline-block; }
.size-tree { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; padding-bottom: 12px; }
.size-node { display: flex; align-items: baseline; gap: 12px; padding: 6px 12px; margin-left: calc(var(--d, 0) * 26px); border-radius: 9px; color: var(--text); border: 1px solid transparent; max-width: 520px; }
.size-node:hover { background: #faf8f3; color: var(--text); }
.size-node.active { border-color: var(--gold); background: var(--gold-soft); }
.size-node .n { font-weight: 600; }
.size-node .v { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.size-node .o { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------------- Reports ---------------- */
.rep-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; color: var(--muted); margin: 22px 0 10px; }
.rep-section:first-child { margin-top: 0; }
.rep-card { display: flex; flex-direction: column; height: 100%; padding: 16px 16px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); transition: border-color .15s, transform .15s; }
.rep-card:hover { border-color: #d9c08b; transform: translateY(-1px); color: var(--text); }
.rep-card .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--gold-soft); color: #a6803a; font-size: 1.1rem; margin-bottom: 10px; }
.rep-card .t { font-weight: 700; color: var(--ink); }
.rep-card .d { font-size: .8rem; color: var(--muted); flex: 1; margin: 4px 0 10px; }
.rep-card .dl { display: flex; gap: 6px; }
.rep-nav { padding: 6px; min-width: 270px; max-height: 75vh; overflow-y: auto; }
.rep-nav a { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 9px; color: #454c5c; font-size: .84rem; }
.rep-nav a i { color: var(--gold); width: 16px; }
.rep-nav a:hover { background: #faf8f3; color: var(--ink); }
.rep-nav a.active { background: var(--ink); color: #fff; }
.rep-nav a.active i { color: var(--gold-2); }
.rep-nav .rep-section { margin: 14px 10px 4px; font-size: .64rem; }
.btn-dl { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.btn-xlsx { --bs-btn-color: #1d6f42; --bs-btn-border-color: #b9dcc7; --bs-btn-bg: #f1faf4; --bs-btn-hover-bg: #1d6f42; --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: #1d6f42; }
.btn-pdf { --bs-btn-color: #b4332a; --bs-btn-border-color: #efc2be; --bs-btn-bg: #fdf3f2; --bs-btn-hover-bg: #b4332a; --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: #b4332a; }
.presets { display: flex; flex-wrap: wrap; gap: 5px; }
.presets a { font-size: .74rem; padding: 3px 9px; border-radius: 20px; border: 1px solid var(--line); color: #545b6b; background: #fff; }
.presets a.on, .presets a:hover { border-color: #d9c08b; background: var(--gold-soft); color: #7a5d24; }
.rep-table { font-size: .82rem; }
.rep-table td, .rep-table th { white-space: nowrap; }
.rep-table td.wrap { white-space: normal; min-width: 220px; }
.rep-table tr.rep-group td { background: var(--gold-soft) !important; font-weight: 700; color: var(--ink); border-left: 3px solid var(--gold); }
.rep-table tr.rep-sub td { background: #fbf7ee !important; font-weight: 700; }
.rep-note { font-size: .82rem; color: var(--muted); }

/* ---------------- Stone form: lab lookup, more details ---------------- */
.lookup-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--radius); background: linear-gradient(135deg, var(--ink) 0%, var(--ink-3) 100%); color: #fff; box-shadow: var(--shadow); }
.lookup-bar .text-muted { color: rgba(255, 255, 255, .62) !important; }
.lookup-bar a { color: var(--gold-2); }
.lookup-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(198, 161, 91, .18); color: var(--gold-2); font-size: 1.3rem; }
.lookup-input { max-width: 220px; font-size: 1.05rem; font-weight: 600; letter-spacing: .04em; }
.more-group { border-top: 1px solid var(--line-2); }
.more-group:first-child { border-top: 0; }
.more-group > summary { padding: 9px 2px; font-weight: 600; color: var(--ink); cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.more-group > summary::-webkit-details-marker { display: none; }
.more-group > summary::before { content: "\F285"; font-family: "bootstrap-icons"; font-size: .75rem; color: var(--gold); transition: transform .15s; }
.more-group[open] > summary::before { transform: rotate(90deg); }
.form-control.is-filled, .form-select.is-filled { background: #f3faf5; border-color: #9fd3b4; }
.kv a { word-break: break-all; }

/* ---------------- Certified filters ---------------- */
.stone-filter .form-label { font-size: .72rem; margin-bottom: 3px; }
.range-pair { display: flex; align-items: center; gap: 4px; }
.range-pair input { width: 78px; }
.range-pair span { color: var(--muted); }
.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.chip-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--muted); margin-right: 4px; }
.chip input, .role-pick input { display: none; }
.chip span { display: inline-block; min-width: 34px; text-align: center; padding: 3px 8px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: .78rem; font-weight: 600; color: #545b6b; cursor: pointer; user-select: none; }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip span:hover { border-color: #d9c08b; }

.chip-row .chip { padding: 0; background: none; margin: 0; border-radius: 0; }

/* ---------------- Certified search (Nivoda-style) ---------------- */
.type-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-top: 4px; }
.type-tabs a { padding: 8px 2px 10px; color: #545b6b; font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.type-tabs a span { font-size: .72rem; color: var(--muted); font-weight: 600; margin-left: 3px; }
.type-tabs a.active { color: var(--ink); border-bottom-color: var(--gold); }
.stone-shell { overflow: visible; }
.stone-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tb-btn { height: 38px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .84rem; border: 1px solid var(--line); background: #fff; }
.tb-btn.on { border-color: #d9c08b; background: var(--gold-soft); }
.tb-count { background: var(--ink); color: #fff; border-radius: 10px; font-size: .7rem; padding: 1px 7px; }
.tb-search { position: relative; flex: 1 1 250px; max-width: 360px; }
.tb-search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.tb-search input { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px 0 32px; font-size: .84rem; background: #fff; }
.tb-search input:focus { outline: none; border-color: #d9c08b; box-shadow: 0 0 0 3px rgba(198, 161, 91, .15); }
.tb-group { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.tb-toggle { margin: 0; }
.tb-toggle input { display: none; }
.tb-toggle span { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; font-size: .82rem; font-weight: 600; color: #545b6b; cursor: pointer; }
.tb-toggle + .tb-toggle span { border-left: 1px solid var(--line); }
.tb-toggle input:checked + span { background: var(--ink); color: #fff; }
.seg-status a { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 11px; font-size: .8rem; font-weight: 600; color: #545b6b; }
.seg-status a + a { border-left: 1px solid var(--line); }
.seg-status a span { font-size: .68rem; color: var(--muted); }
.seg-status a.active { background: var(--gold-soft); color: #6d5220; }
.tb-sort { width: auto; height: 38px; font-weight: 600; font-size: .82rem; }
.view-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.view-switch a { width: 38px; height: 36px; display: grid; place-items: center; color: #545b6b; }
.view-switch a.active { background: var(--ink); color: #fff; }
.saved-row .dropdown-item { font-size: .84rem; }

.filter-panel.offcanvas-end { width: min(720px, 100vw); }
.filter-panel .offcanvas-header { border-bottom: 1px solid var(--line); padding: 14px 20px; }
.filter-panel .offcanvas-body { padding: 0; }
.filter-panel .text-gold { color: #a6803a; }
.fp-row { display: flex; flex-wrap: wrap; }
.fp-row > .fp-sec + .fp-sec { border-left: 1px solid var(--line-2); }
.fp-sec { padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.fp-side { width: 250px; }
.fp-title { font-weight: 700; color: var(--ink); font-size: .9rem; margin-bottom: 10px; }
.fp-sub { font-size: .76rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.offcanvas-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: #fff; }
.shape-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.shape-tile { margin: 0; }
.shape-tile input { display: none; }
.shape-tile span { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 7px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #3d4557; cursor: pointer; transition: border-color .12s; }
.shape-tile em { font-style: normal; font-size: .68rem; color: #545b6b; text-align: center; line-height: 1.1; }
.shape-tile span:hover { border-color: #d9c08b; }
.shape-tile input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--gold-2); }
.shape-tile input:checked + span em { color: #fff; }

.stone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 16px; padding: 4px 16px 18px; }
.stone-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.stone-card:hover { box-shadow: 0 6px 22px rgba(13, 24, 41, .09); border-color: #ddd6c6; }
.stone-card.picked { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(198, 161, 91, .35); }
.sc-media { display: block; aspect-ratio: 1 / .86; background: linear-gradient(160deg, #eef0f3, #e2e5ea); margin: 10px 10px 0; border-radius: 10px; overflow: hidden; }
.sc-media img { width: 100%; height: 100%; object-fit: cover; }
.sc-ph { width: 100%; height: 100%; display: grid; place-items: center; color: #9aa3b2; }
.sc-check { position: absolute; top: 18px; right: 18px; z-index: 2; margin: 0; }
.sc-check input { width: 20px; height: 20px; accent-color: #0d1829; cursor: pointer; }
.sc-badges { position: absolute; top: 18px; left: 18px; display: flex; gap: 4px; }
.sb { display: inline-block; padding: 2px 8px; border-radius: 12px; background: rgba(255, 255, 255, .92); border: 1px solid var(--line); font-size: .68rem; font-weight: 600; color: #545b6b; }
.sb-type { color: #b0762a; border-color: #ecd8b0; }
.sc-360 { position: absolute; left: 18px; top: calc(10px + (100% - 20px) * 0 + 1px); display: none; }
.stone-card .sc-360 { display: grid; place-items: center; top: auto; bottom: auto; position: absolute; width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line); font-size: .62rem; font-weight: 700; color: #3d4557; margin-top: -42px; left: 18px; }
.sc-body { padding: 12px 14px 6px; flex: 1; }
.sc-lab { font-size: .72rem; color: #6d7384; font-weight: 600; }
.sc-title { display: block; font-weight: 700; color: var(--ink); font-size: .95rem; line-height: 1.3; margin: 3px 0 8px; }
.sc-title:hover { color: #a6803a; }
.sc-props { display: flex; justify-content: space-between; gap: 6px; font-size: .72rem; color: #6d7384; border-top: 1px solid var(--line-2); padding-top: 7px; }
.sc-props b { color: var(--ink); font-weight: 600; }
.sc-look { font-size: .72rem; color: #6d7384; margin-top: 5px; }
.sc-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 8px 14px; border-top: 1px solid var(--line-2); }
.sc-price { display: flex; justify-content: space-between; align-items: flex-end; padding: 10px 14px 12px; border-top: 1px solid var(--line-2); background: #fbfaf7; }
.sc-price .k { font-size: .76rem; font-weight: 600; color: #3d4557; }
.sc-price .disc, .sl-disc { color: #7a4fd0; font-weight: 700; font-size: .84rem; }
.sc-price .v { font-weight: 800; font-size: 1.1rem; color: var(--ink); font-variant-numeric: tabular-nums; }

.stone-list th { font-size: .68rem; white-space: nowrap; padding: .5rem .45rem !important; }
.stone-list td { vertical-align: middle; white-space: nowrap; font-size: .8rem; padding: .45rem .45rem !important; }
.stone-list td:first-child, .stone-list th:first-child { padding-left: 16px !important; }
.stone-list .sl-col { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.stone-list .sl-disc { white-space: nowrap; font-size: .76rem; }
.sl-row { cursor: pointer; }
.sl-row.open td, .sl-row.picked td { background: #fbf7ee; }
.sl-thumb { width: 38px; height: 38px; border-radius: 8px; overflow: hidden; background: #eef0f3; display: grid; place-items: center; color: #9aa3b2; }
.sl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sl-detail > td { background: #fdfcf9 !important; padding: 16px 20px !important; }
.sd-grid { display: grid; grid-template-columns: 150px 1fr 1.6fr 1fr 0.9fr 150px; gap: 18px; max-width: calc(100vw - var(--sb-w) - 90px); white-space: normal; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.sd-media img, .sd-media .sc-ph { width: 150px; height: 130px; object-fit: cover; border-radius: 10px; background: #eef0f3; }
.sd-h { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.sd-kv { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 3px 10px; font-size: .78rem; margin-top: 6px; }
.sd-kv span { color: var(--muted); }
.sd-kv b { font-weight: 600; color: var(--ink); }
@media (max-width: 1200px) { .sd-grid { grid-template-columns: 1fr 1fr; } }
.pager { display: flex; gap: 4px; }
.pager a { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); color: #3d4557; font-weight: 600; font-size: .84rem; background: #fff; }
.pager a.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.share-bar { position: fixed; left: calc(var(--sb-w) + 24px); right: 24px; bottom: 18px; z-index: 1030; display: none; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: 0 10px 30px rgba(13, 24, 41, .35); }
.share-bar.show { display: flex; }
.share-bar .sb-count { font-size: .9rem; }
.share-all { position: fixed; right: 24px; bottom: 18px; z-index: 1020; border-radius: 30px; box-shadow: 0 8px 24px rgba(13, 24, 41, .3); font-weight: 600; }
@media (max-width: 991px) { .share-bar { left: 12px; right: 12px; } }
.share-url { background: #fff; padding: 4px 8px; border-radius: 6px; font-size: .78rem; }
.share-body { background: var(--bg); }
.share-head { background: linear-gradient(135deg, var(--ink), var(--ink-3)); color: #fff; padding: 16px 0; }
.share-head .brand-mark { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: var(--ink); font-size: 1.2rem; }
.share-company { font-family: "Cormorant Garamond", serif; font-size: 1.5rem; font-weight: 700; line-height: 1; }

/* ---------------- Party roles ---------------- */
.role-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.role-pick span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 20px; border: 1px solid var(--line); background: #fff; font-size: .8rem; cursor: pointer; user-select: none; }
.role-pick span::before { content: "\F28A"; font-family: "bootstrap-icons"; color: #c3c7d0; }
.role-pick input:checked + span { border-color: #d9c08b; background: var(--gold-soft); color: #6d5220; font-weight: 600; }
.role-pick input:checked + span::before { content: "\F26B"; color: var(--gold); }

/* ---------------- WhatsApp ---------------- */
.section-icon.wa { background: #e7f7ee; color: #1a9e52; }
.wa-panel .card-header { flex-wrap: wrap; gap: 8px; }

/* ---------------- Sale bill · accounts ---------------- */
.bill-type { display: flex; flex-wrap: wrap; gap: 6px; }
.bill-type label { margin: 0; }
.bill-type input { display: none; }
.bill-type span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  font-weight: 600; font-size: .88rem; cursor: pointer; user-select: none; color: #545b6b; }
.bill-type input:checked + span { border-color: var(--ink-3); background: var(--ink-3); color: #fff; }
.bill-type .bt-gst input:checked + span { border-color: var(--info); background: var(--info); }
.bill-type .bt-cash input:checked + span { border-color: var(--success); background: var(--success); }
.bill-card.is-gst { border-color: #bcd0e6; }
.bill-totals { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 10px 14px; background: #faf8f3; border-radius: 10px; font-variant-numeric: tabular-nums; }
.bill-totals > div { display: flex; flex-direction: column; }
.bill-totals span { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.bill-totals strong { font-size: 1.05rem; }
.bill-totals .bill-net strong { font-size: 1.25rem; color: var(--ink); }
.slip-ref { font-size: .8rem; color: var(--muted); }
.slip-ref strong { color: var(--ink); }
.slip-table tr.slip-net td { font-weight: 700; font-size: 1rem; border-top: 2px solid var(--ink); }
.row-overdue td { background: #fdf3f1 !important; }
a.stat { color: inherit; transition: box-shadow .15s, transform .15s; }
a.stat:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(13, 24, 41, .09); }
.stat.stat-active { outline: 2px solid var(--gold); }
.ref-form .form-control { height: 28px; padding: 2px 8px; }
.ref-form .btn { padding: 2px 8px; }

/* ---------------- Auth art ---------------- */
.auth-art .brand { position: relative; z-index: 1; }
.auth-art > div { position: relative; z-index: 1; }

@media print {
  body, .app-body { background: #fff !important; font-size: 10.5pt; }
  .d-print-none, .no-print, .sidebar, .topbar { display: none !important; }
  .app-main { margin: 0 !important; }
  .content { padding: 0 !important; }
  .slip { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .card { box-shadow: none; }
}
