/* Default Admin Theme geometry with the user-approved Navy + Blue palette. */
:root { --font-sans: "Geist", system-ui, sans-serif; --font-mono: "Geist Mono", monospace; }
body:has(.bhandara-theme) {
  --foreground: #0f172a; --primary: #2563eb; --primary-foreground: #fff;
  --secondary: #eff6ff; --secondary-foreground: #1d4ed8;
  --muted: #f1f5f9; --muted-foreground: #64748b; --accent: #eff6ff;
  --border: #e2e8f0; --input: #94a3b8; --ring: #2563eb;
  --sidebar: #0f172a; --sidebar-foreground: #e2e8f0;
  --sidebar-accent: #263956; --sidebar-accent-foreground: #f8fafc;
  --sidebar-border: #28374d; --sidebar-ring: #93c5fd;
}
.theme-workspace { background: #f8fafc; }
.bhandara-theme [data-slot="card"], .theme-summary-card, .wallet-hero, .notice { background: var(--card); }
body:has(.bhandara-theme) [data-slot="sidebar-header"] { background: #142139; }
body:has(.bhandara-theme) [data-slot="sidebar-menu-button"][data-active="true"] { box-shadow: inset 2px 0 var(--primary); }
.side-nav a:hover { color: var(--sidebar-accent-foreground); }
.nav-count { color: var(--sidebar-accent-foreground); }
.app-shell.auth-shell { display: block; }
.auth-shell #sidebar, .auth-shell .theme-topbar, .auth-shell .workspace-footer { display: none; }
.auth-shell .theme-main-content { max-width: none; min-height: 100dvh; padding: 40px 20px; justify-content: center; align-items: center; }
.auth-wrap { width: 100%; max-width: 400px; }
.auth-brand { display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 18px; font-weight: 600; margin-bottom: 24px; }
.auth-brand svg { width: 24px; height: 24px; color: var(--primary); }
.bhandara-theme .auth-card { padding: 24px; }
.auth-card h1 { font-size: 22px; font-weight: 600; letter-spacing: -.035em; }
.auth-subtitle { color: var(--muted-foreground); margin: 6px 0 20px !important; }
.auth-form { display: grid; gap: 16px; }
.auth-form .btn { width: 100%; }
.auth-password { display: flex; align-items: stretch; min-width: 0; border: 1px solid var(--input); border-radius: 6px; background: var(--background); }
body:has(.bhandara-theme) .auth-password input { flex: 1; width: 0; height: 32px; min-height: 32px; padding: 4px 8px; border: 0; border-radius: 5px 0 0 5px; }
.auth-password .password-toggle { display: grid; flex: 0 0 36px; place-items: center; width: 36px; min-width: 36px; padding: 0; border: 0; border-radius: 0 5px 5px 0; background: transparent; color: var(--muted-foreground); }
.auth-password .password-toggle svg { display: block; width: 16px; height: 16px; }
.auth-password .password-toggle:hover { background: var(--secondary); color: var(--primary); }
.auth-password:focus-within { border-color: var(--ring); outline: 1px solid var(--ring); }
body:has(.bhandara-theme) .auth-password input:focus-visible { outline: none; }
body:has(.bhandara-theme) .password-toggle:focus-visible { outline-offset: -3px; }
body:has(.bhandara-theme) .auth-password:has([aria-invalid="true"]) { border-color: var(--destructive); }
.auth-link-row { display: flex; justify-content: flex-end; }
.auth-note { font-size: 12px; color: var(--muted-foreground); margin-top: 20px !important; text-align: center; }
.auth-demo { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 16px; display: grid; gap: 8px; font-size: 12px; color: var(--muted-foreground); }
.auth-demo .segmented { justify-content: center; }
.auth-demo p { text-align: center; overflow-wrap: anywhere; }
.auth-success-icon { display: grid; place-items: center; width: 40px; height: 40px; background: var(--secondary); color: var(--primary); border-radius: 8px; margin-bottom: 16px; }
.auth-success-icon svg { width: 20px; height: 20px; }
.auth-actions { display: grid; gap: 12px; }
.auth-actions .link { text-align: center; }
.sidebar-signout { margin-top: 12px; display: flex; gap: 8px; align-items: center; color: var(--sidebar-foreground); font-size: 12px; min-height: 34px; }
.header-profile, .profile-summary { display: flex; align-items: center; gap: 8px; }
.header-profile .user-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-summary > div, .sidebar-profile > div { min-width: 0; overflow-wrap: anywhere; }
.profile-summary { margin-bottom: 20px; }
.profile-summary .avatar { width: 40px; height: 40px; background: var(--secondary); color: var(--primary); font-size: 13px; }
.profile-password-form { display: grid; gap: 16px; }
input[readonly] { background: var(--muted) !important; color: var(--muted-foreground); }
svg { width: 16px; height: 16px; flex: none; vertical-align: middle; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { width: 100%; min-width: 0; padding: 4px 8px; border: 1px solid var(--input); }
input[type=checkbox] { width: 16px; cursor: pointer; }
textarea { resize: vertical; }
button.btn, a.btn { display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 4px; padding: 2px 6px; border: 1px solid var(--border); background: var(--background); color: var(--foreground); font-weight: 500; }
button.btn:hover, a.btn:hover { background: var(--muted); }
button.btn.primary, a.btn.primary { background: var(--primary); color: var(--primary-foreground); border-color: transparent; }
button.btn.primary:hover, a.btn.primary:hover { background: #1d4ed8; }
button.btn.danger { color: var(--destructive); background: color-mix(in oklch, var(--destructive) 10%, white); border-color: transparent; }
a.link, button.link { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; color: var(--primary); font-size: 12px; font-weight: 500; }
a.link:hover, button.link:hover { text-decoration: underline; }
button.icon-button { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: transparent; border: 0; }
button.icon-button:hover { background: var(--muted); }
.app-shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
.app-shell.sidebar-collapsed { grid-template-columns: 52px minmax(0, 1fr); }
.sidebar-brand-icon { display: none; }
.app-shell.sidebar-collapsed .sidebar-header { display: grid; place-items: center; padding: 12px 8px; }
.app-shell.sidebar-collapsed .sidebar-brand-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; }
.sidebar-brand-icon svg { width: 20px; height: 20px; }
.sidebar-brand-icon > .nav-label, .sidebar-profile > .nav-label { display: none; }
.app-shell.sidebar-collapsed #sidebar { z-index: 30; }
.app-shell.sidebar-collapsed #sidebar a.sidebar-flyout { background: var(--sidebar-accent); color: var(--sidebar-accent-foreground); border-radius: 4px 0 0 4px; }
.app-shell.sidebar-collapsed #sidebar a.sidebar-flyout > .nav-label {
  display: flex; align-items: center; position: fixed; z-index: 120; min-width: 156px;
  padding: 0 12px; border-radius: 0 4px 4px 0; background: var(--sidebar-accent);
  color: var(--sidebar-accent-foreground); font-size: 12px; font-weight: 500; white-space: nowrap;
  box-shadow: 4px 4px 12px #0f172a20;
}
.app-shell.sidebar-collapsed .theme-wordmark,
.app-shell.sidebar-collapsed .nav-caption,
.app-shell.sidebar-collapsed .side-nav a > span,
.app-shell.sidebar-collapsed .sidebar-profile > div,
.app-shell.sidebar-collapsed .sidebar-signout > span { display: none; }
.app-shell.sidebar-collapsed .side-nav a { justify-content: center; }
.app-shell.sidebar-collapsed .sidebar-bottom { padding: 8px; }
.app-shell.sidebar-collapsed .sidebar-profile,
.app-shell.sidebar-collapsed .sidebar-signout { justify-content: center; }
#sidebar { display: flex; flex-direction: column; align-self: start; position: sticky; top: 0; height: 100dvh; overflow-y: auto; background: var(--sidebar); color: var(--sidebar-foreground); }
.sidebar-header { min-height: 72px; padding: 8px 10px 16px; background: #252525; }
.theme-wordmark strong { font-size: 13px; font-weight: 600; }
.theme-wordmark small { overflow-wrap: anywhere; }
.nav-group { padding: 8px; }
.nav-caption { display: flex; align-items: center; min-height: 28px; margin: 0 0 0 8px !important; font-size: 12px; color: #bcbcbc; font-weight: 500; }
.side-nav { display: grid; gap: 1px; }
.side-nav a { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 4px; color: var(--sidebar-foreground); font-size: 12px; }
.side-nav a:hover { background: var(--sidebar-accent); }
.side-nav a[aria-current=page] { font-weight: 500; }
.side-nav :focus-visible { outline-color: var(--sidebar-ring) !important; }
.nav-count { margin-left: auto; padding: 0 5px; background: var(--sidebar-accent); border-radius: 4px; font-size: 11px; }
.sidebar-bottom { margin-top: auto; padding: 12px; border-top: 1px solid var(--sidebar-border); }
.sidebar-profile { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.sidebar-profile small { display: block; color: #bcbcbc; font-size: 11px; }
.sidebar-profile .avatar { background: #23324b; color: var(--sidebar-foreground); border-color: var(--sidebar-border); }
.theme-workspace { display: flex; flex-direction: column; }
.theme-topbar { flex-wrap: wrap; }
.header-context { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 12px; }
.header-context .balance { font-variant-numeric: tabular-nums; }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 50%; background: var(--muted); font-size: 10px; flex: none; }
.preview-controls { display: flex; flex-wrap: wrap; min-width: 0; align-items: center; justify-content: flex-end; gap: 8px; margin-left: auto; }
.segmented { display: flex; gap: 2px; }
.segmented button, button.reset { padding: 2px 6px; min-height: 28px; border-radius: 6px; border: 0; font-size: 12px; white-space: nowrap; }
.segmented button, .tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.card [data-slot="card-title"] { display: flex; align-items: center; gap: 6px; }
.card [data-slot="card-title"] svg { color: var(--muted-foreground); }
.auth-actions .link { justify-content: center; }
.segmented button[aria-pressed=true] { background: var(--secondary); font-weight: 500; }
.segmented button:hover, button.reset:hover { background: var(--muted); }
button.reset { color: var(--muted-foreground) !important; }
.theme-main-content { flex: 1; }
.badge { display: inline-flex; align-items: center; white-space: nowrap; font-size: 11px; font-weight: 500; border-radius: 4px; padding: 2px 6px; }
.badge.success { background: #edf7f0; color: #216b3d; }
.badge.warning { background: #fff4df; color: #805400; }
.badge.danger { background: #fdf0ef; color: #ab2920; }
.badge.neutral { background: var(--muted); color: var(--muted-foreground); }
.muted { color: var(--muted-foreground); }
.mono { font-family: var(--font-mono); font-size: 11px; }
.stat-value .badge { vertical-align: middle; }
.card { min-width: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-head p { color: var(--muted-foreground); margin-top: 4px !important; }
.card h3 { font-size: 14px; font-weight: 600; }
.card-head a, .card-head button { flex: none; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; }
.equal-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.table-scroll { overflow-x: auto; }
.table-scroll:focus-visible { outline-offset: -2px !important; }
table { width: 100%; }
th { text-align: left; border-block: 1px solid var(--border); }
td { border-bottom: 1px solid var(--border); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--muted); }
.cell-company { display: flex; align-items: center; gap: 8px; }
.company-mark { display: grid; place-items: center; width: 32px; height: 32px; background: var(--muted); color: var(--foreground); border-radius: 6px; flex: none; font-size: 11px; font-weight: 500; }
.cell-company strong { display: block; font-weight: 500; }
.cell-company small { display: block; font-size: 11px; color: var(--muted-foreground); }
.right { text-align: right; }
.amount { font-variant-numeric: tabular-nums; }
.card-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border); color: var(--muted-foreground); font-size: 12px; }
.toolbar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.search { position: relative; max-width: 340px; width: 100%; }
.search svg { position: absolute; left: 8px; top: 9px; color: var(--muted-foreground); }
.search input { padding-left: 30px; }
.toolbar select { width: 160px; }
.usage-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.usage-row:last-child { border: 0; }
.usage-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 8px; }
.usage-label { display: flex; align-items: center; gap: 8px; }
.usage-label svg { color: var(--muted-foreground); }
.bar { height: 4px; background: var(--muted); border-radius: 4px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--primary); }
.mini-details { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted-foreground); margin-top: 4px; }
.notice { display: flex; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; }
.notice svg { margin-top: 1px; }
.notice strong { font-weight: 600; }
.notice p { margin-top: 4px !important; }
.notice.neutral { color: var(--muted-foreground); }
.quick-links { display: grid; gap: 8px; }
.quick-link { display: flex; align-items: center; gap: 8px; text-align: left !important; width: 100%; padding: 8px; border-radius: 6px; }
.quick-link:hover { background: var(--muted); }
.quick-link strong { display: block; font-size: 12px; font-weight: 500; }
.quick-link small { font-size: 12px; color: var(--muted-foreground); }
.quick-link>svg { margin-left: auto; }
.service-icon { display: grid; place-items: center; width: 32px; height: 32px; background: var(--muted); color: var(--foreground); border-radius: 6px; flex: none; }
.tabs { display: flex; gap: 12px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs button { flex: none; padding: 6px 0; border-bottom: 2px solid transparent; font-size: 12px; font-weight: 500; white-space: nowrap; }
.tabs button[aria-pressed=true] { border-bottom-color: var(--primary); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
body:has(.bhandara-theme) .theme-field-error { margin: 5px 0 0 !important; }
body:has(.bhandara-theme) .field > .theme-field-error { margin: 0 !important; }
.field small { font-size: 12px; color: var(--muted-foreground); }
#settings-form { display: grid; gap: 16px; }
#settings-form .qr-placeholder { margin: 0; }
#settings-form .form-footer { padding-top: 0; }
.required { color: var(--destructive); }
.span-2 { grid-column: 1 / -1; }
.form-footer { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; padding-top: 12px; }
.price-input { display: inline-block !important; width: 110px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; cursor: pointer; }
.toggle input { margin: 0; }
.compact-list { display: grid; gap: 8px; margin: 0; }
.compact-list div { display: flex; align-items: start; justify-content: space-between; gap: 16px; font-size: 13px; }
.compact-list dt { color: var(--muted-foreground); flex: 1; min-width: 0; }
.compact-list dd { flex: 1; min-width: 0; }
.compact-list dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.small-note { color: var(--muted-foreground); font-size: 12px; }
.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bhandara-theme .service-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.service-card h2 { font-size: 14px; font-weight: 600; margin-bottom: 4px !important; }
.service-card p { font-size: 12px; color: var(--muted-foreground); }
.service-top, .service-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.service-bottom { border-top: 1px solid var(--border); padding-top: 12px; margin-top: auto; }
.service-price strong { font-size: 18px; font-weight: 600; }
.service-price small { font-size: 12px; color: var(--muted-foreground); }
.wallet-hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; }
.wallet-hero p, .wallet-hero small { font-size: 12px; color: var(--muted-foreground); }
.wallet-hero strong { display: block; margin: 6px 0; font-size: 24px; font-weight: 600; }
.amount-positive { color: #216b3d; }
.status-heading { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 16px; }
.status-heading svg { color: #216b3d; }
.status-heading h3 { font-size: 14px; }
.status-heading p { font-size: 12px; color: var(--muted-foreground); }
.status-heading.failed svg { color: var(--destructive); }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.result-grid dt { font-size: 12px; color: var(--muted-foreground); margin-bottom: 4px; }
.result-grid dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.result-score { font-size: 36px; font-weight: 600; color: var(--primary); line-height: 1.3; }
.steps { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-size: 12px; color: var(--muted-foreground); }
.steps span { display: flex; align-items: center; gap: 6px; }
.steps b { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--border); border-radius: 50%; font-weight: 500; }
.steps .active { color: var(--foreground); font-weight: 500; }
.steps .active b { color: var(--primary-foreground); background: var(--primary); border-color: var(--primary); }
.bhandara-theme .empty-state { padding: 32px 16px; text-align: center; color: var(--muted-foreground); }
.empty-state svg { width: 24px; height: 24px; margin-bottom: 8px; }
.empty-state h2 { color: var(--foreground); font-size: 14px; }
.empty-state p { font-size: 12px; margin-top: 4px !important; }
.workspace-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 8px 24px; color: var(--muted-foreground); font-size: 11px; }
dialog { width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--popover); color: var(--popover-foreground); font: inherit; font-size: 12px; box-shadow: 0 0 0 1px #0000001a; }
dialog::backdrop { background: #000c; backdrop-filter: blur(2px); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 16px; }
dialog h2 { margin: 0; font-size: 14px; font-weight: 500; }
.dialog-head p { font-size: 12px; color: var(--muted-foreground); margin-top: 4px !important; }
.dialog-body { padding: 0; }
.dialog-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; padding-top: 12px; }
.dialog-body .field { margin-bottom: 12px; }
.qr-placeholder { padding: 12px; text-align: center; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 16px; }
.qr-placeholder svg { width: 100px; height: 100px; margin: 8px 0; stroke: none; fill: #bbb; }
.qr-placeholder strong { display: block; font-size: 14px; font-weight: 500; }
.qr-placeholder p { font-size: 12px; color: var(--muted-foreground); }
.qr-placeholder .badge { margin-top: 8px; }
.receipt-preview { padding: 16px; border: 1px dashed var(--input); border-radius: 6px; text-align: center; margin: 12px 0; }
.receipt-preview strong { display: block; font-size: 24px; margin: 6px 0; }
.receipt-preview small { color: var(--muted-foreground); }
.dialog-body .notice { margin-top: 12px; }
.check-label { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; font-size: 12px; font-weight: 400; cursor: pointer; }
.check-label input { margin-top: 2px; }
.switch-line select { width: auto; max-width: 170px; font-size: 12px; }
#toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 32px); z-index: 100; padding: 12px 16px; border: 1px solid var(--border); border-radius: 6px; background: var(--popover); color: var(--popover-foreground); font-size: 12px; box-shadow: 0 2px 8px #0001; }
#mobile-nav { left: 0; top: 0; margin: 0; width: 288px; height: 100dvh; max-height: none; padding: 0; border-radius: 0; border: 0; background: var(--sidebar); color: var(--sidebar-foreground); }
#mobile-nav .icon-button { position: absolute; right: 8px; top: 8px; color: var(--sidebar-foreground); }
#mobile-nav .icon-button:hover { background: var(--sidebar-accent); color: var(--sidebar-accent-foreground); }
#mobile-nav .sidebar-bottom { margin-top: 24px; }
#mobile-nav :focus-visible { outline-color: var(--sidebar-ring) !important; }
#main:focus { outline: none; }
.service-pill { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 6px; border-radius: 4px; background: var(--muted); font-size: 11px; color: var(--muted-foreground); }
.inline-actions { display: flex; align-items: center; gap: 8px; }
.credit-placeholder { border: 1px solid var(--border); padding: 12px; border-radius: 6px; margin-top: 16px; }
.credit-placeholder p { margin-top: 4px !important; color: var(--muted-foreground); font-size: 12px; }
.fund-summary { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.fund-summary:last-child { border: 0; }
.fund-summary>div { flex: 1; min-width: 0; }
.fund-summary strong { display: block; font-size: 12px; font-weight: 500; }
.fund-summary small { display: block; font-size: 11px; color: var(--muted-foreground); }
.fund-summary .amount { white-space: nowrap; font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }
@media (max-width: 767px) {
  .app-shell { display: block; }
  #sidebar { display: none; }
  .theme-topbar { gap: 8px; }
  .preview-controls { margin-left: auto; max-width: 100%; gap: 4px; }
  .card-head { flex-wrap: wrap; }
  .auth-card .link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
  .header-context { width: 100%; justify-content: flex-end; }
  .header-context:not(:has(select)) { display: none; }
  .header-context .avatar, .header-context .user-name { display: none; }
  .header-context .muted { display: none; }
  .segmented button, button.reset { font-size: 11px; padding: 4px 6px; }
  .equal-col, .service-grid, .field-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .wallet-hero { flex-wrap: wrap; }
  .wallet-hero .btn { width: 100%; }
  .workspace-footer { padding: 8px 16px; }
  .toolbar .search { max-width: none; flex: 1; min-width: 160px; }
  .toolbar select { width: 120px; }
  .price-input { width: 90px; }
  .steps { gap: 8px; }
  .fund-summary { flex-wrap: wrap; }
  .fund-summary>div { flex-basis: 100%; }
  .fund-summary>.btn { margin-left: auto; }
}
@media (pointer: coarse) {
  body:has(.bhandara-theme) :is([data-slot="input"],[data-slot="native-select"],[data-slot="textarea"]) { font-size: 16px; }
  .segmented button, button.reset, .icon-button { min-height: 44px !important; }
  .icon-button { min-width: 44px !important; }
  .toggle, .check-label, .sidebar-signout, .tabs button { min-height: 44px; }
  body:has(.bhandara-theme) .auth-password input { height: 44px; min-height: 44px; }
  .auth-password .password-toggle { flex-basis: 44px; width: 44px; min-width: 44px; min-height: 44px; }
  .search svg { top: 14px; }
}
@media (max-width: 360px) { .preview-controls > .badge { display: none; } }

/* Native adaptation of the theme Skeleton loading state. */
.theme-page-loader { display: grid; gap: 12px; width: 100%; }
.theme-page-loader [data-slot="skeleton"] { border-radius: 6px; background: var(--muted); animation: theme-skeleton-pulse 2s ease-in-out infinite; }
.theme-page-loader .card-body { display: grid; gap: 12px; min-height: 160px; }
.loader-title { height: 24px; width: min(220px, 65%); }
.loader-subtitle { height: 12px; width: min(340px, 85%); margin-bottom: 12px; }
.loader-label { height: 16px; width: min(160px, 60%); }
.loader-line { height: 16px; width: 100%; }
.loader-short { height: 16px; width: 67%; }
@keyframes theme-skeleton-pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .theme-page-loader [data-slot="skeleton"] { animation: none; } }

/* Compact theme buttons. */
body:has(.bhandara-theme) .btn { gap: 4px; }
.btn svg { width: 14px; height: 14px; }
.theme-heading-actions { gap: 6px; }

.revenue-body { display: grid; gap: 16px; }
.revenue-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 12px; }
.revenue-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.revenue-legend i { width: 8px; height: 8px; border-radius: 2px; }
.revenue-key, .revenue-bar { background: var(--primary); }
.cost-key, .cost-bar { background: #94a3b8; }
.revenue-legend small { margin-left: auto; color: var(--muted-foreground); font-size: 11px; }
.revenue-chart { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 8px; margin: 0; }
.revenue-axis { height: 160px; display: flex; flex-direction: column; justify-content: space-between; color: var(--muted-foreground); font-size: 10px; }
.revenue-plot { position: relative; min-width: 0; }
.revenue-grid { position: absolute; inset: 0 0 auto; height: 160px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.revenue-grid span { border-top: 1px solid var(--border); }
.revenue-bars { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.revenue-day { min-width: 0; display: grid; grid-template-rows: 160px auto; gap: 6px; padding: 0; border-radius: 4px; }
.revenue-track { display: flex; justify-content: center; align-items: flex-end; gap: 3px; height: 160px; }
.revenue-track > span { display: block; width: min(18px, 35%); min-height: 2px; border-radius: 3px 3px 0 0; }
.revenue-date { padding: 4px 0; color: var(--muted-foreground); font-size: 11px; line-height: 1.2; }
.revenue-date small { display: block; font-size: 10px; }
.revenue-day[aria-pressed=true] .revenue-date { color: var(--primary); background: var(--secondary); border-radius: 4px; font-weight: 600; }
.revenue-day:hover .revenue-track { background: color-mix(in oklch, var(--muted) 50%, transparent); }
.revenue-insight { display: flex; align-items: center; gap: 16px; padding: 10px 12px; background: var(--muted); border-radius: 6px; }
.revenue-insight > strong { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; font-weight: 500; }
.revenue-insight .compact-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); flex: 1; gap: 12px; }
.revenue-insight .compact-list > div { display: block; border: 0; padding: 0; }
.revenue-insight dd { margin-top: 4px; text-align: left; font-weight: 600; }
.revenue-profit { color: #216b3d; }
.revenue-loss { color: var(--destructive); }
@media (max-width: 767px) {
  .revenue-legend { gap: 8px; }
  .revenue-legend small { width: 100%; margin-left: 0; }
  .revenue-insight { flex-wrap: wrap; gap: 12px; }
  .revenue-insight .compact-list { flex-basis: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .revenue-bars { gap: 4px; }
}

.admin-analytics > .card { display: flex; flex-direction: column; }
.admin-analytics .usage-chart-body { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.usage-chart-content { display: flex; flex: 1; align-items: center; justify-content: center; flex-wrap: wrap; gap: 24px; padding: 16px 0; }
.usage-donut { position: relative; width: 160px; height: 160px; flex: none; border-radius: 50%; }
.usage-donut-center { position: absolute; inset: 22%; border-radius: 50%; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.usage-donut-center strong { font-size: 24px; font-weight: 600; line-height: 1.2; }
.usage-donut-center small { color: var(--muted-foreground); font-size: 11px; }
.usage-chart-legend { display: grid; gap: 14px; padding: 0; margin: 0; list-style: none; width: min(230px, 100%); }
.usage-chart-legend li { display: grid; grid-template-columns: minmax(0, 1fr) 20px 44px; align-items: center; gap: 8px; font-size: 12px; }
.usage-chart-name { display: flex; align-items: center; gap: 8px; }
.usage-chart-name i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.usage-chart-legend strong { font-weight: 500; text-align: right; }
.usage-chart-legend small { text-align: right; font-size: 11px; color: var(--muted-foreground); }
@media (max-width: 767px) { .usage-chart-content { gap: 20px; padding: 8px 0; } }

@media (min-width: 768px) and (max-width: 1100px) { .admin-analytics { grid-template-columns: 1fr; } }

.usage-donut-svg { display: block; width: 160px; height: 160px; overflow: visible; }
.usage-donut-svg circle { stroke-linecap: butt; }
.usage-donut-svg [data-chart-tooltip] { cursor: help; }
.usage-donut-svg [data-chart-tooltip]:hover, .usage-donut-svg [data-chart-tooltip]:focus-visible { filter: brightness(1.15); }
.usage-donut-center { pointer-events: none; }
#chart-tooltip { position: fixed; z-index: 110; max-width: min(240px, calc(100vw - 16px)); padding: 6px 12px; border-radius: 6px; background: var(--foreground); color: var(--background); font-size: 12px; line-height: 1.65; white-space: pre-line; }

.role-permissions { max-width: 420px; white-space: normal; }
.permission-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; }
@media (pointer: coarse) { .permission-toggle { min-height: 44px; } }

@media (max-width: 767px) { .tabs { gap: 8px; flex-wrap: wrap; overflow: visible; } }

/* Company API setup reuses theme cards, controls and native disclosure elements. */
.api-card-body, .api-guide { display: grid; gap: 12px; }
.api-status-row, .api-actions, .source-tag { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.api-status-row { justify-content: space-between; }
.api-key-mask, .api-path { font-family: var(--font-mono); font-size: 11px; overflow-wrap: anywhere; }
.api-key-empty { display: grid; justify-items: start; gap: 8px; color: var(--muted-foreground); }
.api-key-empty strong { color: var(--foreground); font-size: 13px; font-weight: 500; }
.api-key-empty p { font-size: 12px; }
.api-endpoint { border: 1px solid var(--border); border-radius: 6px; min-width: 0; }
.api-endpoint summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; list-style: none; font-size: 12px; }
.api-endpoint summary::-webkit-details-marker { display: none; }
.api-endpoint summary:hover { background: var(--muted); }
.api-endpoint summary strong { font-weight: 500; }
.api-endpoint summary span { margin-left: auto; color: var(--muted-foreground); font-size: 11px; }
.api-endpoint summary > svg:last-child { margin-left: auto; }
.api-endpoint[open] summary > svg:last-child { transform: rotate(90deg); }
.api-endpoint-body { display: grid; gap: 12px; padding: 12px; border-top: 1px solid var(--border); }
.api-endpoint-body h3, .api-example > strong { font-size: 12px; font-weight: 500; }
.api-example { min-width: 0; }
.api-example pre { margin: 6px 0 0; padding: 12px; background: var(--muted); border-radius: 6px; font-family: var(--font-mono); font-size: 11px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.source-tag { flex-wrap: nowrap; font-size: 11px; color: var(--muted-foreground); }
@media (pointer: coarse) { .api-endpoint summary { min-height: 44px; } }

/* Granular role controls reuse the native theme checkboxes and dialog. */
dialog:has(#admin-role-form) { width: min(720px, calc(100vw - 32px)); }
.permission-summary { margin: 0 0 4px; font-size: 13px; font-weight: 500; }
.permission-summary > span { font-weight: 400; }
.permission-groups { columns: 2; column-gap: 12px; margin-top: 12px; }
.permission-group { min-width: 0; margin: 0 0 10px; padding: 4px 10px 8px; break-inside: avoid; border: 1px solid var(--border); border-radius: 6px; }
.permission-group legend { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 0; font-weight: 500; }
.permission-actions { display: grid; gap: 2px; }
.permission-group .permission-toggle { min-height: 24px; }
.permission-group-action { padding: 2px 4px; min-height: 24px; border: 0; border-radius: 4px; background: var(--background); color: var(--foreground); font-size: 12px; font-weight: 500; white-space: nowrap; }
.permission-group-action:hover { background: var(--muted); }
.permission-group legend .muted { font-weight: 400; }
.permission-toggle:has(:disabled) { color: var(--muted-foreground); cursor: not-allowed; }
.permission-toggle input { flex: none; }
.admin-preview-switch { display: flex; align-items: center; gap: 6px; min-width: 0; }
.admin-preview-switch select { max-width: 260px; width: 100%; }
input:disabled, select:disabled, textarea:disabled { background: var(--muted); color: var(--muted-foreground); cursor: not-allowed; }
@media (max-width: 767px) {
  .permission-groups { columns: 1; }
  .admin-preview-switch { flex-wrap: wrap; width: 100%; }
  .admin-preview-switch select { max-width: 100%; }
}

@media (pointer: coarse) { .permission-group .permission-toggle, .permission-group-action { min-height: 44px; } }

/* Only modal content scrolls; shared headers and action bars stay visible. */
#modal[open] { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
#modal > .dialog-head { flex: none; margin: 0; padding: 16px; border-bottom: 1px solid var(--border); background: var(--popover); }
#modal > .dialog-content { flex: 1 1 auto; min-height: 0; padding: 16px; overflow: auto; }
#modal > .dialog-footer { flex: none; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--popover); }
