/* Shri Bhagwati Tiles — shared design system */
:root {
  --ink: #16140f;
  --ink-2: #2a2620;
  --charcoal: #0f0e0b;
  --gold: #b8913a;
  --gold-2: #d4b062;
  --gold-soft: #f4ecd9;
  --paper: #f7f5f0;
  --surface: #ffffff;
  --line: #e6e1d6;
  --muted: #6f685b;
  --ok: #2f7a4b;
  --ok-soft: #e5f2ea;
  --warn: #a8670f;
  --warn-soft: #fbf0dc;
  --bad: #b23a2e;
  --bad-soft: #f8e4e1;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(22, 20, 15, .06), 0 4px 16px rgba(22, 20, 15, .06);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: lining-nums tabular-nums; }
h1, h2, h3, h4, .kpi .v, .size-card .name, .design .stock strong, .stats strong, .brand-name, .inv-head h2 { font-variant-numeric: lining-nums; }
.hidden { display: none !important; }

/* ---------- Buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface);
  font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover { border-color: #cfc6b3; background: #fbfaf7; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn-gold { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-gold:hover { background: #a6802f; border-color: #a6802f; }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: #e9c3bd; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn svg { width: 18px; height: 18px; flex: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184, 145, 58, .18); }
.hint { font-size: 12.5px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-muted { background: #eeebe4; color: var(--muted); }

/* ---------- Public landing page ---------- */
.site { background: var(--charcoal); color: #ece6d8; }
.site-nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 5vw, 64px);
  background: rgba(15, 14, 11, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(212, 176, 98, .15);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.brand-name { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: .3px; color: #fff; line-height: 1.1; }
.brand-sub { font-size: 11px; letter-spacing: 2.4px; text-transform: uppercase; color: var(--gold-2); }
.site-nav .links { display: flex; gap: 28px; align-items: center; }
.site-nav .links a { text-decoration: none; font-size: 14px; color: #cfc7b5; }
.site-nav .links a:hover { color: #fff; }
@media (max-width: 720px) { .site-nav .links a:not(.btn) { display: none; } }

.hero {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center;
  padding: clamp(48px, 9vw, 120px) clamp(16px, 5vw, 64px);
  max-width: 1240px; margin: 0 auto;
}
.eyebrow { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--gold-2); font-weight: 600; }
.hero h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(40px, 6vw, 72px); line-height: 1.02; margin: 16px 0 20px; color: #fff;
}
.hero h1 em { font-style: italic; color: var(--gold-2); }
.hero p { font-size: 18px; color: #bdb5a3; max-width: 560px; margin: 0 0 32px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .btn { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-ghost-light { background: transparent; color: #ece6d8; border-color: rgba(236, 230, 216, .3); }
.btn-ghost-light:hover { background: rgba(255,255,255,.06); border-color: rgba(236, 230, 216, .5); }
.hero-logo { justify-self: center; width: min(420px, 100%); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(212,176,98,.25); }
.hero-logo img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: left; }
  .hero-logo { width: 240px; order: -1; justify-self: start; }
}

.stats { display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(212,176,98,.15); border-bottom: 1px solid rgba(212,176,98,.15); }
.stats div { padding: 32px 24px; text-align: center; border-right: 1px solid rgba(212,176,98,.15); }
.stats div:last-child { border-right: 0; }
.stats strong { display: block; font-family: var(--serif); font-size: 40px; font-weight: 500; color: var(--gold-2); line-height: 1; }
.stats span { font-size: 13px; color: #a69f8e; letter-spacing: .5px; }
@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stats div:nth-child(2) { border-right: 0; }
  .stats div:nth-child(-n+2) { border-bottom: 1px solid rgba(212,176,98,.15); }
}

.section { padding: clamp(56px, 8vw, 104px) clamp(16px, 5vw, 64px); max-width: 1240px; margin: 0 auto; }
.section h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(32px, 4.5vw, 48px); margin: 12px 0 18px; color: #fff; line-height: 1.1; }
.section .lead { color: #bdb5a3; font-size: 17px; max-width: 680px; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; gap: 32px; } }
.pillars { display: grid; gap: 1px; background: rgba(212,176,98,.15); border: 1px solid rgba(212,176,98,.15); border-radius: var(--radius); overflow: hidden; }
.pillar { background: #15130f; padding: 24px; }
.pillar h3 { margin: 0 0 6px; font-family: var(--serif); font-size: 22px; font-weight: 600; color: #fff; }
.pillar p { margin: 0; color: #a69f8e; font-size: 15px; }

.contact-card { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(212,176,98,.15);
  border: 1px solid rgba(212,176,98,.15); border-radius: var(--radius); overflow: hidden; margin-top: 32px; }
.contact-card > div { background: #15130f; padding: 24px; }
.contact-card .k { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold-2); }
.contact-card .v { font-size: 17px; color: #fff; margin-top: 6px; }
@media (max-width: 720px) { .contact-card { grid-template-columns: 1fr; } }

.site-footer { padding: 28px clamp(16px, 5vw, 64px); border-top: 1px solid rgba(212,176,98,.15);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: #8a8372; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-side { background: var(--charcoal); color: #ece6d8; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-side img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; }
.login-side h1 { font-family: var(--serif); font-weight: 500; font-size: 44px; line-height: 1.05; color: #fff; margin: 24px 0 12px; }
.login-side p { color: #a69f8e; max-width: 380px; }
.login-main { display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-family: var(--serif); font-size: 32px; font-weight: 600; margin: 0 0 4px; }
.login-card form { display: grid; gap: 16px; margin-top: 28px; }
.login-card .btn { height: 46px; }
.err { color: var(--bad); font-size: 13.5px; min-height: 20px; }
@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-side { padding: 28px 16px; flex-direction: row; align-items: center; gap: 16px; }
  .login-side img { width: 56px; height: 56px; }
  .login-side h1 { font-size: 26px; margin: 0; }
  .login-side p, .login-side .foot { display: none; }
}

/* ---------- Admin shell ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--charcoal); color: #cfc7b5;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 18px 14px;
}
.sidebar .brand { padding: 4px 6px 22px; border-bottom: 1px solid rgba(212,176,98,.15); margin-bottom: 14px; }
.sidebar .brand-name { font-size: 19px; }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
  text-decoration: none; font-size: 14.5px; font-weight: 500; color: #bdb5a3;
}
.nav a svg { width: 19px; height: 19px; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a.active { background: rgba(212,176,98,.14); color: var(--gold-2); }
.sidebar .spacer { flex: 1; }
.sidebar .who { font-size: 12.5px; color: #8a8372; padding: 10px 12px; border-top: 1px solid rgba(212,176,98,.15); }
.sidebar .who button { margin-top: 8px; width: 100%; background: transparent; color: #cfc7b5; border-color: rgba(236,230,216,.2); }
.sidebar .who button:hover { background: rgba(255,255,255,.05); }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 5; height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 28px; background: rgba(247,245,240,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-family: var(--serif); font-size: 26px; font-weight: 600; margin: 0; }
.topbar .actions { display: flex; gap: 8px; }
.content { padding: 24px 28px 120px; max-width: 1280px; }

.mobile-nav { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar { padding: 0 16px; height: 58px; }
  .topbar h1 { font-size: 22px; }
  .content { padding: 16px 16px 120px; }
  .mobile-nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
    background: var(--charcoal); border-top: 1px solid rgba(212,176,98,.2);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 0 8px;
    font-size: 11px; color: #a69f8e; text-decoration: none; }
  .mobile-nav a svg { width: 21px; height: 21px; }
  .mobile-nav a.active { color: var(--gold-2); }
}

/* ---------- Cards, KPIs, tables ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-h h3 { margin: 0; font-size: 16px; font-weight: 700; }
.card-b { padding: 18px; }
.stack { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { padding: 18px; }
.kpi .k { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.kpi .v { font-family: var(--serif); font-size: 36px; font-weight: 600; line-height: 1.1; margin-top: 6px; }
.kpi .s { font-size: 13px; color: var(--muted); }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi .v { font-size: 30px; } }

.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 1080px) { .two-col { grid-template-columns: minmax(0, 1fr); } }

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted);
  font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fbfaf7; white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid #f0ece3; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl tbody tr:hover { background: #fcfbf8; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .input { max-width: 300px; }
.toolbar select.input { max-width: 200px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  font-size: 13.5px; font-weight: 600; cursor: pointer; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .c { opacity: .6; margin-left: 4px; font-weight: 500; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty h4 { font-family: var(--serif); font-size: 24px; color: var(--ink); margin: 0 0 6px; font-weight: 600; }

/* sizes */
.size-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.size-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.size-card .name { font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1; }
.size-card .meta { font-size: 13px; color: var(--muted); }
.size-card .row { display: flex; justify-content: space-between; align-items: center; }
.size-card .foot { display: flex; gap: 6px; margin-top: 4px; }

/* designs */
.design-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.design { overflow: hidden; display: flex; flex-direction: column; }
.design .ph { aspect-ratio: 1; background: #efebe2; position: relative; }
.design .ph img { width: 100%; height: 100%; object-fit: cover; }
.design .ph .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: #c9c0ad; font-size: 13px; }
.design .ph .noimg svg, .uploader .ph svg { width: 36px; height: 36px; }
@media (max-width: 640px) {
  .design-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .design .body { padding: 10px 10px 12px; }
  .design .title { font-size: 14px; }
  .design .stock strong { font-size: 24px; }
  .design .acts { padding: 0 10px 10px; }
  .design .acts .btn { font-size: 12.5px; padding: 0 6px; }
}
.design .ph .badge { position: absolute; top: 10px; left: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.design .body { padding: 12px 14px 14px; display: grid; gap: 4px; }
.design .title { font-weight: 700; font-size: 15px; }
.design .meta { font-size: 13px; color: var(--muted); }
.design .stock { display: flex; align-items: baseline; justify-content: space-between; margin-top: 6px; }
.design .stock strong { font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 1; }
.design .acts { display: flex; gap: 6px; padding: 0 14px 14px; }
.design .acts .btn { flex: 1; }

/* bill builder */
.bill-items { display: grid; gap: 10px; }
.bill-row { display: grid; grid-template-columns: 1.1fr 1.6fr 90px 110px 110px 36px; gap: 8px; align-items: end;
  padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fcfbf8; }
.bill-row .amt { height: 42px; display: flex; align-items: center; justify-content: flex-end; font-weight: 700; }
.bill-row .avail { font-size: 12px; color: var(--muted); grid-column: 1 / -1; margin-top: -2px; }
.bill-row .avail.bad { color: var(--bad); }
@media (max-width: 760px) {
  .bill-row { grid-template-columns: 1fr 1fr; }
  .bill-row .f-design { grid-column: 1 / -1; order: -1; }
  .bill-row .f-size { grid-column: 1 / -1; order: -2; }
  .bill-row .amt { justify-content: flex-start; }
}
.totals { display: grid; gap: 8px; margin-left: auto; max-width: 340px; font-size: 15px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-size: 20px; font-weight: 700; padding-top: 10px; border-top: 1px solid var(--line); }

/* ---------- Modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15,14,11,.55); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.modal.wide { max-width: 860px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-h h3 { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 600; }
.modal-b { padding: 20px; display: grid; gap: 14px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (max-width: 640px) {
  .modal-bg { align-items: flex-end; padding: 0; }
  .modal { border-radius: 14px 14px 0 0; max-height: 92vh; }
}

.toast-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; box-shadow: var(--shadow); animation: tin .2s ease-out; }
.toast.bad { background: var(--bad); }
@keyframes tin { from { opacity: 0; transform: translateY(-6px); } }

.uploader { border: 1.5px dashed #d6cdb9; border-radius: 10px; padding: 16px; display: flex; gap: 14px; align-items: center; cursor: pointer; background: #fcfbf8; }
.uploader:hover { border-color: var(--gold); }
.uploader img, .uploader .ph { width: 84px; height: 84px; border-radius: 8px; object-fit: cover; background: #efebe2; flex: none; }

/* stepper */
.stepper { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stepper button { width: 42px; border: 0; background: #fbfaf7; cursor: pointer; font-size: 18px; }
.stepper input { width: 90px; border: 0; text-align: center; height: 42px; outline: none; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }

/* ---------- Invoice (screen preview + print) ---------- */
.invoice { background: #fff; color: #111; font-size: 13px; padding: 28px; }
.inv-head { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 2px solid #111; }
.inv-head .b { display: flex; gap: 14px; align-items: center; }
.inv-head img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.inv-head h2 { font-family: var(--serif); font-size: 28px; margin: 0; line-height: 1; }
.inv-head .addr { color: #444; font-size: 12.5px; margin-top: 4px; }
.inv-title { text-align: right; }
.inv-title .t { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: #666; font-weight: 700; }
.inv-title .n { font-size: 18px; font-weight: 700; margin-top: 4px; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid #ddd; }
.inv-parties .k { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #777; font-weight: 700; margin-bottom: 4px; }
.invoice table { width: 100%; border-collapse: collapse; margin-top: 14px; }
.invoice thead tr { background: #111; }
.invoice tr { break-inside: avoid; page-break-inside: avoid; }
.invoice th { background: #111; color: #fff; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; padding: 8px; text-align: left; }
.invoice td { padding: 8px; border-bottom: 1px solid #e5e5e5; }
.invoice .r { text-align: right; }
.inv-foot { display: grid; grid-template-columns: 1fr 280px; gap: 24px; margin-top: 16px; }
.inv-foot .tot div { display: flex; justify-content: space-between; padding: 4px 0; }
.inv-foot .tot .g { font-size: 16px; font-weight: 700; border-top: 2px solid #111; margin-top: 6px; padding-top: 8px; }
.inv-sign { margin-top: 36px; display: flex; justify-content: space-between; align-items: flex-end; font-size: 12px; color: #444; }
/* Phone layout only for the on-screen preview; PDF and print always use the A4 layout. */
@media (max-width: 640px) {
  .modal .invoice { padding: 16px; font-size: 12px; }
  .modal .inv-head, .modal .inv-parties, .modal .inv-foot { grid-template-columns: 1fr; flex-direction: column; }
  .modal .inv-title { text-align: left; }
}

/* ---------- Chatbot ---------- */
.chat-fab { position: fixed; right: 20px; bottom: 20px; z-index: 30; width: 58px; height: 58px; border-radius: 50%;
  border: 0; background: var(--gold); color: #fff; cursor: pointer; box-shadow: 0 10px 30px rgba(184,145,58,.45);
  display: grid; place-items: center; }
.chat-fab svg { width: 26px; height: 26px; }
@media (max-width: 900px) { .chat-fab { bottom: 84px; right: 16px; } }
.chat { position: fixed; right: 20px; bottom: 92px; z-index: 40; width: 380px; height: 540px; max-height: calc(100vh - 120px);
  background: #fff; border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.25); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); }
@media (max-width: 640px) { .chat { inset: 0; width: auto; height: auto; max-height: none; border-radius: 0; } }
.chat-h { background: var(--charcoal); color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.chat-h img { width: 36px; height: 36px; border-radius: 50%; }
.chat-h .t { font-weight: 700; }
.chat-h .s { font-size: 12px; color: var(--gold-2); }
.chat-h .x { margin-left: auto; background: transparent; border: 0; color: #fff; cursor: pointer; padding: 6px; }
.chat-h .x svg { width: 20px; height: 20px; }
.chat-h .spk { background: transparent; border: 1px solid rgba(255,255,255,.2); color: #cfc7b5; border-radius: 6px; padding: 4px 8px; font-size: 12px; cursor: pointer; }
.chat-h .spk.on { color: var(--gold-2); border-color: var(--gold-2); }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); }
.msg { max-width: 86%; padding: 10px 13px; border-radius: 12px; font-size: 14.5px; white-space: pre-line; }
.msg.bot { background: #fff; border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.me { background: var(--ink); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-sugg { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; border-top: 1px solid var(--line); background: #fff; }
.chat-sugg button { flex: none; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: #fbfaf7; font-size: 12.5px; cursor: pointer; }
.chat-in { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: #fff; }
.chat-in .input { height: 44px; }
.mic { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; display: grid; place-items: center; }
.mic svg { width: 20px; height: 20px; }
.mic.rec { background: var(--bad); border-color: var(--bad); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(178,58,46,.4); } 50% { box-shadow: 0 0 0 8px rgba(178,58,46,0); } }

@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea { position: absolute; left: 0; top: 0; width: 100%; }
}

/* ---------- Bill window actions ---------- */
.modal-f .bill-manage { display: flex; gap: 6px; flex-wrap: wrap; margin-right: auto; }
.modal-f .bill-out { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .modal-f { flex-direction: column; align-items: stretch; }
  .modal-f .bill-manage, .modal-f .bill-out { margin: 0; }
  .modal-f .bill-manage .btn, .modal-f .bill-out .btn { flex: 1; }
}

/* ---------- Danger zone ---------- */
.danger { border-color: #ecc9c3; }
.danger .card-h { background: #fdf6f5; border-bottom-color: #f2d9d4; }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid #f3eee6; }
.danger-row:last-child { border-bottom: 0; padding-bottom: 0; }
.danger-row:first-child { padding-top: 0; }
.danger-row strong { display: block; }
@media (max-width: 640px) { .danger-row { flex-direction: column; align-items: stretch; } }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.choice:hover { border-color: var(--gold); }
.choice input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--gold); flex: none; }
.choice.on { border-color: var(--gold); background: var(--gold-soft); }

/* ---------- Chat typing indicator ---------- */
.msg.typing { color: var(--muted); font-style: italic; }
.chat-h .ai { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--gold-2); border: 1px solid rgba(212,176,98,.4); border-radius: 4px; padding: 1px 5px; margin-left: 6px; }

/* ---------- PDF pages ---------- */
.inv-page-no { font-size: 11px; color: #666; margin-top: 4px; }
.inv-cont-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 10px; border-bottom: 2px solid #111; font-size: 12.5px; }
.inv-cont-head span { color: #555; }
.inv-cont-note { text-align: right; font-size: 12px; color: #666; font-style: italic; margin-top: 12px; }
