/* ===================================================================
   Daylight Health System — theme
   Palette: deep blue (trust, clinical), white (clean), gold (premium)
   =================================================================== */

:root {
    --navy: #0b3d78;
    --navy-dark: #082a54;
    --blue: #155a9c;
    --blue-light: #eaf2fb;
    --gold: #f4c542;
    --gold-dark: #d9a916;
    --white: #ffffff;
    --bg: #f3f6fa;
    --ink: #1c2b3a;
    --ink-soft: #55677c;
    --line: #e2e9f1;
    --danger: #c0392b;
    --danger-bg: #fdecea;
    --success: #1e8a5f;
    --success-bg: #e9f8f1;
    --warn: #b7791f;
    --warn-bg: #fff6e0;
    --radius: 12px;
    --shadow: 0 4px 18px rgba(11, 61, 120, 0.08);
    --shadow-lift: 0 10px 30px rgba(11, 61, 120, 0.16);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 6px 0; color: var(--navy-dark); }
p { margin: 0 0 10px 0; }

/* ---------- App shell ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    background: linear-gradient(120deg, var(--navy) 0%, var(--blue) 100%);
    color: var(--white);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    box-shadow: 0 2px 12px rgba(8, 42, 84, 0.25);
    position: sticky;
    top: 0;
    z-index: 50;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: 0.3px; }
.brand .mark {
    width: 34px; height: 34px; border-radius: 9px;
    background: var(--gold);
    display: flex; align-items: center; justify-content: center;
    color: var(--navy-dark); font-weight: 800; font-size: 16px;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.4);
}
.brand .sub { font-weight: 400; font-size: 11px; color: var(--gold); letter-spacing: 1.5px; text-transform: uppercase; display: block; margin-top: 1px;}

.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
    color: #dfeaf7;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.nav a:hover { background: rgba(255,255,255,0.12); color: var(--white); }
.nav a.active { background: rgba(244, 197, 66, 0.18); color: var(--gold); font-weight: 700; }

.user-pill {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,0.08);
    padding: 6px 8px 6px 14px;
    border-radius: 30px;
    font-size: 13px;
}
.user-pill .avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--gold); color: var(--navy-dark);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px;
}
.user-pill form { margin: 0; }
.user-pill button {
    background: rgba(255,255,255,0.12); color: var(--white); border: none;
    padding: 6px 12px; border-radius: 20px; font-size: 12px; cursor: pointer;
}
.user-pill button:hover { background: rgba(255,255,255,0.24); }
/* Profile button + menu in the top bar */
.profile-wrap { position: relative; }
.user-pill.profile-btn { border: none; color: var(--white); cursor: pointer; font: inherit; font-size: 13px; padding: 6px 14px 6px 8px; }
.user-pill.profile-btn:hover, .user-pill.profile-btn[aria-expanded=true] { background: rgba(255,255,255,0.18); }
.user-pill .caret { opacity: 0.8; font-size: 11px; }
.profile-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; background: var(--white); color: var(--ink);
    border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(8, 42, 84, 0.18); padding: 8px; z-index: 150; }
.profile-head { display: flex; gap: 12px; align-items: center; padding: 8px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.avatar.lg { width: 40px; height: 40px; border-radius: 50%; background: var(--gold); color: var(--navy-dark);
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; flex: none; }
.profile-item { display: block; width: 100%; text-align: left; background: none; border: none; padding: 10px 10px; border-radius: 8px;
    font: inherit; font-size: 13.5px; color: var(--navy-dark); cursor: pointer; }
.profile-item:hover { background: var(--blue-light); }
.profile-item.danger-text { color: var(--danger); }
.role-badge {
    font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
    background: var(--gold); color: var(--navy-dark); padding: 2px 8px; border-radius: 10px; font-weight: 700;
}

.content { flex: 1; padding: 28px 32px 48px; max-width: 1320px; width: 100%; margin: 0 auto; }
.plan-banner { max-width: 1320px; width: 100%; margin: 18px auto 0; padding: 0 32px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.page-head .eyebrow { color: var(--gold-dark); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 4px; }
.page-head h1 { font-size: 26px; }
.page-head .desc { color: var(--ink-soft); font-size: 14px; margin-top: 4px; }

/* ---------- Cards ---------- */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    padding: 22px;
}
.card + .card { margin-top: 18px; }
.card-title {
    font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    color: var(--navy); margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
    border-left: 4px solid var(--gold); padding-left: 10px;
}

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Stat tiles ---------- */
.stat-tile {
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat-tile::after {
    content: ""; position: absolute; right: -20px; top: -20px; width: 80px; height: 80px;
    background: var(--gold); opacity: 0.08; border-radius: 50%;
}
.stat-tile .label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-soft); font-weight: 600; }
.stat-tile .value { font-size: 28px; font-weight: 800; color: var(--navy-dark); margin-top: 6px; }
.stat-tile .value.gold { color: var(--gold-dark); }
.stat-tile .hint { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.stat-tile .hint.danger { color: var(--danger); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px; border-radius: 9px; border: none; cursor: pointer;
    font-size: 14px; font-weight: 600; transition: all 0.15s ease; text-decoration: none;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-dark); text-decoration: none; }
.btn-gold { background: var(--gold); color: var(--navy-dark); }
.btn-gold:hover { background: var(--gold-dark); text-decoration: none; }
.btn-outline { background: var(--white); color: var(--navy); border: 1.5px solid var(--navy); }
.btn-outline:hover { background: var(--blue-light); text-decoration: none; }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: #f8d7d4; text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Forms ---------- */
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 5px; }
input[type=text], input[type=number], input[type=password], input[type=email],
input[type=date], input[type=time], input[type=search], select, textarea {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px;
    font-size: 14px; color: var(--ink); background: var(--white); font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(21, 90, 156, 0.12);
}
.field { margin-bottom: 16px; }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; }
.help-text { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }

/* ---------- Tables ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
    text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
    color: var(--ink-soft); padding: 10px 12px; border-bottom: 2px solid var(--line); font-weight: 700;
}
table.data td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:hover td { background: var(--blue-light); }
table.data tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.muted { color: var(--ink-soft); }
.nowrap { white-space: nowrap; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: 0.3px; }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-gold { background: #fdf3d7; color: var(--gold-dark); }
.badge-navy { background: var(--blue-light); color: var(--navy); }
.badge-gray { background: #eef1f5; color: var(--ink-soft); }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 9px; font-size: 13.5px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-danger { background: var(--danger-bg); color: var(--danger); border-color: #f3c6c0; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: #bfe8d4; }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: #f0dca6; }
.alert-info { background: var(--blue-light); color: var(--navy); border-color: #cfe0f2; }

/* ---------- Login screen ---------- */
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at top left, #123a68, #061c38 60%);
    padding: 20px;
}
.login-card {
    width: 100%; max-width: 400px; background: var(--white); border-radius: 18px;
    padding: 38px 34px; box-shadow: var(--shadow-lift); text-align: center;
}
.login-card .mark {
    width: 58px; height: 58px; border-radius: 16px; margin: 0 auto 14px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    display: flex; align-items: center; justify-content: center; color: var(--navy-dark);
    font-weight: 800; font-size: 26px; box-shadow: 0 6px 18px rgba(217, 169, 22, 0.4);
}
.login-card h1 { font-size: 20px; margin-bottom: 2px; }
.login-card .tagline { color: var(--ink-soft); font-size: 13px; margin-bottom: 24px; }
.login-card .field { text-align: left; }
.login-card .demo-creds { margin-top: 20px; font-size: 11.5px; color: var(--ink-soft); background: var(--blue-light); border-radius: 8px; padding: 10px 12px; text-align: left; line-height: 1.6; }

/* ---------- POS screen ---------- */
.pos-layout { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
@media (max-width: 1080px) { .pos-layout { grid-template-columns: 1fr; } }

.pos-search { margin-bottom: 16px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; max-height: 640px; overflow-y: auto; padding-right: 4px; }
.product-card {
    background: var(--white); border: 1.5px solid var(--line); border-radius: 10px; padding: 14px;
    cursor: pointer; transition: all 0.15s ease; text-align: left;
}
.product-card:hover { border-color: var(--gold); box-shadow: 0 4px 14px rgba(244,197,66,0.25); transform: translateY(-1px); }
.product-card .pname { font-weight: 700; font-size: 13.5px; color: var(--navy-dark); line-height: 1.3; min-height: 34px; }
.product-card .psku { font-size: 11px; color: var(--ink-soft); margin: 4px 0 8px; }
.product-card .pprice { font-size: 16px; font-weight: 800; color: var(--gold-dark); }
.product-card .pstock { font-size: 11px; margin-top: 4px; }
.product-card[disabled], .product-card.out { opacity: 0.45; cursor: not-allowed; }

.cart-panel { position: sticky; top: 84px; }
.cart-items { max-height: 340px; overflow-y: auto; margin: 10px 0; }
.cart-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-row .ci-name { flex: 1; font-size: 13px; font-weight: 600; }
.cart-row .ci-sub { font-size: 11px; color: var(--ink-soft); }
.qty-control { display: flex; align-items: center; gap: 6px; }
.qty-control button {
    width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line); background: var(--white); cursor: pointer; font-weight: 700; color: var(--navy);
}
.qty-control span { min-width: 20px; text-align: center; font-weight: 700; font-size: 13px; }
.cart-total-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.cart-total-row.grand { font-size: 20px; font-weight: 800; color: var(--navy-dark); border-top: 2px solid var(--line); margin-top: 8px; padding-top: 12px; }
.cart-total-row .amt.gold { color: var(--gold-dark); }
.empty-cart { text-align: center; color: var(--ink-soft); font-size: 13px; padding: 30px 10px; }

/* ---------- Receipt ---------- */
.receipt { max-width: 340px; margin: 0 auto; background: var(--white); border: 1px dashed var(--line); border-radius: 10px; padding: 20px; font-family: "Courier New", monospace; font-size: 12.5px; }
.receipt h2 { text-align: center; font-size: 15px; }
.receipt .r-line { display: flex; justify-content: space-between; }
.receipt hr { border: none; border-top: 1px dashed #ccc; margin: 10px 0; }

/* ---------- Misc ---------- */
.pill-tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.pill-tabs a { padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 600; background: var(--white); border: 1.5px solid var(--line); color: var(--ink-soft); }
.pill-tabs a.active { background: var(--navy); border-color: var(--navy); color: var(--white); }
.pill-tabs a:hover { text-decoration: none; border-color: var(--navy); }

.modal-backdrop { position: fixed; inset: 0; background: rgba(8,26,52,0.55); display: none; align-items: center; justify-content: center; z-index: 100; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--white); border-radius: var(--radius); padding: 24px; width: 100%; max-width: 440px; box-shadow: var(--shadow-lift); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-close { cursor: pointer; border: none; background: none; font-size: 18px; color: var(--ink-soft); }

.footer-note { text-align: center; color: var(--ink-soft); font-size: 12px; padding: 20px 0 6px; }

.toast { position: fixed; bottom: 24px; right: 24px; background: var(--navy-dark); color: var(--white); padding: 12px 20px; border-radius: 10px; font-size: 13.5px; box-shadow: var(--shadow-lift); z-index: 200; display: none; }
.toast.show { display: block; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

/* ===================================================================
   Online edition additions
   =================================================================== */
[hidden] { display: none !important; }
.brand .sub { white-space: nowrap; }
.topbar { gap: 16px; }
.nav { overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { white-space: nowrap; cursor: pointer; }
.brand > div:last-child { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a { padding: 8px 11px; }
.user-pill button { white-space: nowrap; }
@media (max-width: 1340px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 10px 20px; row-gap: 6px; }
  .brand { flex: 1; }
  .nav { order: 3; width: 100%; padding-bottom: 4px; }
  .brand .sub { display: none; }
}
@media (max-width: 640px) {
  .content { padding: 18px 16px 40px; }
  .plan-banner { padding: 0 16px; margin-top: 12px; }
  .user-pill .uname { display: none; }
  .field-row { flex-direction: column; gap: 0; }
  .page-head h1 { font-size: 22px; }
}

/* Utilities (no inline styles: the Content-Security-Policy forbids them) */
.mt-8 { margin-top: 8px; } .mt-14 { margin-top: 14px; } .mt-18 { margin-top: 18px; }
.mb-0 { margin-bottom: 0; } .mb-12 { margin-bottom: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.strong { font-weight: 700; }
.small { font-size: 12px; }
.danger-text { color: var(--danger); }
.warn-text { color: var(--warn); }
.align-start { align-items: start; }
.section-label { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 6px; }
.section-label.danger { color: var(--danger); } .section-label.warn { color: var(--warn); }
.link-btn { background: none; border: none; color: var(--blue); cursor: pointer; padding: 0; font: inherit; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.shift-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; background: var(--success-bg); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.shift-gate { max-width: 440px; margin: 24px auto; }
.thumb { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; background: var(--blue-light); border: 1px solid var(--line); }
.logo-preview { max-height: 64px; max-width: 220px; border-radius: 8px; border: 1px solid var(--line); background: var(--white); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
table.data td .btn-row { gap: 6px; min-width: 210px; }
.stat-tile .hint .up { color: var(--success); font-weight: 600; }
.stat-tile .hint .down, table.data .down { color: var(--danger); font-weight: 600; }
table.data .up { color: var(--success); font-weight: 600; }
table.data td .btn-row .btn-sm { padding: 5px 9px; }
.divider { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---------- Skeleton loaders ---------- */
.skeleton {
  position: relative; overflow: hidden; background: #e7edf4; border-radius: 6px;
  color: transparent !important; user-select: none; pointer-events: none;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.65), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; } }
.sk-line { height: 12px; margin: 6px 0; }
.sk-line.w40 { width: 40%; } .sk-line.w60 { width: 60%; } .sk-line.w80 { width: 80%; } .sk-line.w30 { width: 30%; }
.sk-value { height: 30px; width: 55%; margin-top: 10px; }
.sk-title { height: 26px; width: 260px; max-width: 70%; margin: 6px 0; }
.sk-card { height: 118px; border-radius: 10px; }
.sk-cell { height: 12px; width: 80%; }
.sk-block { height: 180px; border-radius: 10px; }

/* ---------- Boot screen ---------- */
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.boot .mark { width: 58px; height: 58px; border-radius: 16px; background: linear-gradient(135deg, var(--gold), var(--gold-dark)); display: flex; align-items: center; justify-content: center; color: var(--navy-dark); font-weight: 800; font-size: 24px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(0.92); opacity: 0.7; } }

/* ---------- Modals ---------- */
.modal { max-height: calc(100vh - 40px); overflow-y: auto; margin: 20px; }
.modal.wide { max-width: 720px; }
.modal.mid { max-width: 540px; }
.modal-head h3 { margin: 0; }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 300; max-width: calc(100vw - 40px); }
.toast-stack .toast { display: block; position: static; animation: toastIn 0.2s ease; }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } }

/* ---------- POS extras ---------- */
.product-card .rx { float: right; }
.product-card .pexp { font-size: 11px; color: var(--warn); }
.rx-box { background: var(--warn-bg); border: 1px solid #f0dca6; border-radius: 10px; padding: 12px; margin: 10px 0; }
.rx-box label { color: var(--warn); }
.cart-row .ci-remove { border: none; background: none; color: var(--danger); cursor: pointer; font-size: 16px; padding: 0 2px; }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pay-methods button { padding: 9px 6px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--white); cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--ink-soft); }
.pay-methods button.active { border-color: var(--navy); background: var(--blue-light); color: var(--navy); }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters input[type=search] { max-width: 320px; }
.filters .pill-tabs { margin-bottom: 0; }
.pill-tabs button { padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 600; background: var(--white); border: 1.5px solid var(--line); color: var(--ink-soft); cursor: pointer; }
.pill-tabs button.active { background: var(--navy); border-color: var(--navy); color: var(--white); }

/* ---------- AI assistant ---------- */
.chat { display: flex; flex-direction: column; height: calc(100vh - 230px); min-height: 420px; }
.chat-log { flex: 1; overflow-y: auto; padding: 4px 4px 12px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 82%; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--navy); color: var(--white); border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--white); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.bot.flagged { background: var(--warn-bg); border-color: #f0dca6; }
.msg.typing { width: 220px; }
.chat-form { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.chat-form textarea { resize: none; height: 46px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.suggestions button { border: 1.5px solid var(--line); background: var(--white); border-radius: 20px; padding: 7px 14px; font-size: 12.5px; cursor: pointer; color: var(--navy); font-weight: 600; }
.suggestions button:hover { border-color: var(--gold); }
.chat-note { font-size: 11.5px; color: var(--ink-soft); margin-top: 6px; }

/* ---------- Receipt printing ---------- */
.receipt .r-logo { display: block; margin: 0 auto 6px; max-height: 48px; }
.receipt .center { text-align: center; }
.void-stamp { text-align: center; color: var(--danger); font-weight: 800; border: 2px solid var(--danger); border-radius: 6px; padding: 4px; margin-bottom: 8px; }
@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; left: 0; top: 0; width: 100%; border: none; box-shadow: none; }
  .no-print { display: none !important; }
}
.grid > .card + .card { margin-top: 0; }
.brand > div:last-child { max-width: 380px; }
.page-head input[type=date], .filters input[type=date], .filters select { width: auto; }
progress { width: 100%; height: 14px; accent-color: var(--navy); }

/* ---------- Accounting charts (single series: brand navy; recessive grid; text in ink tokens) ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--navy); }
.chart .bar:hover, .chart .hit:hover + .bar { fill: var(--navy-dark); }
.chart .hit { fill: transparent; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: #c9d3df; stroke-width: 1; }
.chart text { fill: var(--ink-soft); font-size: 11px; font-family: inherit; }
.chart text.value { fill: var(--navy-dark); font-weight: 700; }
.chart .track { fill: #eef2f7; }
.chart .bar.warn { fill: var(--gold-dark); }
.chart .bar.danger { fill: var(--danger); }
.pl-table td.amt { text-align: right; white-space: nowrap; }
.pl-table tr.total td { font-weight: 800; color: var(--navy-dark); border-top: 2px solid var(--line); }
.pl-table td.indent { padding-left: 28px; color: var(--ink-soft); }
.neg { color: var(--danger) !important; }
details.table-view summary { cursor: pointer; color: var(--navy); font-weight: 600; font-size: 13px; margin-top: 10px; }
@media print {
  .print-area .card { break-inside: avoid; }
  .print-area .grid-4 { grid-template-columns: repeat(4, 1fr); }
}
