:root, :root[data-theme="emerald-classic"] {
    --brand-primary: #075746;
    --brand-dark: #043D32;
    --brand-hover: #096B50;
    --brand-soft: #E1EFE4;
    --app-background: #F7F5F2;
    --sidebar-background: #F0EEEA;
    --surface-primary: #FFFFFF;
    --surface-secondary: #F3F2F0;
    --border-color: #E5E2DD;
    --text-primary: #141C19;
    --text-secondary: #626762;
    --text-muted: #626762;
    --chart-line: #8FF2D5;
    --sale-icon: #075B3D;
    --sale-background: #E2F0E5;
    --inventory-icon: #174FC4;
    --inventory-background: #E3ECFA;
    --expense-icon: #B6530A;
    --expense-background: #FCEBD9;
    --customer-icon: #66518C;
    --customer-background: #EEE6F8;
    --delivery-icon: #315BA7;
    --delivery-background: #E5ECF8;
    --tools-icon: #505452;
    --tools-background: #EBEBEA;
    --radius-card: 22px;
    --radius-button: 12px;
    --shadow-card: 0 8px 30px rgba(24, 39, 30, .055);
    --focus-color: #16805C;
    --gradient-revenue: linear-gradient(135deg, #246B56 0%, #075044 50%, #03382E 100%);
    --gradient-navigation: linear-gradient(135deg, #087653, #064A38);
    --gradient-store: linear-gradient(145deg, #628456, #07513D);
    --gradient-mark: linear-gradient(145deg, #0B8E61, #07513D);
    --text-on-dark: #FFFFFF;
    --text-nav: #242B27;
    --icon-nav: #424A46;
    --hover-nav: #E4E9E2;
    --border-soft: #EEEAE5;
    --border-subtle: #EEECE8;
    --border-nav: #DDDCD7;
    --search-background: #F4F3F1;
    --search-border: #D8D8D4;
    --search-text: #404942;
    --search-focus-border: #CCD7D0;
    --icon-subtle: #69736B;
    --positive: #087443;
    --negative: #C83A34;
    --chart-fill: #6CEBC5;
    --chart-text: #D3E9DF;
    --growth-text: #B8F7E1;
    --dark-overlay-8: #FFFFFF14;
    --dark-overlay-14: #FFFFFF24;
    --dark-divider: #FFFFFF33;
    --dark-border: #FFFFFF50;
    --error-background: #FFF0D9;
    --error-text: #653A00;    color-scheme: light;
}
* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; background: var(--app-background); color: var(--text-primary); font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--focus-color); outline-offset: 3px; }
.icon { width: 22px; height: 22px; flex: none; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 238px; flex: none; background: var(--sidebar-background); border-left: 1px solid var(--border-color); padding: 25px 14px 18px; display: flex; flex-direction: column; min-height: 100vh; }
.brand { height: 63px; display: flex; align-items: center; gap: 9px; padding: 0 16px; color: var(--brand-dark); font-size: 34px; font-weight: 850; letter-spacing: -.06em; }
.brand-mark { width: 30px; height: 30px; display: block; flex: none; border-radius: 8px; object-fit: cover; }
.side-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 20px; }
.nav-item { display: flex; align-items: center; gap: 14px; min-height: 47px; border-radius: 11px; padding: 0 15px; font-weight: 650; color: var(--text-nav); transition: background .16s, color .16s; }
.nav-item .icon { color: var(--icon-nav); }
.nav-item:hover { background: var(--hover-nav); }
.nav-item.active { background: var(--gradient-navigation); color: var(--text-on-dark); box-shadow: 0 4px 12px rgba(4, 61, 50, .14); }
.nav-item.active .icon { color: var(--text-on-dark); }
.nav-label { border-top: 1px solid var(--border-nav); margin: 21px 8px 7px; padding: 20px 9px 0; color: var(--text-secondary); font-size: 13px; }
.sidebar-foot { margin-top: auto; border: 1px solid var(--border-color); background: rgba(255,255,255,.7); border-radius: 16px; padding: 12px; display: flex; align-items: center; gap: 10px; }
.sidebar-foot strong, .business-title strong { display: block; }
.sidebar-foot small, .business-title small { display: block; color: var(--text-secondary); font-size: 12px; margin-top: 2px; }
.store-avatar { width: 42px; height: 42px; display: grid; place-items: center; flex: none; color: var(--text-on-dark); background: var(--gradient-store); border-radius: 12px; }
.app-content { min-width: 0; flex: 1; }
.topbar { min-height: 82px; display: flex; align-items: center; gap: 24px; padding: 13px 34px; background: rgba(255,255,255,.72); border-bottom: 1px solid var(--border-color); }
.business-title { display: flex; align-items: center; gap: 11px; white-space: nowrap; }
.business-title strong { font-size: 20px; }
.global-search { min-width: 0; max-width: 620px; flex: 1; margin-inline: auto; height: 48px; padding: 0 16px; display: flex; align-items: center; gap: 12px; background: var(--search-background); border: 1px solid var(--search-border); border-radius: 25px; color: var(--text-secondary); }
.global-search:hover { border-color: var(--focus-color); }
.global-search span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.global-search kbd { margin-inline-start: auto; border: 1px solid var(--search-border); border-radius: 9px; padding: 2px 7px; color: var(--search-text); background: var(--text-on-dark); white-space: nowrap; font-family: inherit; font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.demo-badge { display: flex; align-items: center; gap: 6px; background: var(--brand-soft); color: var(--brand-primary); border-radius: 24px; padding: 8px 11px; white-space: nowrap; font-size: 13px; font-weight: 700; }
.demo-badge .icon { width: 16px; height: 16px; }
.round-button { width: 38px; height: 38px; display: grid; place-items: center; color: var(--text-primary); border-radius: 50%; }
.round-button:hover { background: var(--surface-secondary); }
.main-content { max-width: 1550px; margin: auto; padding: 29px 32px 48px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 6px; color: var(--brand-primary); font-weight: 700; font-size: 13px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(26px, 2.7vw, 38px); line-height: 1.3; margin-bottom: 4px; }
h2 { font-size: 21px; line-height: 1.35; margin-bottom: 0; }
.subtle { color: var(--text-secondary); font-size: 14px; margin-bottom: 0; }
.heading-chip { display: flex; align-items: center; gap: 8px; background: var(--surface-primary); padding: 9px 14px; border: 1px solid var(--border-color); border-radius: 14px; box-shadow: var(--shadow-card); white-space: nowrap; font-weight: 600; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, .95fr); grid-template-areas: "revenue summary" "quick activity" "followup activity"; gap: 24px; align-items: start; }
.revenue-card { grid-area: revenue; min-width: 0; min-height: 315px; color: var(--text-on-dark); border-radius: 24px; background: var(--gradient-revenue); padding: 26px 30px 22px; box-shadow: 0 14px 32px rgba(3, 56, 46, .15); overflow: hidden; }
.revenue-top { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.revenue-label { font-size: 18px; font-weight: 700; }
.revenue-amount { font-size: clamp(38px, 4vw, 58px); font-weight: 750; letter-spacing: -.04em; line-height: 1.2; white-space: nowrap; }
.revenue-amount small { font-size: 22px; }
.growth-pill { background: var(--dark-overlay-14); color: var(--growth-text); padding: 8px 12px; border-radius: 30px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.revenue-chart { width: 100%; height: 135px; display: block; margin: 1px 0 0; border-bottom: 1px solid var(--dark-border); }
.revenue-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 17px; }
.revenue-stats > div { padding-inline: 16px; border-inline-start: 1px solid var(--dark-divider); }
.revenue-stats > div:first-child { padding-inline-start: 0; border: 0; }
.revenue-stats span { display: block; color: var(--chart-text); font-size: 12px; margin-bottom: 3px; }
.revenue-stats strong { font-size: 23px; white-space: nowrap; }
.panel { background: var(--surface-primary); border: 1px solid var(--border-soft); border-radius: var(--radius-card); padding: 20px 22px; box-shadow: var(--shadow-card); min-width: 0; }
.business-summary { grid-area: summary; }
.panel-title { display: flex; align-items: start; gap: 10px; margin-bottom: 13px; }
.panel-title > .icon { color: var(--brand-primary); margin-top: 3px; }
.panel-title span { font-size: 12px; color: var(--text-secondary); }
.summary-item, .activity-item, .feature-result { display: flex; align-items: center; gap: 11px; padding: 12px 0; border-top: 1px solid var(--border-subtle); }
.summary-item > span:nth-child(2), .activity-item > span:nth-child(2), .followup-row > span:nth-child(2), .result-row > span:nth-child(2) { min-width: 0; flex: 1; }
.summary-item strong, .activity-item strong, .followup-row strong, .result-row strong { display: block; font-size: 14px; line-height: 1.4; }
.summary-item small, .activity-item small, .followup-row small, .result-row small { display: block; color: var(--text-secondary); font-size: 12px; line-height: 1.45; margin-top: 3px; }
.summary-item > .icon { width: 17px; color: var(--icon-subtle); }
.summary-item:hover strong, .followup-row:hover strong { color: var(--brand-primary); }
.soft-icon { width: 41px; height: 41px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.soft-icon.green { background: var(--sale-background); color: var(--sale-icon); }
.soft-icon.blue { background: var(--inventory-background); color: var(--inventory-icon); }
.soft-icon.orange { background: var(--expense-background); color: var(--expense-icon); }
.quick-section { grid-area: quick; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 15px; }
.text-link { color: var(--brand-primary); font-weight: 700; font-size: 13px; white-space: nowrap; }
.text-link:hover { text-decoration: underline; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 11px; }
.quick-card { min-height: 100px; border-radius: 17px; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; transition: transform .15s, box-shadow .15s; }
.quick-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.quick-card > .icon { width: 28px; height: 28px; }
.quick-card span { font-weight: 750; line-height: 1.35; }
.quick-card.sale { color: var(--sale-icon); background: var(--sale-background); }
.quick-card.stock { color: var(--inventory-icon); background: var(--inventory-background); }
.quick-card.expense { color: var(--expense-icon); background: var(--expense-background); }
.quick-card.customer { color: var(--customer-icon); background: var(--customer-background); }
.quick-card.delivery { color: var(--delivery-icon); background: var(--delivery-background); }
.quick-card.tools { color: var(--tools-icon); background: var(--tools-background); }
.activity-panel { grid-area: activity; }
.activity-item b { white-space: nowrap; font-size: 13px; }
.positive { color: var(--positive); }
.negative { color: var(--negative); }
.panel-link { display: block; text-align: center; border: 1px solid var(--border-color); padding: 9px; border-radius: 12px; font-weight: 700; font-size: 13px; margin-top: 14px; }
.panel-link:hover { background: var(--brand-soft); }
.followup-section { grid-area: followup; }
.followup-row { display: flex; align-items: center; gap: 13px; background: var(--surface-primary); border: 1px solid var(--border-color); padding: 12px 15px; border-radius: 15px; margin-top: 7px; }
.row-action { color: var(--brand-primary); background: var(--brand-soft); padding: 8px 12px; border-radius: 11px; white-space: nowrap; font-size: 12px; font-weight: 700; }
.bottom-nav { display: none; }
.search-page { max-width: 1100px; margin: auto; }
.search-input-wrap { display: flex; align-items: center; gap: 12px; min-height: 62px; background: var(--surface-primary); border: 1px solid var(--search-focus-border); border-radius: 19px; padding: 0 18px; box-shadow: var(--shadow-card); }
.search-input-wrap:focus-within { border-color: var(--brand-primary); }
.search-input-wrap > .icon { color: var(--brand-primary); }
.search-input-wrap input { flex: 1; width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-primary); font-size: 18px; }
.search-input-wrap input::placeholder { color: var(--text-secondary); }
.search-scope { color: var(--text-secondary); font-size: 12px; white-space: nowrap; }
.search-columns { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; margin-top: 22px; align-items: start; }
.result-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--border-color); }
.product-icon { width: 43px; height: 43px; display: grid; place-items: center; background: var(--sale-background); color: var(--sale-icon); border-radius: 12px; flex: none; }
.quantity { color: var(--text-secondary); white-space: nowrap; font-size: 13px; }
.quantity b { color: var(--brand-primary); }
.feature-result > strong { flex: 1; font-size: 14px; }
.feature-result > .icon { width: 17px; }
.feature-result:hover { color: var(--brand-primary); }
.empty-state { color: var(--text-secondary); padding: 18px 0 4px; }
.feature-page { max-width: 600px; margin: 12vh auto; text-align: center; background: var(--surface-primary); border: 1px solid var(--border-color); border-radius: 24px; padding: 50px 35px; box-shadow: var(--shadow-card); }
.feature-page h1 { margin: 18px 0 12px; }
.feature-page p { line-height: 1.8; color: var(--text-secondary); }
.feature-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--brand-soft); border-radius: 22px; color: var(--brand-primary); font-weight: 700; font-size: 13px; }
.feature-badge .icon { width: 17px; height: 17px; }
.primary-link { display: inline-block; margin-top: 12px; padding: 11px 20px; border-radius: var(--radius-button); background: var(--brand-primary); color: var(--text-on-dark); font-weight: 700; }
.primary-link:hover { background: var(--brand-hover); }
#blazor-error-ui { display: none; background: var(--error-background); color: var(--error-text); position: fixed; bottom: 0; left: 0; right: 0; padding: 12px 20px; z-index: 1000; }
#blazor-error-ui .dismiss { position: absolute; left: 15px; cursor: pointer; }
.loading-progress { position: absolute; inset: 30vh 0 auto; width: 90px; height: 90px; margin: auto; }
.loading-progress circle { fill: none; stroke: var(--brand-primary); stroke-width: 5px; }

@media (max-width: 1180px) {
    .sidebar { width: 200px; }
    .topbar { gap: 14px; padding-inline: 22px; }
    .main-content { padding-inline: 22px; }
    .dashboard-grid { grid-template-columns: minmax(0, 1.5fr) minmax(260px, .9fr); gap: 16px; }
    .revenue-card { padding: 22px; }
    .growth-pill { font-size: 11px; }
}
@media (max-width: 980px) {
    .sidebar { display: none; }
    .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; height: 70px; padding: 5px 12px calc(5px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.97); border-top: 1px solid var(--border-color); justify-content: space-around; }
    .bottom-nav a { display: flex; flex: 1; align-items: center; justify-content: center; flex-direction: column; gap: 2px; border-radius: 13px; color: var(--text-secondary); font-size: 11px; }
    .bottom-nav a.active { background: var(--brand-soft); color: var(--brand-primary); font-weight: 750; }
    .bottom-nav .icon { width: 21px; height: 21px; }
    .main-content { padding-bottom: 105px; }
}
@media (max-width: 720px) {
    .topbar { min-height: 67px; padding: 10px 16px; justify-content: space-between; }
    .business-title { margin-inline-end: auto; }
    .business-title .store-avatar { width: 37px; height: 37px; }
    .business-title strong { font-size: 17px; }
    .business-title small { display: none; }
    .global-search { display: none; }
    .demo-badge { font-size: 0; padding: 9px; }
    .demo-badge .icon { width: 19px; height: 19px; }
    .top-actions { gap: 2px; }
    .main-content { padding: 21px 14px 105px; }
    .page-heading { margin-bottom: 18px; }
    .page-heading h1 { font-size: 27px; }
    .heading-chip { display: none; }
    .dashboard-grid { display: flex; flex-direction: column; gap: 22px; }
    .dashboard-grid > * { width: 100%; }
    .revenue-card { min-height: 280px; }
    .revenue-amount { font-size: 43px; }
    .revenue-label { font-size: 15px; }
    .growth-pill { font-size: 11px; padding: 7px 9px; }
    .revenue-chart { height: 115px; }
    .revenue-stats strong { font-size: 17px; }
    .revenue-stats span { font-size: 10px; }
    .quick-grid { grid-template-columns: repeat(3, 1fr); gap: 9px; }
    .quick-card { min-height: 106px; padding: 12px; font-size: 13px; }
    .quick-card > .icon { width: 25px; height: 25px; }
    .panel { padding: 18px; }
    .search-columns { display: flex; flex-direction: column; gap: 18px; }
    .search-columns > * { width: 100%; }
    .search-scope { display: none; }
    .quantity { font-size: 12px; }
}
@media (max-width: 390px) {
    .revenue-card { padding: 18px; }
    .revenue-amount { font-size: 37px; }
    .growth-pill { white-space: normal; max-width: 130px; text-align: center; }
    .revenue-stats > div { padding-inline: 7px; }
    .quick-card { padding: 10px; }
    .row-action { display: none; }
}

/* v0.2 business and branch context */
.context-switchers { display: flex; align-items: center; gap: 8px; min-width: 0; }
.context-switchers label { display: flex; align-items: center; gap: 5px; min-width: 0; color: var(--text-secondary); font-size: 12px; font-weight: 700; }
.context-switchers select { min-width: 0; max-width: 138px; height: 37px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--surface-primary); color: var(--text-primary); padding: 0 8px; font: inherit; font-size: 12px; cursor: pointer; }
.context-switchers select:hover { border-color: var(--brand-primary); }

@media (max-width: 1180px) {
    .context-switchers label span { display: none; }
    .context-switchers select { max-width: 118px; }
}
@media (max-width: 720px) {
    .topbar { flex-wrap: wrap; }
    .context-switchers { order: 3; flex: 0 0 100%; }
    .context-switchers label { flex: 1; }
    .context-switchers select { width: 100%; max-width: none; }
}

.auth-shell { min-height: 100vh; padding: 32px 16px; background: var(--app-background); display: flex; flex-direction: column; align-items: center; }
.auth-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 26px; color: var(--brand-primary); }
.auth-brand strong { font-size: 32px; }
.auth-brand > span:last-child { font-size: 14px; margin-inline-start: 10px; }
.auth-card { width: min(100%, 510px); background: var(--surface-primary); border: 1px solid var(--border-color); border-radius: 23px; padding: 30px; box-shadow: var(--shadow-card); }
.auth-card h1 { font-size: 26px; }
.auth-form { display: grid; gap: 15px; margin-top: 24px; }
.auth-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 700; }
.auth-form input, .auth-form select { width: 100%; min-height: 45px; padding: 9px 12px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--surface-primary); color: var(--text-primary); }
.auth-form input:focus, .auth-form select:focus { border-color: var(--brand-primary); }
.auth-submit { width: 100%; border: 0; border-radius: 11px; background: var(--brand-primary); color: var(--text-on-dark); min-height: 47px; font-weight: 700; cursor: pointer; }
.auth-submit:disabled { opacity: .6; cursor: wait; }
.auth-link { display: grid; place-items: center; margin-top: 20px; }
.auth-footer { text-align: center; margin: 22px 0 0; font-size: 14px; }
.auth-footer a { color: var(--brand-primary); font-weight: 700; }
.form-message { padding: 11px 13px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-primary); line-height: 1.6; }
.form-message.error { background: var(--error-background); color: var(--error-text); }
@media (max-width: 600px) { .auth-card { padding: 22px; } .auth-brand > span:last-child { display: none; } }

.account-menu { position: relative; min-width: 0; }
.active-account { display: flex; align-items: center; gap: 8px; min-width: 190px; max-width: 270px; padding: 6px 10px; border: 1px solid var(--border-color); border-radius: 13px; background: var(--surface-primary); cursor: pointer; list-style: none; }
.active-account::-webkit-details-marker { display: none; }
.active-account:hover, .account-menu[open] .active-account { border-color: var(--brand-primary); background: var(--brand-soft); }
.active-account:focus-visible { outline: 2px solid var(--focus-color); outline-offset: 2px; }
.account-label { min-width: 0; flex: 1; }
.account-label strong, .account-label small { overflow: hidden; text-overflow: ellipsis; }
.account-caret { color: var(--text-secondary); font-size: 18px; }
.account-menu-panel { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 40; width: max(220px, 100%); padding: 6px; border: 1px solid var(--border-color); border-radius: 14px; background: var(--surface-primary); box-shadow: var(--shadow-card); }
.account-menu-panel a, .account-menu-panel button { display: block; width: 100%; padding: 11px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--text-primary); font: inherit; text-align: start; text-decoration: none; cursor: pointer; }
.account-menu-panel a:hover, .account-menu-panel button:hover { background: var(--brand-soft); color: var(--brand-primary); }
.account-preferences { max-width: 560px; }
.account-preferences .auth-form { max-width: 480px; margin-top: 18px; }
.install-panel { max-width: 680px; }
.install-panel h2 { margin: 18px 0 9px; }
.install-panel .auth-submit { width: auto; padding-inline: 24px; }
.offline-status-panel { max-width: 720px; }
.offline-status-panel .auth-submit { width: auto; padding-inline: 22px; margin: 10px 0 18px; }
.offline-sale-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; padding: 13px 0; border-top: 1px solid var(--border-color); }
.offline-sale-row strong { color: var(--brand-primary); }
.offline-sale-row a { color: var(--brand-primary); font-weight: 700; }
.offline-sale-details { flex-basis: 100%; color: var(--text-secondary); font-size: 13px; }
.offline-sale-details summary { cursor: pointer; color: var(--brand-primary); font-weight: 700; }
.offline-sale-details ul { margin: 8px 0; padding-inline-start: 20px; }
@media (max-width: 600px) { .offline-status-panel .auth-submit { width: 100%; } .offline-sale-row { display: grid; gap: 5px; } }
.pos-heading-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.update-notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 30px; background: var(--brand-soft); color: var(--text-primary); border-bottom: 1px solid var(--border-color); font-size: 13px; }
.update-notice button { border: 1px solid var(--border-color); border-radius: 9px; background: var(--surface-primary); color: var(--brand-primary); padding: 6px 12px; cursor: pointer; white-space: nowrap; }
@media (max-width: 720px) { .update-notice { padding: 10px 16px; align-items: start; } }
.active-account-avatar { width: 31px; height: 31px; display: grid; place-items: center; flex: none; border-radius: 10px; background: var(--brand-soft); color: var(--brand-primary); }
.active-account-avatar .icon { width: 18px; height: 18px; }
.active-account strong, .active-account small { display: block; line-height: 1.25; white-space: nowrap; }
.active-account strong { font-size: 13px; }
.active-account small { color: var(--text-secondary); font-size: 11px; margin-top: 2px; }
@media (max-width: 1180px) { .active-account { min-width: 145px; max-width: 190px; } }
@media (max-width: 720px) { .active-account { min-width: 0; width: 44px; padding: 5px; } .active-account .account-label, .active-account .account-caret { display: none; } .account-menu-panel { width: 220px; } }

:root[data-theme="ocean"] {
    --brand-primary: #155D88; --brand-dark: #123D5A; --brand-hover: #1C709C;
    --brand-soft: #E1EFF7; --sidebar-background: #EDF3F6; --app-background: #F5F8FA;
    --focus-color: #237CA5; --sale-icon: #136A72; --sale-background: #E0F2F0;
    --inventory-icon: #235CB0; --inventory-background: #E5EEFA;
    --gradient-revenue: linear-gradient(135deg, #217B98, #155676 55%, #103C5B);
    --gradient-navigation: linear-gradient(135deg, #257CA5, #155676);
    --gradient-store: linear-gradient(145deg, #6195A5, #155676);
    --gradient-mark: linear-gradient(145deg, #218CA8, #155676);
}
:root[data-theme="charcoal"] {
    --brand-primary: #8DDEBD; --brand-dark: #A8EBCF; --brand-hover: #60C99A;
    --brand-soft: #1F4A3D; --app-background: #131A1A; --sidebar-background: #1B2524;
    --surface-primary: #25302E; --surface-secondary: #2D3937; --border-color: #3D4946;
    --text-primary: #F1F5F2; --text-secondary: #B8C6BF; --text-muted: #B8C6BF;
    --text-nav: #E5EEE9; --icon-nav: #B8C6BF; --hover-nav: #30433B;
    --border-soft: #3D4946; --border-subtle: #3D4946; --border-nav: #45514D;
    --search-background: #25302E; --search-border: #4A5953; --search-text: #F1F5F2;
    --search-focus-border: #8DDEBD; --icon-subtle: #B8C6BF;
    --gradient-revenue: linear-gradient(135deg, #236E58, #164C40 55%, #0E332C);
    --gradient-navigation: linear-gradient(135deg, #207358, #105640);
    --gradient-store: linear-gradient(145deg, #54816B, #105640);
    --gradient-mark: linear-gradient(145deg, #248B65, #105640);
    --sale-background: #234738; --inventory-background: #263D65;
    --expense-background: #624129; --customer-background: #44365D;
    --delivery-background: #2A4364; --tools-background: #3D4543;
    --sale-icon: #9CF0BD; --inventory-icon: #A8C7FF; --expense-icon: #FFD0A4;
    --customer-icon: #D9BEFF; --delivery-icon: #B3CEFF; --tools-icon: #DBE1DE;
    --error-background: #54422A; --error-text: #FFDCAC;
    color-scheme: dark;
}
:root[data-theme="charcoal"] .topbar { background: #1B2524; }
:root[data-theme="charcoal"] .sidebar-foot { background: #25302E; }
:root[data-theme="charcoal"] .global-search kbd { background: #303D39; }:root[data-theme="charcoal"] .auth-submit { background: #207358; color: #FFFFFF; }
@media print { .sidebar,.topbar,.bottom-nav { display:none !important; } .app-shell,.app-content { display:block !important; min-height:0; } .main-content { max-width:none; padding:0; } body { background:#fff !important; } }
.search-shell { min-width:0; width:min(100%,620px); flex:1; margin-inline:auto; position:relative; }
.search-shell .global-search { width:100%; max-width:none; margin:0; }
.search-shell .global-search input { min-width:0; flex:1; border:0; outline:0; background:transparent; color:var(--text-primary); font:inherit; }
.search-shell .global-search input::placeholder { color:var(--text-secondary); }
.global-search-menu { position:absolute; z-index:60; inset-inline:0; top:calc(100% + 6px); max-height:65vh; overflow:auto; background:var(--surface-primary); border:1px solid var(--border-color); border-radius:16px; box-shadow:var(--shadow-card); padding:8px; }
.global-search-menu a { display:flex; align-items:center; gap:10px; padding:9px; border-radius:9px; }
.global-search-menu a:hover { background:var(--brand-soft); }
.global-search-menu a .icon { width:18px; }
.global-search-menu a span { min-width:0; }
.global-search-menu a strong,.global-search-menu a small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.global-search-menu a small { color:var(--text-secondary); font-size:12px; }
.global-search-menu button { width:100%; border:0; background:var(--brand-soft); color:var(--brand-primary); border-radius:9px; padding:9px; cursor:pointer; }
.global-search-menu p { padding:8px; margin:0; }
.feature-result > span:nth-child(2) { flex:1; min-width:0; }
.feature-result small { display:block; color:var(--text-secondary); }
@media(max-width:720px) { .search-shell { display:none; } }
/* Staff management fallback styles */
.staff-page { width: 100%; }
.staff-header { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 22px; }
.staff-header-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.staff-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.staff-button .icon { width: 18px; height: 18px; }
.staff-button.primary { color: var(--text-on-dark); background: var(--brand-primary); }
.staff-button.primary:hover { filter: brightness(1.08); }
.staff-button.secondary { color: var(--brand-primary); background: var(--brand-soft); border-color: var(--border-color); }
.staff-button.secondary:hover { border-color: var(--brand-primary); }
.staff-button:disabled { opacity: .55; cursor: wait; }
.staff-button.full { width: 100%; }
.staff-panel { min-width: 0; background: var(--surface-primary); border: 1px solid var(--border-soft); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.staff-empty { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; }
.staff-context { display: flex; align-items: end; flex-wrap: wrap; gap: 16px; padding: 16px 20px; margin-bottom: 16px; }
.staff-context label { display: grid; gap: 5px; min-width: 210px; color: var(--text-secondary); font-weight: 700; font-size: 12px; }
.staff-context select { min-height: 42px; border: 1px solid var(--border-color); border-radius: 11px; padding: 8px 12px; background: var(--surface-primary); color: var(--text-primary); font: inherit; font-size: 14px; }
.staff-code { display: grid; gap: 4px; margin-inline-end: auto; color: var(--text-secondary); font-size: 12px; }
.staff-code strong { color: var(--brand-primary); font-size: 16px; letter-spacing: .08em; }
.staff-notice { padding: 12px 16px; margin-bottom: 16px; border-radius: 12px; color: var(--brand-primary); background: var(--brand-soft); font-weight: 650; overflow-wrap: anywhere; }
.staff-notice.success { color: var(--text-primary); }
.staff-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.staff-metric { padding: 17px 20px; display: grid; gap: 5px; }
.staff-metric span { color: var(--text-secondary); font-size: 13px; }
.staff-metric strong { color: var(--text-primary); font-size: 25px; overflow-wrap: anywhere; }
.staff-workspace { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, .9fr); align-items: start; gap: 18px; }
.staff-directory, .staff-editor { padding: 22px; }
.staff-editor { position: sticky; top: 16px; }
.staff-section-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.staff-section-heading h2 { font-size: 20px; margin-bottom: 3px; }
.staff-count { background: var(--brand-soft); color: var(--brand-primary); border-radius: 99px; padding: 6px 10px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.staff-list-empty { padding: 42px 14px; text-align: center; color: var(--text-secondary); border: 1px dashed var(--border-color); border-radius: 14px; }
.staff-table-wrap { width: 100%; overflow-x: auto; }
.staff-table { width: 100%; border-collapse: collapse; text-align: right; }
.staff-table th { color: var(--text-secondary); font-size: 12px; font-weight: 700; padding: 11px 10px; border-bottom: 1px solid var(--border-color); white-space: nowrap; }
.staff-table td { padding: 14px 10px; border-bottom: 1px solid var(--border-subtle); font-size: 13px; white-space: nowrap; }
.staff-table tr.selected td { background: var(--brand-soft); }
.staff-table tbody tr:hover td { background: var(--surface-secondary); }
.staff-person { display: flex; align-items: center; gap: 10px; }
.staff-person strong, .staff-person small { display: block; }
.staff-person strong { font-size: 14px; }
.staff-person small { color: var(--text-secondary); margin-top: 2px; text-align: right; }
.staff-avatar { width: 38px; height: 38px; display: grid; place-items: center; flex: none; border-radius: 12px; color: var(--brand-primary); background: var(--brand-soft); font-size: 16px; font-weight: 800; }
.staff-avatar.large { width: 45px; height: 45px; }
.staff-status { display: inline-flex; padding: 5px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.staff-status.active { color: var(--brand-primary); background: var(--brand-soft); }
.staff-status.inactive { color: var(--error-text); background: var(--error-background); }
.staff-text-button { border: 0; background: none; color: var(--brand-primary); font: inherit; font-weight: 800; cursor: pointer; white-space: nowrap; }
.staff-text-button:hover { text-decoration: underline; }
.role-heading { margin-top: 30px; }
.staff-role-list { display: flex; flex-wrap: wrap; gap: 9px; }
.staff-role-chip { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--surface-secondary); font-size: 13px; font-weight: 700; }
.staff-role-chip .icon { width: 16px; height: 16px; color: var(--brand-primary); }
.staff-role-chip small { color: var(--text-secondary); font-weight: 500; }
.staff-fields { display: grid; gap: 16px; }
.staff-fields > label { display: grid; gap: 6px; color: var(--text-primary); font-size: 13px; font-weight: 700; }
.staff-fields > label small { color: var(--text-secondary); font-weight: 400; }
.staff-fields input:not([type=checkbox]), .staff-fields select { width: 100%; min-height: 43px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--surface-primary); color: var(--text-primary); padding: 9px 11px; font: inherit; }
.staff-fields input:focus, .staff-fields select:focus { border-color: var(--brand-primary); }
.staff-permissions { display: grid; gap: 9px; border: 1px solid var(--border-color); border-radius: 12px; padding: 12px 15px 15px; }
.staff-permissions legend { padding: 0 5px; font-size: 13px; font-weight: 800; }
.staff-permissions label { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.staff-permissions input { accent-color: var(--brand-primary); }
.staff-editor-divider { border-top: 1px solid var(--border-color); }
@media (max-width: 1180px) { .staff-workspace { grid-template-columns: minmax(0, 1fr) 320px; } .staff-directory, .staff-editor { padding: 18px; } }
@media (max-width: 900px) { .staff-workspace { grid-template-columns: 1fr; } .staff-editor { position: static; } }
@media (max-width: 720px) { .staff-header { align-items: stretch; flex-direction: column; } .staff-header-actions { width: 100%; } .staff-header-actions .staff-button { flex: 1; } .staff-context { align-items: stretch; } .staff-context label { min-width: 100%; } .staff-code { margin-inline-end: 0; } .staff-context > .staff-button { width: 100%; } .staff-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); } .staff-metric:last-child { grid-column: 1 / -1; } .staff-directory, .staff-editor { padding: 16px; } .staff-table thead { display: none; } .staff-table, .staff-table tbody { display: block; } .staff-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--border-color); } .staff-table td { display: block; padding: 0; border: 0; white-space: normal; } .staff-table td:first-child { grid-column: 1 / -1; } .staff-table td:last-child { text-align: left; } .staff-table tr.selected td, .staff-table tbody tr:hover td { background: transparent; } }
@media (max-width: 390px) { .staff-metrics { gap: 8px; } .staff-metric { padding: 13px; } .staff-header-actions { flex-direction: column; } }

/* Workspace setup must retain its theme cards when isolated styles are cached. */
.auth-card:has(.setup-page) { width: min(100%, 960px); }
.setup-page { display: grid; gap: 17px; }
.setup-page h1, .setup-page p { margin-bottom: 0; }
.setup-page .auth-form { margin-top: 0; }
.setup-page .auth-link { margin-top: 0; }
.setup-page .theme-heading { margin-top: 4px; font-weight: 700; }
.setup-page .theme-heading span { display: block; font-size: 12px; color: var(--text-secondary); font-weight: 400; }
.setup-page .theme-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.setup-page .theme-option { min-width: 0; min-height: 130px; text-align: right; display: flex; flex-direction: column; align-items: start; gap: 10px; padding: 15px; border-radius: 15px; border: 2px solid var(--border-color); background: var(--surface-secondary); color: var(--text-primary); cursor: pointer; }
.setup-page .theme-option:hover { border-color: var(--brand-primary); }
.setup-page .theme-option.selected { border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-soft); }
.setup-page .theme-option strong { font-size: 16px; }
.setup-page .theme-option small { direction: ltr; color: var(--text-secondary); font-size: 11px; overflow-wrap: anywhere; }
.setup-page .theme-swatches { display: inline-flex; gap: 5px; }
.setup-page .theme-swatches i { width: 31px; height: 31px; border: 1px solid #9996; border-radius: 8px; }
.setup-page .theme-live-preview { display: grid; grid-template-columns: 145px minmax(0, 1fr); min-height: 220px; border: 1px solid var(--border-color); border-radius: 16px; overflow: hidden; background: var(--app-background); color: var(--text-primary); }
.setup-page .preview-sidebar { display: grid; align-content: start; gap: 15px; padding: 20px 14px; background: var(--sidebar-background); font-size: 12px; }
.setup-page .preview-sidebar strong { color: var(--brand-dark); font-size: 24px; }
.setup-page .preview-content { padding: 20px; min-width: 0; font-size: 14px; }
.setup-page .preview-revenue { background: var(--gradient-revenue); color: white; padding: 18px; border-radius: 12px; margin-top: 12px; }
.setup-page .preview-revenue b { display: block; font-size: 27px; }
.setup-page .preview-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.setup-page .preview-actions span { background: var(--brand-soft); color: var(--brand-primary); padding: 7px 10px; border-radius: 8px; }
@media (max-width: 650px) { .setup-page .theme-choices { grid-template-columns: 1fr; } .setup-page .theme-option { min-height: 0; flex-direction: row; align-items: center; flex-wrap: wrap; } .setup-page .theme-option small { width: 100%; } .setup-page .theme-live-preview { grid-template-columns: 100px minmax(0, 1fr); } .setup-page .preview-content { padding: 12px; } }

/* Sales history also needs styles when the isolated bundle is stale. */
.sales-panel { padding: 22px; }
.sales-search { width: 100%; min-height: 46px; margin: 18px 0; padding: 9px 14px; border: 1px solid var(--border-color); border-radius: 11px; background: var(--surface-primary); color: var(--text-primary); }
.sales-search:focus { border-color: var(--brand-primary); }
.sales-list { display: grid; gap: 10px; }
.sales-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 22px; align-items: center; gap: 16px; min-height: 76px; padding: 13px 17px; border: 1px solid var(--border-color); border-radius: 13px; background: var(--surface-primary); }
.sales-row:hover { border-color: var(--brand-primary); background: var(--surface-secondary); }
.sales-row strong, .sales-row small { display: block; }
.sales-row strong { font-size: 15px; }
.sales-row small { margin-top: 4px; color: var(--text-secondary); font-size: 12px; }
.sales-row b { white-space: nowrap; color: var(--text-primary); }
.sales-row > .icon { width: 18px; color: var(--icon-subtle); }
.sales-status { display: inline-flex; align-items: center; justify-content: center; min-width: 88px; padding: 6px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-primary); font-size: 12px; font-weight: 700; white-space: nowrap; }
.sales-status.partial_return, .sales-status.returned { background: var(--expense-background); color: var(--expense-icon); }
.sales-refresh { padding: 8px 14px; border: 1px solid var(--border-color); border-radius: 9px; background: var(--surface-secondary); color: var(--text-primary); cursor: pointer; }
.sales-refresh:hover { border-color: var(--brand-primary); }
@media (max-width: 600px) { .sales-panel { padding: 16px; } .sales-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 13px; } .sales-row > span:first-child { grid-column: 1; } .sales-row .sales-status { grid-column: 1; justify-self: start; } .sales-row b { grid-column: 2; grid-row: 1 / 3; } .sales-row > .icon { display: none; } }

.owner-plan { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; margin-bottom: 20px; }
.owner-plan-counts { display: flex; flex-wrap: wrap; gap: 10px; }
.owner-plan-counts span { display: grid; gap: 3px; min-width: 116px; padding: 10px 13px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-primary); font-size: 12px; }
.owner-plan-counts b { font-size: 17px; }
.owner-combined { display: grid; grid-template-columns: 1fr auto; gap: 14px 26px; padding: 23px; margin-bottom: 20px; border-radius: 20px; background: var(--gradient-revenue); color: var(--text-on-dark); }
.owner-combined .eyebrow, .owner-combined p { color: var(--chart-text); }
.owner-combined strong { display: block; margin-top: 8px; font-size: clamp(30px,4vw,48px); }
.owner-combined > div:nth-child(2) { display: grid; grid-template-columns: auto auto; gap: 8px 14px; align-content: center; }
.owner-combined > p { grid-column: 1 / -1; margin: 0; font-size: 12px; }
.owner-business-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(270px,1fr)); gap: 16px; margin-bottom: 20px; }
.owner-business-card > div:first-child { display: flex; gap: 12px; align-items: center; margin-bottom: 17px; }
.owner-business-card h2 { margin: 0; }
.owner-business-card small { color: var(--text-secondary); }
.owner-business-card p { margin: 8px 0; color: var(--text-secondary); }
.owner-business-card p strong { color: var(--text-primary); }
.owner-business-actions { display: flex; align-items: center; gap: 13px; margin-top: 18px; }
.owner-business-actions .auth-submit { width: auto; padding-inline: 20px; }
.owner-business-actions a { color: var(--brand-primary); font-weight: 700; }
.owner-new-business form { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; margin-top: 18px; }
.owner-new-business label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; }
.owner-new-business input, .owner-new-business select { min-width: 0; width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--surface-primary); color: var(--text-primary); }
.owner-new-business form button { grid-column: 1 / -1; }
.owner-limit-note { color: var(--text-secondary); }
@media (max-width: 720px) { .owner-combined { grid-template-columns: 1fr; } .owner-combined > div:nth-child(2) { justify-content: start; } .owner-new-business form { grid-template-columns: 1fr; } }
