:root { color-scheme: light; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #1a1a2e; background: #f0f4f8; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }
.topbar { background: #fff; border-bottom: 1px solid #dfe5ec; }
.topbar-inner { max-width: 1080px; height: 66px; padding: 0 24px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 15px; color: #1a1a2e; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: #697483; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 6px; background: #1a1a2e; color: #fff; font-size: 19px; }
.main { max-width: 1080px; padding: 64px 24px; margin: auto; }
.sign-in { width: min(100%, 410px); margin: 48px auto 0; }
.eyebrow { margin: 0 0 12px; color: #426d73; font-size: 11px; font-weight: 700; }
h1 { margin: 0; font-size: 29px; line-height: 1.2; }
h2 { margin: 0; font-size: 16px; }
.muted { color: #657280; font-size: 14px; line-height: 1.5; }
form { display: grid; margin-top: 30px; gap: 10px; }
label { margin-top: 10px; font-size: 13px; font-weight: 650; }
input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid #c7d0da; border-radius: 4px; background: #fff; color: inherit; font: inherit; }
input:focus-visible, button:focus-visible { outline: 3px solid #86b8b2; outline-offset: 2px; }
button { font: inherit; cursor: pointer; }
.primary { height: 45px; margin-top: 15px; border: 0; border-radius: 4px; color: #fff; background: #1a1a2e; font-weight: 650; }
.primary:disabled { opacity: .6; cursor: wait; }
.sign-out { padding: 8px 12px; border: 1px solid #c7d0da; border-radius: 4px; background: #fff; color: #263547; font-size: 13px; }
.error { margin: 8px 0; color: #a43736; font-size: 13px; }
.notice { margin: 18px 0 0; padding: 10px 12px; border-left: 3px solid #bd8b2f; background: #fff5dd; color: #705116; font-size: 13px; }
.account-heading { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 16px; padding-bottom: 28px; border-bottom: 1px solid #d8e0e8; }
.account-heading .muted { margin-bottom: 0; }
.status { padding: 5px 9px; border-radius: 4px; background: #e4f2e9; color: #276344; font-size: 12px; font-weight: 650; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 30px 0 12px; }
.section-heading span { font-size: 12px; color: #657280; }
.permission-list { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); list-style: none; border-top: 1px solid #d8e0e8; }
.permission-list li { padding: 13px 10px 13px 0; border-bottom: 1px solid #d8e0e8; font-size: 13px; overflow-wrap: anywhere; }
.app-nav { display: flex; flex-wrap: wrap; gap: 0 20px; margin-bottom: 32px; border-bottom: 1px solid #d8e0e8; }
.app-nav button { padding: 10px 0; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #657280; font-size: 13px; }
.app-nav button[aria-current="page"] { border-bottom-color: #426d73; color: #1a1a2e; font-weight: 700; }
.compact { height: 38px; margin: 0; padding: 0 15px; font-size: 13px; }
.category-form { max-width: 550px; padding: 20px 0; border-bottom: 1px solid #d8e0e8; }
.category-form label { display: grid; gap: 8px; }
.category-form select, .category-form textarea { width: 100%; padding: 10px 12px; border: 1px solid #c7d0da; border-radius: 4px; background: #fff; font: inherit; color: inherit; }
.category-form .check-label { display: flex; align-items: center; gap: 8px; }
.check-label input { width: 16px; height: 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 10px; }
.category-search { max-width: 460px; margin: 24px 0; }
.category-search div { display: flex; gap: 8px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th, td { padding: 13px 12px; border-bottom: 1px solid #d8e0e8; vertical-align: top; }
th { color: #657280; font-size: 12px; font-weight: 650; }
td { overflow-wrap: anywhere; }
.table-actions { white-space: nowrap; }
.table-action { padding: 4px 8px; border: 0; background: transparent; color: #315d64; font-size: 13px; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 20px; color: #657280; font-size: 12px; }
.pagination button:disabled { opacity: .5; cursor: default; }
.branch-selector { display: grid; gap: 7px; color: #657280; font-size: 12px; }
.branch-selector select { min-width: 190px; max-width: 100%; padding: 9px; border: 1px solid #c7d0da; border-radius: 4px; background: #fff; color: #1a1a2e; font: inherit; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1px; margin-top: 28px; background: #d8e0e8; border: 1px solid #d8e0e8; }
.dashboard-metrics div { min-width: 0; padding: 20px; background: #fff; }
.dashboard-metrics p { margin: 0 0 14px; color: #657280; font-size: 12px; }
.dashboard-metrics strong { display: block; font-size: 20px; overflow-wrap: anywhere; }
@media (max-width: 520px) { .main { padding: 42px 20px; } .sign-in { margin-top: 20px; } .topbar-inner { padding: 0 20px; } }

/* Shared application surfaces use the Google-like design system. */
body { background: var(--gray-50); color: var(--gray-800); }
.topbar { border-color: var(--gray-200); box-shadow: var(--shadow-sm); }
.topbar-inner, .main { max-width: 1200px; }
.brand, .app-nav button[aria-current="page"] { color: var(--primary-color); }
.brand-mark { background: var(--primary-color); border-radius: var(--border-radius); }
.main { padding-top: 40px; }
.sign-in { display: grid; grid-template-columns: 1fr 1fr; width: min(100%, 960px); margin: 30px auto; overflow: hidden; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--border-radius-lg); box-shadow: var(--shadow-lg); }
.welcome-panel, .sign-in-panel { padding: 64px 48px; }
.welcome-panel { color: #fff; background: linear-gradient(135deg, var(--primary-color), var(--primary-light)); }
.welcome-panel .eyebrow { color: var(--accent-light); }
.welcome-panel h1 { font-size: 32px; }
.welcome-panel p:not(.eyebrow) { margin-top: 18px; line-height: 1.6; color: var(--gray-200); }
.welcome-panel ul { margin: 32px 0 0; padding-left: 20px; color: var(--gray-200); }
.welcome-panel li + li { margin-top: 14px; }
.sign-in-panel { display: flex; flex-direction: column; justify-content: center; }
.sign-in-panel h2 { font-size: 28px; }
.sign-in-panel .muted { margin-top: 8px; }
.sign-in-panel form { margin-top: 20px; }
.auth-link { align-self: flex-start; margin-top: 20px; color: var(--accent-color); font-size: 13px; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }
input, .category-form select, .category-form textarea, .branch-selector select { border-color: var(--gray-300); border-radius: var(--border-radius); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 2px; }
.primary { background: var(--accent-color); border-radius: var(--border-radius); }
.primary:hover:not(:disabled) { background: #2563eb; }
.sign-out { border-color: var(--gray-300); border-radius: var(--border-radius); }
.app-nav { gap: 8px; padding: 8px; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--border-radius-lg); box-shadow: var(--shadow-sm); }
.app-nav button { padding: 10px 14px; border: 0; border-radius: var(--border-radius); color: var(--gray-600); }
.app-nav button:hover, .app-nav button[aria-current="page"] { background: #eff6ff; color: #2563eb; }
.account, #page-slot > section { padding: 28px; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--border-radius-lg); box-shadow: var(--shadow-sm); }
.eyebrow { color: var(--accent-color); }
.dashboard-metrics { gap: 16px; background: transparent; border: 0; }
.dashboard-metrics div { border: 1px solid var(--gray-200); border-radius: var(--border-radius-lg); background: var(--gray-50); }
.dashboard-metrics strong { color: var(--primary-color); }
.table-wrap { border: 1px solid var(--gray-200); border-radius: var(--border-radius); }
th { background: var(--gray-50); }
@media (max-width: 700px) {
    .sign-in { grid-template-columns: 1fr; }
    .welcome-panel, .sign-in-panel { padding: 32px 24px; }
    .welcome-panel ul { margin-top: 20px; }
    .account, #page-slot > section { padding: 20px; }
}

body { display: flex; flex-direction: column; min-height: 100vh; }
.topbar-inner { max-width: none; height: 72px; }
.brand-mark { width: 40px; height: 40px; background: #e8f0fe; color: #1a73e8; }
.brand-mark svg, .icon, .metric-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sign-out { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.sign-out .icon { width: 18px; height: 18px; }
.app-shell { display: flex; flex: 1; min-width: 0; }
.app-sidebar { width: 240px; flex: 0 0 240px; padding: 24px 12px; background: #fff; border-right: 1px solid var(--gray-200); }
.app-nav { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 0; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.nav-group > summary { display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 10px 14px; border-radius: 24px; color: var(--gray-600); font-size: 14px; cursor: pointer; list-style: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary:hover, .nav-group:has([aria-current="page"]) > summary { color: #174ea6; background: #e8f0fe; }
.nav-chevron { width: 8px; height: 8px; margin-left: auto; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(-45deg); }
.nav-group[open] .nav-chevron { transform: rotate(45deg); }
.nav-submenu { display: grid; gap: 4px; margin-left: 22px; }
.nav-heading { padding: 0 14px 12px; color: var(--gray-500); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.app-nav button { display: flex; align-items: center; gap: 14px; min-height: 48px; text-align: left; border-radius: 24px; font-size: 14px; }
.app-nav button:hover, .app-nav button[aria-current="page"] { color: #174ea6; background: #e8f0fe; }
.main { flex: 1; width: 100%; max-width: 1200px; min-width: 0; margin: 0 auto; padding: 40px 32px; }
.app-footer { padding: 18px 24px; border-top: 1px solid var(--gray-200); background: #fff; color: var(--gray-500); text-align: center; font-size: 12px; }
.metric-icon { width: 36px; height: 36px; padding: 8px; margin-bottom: 12px; color: #1a73e8; background: #e8f0fe; border-radius: 50%; }
.dashboard-metrics div { background: #fff; box-shadow: var(--shadow-sm); }

.outlined-field, .category-form .outlined-field { position: relative; display: block; min-width: 0; margin: 10px 0 0; font-size: 14px; font-weight: 400; }
.outlined-field > input, .outlined-field > select, .outlined-field > textarea,
.category-form .outlined-field > select, .category-form .outlined-field > textarea,
.branch-selector.outlined-field > select { display: block; width: 100%; min-width: 0; height: 56px; padding: 16px 14px; border: 1px solid #747775; border-radius: 4px; outline: none; background: #fff; color: var(--gray-800); font: inherit; }
.outlined-field > textarea, .category-form .outlined-field > textarea { height: auto; min-height: 80px; resize: vertical; }
.outlined-field > span { position: absolute; top: 28px; left: 12px; max-width: calc(100% - 24px); padding: 0 4px; overflow: hidden; background: #fff; color: #5f6368; line-height: 1; white-space: nowrap; text-overflow: ellipsis; transform: translateY(-50%); transform-origin: left center; pointer-events: none; transition: top .15s ease, font-size .15s ease, color .15s ease; }
.outlined-field > input:focus, .outlined-field > select:focus, .outlined-field > textarea:focus { border: 2px solid #1a73e8; padding-left: 13px; }
.outlined-field > :focus + span, .outlined-field > input:not(:placeholder-shown) + span,
.outlined-field > textarea:not(:placeholder-shown) + span, .outlined-field > select + span { top: 0; font-size: 12px; }
.outlined-field > :focus + span { color: #1a73e8; }
.category-search > div { align-items: center; }
.category-search .outlined-field { flex: 1; margin: 0; }
.branch-selector.outlined-field { min-width: 200px; max-width: 100%; }
.inventory-page > .branch-selector { width: 260px; margin: 0 0 24px; }
@media (max-width: 700px) {
    .app-shell { flex-direction: column; }
    .app-sidebar { width: 100%; flex: none; padding: 8px; border-right: 0; border-bottom: 1px solid var(--gray-200); }
    .app-nav { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
    .app-nav button { flex: 0 0 auto; }
    .nav-heading { display: none; }
    .main { padding: 24px 16px; }
    .sign-in { margin: 0 auto; }
}

.filter-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin: 24px 0; }
.filter-grid > .outlined-field { grid-column: span 3; min-width: 0; margin: 0; }
.filter-grid > .autocomplete { grid-column: span 3; }
.filter-grid > .autocomplete .outlined-field { margin: 0; }
.autocomplete { position: relative; min-width: 0; }
.account-heading > .autocomplete { width: 240px; max-width: 100%; }
.autocomplete-popup { position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; width: 100%; padding: 6px 0; border: 1px solid var(--gray-200); border-radius: 8px; background: #fff; box-shadow: var(--shadow-lg); }
.autocomplete-popup [role="listbox"] { max-height: 200px; overflow-y: auto; }
.autocomplete-popup [role="option"] { padding: 10px 14px; cursor: pointer; }
.autocomplete-popup [role="option"]:hover, .autocomplete-popup [role="option"][aria-selected="true"] { background: #e8f0fe; color: #174ea6; }
.autocomplete-status, .autocomplete-popup .error { margin: 0; padding: 4px 14px; font-size: 12px; }
.autocomplete-status:empty { display: none; }
.autocomplete-more { width: 100%; padding: 9px 14px; border: 0; background: #fff; color: #1a73e8; text-align: left; }
.autocomplete-more:hover { background: #e8f0fe; }
.table-region { position: relative; min-height: 65px; }
.table-loading, .page-loading { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 88px; border-radius: var(--border-radius); background: rgba(255, 255, 255, .92); color: #5f6368; font-size: 13px; }
.table-loading { position: absolute; z-index: 2; inset: 0; }
.table-region[aria-busy="true"] { min-height: 88px; }
.loading-spinner { width: 24px; height: 24px; border: 3px solid #d2e3fc; border-top-color: #1a73e8; border-radius: 50%; animation: table-spin .8s linear infinite; }
@keyframes table-spin { to { transform: rotate(360deg); } }
.table-actions { width: 52px; text-align: center; }
.action-trigger { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 8px; border: 0; border-radius: 50%; background: transparent; color: #5f6368; }
.action-trigger:hover, .action-trigger[aria-expanded="true"] { background: #e8f0fe; color: #1a73e8; }
.action-trigger svg { width: 20px; height: 20px; fill: currentColor; }
.action-menu { position: fixed; z-index: 20; min-width: 160px; padding: 6px 0; border: 1px solid var(--gray-200); border-radius: 8px; background: #fff; box-shadow: var(--shadow-lg); text-align: left; }
.action-menu button { display: block; width: 100%; padding: 10px 16px; border: 0; background: transparent; color: var(--gray-800); text-align: left; }
.action-menu button:hover, .action-menu button:focus-visible { background: #e8f0fe; }
.form-dialog { width: min(520px, calc(100% - 32px)); max-height: calc(100% - 32px); margin: auto; padding: 24px; border: 0; border-radius: 12px; box-shadow: var(--shadow-xl); }
.form-dialog::backdrop { background: rgba(31, 41, 55, .55); }
.form-dialog .category-form { max-width: none; margin: 0; padding: 0; border: 0; }
.form-page { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; margin-top: 16px; border: 0; }
.form-page .form-actions { grid-column: 1 / -1; }
@media (max-width: 900px) {
    .filter-grid > .outlined-field, .filter-grid > .autocomplete { grid-column: span 6; }
    .form-page { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
    .filter-grid > .outlined-field, .filter-grid > .autocomplete { grid-column: span 12; }
    .form-page { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .loading-spinner { animation-duration: 2s; }
}

.sale-checkout { display: grid; gap: 12px; }
.sale-checkout > .autocomplete, .sale-payment { width: min(100%, 360px); }
.sales-page .table-wrap input { width: 110px; }
.sale-totals { display: grid; grid-template-columns: auto auto; gap: 6px 24px; justify-content: start; margin: 0; }
.sale-totals dd { margin: 0; text-align: right; }
.sale-totals dt:last-of-type, .sale-totals dd:last-child { font-weight: 700; }

.topbar-actions { display: flex; align-items: center; gap: 12px; }
.active-branch.outlined-field { width: clamp(125px, 23vw, 245px); margin: 0; }
.active-branch.outlined-field select { height: 40px; padding: 8px 10px; }
@media (max-width: 460px) {
    .topbar-inner { height: auto; min-height: 66px; flex-wrap: wrap; padding-block: 10px; }
    .topbar-actions { margin-left: auto; }
}
