/* =====================================================================
   Tirth Management System - Design System
   Theme: Jain temple heritage - saffron, sandstone, maroon & gold
   ===================================================================== */
:root {
  --saffron: #e8710a;
  --saffron-600: #cc5f04;
  --saffron-50: #fff4e8;
  --saffron-100: #ffe3c4;
  --maroon: #7a1e2c;
  --maroon-700: #5c1420;
  --maroon-900: #3a0b13;
  --gold: #c99a2e;
  --gold-soft: #f3e2b5;
  --sand: #fbf7f0;
  --sand-2: #f4ede1;
  --ink: #2a1f18;
  --ink-2: #5b4d42;
  --muted: #8b7d71;
  --line: #ece3d5;
  --line-2: #e0d4c1;
  --white: #ffffff;
  --green: #1f8a4c;
  --green-50: #e7f6ed;
  --red: #c62f3a;
  --red-50: #fdecee;
  --amber: #c98a06;
  --amber-50: #fdf5df;
  --blue: #2563c9;
  --blue-50: #e9f0fd;
  --purple: #7046c7;
  --purple-50: #f1ebfd;
  --teal: #0f8a8a;
  --teal-50: #e3f5f5;
  --gray-50: #f3f1ee;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(58, 11, 19, .06);
  --shadow: 0 1px 2px rgba(58, 11, 19, .05), 0 6px 18px -6px rgba(58, 11, 19, .12);
  --shadow-lg: 0 20px 50px -12px rgba(58, 11, 19, .28);
  --font: 'Mukta', 'Nirmala UI', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --sidebar-w: 268px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--sand); -webkit-font-smoothing: antialiased; }
a { color: var(--saffron-600); text-decoration: none; }
a:hover { color: var(--maroon); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--ink); }
p { margin: 0 0 .6em; }
hr { border: 0; border-top: 1px dashed var(--line-2); margin: 18px 0; }
.ic { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; }
.ic-sm { width: 15px; height: 15px; }
.ic-xs { width: 12px; height: 12px; }
.ic-lg { width: 24px; height: 24px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.hi { font-family: var(--font); }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; }
.hidden { display: none !important; }
.text-green { color: var(--green); } .text-red { color: var(--red); } .text-amber { color: var(--amber); } .text-saffron { color: var(--saffron); } .text-maroon { color: var(--maroon); }
.fw-6 { font-weight: 600; } .fw-7 { font-weight: 700; }

/* ---------------- App shell ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; position: fixed; inset: 0 auto 0 0; z-index: 40;
  background: radial-gradient(120% 60% at 0% 0%, #8e2635 0%, transparent 60%), linear-gradient(180deg, var(--maroon-700) 0%, var(--maroon-900) 100%);
  color: #f6e7d7; display: flex; flex-direction: column; transition: transform .25s ease;
}
.sidebar::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M20 4l4 8 8 4-8 4-4 8-4-8-8-4 8-4z' fill='%23f3e2b5'/%3E%3C/svg%3E"); }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 18px; color: #fff; border-bottom: 1px solid rgba(243, 226, 181, .12); position: relative; z-index: 1; }
.brand:hover { color: #fff; }
.brand-logo { width: 46px; height: 46px; border-radius: 50%; background: #fff7e8; padding: 3px; box-shadow: 0 0 0 2px var(--gold), 0 6px 14px rgba(0,0,0,.3); }
.brand-text strong { display: block; font-family: var(--font-display); font-size: 18px; letter-spacing: .2px; color: var(--gold-soft); }
.brand-text small { display: block; font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; color: rgba(246, 231, 215, .65); }
.nav { flex: 1; overflow-y: auto; padding: 14px 12px; position: relative; z-index: 1; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.nav-link, .nav-group-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 10px; color: #f6e7d7; font: inherit; font-weight: 600; font-size: 14.5px; background: none; border: 0; cursor: pointer; text-align: left; }
.nav-link:hover, .nav-group-btn:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-link.active { background: linear-gradient(90deg, var(--saffron), #f08a2a); color: #fff; box-shadow: 0 6px 16px -6px rgba(232,113,10,.7); }
.nav-group { margin-top: 4px; }
.nav-group-btn span { flex: 1; display: flex; flex-direction: column; line-height: 1.15; }
.nav-group-btn small { font-weight: 400; font-size: 11.5px; color: rgba(246,231,215,.55); margin-top: 2px; }
.nav-group-btn .chev { width: 15px; height: 15px; transition: transform .2s; opacity: .6; }
.nav-group.open .nav-group-btn .chev { transform: rotate(180deg); }
.nav-group.open > .nav-group-btn { color: var(--gold-soft); }
.nav-sub { display: none; padding: 4px 0 8px 18px; margin-left: 20px; border-left: 1px dashed rgba(243,226,181,.2); }
.nav-group.open .nav-sub { display: block; }
.nav-sublink { display: flex; align-items: center; gap: 10px; padding: 7px 10px; margin: 1px 0; border-radius: 8px; font-size: 13.8px; color: rgba(246,231,215,.78); }
.nav-sublink .ic { width: 15px; height: 15px; opacity: .75; }
.nav-sublink:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-sublink.active { color: #fff; background: rgba(232,113,10,.28); box-shadow: inset 3px 0 0 var(--saffron); font-weight: 600; }
.sidebar-foot { padding: 12px 20px; font-size: 12px; color: rgba(246,231,215,.5); border-top: 1px solid rgba(243,226,181,.1); position: relative; z-index: 1; }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; padding: 10px 28px; background: rgba(251,247,240,.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); min-height: 66px; }
.topbar-title { flex: 1; min-width: 0; }
.trust-hi { font-weight: 700; font-size: 16px; color: var(--maroon); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trust-en { font-size: 12.5px; color: var(--muted); letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-date { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); background: #fff; border: 1px solid var(--line); padding: 7px 12px; border-radius: 999px; }
.topbar-date .ic { color: var(--saffron); width: 16px; height: 16px; }
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; width: 40px; height: 40px; display: inline-grid; place-items: center; cursor: pointer; color: var(--ink); }
.only-mobile { display: none; }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: #fff; padding: 5px 10px 5px 5px; border-radius: 999px; cursor: pointer; font: inherit; color: var(--ink); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--saffron), var(--maroon)); }
.user-meta { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.user-meta strong { font-size: 13.5px; }
.user-meta small { font-size: 11.5px; color: var(--muted); }
.dropdown { display: none; position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 200px; padding: 6px; z-index: 50; }
.dropdown.show { display: block; }
.dropdown a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 8px; color: var(--ink); font-size: 14px; }
.dropdown a:hover { background: var(--saffron-50); color: var(--saffron-600); }
.content { padding: 24px 28px 40px; flex: 1; width: 100%; max-width: 1600px; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 16px 28px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); display: inline-flex; }
.crumbs a:hover { color: var(--saffron-600); }
.crumbs span { color: var(--ink-2); font-weight: 600; }
.sidebar-backdrop { display: none; }

/* ---------------- Page header ---------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.2px; display: flex; align-items: center; gap: 12px; }
.page-head h1 .ic { width: 30px; height: 30px; padding: 6px; border-radius: 10px; color: var(--saffron-600); background: var(--saffron-100); box-sizing: content-box; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: 14.5px; }
.page-head .sub .hi { color: var(--maroon); font-weight: 600; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- Grid ---------------- */
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }

/* ---------------- KPI cards ---------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { --c: var(--saffron); --cb: var(--saffron-50); position: relative; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 6px; transition: transform .15s, box-shadow .15s; }
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi::before { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--cb); }
.kpi-icon { position: absolute; right: 16px; top: 16px; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--c); box-shadow: 0 8px 16px -8px var(--c); }
.kpi-icon .ic { width: 22px; height: 22px; }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; position: relative; padding-right: 50px; }
.kpi-value { font-size: 27px; font-weight: 800; color: var(--ink); position: relative; letter-spacing: -.3px; line-height: 1.15; }
.kpi-foot { font-size: 12.5px; color: var(--muted); position: relative; }
.k-saffron { --c: var(--saffron); --cb: var(--saffron-50); }
.k-maroon { --c: var(--maroon); --cb: #fbeef0; }
.k-green { --c: var(--green); --cb: var(--green-50); }
.k-blue { --c: var(--blue); --cb: var(--blue-50); }
.k-gold { --c: var(--gold); --cb: #fbf3dd; }
.k-red { --c: var(--red); --cb: var(--red-50); }
.k-purple { --c: var(--purple); --cb: var(--purple-50); }
.k-teal { --c: var(--teal); --cb: var(--teal-50); }
.k-gray { --c: #7d7268; --cb: var(--gray-50); }

/* ---------------- Cards ---------------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 18px; min-width: 0; }
.grid > .card { margin-bottom: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head h3 .ic { color: var(--saffron); }
.card-head h3 small { font-weight: 500; color: var(--muted); font-size: 13px; }
.card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-body { padding: 18px; }
.card-body.p-0, .card-flush .card-body { padding: 0; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line); background: #fdfbf7; border-radius: 0 0 var(--radius) var(--radius); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--maroon); margin: 6px 0 12px; display: flex; align-items: center; gap: 10px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }

/* ---------------- Forms ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid.cols-1 { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field label .hi, .label .hi { color: var(--muted); font-weight: 500; }
.req { color: var(--red); }
.help { font-size: 12px; color: var(--muted); }
input[type=text], input[type=number], input[type=email], input[type=password], input[type=date], input[type=datetime-local], input[type=time], input[type=tel], input[type=search], input[type=file], select, textarea {
  width: 100%; font: inherit; font-size: 14.5px; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 9px 12px; min-height: 40px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 76px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--saffron); box-shadow: 0 0 0 3px rgba(232,113,10,.15); }
input[readonly], input[disabled], select[disabled] { background: var(--sand); color: var(--ink-2); }
input.input-lg { font-size: 20px; font-weight: 700; min-height: 50px; }
input.amount { text-align: right; font-variant-numeric: tabular-nums; }
.input-group { display: flex; }
.input-group > * { border-radius: 0 !important; }
.input-group > :first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important; }
.input-group > :last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important; }
.input-group .addon { display: grid; place-items: center; padding: 0 12px; background: var(--sand-2); border: 1px solid var(--line-2); color: var(--ink-2); font-weight: 600; font-size: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check input { width: 17px; height: 17px; accent-color: var(--saffron); }
.radio-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-pills label { position: relative; cursor: pointer; }
.radio-pills input { position: absolute; opacity: 0; }
.radio-pills span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); background: #fff; transition: all .15s; }
.radio-pills input:checked + span { background: var(--saffron); border-color: var(--saffron); color: #fff; box-shadow: 0 6px 14px -6px rgba(232,113,10,.8); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-2); }

/* ---------------- Buttons ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: 14.5px; line-height: 1; padding: 10px 16px; min-height: 40px; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; transition: all .15s; white-space: nowrap; color: var(--ink); background: #fff; text-decoration: none; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn .ic { width: 17px; height: 17px; }
.btn-primary { background: linear-gradient(180deg, #f07f1d, var(--saffron-600)); color: #fff; box-shadow: 0 6px 14px -6px rgba(204,95,4,.7), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-primary:hover { color: #fff; filter: brightness(1.05); }
.btn-maroon { background: linear-gradient(180deg, #8f2737, var(--maroon-700)); color: #fff; box-shadow: 0 6px 14px -6px rgba(92,20,32,.7); }
.btn-maroon:hover { color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { color: #fff; filter: brightness(1.08); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { color: #fff; filter: brightness(1.08); }
.btn-secondary { background: #fff; border-color: var(--line-2); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--saffron); color: var(--saffron-600); }
.btn-outline { background: transparent; border-color: var(--saffron); color: var(--saffron-600); }
.btn-outline:hover { background: var(--saffron-50); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--sand-2); color: var(--ink); }
.btn-sm { padding: 6px 10px; min-height: 32px; font-size: 13px; border-radius: 8px; }
.btn-sm .ic { width: 15px; height: 15px; }
.btn-xs { padding: 4px 8px; min-height: 26px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn-xs .ic { width: 13px; height: 13px; }
.btn-lg { padding: 14px 22px; min-height: 50px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { padding: 0; width: 34px; min-height: 34px; height: 34px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------- Tables ---------------- */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-2); background: #fbf6ee; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover td { background: #fffaf3; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 800; background: #fbf6ee; border-top: 2px solid var(--line-2); }
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .center { text-align: center; }
.table tr.row-muted td { color: var(--muted); text-decoration: line-through; }
.table tr.row-alert td { background: var(--red-50); }
.table tr.row-warn td { background: var(--amber-50); }
.table-compact td, .table-compact th { padding: 7px 10px; }
.table input, .table select { min-height: 34px; padding: 6px 9px; font-size: 14px; }
.cell-title { font-weight: 600; color: var(--ink); }
.cell-sub { font-size: 12.5px; color: var(--muted); }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .ic { width: 46px; height: 46px; color: var(--gold); margin-bottom: 10px; }
.empty-state h3 { color: var(--ink); margin-bottom: 6px; }
.empty-state.small { padding: 22px; font-size: 14px; }
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 12px 16px; flex-wrap: wrap; }
.pager-info { margin-right: auto; font-size: 13px; color: var(--muted); }
.pager a { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; font-size: 13px; background: #fff; }
.pager a.active { background: var(--saffron); border-color: var(--saffron); color: #fff; }

/* Fund head entry grid (Bhent / Corpus) */
.head-table td { padding: 7px 12px; }
.head-table .code { width: 70px; font-weight: 700; color: var(--maroon); text-align: center; }
.head-table .grp td { background: linear-gradient(90deg, var(--saffron-50), #fff); font-weight: 700; color: var(--maroon); font-size: 14.5px; }
.head-table input.amount { max-width: 170px; margin-left: auto; display: block; }
.total-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; border-radius: 12px; background: linear-gradient(135deg, var(--maroon-700), var(--maroon)); color: #fff; margin-top: 16px; flex-wrap: wrap; }
.total-bar .lbl { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--gold-soft); }
.total-bar .amt { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.total-bar .words { font-size: 13px; color: rgba(255,255,255,.75); }

/* ---------------- Badges / chips ---------------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.4; white-space: nowrap; }
.b-green { background: var(--green-50); color: var(--green); }
.b-red { background: var(--red-50); color: var(--red); }
.b-amber { background: var(--amber-50); color: #9a6a00; }
.b-blue { background: var(--blue-50); color: var(--blue); }
.b-purple { background: var(--purple-50); color: var(--purple); }
.b-teal { background: var(--teal-50); color: var(--teal); }
.b-saffron { background: var(--saffron-100); color: var(--saffron-600); }
.b-maroon { background: #f8e4e7; color: var(--maroon); }
.b-gray { background: var(--gray-50); color: #6d625a; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.chip.active { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ---------------- Tabs / filter bar ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab { padding: 10px 16px; font-weight: 600; font-size: 14.5px; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--saffron-600); border-bottom-color: var(--saffron); }
.tab .badge { font-size: 11px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fdfbf7; }
.filter-bar .field { min-width: 150px; }
.filter-bar .field.grow { flex: 1; min-width: 200px; }

/* ---------------- Alerts ---------------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; font-size: 14.5px; border: 1px solid; }
.alert > .ic { margin-top: 2px; }
.alert > div { flex: 1; }
.alert-x { border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; opacity: .5; }
.alert-success { background: var(--green-50); border-color: #bfe5cd; color: #12623a; }
.alert-error { background: var(--red-50); border-color: #f5c2c7; color: #8f1f28; }
.alert-info { background: var(--blue-50); border-color: #c5d6f6; color: #1d4a99; }
.alert-warn { background: var(--amber-50); border-color: #f1dc9c; color: #7a5600; }

/* ---------------- Modal ---------------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-start; justify-content: center; padding: 6vh 16px; background: rgba(42, 12, 18, .5); backdrop-filter: blur(3px); overflow-y: auto; }
.modal.show { display: flex; animation: fade .15s ease; }
.modal-box { background: #fff; border-radius: 16px; width: 100%; max-width: 620px; box-shadow: var(--shadow-lg); animation: pop .18s ease; }
.modal-box.lg { max-width: 900px; }
.modal-box.sm { max-width: 440px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; display: flex; gap: 8px; align-items: center; }
.modal-head h3 .ic { color: var(--saffron); }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fdfbf7; border-radius: 0 0 16px 16px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------- Lists, progress, charts ---------------- */
.stat-list { list-style: none; margin: 0; padding: 0; }
.stat-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.stat-list li:last-child { border-bottom: 0; }
.stat-list .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.progress { height: 8px; border-radius: 999px; background: var(--sand-2); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--saffron), var(--gold)); }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 220px; padding: 10px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bar { width: 100%; max-width: 46px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #f39a45, var(--saffron-600)); box-shadow: inset 0 1px 0 rgba(255,255,255,.3); transition: height .4s; }
.bar-col:hover .bar { background: linear-gradient(180deg, #a83445, var(--maroon)); }
.bar-val { font-size: 11px; font-weight: 700; color: var(--ink-2); margin-bottom: 4px; white-space: nowrap; }
.bar-label { font-size: 11.5px; color: var(--muted); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--saffron); box-shadow: 0 0 0 3px var(--saffron-100); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 1px; background: var(--line-2); }
.timeline li:last-child::after { display: none; }
.quick-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.quick-link { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; font-size: 14px; transition: all .15s; }
.quick-link .ic { width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: var(--saffron-50); color: var(--saffron-600); box-sizing: border-box; }
.quick-link:hover { border-color: var(--saffron); color: var(--saffron-600); transform: translateY(-2px); box-shadow: var(--shadow); }

/* ---------------- Room board ---------------- */
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.block-title { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; font-weight: 700; color: var(--maroon); }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.room-tile { --rc: var(--green); --rb: var(--green-50); position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--rb); border: 1px solid transparent; border-top: 4px solid var(--rc); color: var(--ink); cursor: pointer; transition: all .15s; min-height: 86px; text-align: left; font: inherit; }
.room-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.room-tile .rno { font-size: 20px; font-weight: 800; line-height: 1.1; }
.room-tile .rtype { font-size: 11.5px; color: var(--ink-2); }
.room-tile .rguest { font-size: 12px; font-weight: 600; color: var(--rc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: auto; }
.room-tile .ac-tag { position: absolute; right: 8px; top: 8px; font-size: 10px; font-weight: 800; color: var(--blue); }
.st-vacant { --rc: var(--green); --rb: var(--green-50); }
.st-occupied { --rc: var(--red); --rb: var(--red-50); }
.st-reserved { --rc: var(--blue); --rb: var(--blue-50); }
.st-dirty { --rc: var(--amber); --rb: var(--amber-50); }
.st-blocked { --rc: #6d625a; --rb: #ece8e4; }
.st-late { box-shadow: 0 0 0 2px var(--red); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(198,47,58,.2); } }

/* ---------------- Coupon (bhojan) ---------------- */
.coupon-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.coupon-cat { position: relative; cursor: pointer; }
.coupon-cat input { position: absolute; opacity: 0; }
.coupon-cat .cc { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 12px; border: 2px dashed var(--line-2); background: #fff; transition: all .15s; }
.coupon-cat .cc strong { font-size: 15px; }
.coupon-cat .cc .price { font-size: 20px; font-weight: 800; color: var(--saffron-600); }
.coupon-cat input:checked + .cc { border-style: solid; border-color: var(--saffron); background: var(--saffron-50); box-shadow: 0 8px 18px -10px rgba(232,113,10,.7); }
.coupon-print { border: 2px dashed var(--ink); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; page-break-inside: avoid; }

/* ---------------- Login ---------------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--sand); }
.login-art { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(80% 60% at 20% 10%, rgba(232,113,10,.55), transparent 60%), radial-gradient(60% 50% at 90% 90%, rgba(201,154,46,.45), transparent 60%), linear-gradient(160deg, var(--maroon) 0%, var(--maroon-900) 100%); }
.login-art::after { content: ""; position: absolute; inset: 0; opacity: .08; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath d='M30 6l6 12 12 6-12 6-6 12-6-12-12-6 12-6z' fill='%23fff'/%3E%3C/svg%3E"); }
.login-art > * { position: relative; z-index: 1; }
.login-art .lg-logo { width: 96px; height: 96px; border-radius: 50%; background: #fff7e8; padding: 5px; box-shadow: 0 0 0 3px var(--gold), 0 20px 40px rgba(0,0,0,.35); }
.login-art h1 { color: #fff; font-family: var(--font-display); font-size: 40px; margin: 24px 0 8px; }
.login-art .hi-name { font-size: 22px; color: var(--gold-soft); font-weight: 700; }
.login-art p { color: rgba(255,255,255,.75); max-width: 460px; font-size: 16px; }
.login-mods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 480px; }
.login-mods div { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); font-weight: 600; font-size: 14px; }
.login-mods .ic { color: var(--gold-soft); }
.login-form-wrap { display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 410px; }
.login-card h2 { font-size: 28px; font-weight: 800; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); margin-bottom: 26px; }
.login-card .field { margin-bottom: 16px; }

/* ---------------- Print documents ---------------- */
.print-body { background: #e9e4dc; }
.print-toolbar { position: sticky; top: 0; z-index: 5; display: flex; gap: 10px; justify-content: center; padding: 12px; background: rgba(255,255,255,.9); border-bottom: 1px solid var(--line); }
.print-sheet { background: #fff; margin: 24px auto; padding: 28px 32px; box-shadow: var(--shadow-lg); color: #111; }
.size-a4 .print-sheet { width: 210mm; min-height: 280mm; }
.size-a5 .print-sheet { width: 148mm; min-height: 200mm; padding: 18px 22px; font-size: 13.5px; }
.size-a4l .print-sheet { width: 297mm; }
.size-thermal .print-sheet { width: 80mm; padding: 10px 12px; font-size: 12.5px; }
.letterhead { display: flex; align-items: center; gap: 16px; padding-bottom: 12px; border-bottom: 3px double var(--maroon); }
.lh-logo { width: 72px; height: 72px; }
.lh-text { flex: 1; text-align: center; }
.lh-jai { font-size: 12px; color: var(--saffron-600); font-weight: 600; letter-spacing: .5px; }
.lh-hi { font-size: 21px; font-weight: 800; color: var(--maroon); line-height: 1.2; }
.lh-en { font-size: 13.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: #333; }
.lh-addr, .lh-reg { font-size: 11.5px; color: #555; }
.size-thermal .letterhead { flex-direction: column; gap: 4px; }
.size-thermal .lh-logo { width: 44px; height: 44px; }
.size-thermal .lh-hi { font-size: 15px; }
.size-thermal .lh-en { font-size: 10.5px; }
.doc-title { text-align: center; margin: 12px 0; }
.doc-title span { display: inline-block; padding: 5px 22px; border: 1.5px solid var(--maroon); border-radius: 999px; font-weight: 800; color: var(--maroon); letter-spacing: .5px; font-size: 14.5px; }
.doc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; margin: 10px 0 14px; font-size: 13.5px; }
.doc-meta div { display: flex; gap: 8px; border-bottom: 1px dotted #bbb; padding: 3px 0; }
.doc-meta b { min-width: 110px; color: #444; font-weight: 600; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 8px 0; }
.doc-table th, .doc-table td { border: 1px solid #999; padding: 6px 8px; }
.doc-table th { background: #f5ede0; text-align: left; font-weight: 700; }
.doc-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc-table tfoot td { font-weight: 800; background: #faf5ec; }
.doc-words { margin: 10px 0; padding: 8px 12px; background: #faf5ec; border-left: 4px solid var(--saffron); font-size: 13.5px; font-weight: 600; }
.doc-note { font-size: 11.5px; color: #555; margin-top: 10px; }
.doc-sign { display: flex; justify-content: space-between; margin-top: 44px; font-size: 13px; }
.doc-sign div { text-align: center; min-width: 150px; border-top: 1px solid #333; padding-top: 4px; }
.cancel-stamp { position: relative; }
.cancel-stamp::after { content: "CANCELLED"; position: absolute; top: 40%; left: 50%; transform: translate(-50%,-50%) rotate(-20deg); font-size: 72px; font-weight: 900; color: rgba(198,47,58,.25); border: 6px solid rgba(198,47,58,.25); padding: 0 24px; border-radius: 12px; pointer-events: none; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1200px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
  .main { margin-left: 0; }
  .only-mobile { display: inline-grid; }
  .topbar { padding: 10px 16px; }
  .topbar-date, .user-meta { display: none; }
  .content { padding: 18px 16px 30px; }
  .g-2, .g-3, .g-2-1, .g-1-2 { grid-template-columns: 1fr; }
  .form-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-page { grid-template-columns: 1fr; }
  .login-art { display: none; }
}
@media (max-width: 620px) {
  .g-4, .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .page-head h1 { font-size: 22px; }
  .doc-meta { grid-template-columns: 1fr; }
}

/* ---------------- Print ---------------- */
@media print {
  @page { margin: 10mm; }
  body, .print-body { background: #fff !important; }
  .no-print, .print-toolbar, .sidebar, .topbar, .footer, .crumbs, .page-head .actions, .filter-bar, .pager, .btn { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; max-width: none; }
  .print-sheet { margin: 0 !important; box-shadow: none !important; width: auto !important; min-height: 0 !important; padding: 0 !important; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .table th { position: static; }
  a { color: inherit; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
