/* =====================================================================
   EventBook — application styles
   ===================================================================== */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --line: #e4e8f1;
  --line-strong: #d3dae8;
  --text: #111827;
  --text-2: #344054;
  --muted: #697586;
  --primary: #4f46e5;
  --primary-600: #4338ca;
  --primary-soft: #eef2ff;
  --success: #059669;
  --success-soft: #ecfdf5;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --info: #0284c7;
  --info-soft: #f0f9ff;
  --rose: #e11d48;
  --sidebar: #0d1526;
  --sidebar-2: #111d35;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 12px 28px -20px rgba(16, 24, 40, .28);
  --shadow-lg: 0 24px 60px -28px rgba(15, 23, 42, .38);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: #c7d2fe; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  pointer-events: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.muted { color: var(--muted); }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.ml-1 { margin-left: 6px; }

/* ---------------------------------------------------------------------
   App shell
   --------------------------------------------------------------------- */
.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 252px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  transition: transform .22s ease;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(79, 70, 229, .28), transparent 60%),
    linear-gradient(180deg, var(--sidebar-2), var(--sidebar));
  color: #cbd5e1;
  border-right: 1px solid rgba(255, 255, 255, .05);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.brand-link { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(145deg, #6366f1, #4338ca);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -.5px;
  box-shadow: 0 8px 20px -8px rgba(79, 70, 229, .9);
  flex: 0 0 auto;
}
.brand-mark span { color: #c7d2fe; font-weight: 700; }
.brand-mark-lg { width: 50px; height: 50px; border-radius: 14px; font-size: 22px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { color: #f8fafc; font-size: 15.5px; letter-spacing: -.2px; }
.brand-text small { color: #94a3b8; font-size: 10.5px; letter-spacing: .2px; }
.sidebar-close { display: inline-flex; color: #94a3b8; }

.side-nav { flex: 1; overflow-y: auto; padding: 14px 12px 10px; scrollbar-width: thin; scrollbar-color: #334155 transparent; }
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: #334155; border-radius: 99px; }

.nav-section { margin-bottom: 14px; }
.nav-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 10px 7px;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.nav-heading .icon { width: 14px; height: 14px; transition: transform .2s; }
.nav-toggle[aria-expanded="false"] .icon { transform: rotate(-90deg); }
.nav-group { display: grid; gap: 1px; }
.nav-group.collapsed { display: none; }

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8.5px 10px;
  border-radius: 8px;
  color: #b8c4d9;
  font-size: 13.2px;
  line-height: 1.25;
  transition: background .15s, color .15s, transform .15s;
}
.nav-link .icon { width: 17px; height: 17px; color: #7c8aa5; transition: color .15s; }
.nav-link:hover { background: rgba(255, 255, 255, .055); color: #f1f5f9; }
.nav-link:hover .icon { color: #a5b4fc; }
.nav-link.active {
  background: linear-gradient(90deg, rgba(79, 70, 229, .27), rgba(79, 70, 229, .1));
  color: #fff;
  box-shadow: inset 2px 0 0 #818cf8;
}
.nav-link.active .icon { color: #a5b4fc; }
.nav-pill {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #a5b4fc;
  background: rgba(99, 102, 241, .18);
  padding: 2px 6px;
  border-radius: 5px;
}

.side-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .07); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 4px 2px 10px; }
.side-user .avatar { background: #312e81; color: #e0e7ff; }
.side-user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.side-user-meta strong { color: #f1f5f9; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-meta small { color: #94a3b8; font-size: 10.5px; }
.side-user .icon-btn { color: #94a3b8; }
.side-settings {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #b8c4d9;
  font-size: 13px;
}
.side-settings:hover, .side-settings.active { background: rgba(255, 255, 255, .06); color: #fff; }
.side-settings .icon { width: 17px; height: 17px; }

.app-main { margin-left: 252px; min-height: 100vh; display: flex; flex-direction: column; min-width: 0; transition: margin-left .22s ease; }

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 26px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-menu { display: inline-flex; }
.breadcrumb { display: flex; align-items: center; gap: 8px; min-width: 0; }
.breadcrumb-root { color: var(--muted); font-size: 12.5px; }
.breadcrumb-sep { width: 13px; height: 13px; color: #b6c0d0; }
.breadcrumb-current { font-weight: 650; font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(300px, 26vw);
  padding: 0 12px;
  height: 36px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
}
.topbar-search .icon { width: 16px; height: 16px; }
.topbar-search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 12.5px; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.date-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.date-chip .icon { width: 15px; height: 15px; }
.fy-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 9px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.fy-switch .icon { width: 15px; height: 15px; color: var(--muted); }
.fy-select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 2px 2px 0;
  cursor: pointer;
  max-width: 150px;
}
.fy-select:focus { color: var(--primary-600); }
.table-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.table-actions form { margin: 0; }
.mono-wrap { word-break: break-all; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11.5px; }
code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11.5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--text-2);
}

.user-menu { position: relative; }
.user-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 4px 8px 4px 5px;
  border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.user-trigger:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.user-trigger .icon { width: 14px; height: 14px; color: var(--muted); }
.user-trigger-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.user-trigger-text strong { font-size: 12px; font-weight: 650; }
.user-trigger-text small { font-size: 10px; color: var(--muted); }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary-600);
  font-weight: 700;
  font-size: 13px;
  flex: 0 0 auto;
}
.avatar-sm { width: 29px; height: 29px; font-size: 11.5px; }
.avatar-lg { width: 52px; height: 52px; font-size: 19px; }
.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 216px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 60;
}
.user-dropdown-head { padding: 9px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 5px; display: flex; flex-direction: column; }
.user-dropdown-head strong { font-size: 13px; }
.user-dropdown-head span { color: var(--muted); font-size: 11.5px; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  text-align: left;
}
.dropdown-item:hover { background: var(--surface-2); color: var(--text); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item .icon { width: 16px; height: 16px; }
.user-dropdown form { margin: 0; }

/* Tab bar */
.tabbar {
  position: sticky;
  top: 64px;
  z-index: 35;
  height: 42px;
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 0 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.tabbar-home {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  color: var(--muted);
  border-right: 1px solid var(--line);
}
.tabbar-home:hover { color: var(--primary); }
.tabbar-home.active { color: var(--primary-600); background: var(--primary-soft); }
.tabbar-home .icon { width: 16px; height: 16px; }
.tabbar-tabs { display: flex; align-items: stretch; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.tabbar-tabs::-webkit-scrollbar { display: none; }
.tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 6px 0 11px;
  max-width: 210px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.tab:hover { color: var(--text-2); background: var(--surface-2); }
.tab.active { color: var(--primary-600); border-bottom-color: var(--primary); background: var(--primary-soft); }
.tab-label { overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border: 0;
  padding: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  opacity: .55;
}
.tab-close:hover { background: rgba(79, 70, 229, .14); opacity: 1; }
.tab-close .icon { width: 11px; height: 11px; }
.tabbar-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-left: 1px solid var(--line);
}
.tabbar-clear:hover { color: var(--danger); }
.tabbar-clear .icon { width: 14px; height: 14px; }

/* Content */
.app-content { width: 100%; max-width: 1560px; margin: 0 auto; padding: 24px 28px 44px; flex: 1; }
.app-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  color: #98a2b3;
  font-size: 11px;
  padding: 16px 24px 22px;
}
.footer-dot { width: 3px; height: 3px; border-radius: 50%; background: #cbd5e1; }

.sidebar-scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  z-index: 55;
  backdrop-filter: blur(2px);
}

/* ---------------------------------------------------------------------
   Page heading
   --------------------------------------------------------------------- */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.page-head-main { display: flex; align-items: flex-start; gap: 13px; }
.page-head-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #eef2ff, #e0e7ff);
  color: var(--primary-600);
  border: 1px solid #e0e7ff;
}
.page-head-icon .icon { width: 21px; height: 21px; }
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.4px; line-height: 1.2; }
.page-head p { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.btn .icon { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #5b52e8, var(--primary)); color: #fff; box-shadow: 0 1px 2px rgba(67, 56, 202, .3), inset 0 1px 0 rgba(255, 255, 255, .16); }
.btn-primary:hover { background: linear-gradient(180deg, #4f46e5, var(--primary-600)); color: #fff; box-shadow: 0 5px 16px -6px rgba(79, 70, 229, .55); }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: #c3cddd; color: var(--text); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-ghost.danger, .btn-ghost.btn-danger-ghost { color: var(--danger); border-color: #fecaca; }
.btn-ghost.danger:hover { background: var(--danger-soft); border-color: #fca5a5; color: var(--danger); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-xs { height: 28px; padding: 0 9px; font-size: 11.5px; border-radius: 7px; }
.btn-xs .icon { width: 13px; height: 13px; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 13.5px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn .icon { width: 15.5px; height: 15.5px; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------------------------------------------------------------------
   Cards & layout
   --------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  overflow: hidden;
}
.card-compact { padding: 0; }
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.card-head h2 { font-size: 14.5px; font-weight: 700; letter-spacing: -.15px; display: flex; align-items: center; gap: 8px; }
.card-head p { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.card-head + *:not(.table-wrap):not(.form-grid):not(.stack-form):not(.voucher-feed):not(.trend-chart):not(.agenda) { padding: 18px; }

.split-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.split-layout.is-single { grid-template-columns: minmax(0, 1fr); }
.split-layout > .card { min-width: 0; }
.form-card { position: sticky; top: 124px; }
.stack-form { display: grid; gap: 13px; padding: 18px; }
.form-card .stack-form { padding: 16px 18px 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid { display: grid; gap: 14px; padding: 18px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field-span-2 { grid-column: span 2; }
.field-span-3 { grid-column: span 3; }
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.form-actions .muted { font-size: 11.5px; }

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 11.5px; font-weight: 650; color: var(--text-2); letter-spacing: .01em; }
.field-label em { color: var(--danger); font-style: normal; margin-left: 2px; }
.field-hint { color: var(--muted); font-size: 10.5px; line-height: 1.4; }
.input {
  width: 100%;
  height: 37px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  outline: 0;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea.input { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.5; }
select.input { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23697586' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.input:hover { border-color: #bdc8d9; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.input::placeholder { color: #a4afc0; }
.input-sm { height: 32px; font-size: 12px; border-radius: 7px; }
.input-amount { font-weight: 600; }
.num-input { text-align: right; }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.check-field { display: flex; align-items: flex-start; gap: 10px; padding: 2px 0; cursor: pointer; }
.check-field input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--primary); }
.check-field span { display: flex; flex-direction: column; }
.check-field strong { font-size: 12.5px; font-weight: 600; }
.check-field small { color: var(--muted); font-size: 10.5px; }

.input-icon { position: relative; display: block; }
.input-icon .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: #94a3b8; pointer-events: none; }
.input-icon .input { padding-left: 38px; height: 42px; }

.form-details { border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.form-details summary { cursor: pointer; padding: 9px 11px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.form-details .details-body { display: grid; gap: 11px; padding: 0 11px 12px; }

.inline-form { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

/* Filter bar */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.filter-bar-wrap { flex-wrap: wrap; }
.filter-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.filter-field > span { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.filter-field.grow { flex: 1; min-width: 150px; }

/* ---------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.8px; }
.table th {
  padding: 9px 13px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
  color: #7b8799;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 11px 13px; border-bottom: 1px solid #eef1f7; vertical-align: middle; color: var(--text-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover tbody tr:hover td { background: #fafbff; }
.table tr.clickable { cursor: pointer; }
.table tfoot td { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 0; padding: 11px 13px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .strong { font-weight: 700; color: var(--text); }
.table-sm th, .table-sm td { padding: 8px 11px; }
.actions-col { width: 1%; white-space: nowrap; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 1px; }
.row-actions form { margin: 0; }
.cell-title { font-weight: 600; color: var(--text); }
.cell-sub { display: block; color: var(--muted); font-size: 10.5px; margin-top: 1px; }
.cell-link { font-weight: 600; color: var(--primary-600); }
.cell-link .icon { width: 12px; height: 12px; }
.particulars { max-width: 280px; color: var(--text-2); }
.date-main { display: block; font-weight: 600; color: var(--text); }

.soft-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--surface-3);
  color: #526072;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.inline-icon { display: inline-flex; align-items: center; gap: 4px; }
.inline-icon .icon { width: 13px; height: 13px; color: var(--muted); }
.money { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------
   Badges & pills
   --------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 8px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.badge-info { background: #eef2ff; color: #4338ca; }
.badge-success { background: #ecfdf5; color: #047857; }
.badge-danger { background: #fef2f2; color: #b91c1c; }
.badge-muted { background: #f1f5f9; color: #526072; }
.badge-warning { background: #fffbeb; color: #b45309; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.status-dot.badge-info { background: #6366f1; }
.status-dot.badge-success { background: #10b981; }
.status-dot.badge-muted { background: #94a3b8; }
.status-dot.badge-danger { background: #ef4444; }

.type-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
}
.type-1 { background: #ecfdf5; color: #047857; }
.type-2 { background: #fff7ed; color: #c2410c; }
.type-3 { background: #eff6ff; color: #1d4ed8; }
.type-4 { background: #f5f3ff; color: #6d28d9; }
.type-5 { background: #eef2ff; color: #4338ca; }
.type-6 { background: #fef2f2; color: #b91c1c; }
.type-7 { background: #fdf2f8; color: #be185d; }

/* ---------------------------------------------------------------------
   Notices & alerts
   --------------------------------------------------------------------- */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px;
  margin-bottom: 16px;
}
.notice .icon { width: 17px; height: 17px; margin-top: 1px; }
.notice-info { background: #f5f8ff; border-color: #dbe4ff; color: #33408a; }
.notice-danger { background: var(--danger-soft); border-color: #fecaca; color: #991b1b; }
.notice.compact { margin: 14px 0 0; font-size: 11.5px; }

.flash-stack { display: grid; gap: 8px; margin-bottom: 16px; }
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 12.5px;
  animation: alertIn .22s ease-out;
}
@keyframes alertIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.alert-icon { display: inline-flex; margin-top: 1px; }
.alert-icon .icon { width: 17px; height: 17px; }
.alert-text { flex: 1; }
.alert-close { border: 0; background: transparent; color: inherit; opacity: .55; padding: 0; display: inline-flex; }
.alert-close:hover { opacity: 1; }
.alert-close .icon { width: 14px; height: 14px; }
.alert-success { background: var(--success-soft); border-color: #bbf7d0; color: #047857; }
.alert-error { background: var(--danger-soft); border-color: #fecaca; color: #b91c1c; }
.alert-info { background: var(--info-soft); border-color: #bae6fd; color: #0369a1; }

/* PDF preparation feedback */
.pdf-progress {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 230px;
  padding: 12px 16px 14px;
  border-radius: 11px;
  background: #111827;
  color: #fff;
  box-shadow: 0 18px 40px -16px rgba(15, 23, 42, .65);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  animation: pdfProgressIn .18s ease-out;
}
@keyframes pdfProgressIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pdf-spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, .28);
  border-top-color: #fff;
  border-radius: 50%;
  animation: pdfSpin .7s linear infinite;
}
@keyframes pdfSpin { to { transform: rotate(360deg); } }
.pdf-progress-text { flex: 1; }
.pdf-progress-track {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 7px;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, .18);
}
.pdf-progress-fill {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: 2px;
  background: #818cf8;
  animation: pdfProgressSlide 1.15s ease-in-out infinite;
}
@keyframes pdfProgressSlide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(340%); }
}
.pdf-progress.is-error { background: #7f1d1d; }
.pdf-progress.is-error .pdf-spinner { display: none; }
.pdf-progress.is-error .pdf-progress-track { display: none; }
.pdf-progress.is-error .pdf-progress-text { color: #fee2e2; }

/* ---------------------------------------------------------------------
   Empty state
   --------------------------------------------------------------------- */
.empty-state { padding: 44px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: var(--surface-3);
  color: #94a3b8;
  margin-bottom: 4px;
}
.empty-icon .icon { width: 22px; height: 22px; }
.empty-state h3 { font-size: 13.5px; font-weight: 650; }
.empty-state p { color: var(--muted); font-size: 12px; max-width: 360px; }
.mini-empty { padding: 18px; color: var(--muted); font-size: 12px; text-align: center; }

/* ---------------------------------------------------------------------
   Dashboard
   --------------------------------------------------------------------- */
.hero-strip {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  margin-bottom: 18px;
  border-radius: 16px;
  background:
    radial-gradient(90% 140% at 100% 0%, rgba(99, 102, 241, .22), transparent 55%),
    linear-gradient(120deg, #101a33, #172554 60%, #1e1b4b);
  color: #e2e8f0;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.hero-strip::after {
  content: "";
  position: absolute;
  right: -50px;
  top: -90px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1px solid rgba(165, 180, 252, .18);
  box-shadow: 0 0 0 34px rgba(165, 180, 252, .05), 0 0 0 68px rgba(165, 180, 252, .035);
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; max-width: 690px; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; color: #a5b4fc; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.eyebrow .icon { width: 13px; height: 13px; }
.hero-copy h1 { color: #fff; font-size: 24px; font-weight: 700; letter-spacing: -.5px; margin: 7px 0 5px; }
.hero-copy p { color: #aab8cf; font-size: 12.5px; max-width: 600px; }
.hero-actions { display: flex; gap: 8px; position: relative; z-index: 1; flex-wrap: wrap; }
.hero-actions .btn-ghost { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .18); color: #e2e8f0; }
.hero-actions .btn-ghost:hover { background: rgba(255, 255, 255, .14); color: #fff; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.stat-icon .icon { width: 19px; height: 19px; }
.stat-indigo .stat-icon { background: #eef2ff; color: #4f46e5; }
.stat-emerald .stat-icon { background: #ecfdf5; color: #059669; }
.stat-amber .stat-icon { background: #fffbeb; color: #d97706; }
.stat-sky .stat-icon { background: #f0f9ff; color: #0284c7; }
.stat-rose .stat-icon { background: #fff1f2; color: #e11d48; }
.stat-body { min-width: 0; flex: 1; }
.stat-label { color: var(--muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .045em; display: block; }
.stat-value { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.5px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.stat-foot { display: block; color: var(--muted); font-size: 10.5px; margin-top: 3px; }

.dash-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; align-items: start; }
.dash-grid.is-single { grid-template-columns: 1fr; }
.dash-grid-wide { grid-template-columns: 1.55fr 1fr; }
.dash-footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.dash-grid > .card, .dash-footer-grid > .card { margin-bottom: 0; }
.dash-footer-grid { margin-top: 18px; }

.trend-chart { display: flex; align-items: flex-end; gap: 8px; padding: 22px 18px 16px; height: 228px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.trend-value { font-size: 9.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.trend-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; padding: 6px 0; }
.trend-bar {
  width: min(34px, 74%);
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #c7d2fe, #a5b4fc);
  transition: height .5s ease;
  min-height: 4px;
}
.trend-bar.is-current { background: linear-gradient(180deg, #6366f1, #4338ca); }
.trend-label { font-size: 10px; color: var(--muted); margin-top: 2px; }

.agenda { display: grid; }
.agenda-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #eef1f7; color: inherit; }
.agenda-item:last-child { border-bottom: 0; }
.agenda-item:hover { background: #fafbff; }
.agenda-time { width: 54px; font-size: 11.5px; font-weight: 700; color: var(--text); display: flex; flex-direction: column; flex: 0 0 auto; }
.agenda-time small { color: var(--muted); font-weight: 500; font-size: 9.5px; }
.agenda-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.agenda-body strong { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-body small { color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.voucher-feed { display: grid; }
.voucher-feed.compact { max-height: 420px; overflow-y: auto; }
.feed-item { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid #eef1f7; color: inherit; }
.feed-item:last-child { border-bottom: 0; }
.feed-item:hover { background: #fafbff; }
.feed-type { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #6366f1; background: #eef2ff; padding: 2px 6px; border-radius: 4px; flex: 0 0 auto; }
.feed-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.feed-main strong { font-size: 11.5px; font-weight: 650; }
.feed-main small { color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-amount { font-weight: 650; font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.status-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px 18px; }
.status-chip { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 11.5px; color: var(--muted); }
.status-chip strong { margin-left: auto; color: var(--text); font-size: 13px; }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px 18px; }
.quick-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-2);
}
.quick-action:hover { border-color: #c7d2fe; background: #f5f7ff; color: var(--primary-600); }
.quick-action .icon { width: 16px; height: 16px; color: var(--primary); }

.link-arrow { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--primary-600); white-space: nowrap; }
.link-arrow .icon { width: 13px; height: 13px; }

/* ---------------------------------------------------------------------
   Summary strips
   --------------------------------------------------------------------- */
.summary-strip {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
}
.summary-strip-lg { padding: 16px 18px; gap: 40px; }
.summary-item { display: flex; align-items: baseline; gap: 8px; }
.summary-label { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 650; }
.summary-item strong { font-size: 15px; font-weight: 700; letter-spacing: -.2px; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------
   Masters
   --------------------------------------------------------------------- */
.tree-label { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); }
.ml-1 { margin-left: 6px; }
.venue-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 16px; }
.venue-card { border: 1px solid var(--line); border-radius: 12px; padding: 15px; background: linear-gradient(180deg, #fff, #fcfdff); }
.venue-card.is-inactive { opacity: .62; }
.venue-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.venue-icon { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: #eef2ff; color: #4f46e5; }
.venue-icon .icon { width: 17px; height: 17px; }
.venue-card-top .soft-tag { margin-left: auto; }
.venue-card h3 { font-size: 14px; font-weight: 700; letter-spacing: -.2px; }
.venue-location { color: var(--muted); font-size: 11px; display: flex; align-items: center; gap: 4px; margin: 3px 0 12px; }
.venue-location .icon { width: 12px; height: 12px; }
.venue-meta { display: flex; gap: 18px; padding: 10px 0; border-top: 1px solid #eef1f7; border-bottom: 1px solid #eef1f7; }
.venue-meta span { display: flex; flex-direction: column; }
.venue-meta small { color: var(--muted); font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; }
.venue-meta strong { font-size: 12.5px; font-weight: 650; margin-top: 1px; }
.venue-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.venue-actions form { margin: 0; }
.user-cell { display: flex; align-items: center; gap: 9px; }
.user-cell > span:last-child { display: flex; flex-direction: column; }

/* ---------------------------------------------------------------------
   Vouchers
   --------------------------------------------------------------------- */
.voucher-type-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.voucher-type-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.voucher-type-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--text); }
.vt-icon { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; flex: 0 0 auto; }
.vt-icon .icon { width: 19px; height: 19px; }
.vt-receipt .vt-icon { background: #ecfdf5; color: #059669; }
.vt-payment .vt-icon { background: #fff7ed; color: #ea580c; }
.vt-contra .vt-icon { background: #eff6ff; color: #2563eb; }
.vt-journal .vt-icon { background: #f5f3ff; color: #7c3aed; }
.vt-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.vt-body strong { font-size: 13px; font-weight: 700; }
.vt-body small { color: var(--muted); font-size: 10.5px; line-height: 1.3; }
.vt-count { font-size: 17px; font-weight: 700; color: #cbd5e1; font-variant-numeric: tabular-nums; }
.voucher-type-card:hover .vt-count { color: var(--primary); }
.vt-receipt:hover { border-color: #a7f3d0; }
.vt-payment:hover { border-color: #fed7aa; }
.vt-contra:hover { border-color: #bfdbfe; }
.vt-journal:hover { border-color: #ddd6fe; }

.voucher-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.voucher-side { display: grid; gap: 0; position: sticky; top: 124px; }
.voucher-form { padding: 18px; display: grid; gap: 16px; }
.voucher-section { border: 1px solid var(--line); border-radius: 11px; padding: 14px; background: #fdfdff; }
.voucher-section .form-grid { padding: 0; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 650; margin-bottom: 11px; color: var(--text); }
.section-title > span { width: 20px; height: 20px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-600); font-size: 10.5px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.section-title small { color: var(--muted); font-weight: 400; font-size: 10.5px; }
.booking-hint { display: flex; align-items: flex-start; gap: 7px; margin-top: 9px; padding: 8px 10px; background: #eef2ff; border-radius: 7px; color: #4338ca; font-size: 11px; }
.booking-hint .icon { width: 14px; height: 14px; margin-top: 1px; }
.tips-card .tip-list { margin: 0; padding: 14px 18px 16px 30px; color: var(--text-2); font-size: 11.5px; display: grid; gap: 7px; }
.tip-list li::marker { color: #a5b4fc; }

.journal-table th { padding: 8px 10px; }
.journal-table td { padding: 7px 8px; }
.journal-table tfoot td { padding: 9px 10px; }
.journal-balance { font-size: 11px; font-weight: 650; color: var(--danger); }
.journal-balance.ok { color: var(--success); }
.journal-table .input-sm { height: 31px; }

/* ---------------------------------------------------------------------
   Booking form
   --------------------------------------------------------------------- */
.booking-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 18px; align-items: start; }
.booking-main { min-width: 0; }
.booking-summary { position: sticky; top: 124px; display: grid; gap: 0; }
.step-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-600);
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.charge-table th { padding: 8px 9px; }
.charge-table td { padding: 7px 9px; }
.charge-table .input-sm { height: 32px; }
.charge-line-total { font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.charge-foot { padding: 10px 18px 14px; border-top: 1px solid #eef1f7; font-size: 10.5px; }
.summary-card .summary-lines { padding: 12px 16px 15px; display: grid; gap: 8px; }
.summary-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--text-2); }
.summary-line strong { font-weight: 650; font-variant-numeric: tabular-nums; }
.summary-line.subtle { color: var(--muted); font-size: 11.5px; }
.summary-line.total { font-size: 13px; color: var(--text); }
.summary-line.total strong { font-size: 17px; letter-spacing: -.3px; }
.summary-line.balance { color: var(--danger); font-weight: 650; }
.summary-line.balance strong { font-size: 15px; }
.summary-line.summary-input { gap: 8px; }
.summary-line.summary-input .input { width: 110px; text-align: right; }
.summary-divider { height: 1px; background: var(--line); margin: 3px 0; }
.summary-note { display: flex; align-items: center; gap: 6px; padding: 0 16px 14px; color: var(--muted); font-size: 10px; }
.summary-note .icon { width: 13px; height: 13px; }
.slot-card { margin-top: 0; }
.slot-preview { padding: 12px 16px; display: grid; gap: 7px; }
.slot-preview .slot-mini { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.slot-preview .slot-mini.free { border-color: #bbf7d0; background: #f0fdf4; color: #047857; }
.slot-preview .slot-mini.booked { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.slot-preview .slot-mini small { color: inherit; opacity: .78; }
.sticky-actions { display: grid; gap: 8px; margin-top: 12px; }

/* ---------------------------------------------------------------------
   Booking detail
   --------------------------------------------------------------------- */
.detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.detail-hero-main { display: flex; align-items: center; gap: 16px; min-width: 0; }
.detail-date {
  width: 64px;
  height: 70px;
  border-radius: 12px;
  background: linear-gradient(160deg, #eef2ff, #e0e7ff);
  border: 1px solid #e0e7ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--primary-600);
  flex: 0 0 auto;
}
.detail-date strong { font-size: 25px; line-height: 1; font-weight: 750; letter-spacing: -.5px; }
.detail-date small { font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.detail-hero-text { min-width: 0; }
.detail-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-title-row h2 { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.detail-sub { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 11.5px; margin-top: 5px; }
.detail-sub span { display: inline-flex; align-items: center; gap: 5px; }
.detail-sub .icon { width: 13px; height: 13px; }
.detail-hero-customer { display: flex; align-items: center; gap: 10px; padding-left: 20px; border-left: 1px solid var(--line); }
.detail-hero-customer > div { display: flex; flex-direction: column; }
.detail-hero-customer strong { font-size: 13px; }
.detail-hero-customer span { color: var(--muted); font-size: 10.5px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.detail-side { position: sticky; top: 124px; }
.detail-list { margin: 0; padding: 6px 18px 14px; display: grid; }
.detail-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid #eef1f7; }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); font-size: 11px; }
.detail-list dd { margin: 0; font-size: 12px; font-weight: 600; text-align: right; }
.note-text { padding: 14px 18px 16px; color: var(--text-2); font-size: 12px; }
.totals-panel { margin-left: auto; width: min(340px, 100%); padding: 14px 18px 16px; border-top: 1px solid var(--line); }
.totals-row { display: flex; justify-content: space-between; gap: 14px; padding: 4px 0; font-size: 12px; }
.totals-row.subtle { color: var(--muted); font-size: 11.5px; }
.totals-row.grand { margin-top: 6px; padding-top: 9px; border-top: 1px dashed var(--line-strong); font-size: 13.5px; }
.totals-row.grand strong { font-size: 18px; letter-spacing: -.3px; }
.danger-card { border-color: #fecaca; }
.danger-card .card-head { background: #fffafa; }
.cancel-details summary { list-style: none; }
.cancel-details summary::-webkit-details-marker { display: none; }
.cancel-details[open] summary { margin-bottom: 12px; }
.cancel-details .stack-form { padding: 0 18px 18px; }
.cancel-details .btn.danger { color: var(--danger); border-color: #fecaca; }

/* ---------------------------------------------------------------------
   Calendar
   --------------------------------------------------------------------- */
.calendar-card { overflow: hidden; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.calendar-nav { display: flex; align-items: center; gap: 8px; }
.calendar-nav h2 { font-size: 16px; font-weight: 700; min-width: 150px; text-align: center; letter-spacing: -.2px; }
.calendar-legend { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 10.5px; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.legend-dot.badge-info { background: #6366f1; }
.legend-dot.badge-success { background: #10b981; }
.legend-dot.badge-muted { background: #94a3b8; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekday { padding: 8px 10px; font-size: 9.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); border-right: 1px solid #eef1f7; text-align: right; }
.calendar-day { min-height: 118px; padding: 7px; border-right: 1px solid #eef1f7; border-bottom: 1px solid #eef1f7; background: #fff; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.is-outside { background: #fbfcfe; }
.calendar-day.is-outside .day-number { color: #c3ccdb; }
.calendar-day.is-today { background: #f7f8ff; box-shadow: inset 0 0 0 1.5px #c7d2fe; }
.calendar-day.is-weekend { background: #fcfdff; }
.calendar-day.is-today .day-number { background: var(--primary); color: #fff; }
.day-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.day-number { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 650; color: var(--text-2); }
.day-add { color: #b6c0d0; opacity: 0; transition: opacity .15s; display: inline-flex; }
.calendar-day:hover .day-add { opacity: 1; }
.day-add:hover { color: var(--primary); }
.day-add .icon { width: 13px; height: 13px; }
.day-events { display: grid; gap: 3px; }
.event-chip { display: block; padding: 4px 5px; border-radius: 5px; border-left: 2px solid; font-size: 9px; line-height: 1.25; overflow: hidden; }
.event-chip:hover { filter: brightness(.97); }
.event-chip.badge-info { background: #eef2ff; border-color: #6366f1; color: #3730a3; }
.event-chip.badge-success { background: #ecfdf5; border-color: #10b981; color: #065f46; }
.event-chip.badge-muted { background: #f1f5f9; border-color: #94a3b8; color: #475569; }
.event-chip.badge-danger { background: #fef2f2; border-color: #ef4444; color: #991b1b; }
.event-time { font-weight: 700; font-size: 8px; opacity: .8; margin-right: 3px; }
.event-name { font-weight: 650; }
.event-meta { display: block; opacity: .72; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------------
   Availability
   --------------------------------------------------------------------- */
.availability-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 18px 0 14px; }
.availability-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -.3px; }
.availability-head p { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.availability-counts { display: flex; gap: 8px; }
.count-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 99px; font-size: 10.5px; font-weight: 600; }
.count-pill strong { font-size: 12.5px; }
.count-pill.free { background: #ecfdf5; color: #047857; }
.count-pill.booked { background: #fef2f2; color: #b91c1c; }
.slot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.slot-card { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 15px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 9px; }
.slot-card.is-free { border-top: 3px solid #10b981; }
.slot-card.is-booked { border-top: 3px solid #ef4444; background: #fffdfd; }
.slot-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.slot-status { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.slot-status .icon { width: 12px; height: 12px; }
.is-free .slot-status { color: #047857; }
.is-booked .slot-status { color: #b91c1c; }
.slot-time { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.slot-card h3 { font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.slot-desc { color: var(--muted); font-size: 11.5px; flex: 1; }
.slot-booking { display: flex; flex-direction: column; gap: 2px; flex: 1; font-size: 11.5px; }
.slot-booking strong { font-size: 12.5px; }
.slot-booking span { color: var(--muted); font-size: 11px; }
.slot-booking .soft-tag { align-self: flex-start; margin-top: 3px; }
.availability-note { margin-top: 4px; }
.availability-note p { padding: 0 18px 18px; font-size: 12px; }

/* ---------------------------------------------------------------------
   Reports
   --------------------------------------------------------------------- */
.report-section { margin-bottom: 22px; }
.section-label { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 9px; }
.report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.report-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.report-card:hover { border-color: #c7d2fe; transform: translateY(-2px); box-shadow: var(--shadow); color: var(--text); }
.report-card > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.report-card strong { font-size: 13px; font-weight: 700; }
.report-card small { color: var(--muted); font-size: 10.5px; line-height: 1.4; margin-top: 2px; }
.report-icon { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.report-icon .icon { width: 19px; height: 19px; }
.tone-indigo { background: #eef2ff; color: #4f46e5; }
.tone-emerald { background: #ecfdf5; color: #059669; }
.tone-amber { background: #fffbeb; color: #d97706; }
.tone-sky { background: #f0f9ff; color: #0284c7; }
.tone-rose { background: #fff1f2; color: #e11d48; }
.report-arrow { width: 15px; height: 15px; color: #c3ccdb; flex: 0 0 auto; }
.report-card:hover .report-arrow { color: var(--primary); }

.report-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.report-head-main { min-width: 0; }
.report-company { display: block; color: #000; font-size: 20px; font-weight: 800; letter-spacing: -.35px; line-height: 1.2; }
.report-head p.report-company-meta { color: #000; font-size: 11.5px; font-weight: 400; margin-top: 3px; line-height: 1.45; }
.report-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -.3px; margin-top: 12px; }
.report-head p { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.report-head:last-child { border-bottom: 0; }
.report-badge { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 7px; background: var(--primary-soft); color: var(--primary-600); font-size: 11px; font-weight: 700; white-space: nowrap; }
.report-badge.ok { background: #ecfdf5; color: #047857; }
.report-badge.bad { background: #fef2f2; color: #b91c1c; }
.report-table { font-size: 12.3px; }
.report-table th.group-head { text-align: center; border-left: 1px solid var(--line); }
.report-table th.num { text-align: right; }
.report-foot-note { display: flex; align-items: center; gap: 7px; padding: 12px 18px; font-size: 11.5px; color: var(--muted); border-top: 1px solid #eef1f7; }
.report-foot-note .icon { width: 14px; height: 14px; }

/* GST return tables */
.card-subhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line); background: #fbfcfe; color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.card-subhead:first-of-type { border-top: 0; }
.card-subhead strong { color: var(--text); font-size: 11px; letter-spacing: 0; }
.gstr-table { font-size: 12px; }
.gstr-table th, .gstr-table td { padding: 8px 9px; vertical-align: top; }
.gstr-table .gstr-mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; letter-spacing: .01em; white-space: nowrap; }
.gstr-table .gstr-sub { display: inline-block; color: var(--muted); font-size: 10.5px; font-weight: 400; margin-top: 2px; }
.gstr-table .gstr-total-row td { background: #f8fafc; }
@media print {
  .gstr-table { font-size: 8.4px; }
  .gstr-table th, .gstr-table td { padding: 3px 4px; }
  .gstr-table .gstr-sub { font-size: 8px; }
}


.balance-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.balance-col { min-width: 0; }
.balance-col + .balance-col { border-left: 1px solid var(--line); }
.balance-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.balance-head.liabilities { background: #fff7ed; color: #9a3412; }
.balance-head.assets { background: #ecfdf5; color: #065f46; }
.balance-head strong { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.tree-table td { padding: 7px 14px; }
.tree-table tfoot td { padding: 9px 14px; }
.tree-row.tree-group td { background: #fcfdff; }
.tree-row.tree-group .tree-cell { color: var(--text); }
.tree-row.tree-ledger .tree-cell { color: var(--text-2); }
.tree-row.tree-pnl td { background: #f8fafc; font-weight: 650; }
.tree-cell { display: inline-block; }
.report-balance-check { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 11.5px; }
.report-balance-check .icon { width: 15px; height: 15px; }
.report-balance-check strong { margin-left: auto; }
.report-balance-check.ok { background: #ecfdf5; color: #047857; }
.report-balance-check.bad { background: #fef2f2; color: #b91c1c; }

.pl-grid { display: grid; grid-template-columns: 1fr 1fr; }
.pl-block + .pl-block { border-left: 1px solid var(--line); }
.pl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; font-size: 11.5px; font-weight: 700; }
.pl-head.income { background: #ecfdf5; color: #065f46; }
.pl-head.expense { background: #fff7ed; color: #9a3412; }
.pl-total { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; background: var(--surface-2); }
.pl-total.profit { color: #047857; }
.pl-total.loss { color: #b91c1c; }
.pl-total strong { font-size: 17px; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.pl-total.big { font-size: 14px; padding: 15px 18px; }
.pl-total.big strong { font-size: 21px; }
.pl-total.big.profit { background: #ecfdf5; }
.pl-total.big.loss { background: #fef2f2; }

.daybook-list { display: grid; gap: 12px; }
.daybook-entry { margin-bottom: 0; }
.daybook-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.daybook-id { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.daybook-id strong { font-size: 12.5px; }
.daybook-amount { display: flex; align-items: center; gap: 14px; font-size: 11.5px; }
.daybook-amount strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.daybook-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; border-top: 1px solid #eef1f7; font-size: 11px; }
.daybook-foot .cell-link { display: inline-flex; align-items: center; gap: 4px; }

.ledger-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 18px; border-bottom: 1px solid var(--line); }
.ledger-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.ledger-head p { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.ledger-closing { text-align: right; }
.ledger-closing span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.ledger-closing strong { font-size: 18px; font-weight: 700; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.opening-row td { background: #fcfdff; }
.ledger-table td { white-space: nowrap; }
.ledger-table .particulars { white-space: normal; min-width: 220px; }

.occupancy-wrap { padding: 0 0 4px; }
.occupancy-table { font-size: 10.5px; }
.occupancy-table th, .occupancy-table td { padding: 6px 5px; }
.occ-venue-col { position: sticky; left: 0; z-index: 2; background: #fff; min-width: 150px; text-align: left; }
th.occ-venue-col { z-index: 3; background: var(--surface-2); }
.occ-day { min-width: 24px; text-align: center; }
.occ-cell { text-align: center; border-radius: 4px; font-weight: 650; }
.occ-cell.zero { color: #cbd5e1; background: #fff; }
.occ-cell.mid { background: #fef3c7; color: #92400e; }
.occ-cell.high { background: #fca5a5; color: #7f1d1d; }
.occupancy-legend { display: flex; gap: 16px; padding: 10px 18px 0; color: var(--muted); font-size: 10.5px; }
.occupancy-legend span { display: inline-flex; align-items: center; gap: 5px; }
.occ-swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.occ-swatch.zero { background: #f1f5f9; border: 1px solid #e2e8f0; }
.occ-swatch.mid { background: #fcd34d; }
.occ-swatch.high { background: #f87171; }
.util-pill { display: inline-block; padding: 2px 7px; border-radius: 99px; font-size: 9.5px; font-weight: 700; }
.util-pill.low { background: #f1f5f9; color: #526072; }
.util-pill.mid { background: #fffbeb; color: #b45309; }
.util-pill.high { background: #fef2f2; color: #b91c1c; }

/* ---------------------------------------------------------------------
   Settings
   --------------------------------------------------------------------- */
.section-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}
.section-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.section-tab .icon { width: 15px; height: 15px; }
.section-tab:hover { background: var(--surface-2); color: var(--text); }
.section-tab.active { background: var(--primary-soft); color: var(--primary-600); }
.section-panel { display: none; }
.section-panel.active { display: block; }
.settings-defaults { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 18px; }
.account-card { display: flex; align-items: center; gap: 12px; padding: 18px; }
.account-card > div { display: flex; flex-direction: column; gap: 2px; }
.account-card strong { font-size: 14px; }
.account-card span { color: var(--muted); font-size: 11.5px; }
.account-card .badge { align-self: flex-start; margin-top: 4px; }

/* ---------------------------------------------------------------------
   Confirm dialog
   --------------------------------------------------------------------- */
.confirm-dialog { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.confirm-dialog[hidden] { display: none; }
.confirm-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); }
.confirm-card {
  position: relative;
  width: min(400px, 100%);
  background: #fff;
  border-radius: 15px;
  padding: 22px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: confirmIn .18s ease-out;
}
@keyframes confirmIn { from { opacity: 0; transform: scale(.97) translateY(6px); } to { opacity: 1; transform: none; } }
.confirm-icon { width: 46px; height: 46px; border-radius: 50%; background: #fef2f2; color: #dc2626; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.confirm-icon .icon { width: 22px; height: 22px; }
.confirm-card h3 { font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.confirm-card p { color: var(--muted); font-size: 12px; margin-top: 6px; }
.confirm-actions { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }

/* ---------------------------------------------------------------------
   Login
   --------------------------------------------------------------------- */
.login-body { background: #0b1220; min-height: 100vh; }
.login-shell { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-brand {
  position: relative;
  display: flex;
  align-items: center;
  padding: 56px clamp(32px, 6vw, 90px);
  color: #e2e8f0;
  background:
    radial-gradient(80% 60% at 10% 0%, rgba(79, 70, 229, .38), transparent 60%),
    radial-gradient(60% 50% at 100% 100%, rgba(14, 165, 233, .16), transparent 60%),
    linear-gradient(150deg, #101a33, #0b1220 60%);
  overflow: hidden;
}
.login-brand::before {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -220px;
  top: -160px;
  border-radius: 50%;
  border: 1px solid rgba(165, 180, 252, .12);
  box-shadow: 0 0 0 60px rgba(165, 180, 252, .03), 0 0 0 120px rgba(165, 180, 252, .02);
}
.login-brand-inner { position: relative; z-index: 1; max-width: 520px; }
.login-logo { display: flex; align-items: center; gap: 13px; margin-bottom: 44px; }
.login-logo strong { display: block; font-size: 17px; color: #fff; letter-spacing: -.2px; }
.login-logo small { display: block; color: #94a3b8; font-size: 11px; }
.login-brand h1 { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.16; font-weight: 700; letter-spacing: -.8px; color: #fff; max-width: 480px; }
.login-lead { color: #a7b4c9; font-size: 13.5px; line-height: 1.65; margin-top: 16px; max-width: 440px; }
.login-features { display: grid; gap: 15px; margin-top: 38px; }
.login-feature { display: flex; gap: 12px; align-items: flex-start; }
.feature-icon { width: 36px; height: 36px; border-radius: 9px; background: rgba(99, 102, 241, .16); border: 1px solid rgba(129, 140, 248, .2); color: #a5b4fc; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.feature-icon .icon { width: 17px; height: 17px; }
.login-feature strong { display: block; color: #e2e8f0; font-size: 12.5px; }
.login-feature span { color: #94a3b8; font-size: 11.5px; line-height: 1.5; }
.login-quote { color: #64748b; font-size: 10.5px; margin-top: 44px; letter-spacing: .02em; }
.login-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 28px; background: #f5f7fb; }
.login-card { width: min(400px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 17px; padding: 28px; box-shadow: 0 30px 70px -40px rgba(15, 23, 42, .35); }
.login-card-head { margin-bottom: 20px; }
.login-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); }
.login-card-head h2 { font-size: 21px; font-weight: 700; letter-spacing: -.4px; margin-top: 4px; }
.login-card-head p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.login-form { display: grid; gap: 14px; }
.login-form .btn { margin-top: 3px; }
.login-foot { color: #98a2b3; font-size: 10.5px; margin-top: 18px; }

/* ---------------------------------------------------------------------
   Error page
   --------------------------------------------------------------------- */
.error-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: radial-gradient(80% 60% at 50% 0%, #eef2ff, #f8fafc 60%); padding: 24px; }
.error-card { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 40px 36px; max-width: 440px; box-shadow: var(--shadow-lg); }
.error-code { font-size: 58px; font-weight: 800; line-height: 1; letter-spacing: -3px; background: linear-gradient(135deg, #4f46e5, #0ea5e9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-card h1 { font-size: 20px; font-weight: 700; margin-top: 8px; letter-spacing: -.3px; }
.error-card p { color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.error-actions { display: flex; justify-content: center; gap: 8px; margin-top: 22px; }
.error-brand { display: block; color: #a4afc0; font-size: 10px; margin-top: 26px; }

/* ---------------------------------------------------------------------
   Print documents
   --------------------------------------------------------------------- */
.print-body { background: #e8ecf3; min-height: 100vh; padding-bottom: 40px; }
.print-toolbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.print-toolbar-actions { display: flex; gap: 7px; }
.print-page {
  position: relative;
  width: min(210mm, calc(100% - 32px));
  min-height: 280mm;
  margin: 22px auto 0;
  background: #fff;
  padding: 16mm 15mm 14mm;
  box-shadow: 0 24px 60px -30px rgba(15, 23, 42, .35);
  color: #1f2937;
  font-size: 11.5px;
}
.print-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 74px;
  font-weight: 800;
  letter-spacing: 8px;
  color: rgba(220, 38, 38, .09);
  transform: rotate(-24deg);
  pointer-events: none;
  z-index: 5;
}
.invoice-header { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 14px; border-bottom: 2px solid #1f2937; }
.invoice-brand { display: flex; gap: 12px; align-items: flex-start; }
.print-logo { width: 46px; height: 46px; border-radius: 10px; background: linear-gradient(145deg, #6366f1, #4338ca); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; letter-spacing: -.5px; flex: 0 0 auto; }
.invoice-brand h1 { font-size: 18px; font-weight: 750; letter-spacing: -.4px; color: #111827; }
.invoice-brand p { color: #4b5563; font-size: 10px; line-height: 1.55; margin-top: 2px; }
.invoice-brand .invoice-gstin { margin-top: 3px; color: #374151; }
.invoice-title-block { text-align: right; flex: 0 0 auto; }
.invoice-title { display: inline-block; font-size: 15px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; color: #4338ca; border-bottom: 2px solid #4338ca; padding-bottom: 2px; margin-bottom: 7px; }
.invoice-meta { border-collapse: collapse; margin-left: auto; font-size: 10px; }
.invoice-meta td { padding: 2px 0 2px 12px; text-align: right; }
.invoice-meta td:first-child { color: #6b7280; text-align: left; }
.invoice-meta td:last-child { font-weight: 600; color: #111827; }
.invoice-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding: 14px 0; border-bottom: 1px solid #e5e7eb; }
.party-label { display: block; font-size: 8.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #6b7280; margin-bottom: 4px; }
.invoice-party h3 { font-size: 13px; font-weight: 700; color: #111827; }
.invoice-party p { color: #4b5563; font-size: 10px; line-height: 1.6; margin-top: 2px; }
.invoice-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 10px; }
.invoice-table th { background: #f3f4f6; border-top: 1px solid #d1d5db; border-bottom: 1px solid #d1d5db; padding: 7px 8px; text-align: left; font-size: 8.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #4b5563; }
.invoice-table th.num, .invoice-table td.num { text-align: right; }
.invoice-table td { padding: 7px 8px; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
.invoice-table td strong { display: block; font-size: 10.5px; color: #111827; }
.invoice-table td small { color: #6b7280; font-size: 8.5px; }
.invoice-table tfoot td { border-top: 1.5px solid #1f2937; border-bottom: 0; padding-top: 8px; }
.invoice-summary { display: flex; justify-content: space-between; gap: 28px; margin-top: 6px; }
.invoice-words { flex: 1; padding-top: 10px; }
.invoice-words p { font-size: 10px; color: #374151; line-height: 1.6; }
.invoice-words .party-label { margin-top: 10px; }
.invoice-note { color: #6b7280 !important; font-size: 9px !important; margin-top: 6px; }
.invoice-bank { margin-top: 8px; }
.invoice-bank p { font-size: 9.5px; color: #4b5563; }
.invoice-totals { width: 250px; flex: 0 0 auto; border-collapse: collapse; margin-top: 10px; font-size: 10px; }
.invoice-totals td { padding: 4px 0; color: #374151; }
.invoice-totals td:last-child { text-align: right; font-weight: 600; color: #111827; font-variant-numeric: tabular-nums; }
.invoice-totals tr.subtle td { color: #6b7280; }
.invoice-totals tr.grand td { border-top: 1.5px solid #1f2937; border-bottom: 1px solid #d1d5db; padding: 7px 0; font-size: 12px; font-weight: 700; color: #111827; }
.invoice-totals tr.balance td { padding-top: 6px; color: #b91c1c; font-weight: 700; }
.invoice-terms { margin-top: 14px; padding-top: 10px; border-top: 1px solid #e5e7eb; font-size: 9px; color: #4b5563; line-height: 1.6; }
.invoice-footer { display: flex; justify-content: space-between; gap: 30px; margin-top: 22px; padding-top: 10px; border-top: 1px solid #e5e7eb; font-size: 9px; color: #6b7280; }
.invoice-footer > div:first-child { max-width: 60%; }
.invoice-footer p { line-height: 1.6; margin-top: 2px; }
.invoice-sign { text-align: right; display: flex; flex-direction: column; gap: 26px; font-size: 9.5px; color: #374151; }
.sign-line { border-top: 1px solid #9ca3af; padding-top: 4px; min-width: 140px; }

.voucher-print-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 14px; border-bottom: 2px solid #1f2937; }
.voucher-print-head h1 { font-size: 18px; font-weight: 750; color: #111827; letter-spacing: -.3px; }
.voucher-print-head p { color: #4b5563; font-size: 10px; line-height: 1.55; margin-top: 3px; }
.voucher-print-type { text-align: right; }
.voucher-print-type span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: #6b7280; font-weight: 700; }
.voucher-print-type strong { display: block; font-size: 16px; color: #4338ca; letter-spacing: -.2px; margin-top: 2px; }
.voucher-print-type small { color: #6b7280; font-size: 10px; }
.voucher-print-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 12px 0; border-bottom: 1px solid #e5e7eb; }
.voucher-print-meta div { display: flex; flex-direction: column; }
.voucher-print-meta span { font-size: 8px; text-transform: uppercase; letter-spacing: .08em; color: #6b7280; font-weight: 700; }
.voucher-print-meta strong { font-size: 10.5px; color: #111827; }
.voucher-print-table { margin-top: 12px; }
.voucher-print-words, .voucher-print-narration { margin-top: 12px; padding-top: 9px; border-top: 1px solid #e5e7eb; font-size: 10px; color: #374151; }
.voucher-print-words span, .voucher-print-narration span { font-size: 8.5px; text-transform: uppercase; letter-spacing: .08em; color: #6b7280; font-weight: 700; }
.voucher-print-words p, .voucher-print-narration p { margin-top: 2px; }

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 1280px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .voucher-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .booking-layout, .voucher-layout, .detail-grid { grid-template-columns: minmax(0, 1fr) 310px; }
}

@media (max-width: 1100px) {
  .topbar-search { display: none; }
  .split-layout { grid-template-columns: minmax(0, 1fr); }
  .form-card, .voucher-side, .booking-summary, .detail-side { position: static; }
  .split-layout > .form-card { order: 2; }
  .venue-grid { grid-template-columns: 1fr; }
  .booking-layout, .voucher-layout, .detail-grid { grid-template-columns: 1fr; }
  .booking-summary { grid-template-columns: 1fr 1fr; }
  .sticky-actions { grid-column: 1 / -1; }
  .dash-grid, .dash-grid-wide { grid-template-columns: 1fr; }
  .dash-footer-grid { grid-template-columns: 1fr; }
}

@media (min-width: 861px) {
  .app-shell.sidebar-collapsed .sidebar { transform: translateX(-100%); box-shadow: none; }
  .app-shell.sidebar-collapsed .app-main { margin-left: 0; }
}

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: 24px 0 60px -20px rgba(15, 23, 42, .45); }
  .sidebar-close { display: inline-flex; }
  .app-main { margin-left: 0; }
  .topbar { padding: 0 16px; height: 58px; gap: 12px; }
  .topbar-menu { display: inline-flex; }
  .tabbar { top: 58px; padding: 0 10px; }
  .date-chip { display: none; }
  .user-trigger-text { display: none; }
  .app-content { padding: 18px 16px 34px; }
  .form-grid-3, .form-grid-4 { grid-template-columns: 1fr 1fr; }
  .field-span-2, .field-span-3 { grid-column: span 2; }
  .balance-columns, .pl-grid { grid-template-columns: 1fr; }
  .balance-col + .balance-col, .pl-block + .pl-block { border-left: 0; border-top: 1px solid var(--line); }
  .slot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-day { min-height: 96px; }
  .settings-defaults { grid-template-columns: 1fr; }
  .detail-hero-customer { padding-left: 0; border-left: 0; }
  .hero-strip { flex-direction: column; align-items: flex-start; }
  .hero-actions { width: 100%; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { min-height: 100vh; }
}

@media (max-width: 620px) {
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-actions { justify-content: flex-start; }
  .stat-grid { grid-template-columns: 1fr; }
  .report-grid, .voucher-type-grid, .slot-grid, .booking-summary { grid-template-columns: 1fr; }
  .form-grid-3, .form-grid-4, .form-row { grid-template-columns: 1fr; }
  .field-span-2, .field-span-3 { grid-column: span 1; }
  .filter-bar { align-items: stretch; }
  .filter-field { flex: 1 1 100%; }
  .filter-bar .btn { flex: 0 0 auto; }
  .summary-strip { gap: 14px; }
  .summary-item { min-width: 45%; }
  .calendar-day { min-height: 76px; padding: 4px; }
  .event-chip { font-size: 8px; padding: 3px; }
  .event-meta { display: none; }
  .calendar-legend { display: none; }
  .day-add { display: none; }
  .topbar-new span { display: none; }
  .user-trigger { padding: 3px; }
  .app-footer { flex-wrap: wrap; }
  .detail-hero-main { align-items: flex-start; }
  .detail-sub { gap: 8px; }
  .invoice-page { padding: 10mm 8mm; }
  .invoice-header, .invoice-summary, .invoice-footer, .voucher-print-head { flex-direction: column; }
  .invoice-title-block, .voucher-print-type { text-align: left; }
  .invoice-meta { margin-left: 0; }
  .invoice-parties { grid-template-columns: 1fr; }
  .voucher-print-meta { grid-template-columns: 1fr 1fr; }
  .invoice-totals { width: 100%; }
  .login-card { padding: 22px; }
}

/* ---------------------------------------------------------------------
   Animations & utilities
   --------------------------------------------------------------------- */
.hidden { display: none !important; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------------------------------------------------------------------
   Print
   --------------------------------------------------------------------- */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; }
  .no-print, .print-toolbar, .sidebar, .topbar, .tabbar, .app-footer, .flash-stack, .confirm-dialog, .page-actions, .filter-bar, .summary-strip, .section-tabs { display: none !important; }
  .app-main { margin: 0 !important; }
  .app-content { padding: 0 !important; max-width: none !important; }
  .card { box-shadow: none !important; border: 1px solid #d1d5db !important; break-inside: avoid; }
  .card-head { background: #fff !important; }
  .report-card-print { border: 0 !important; }
  .table th { background: #f3f4f6 !important; color: #374151 !important; }
  .badge, .type-pill, .soft-tag { border: 1px solid #d1d5db; }
  .print-body { padding: 0 !important; }
  .print-page { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
  .print-watermark { position: fixed; }
  .print-toolbar { display: none !important; }
}
