:root {
    --olive-950: #26301e;
    --olive-900: #39442c;
    --olive-800: #4d5939;
    --olive-700: #626e49;
    --olive-100: #eef0df;
    --cream: #f7f5e7;
    --paper: #fffef8;
    --yellow: #f2d648;
    --yellow-2: #ffe86a;
    --ink: #20251d;
    --muted: #6f7569;
    --line: #dedfcf;
    --green: #317a4e;
    --red: #b7483e;
    --blue: #3d6c9e;
    --shadow: 0 12px 35px rgba(38, 48, 30, .10);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--cream); }
body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--cream);
    font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    display: flex;
    width: 255px;
    flex-direction: column;
    overflow-y: auto;
    color: #fff;
    background: linear-gradient(180deg, var(--olive-950), #1f2719 100%);
    box-shadow: 10px 0 30px rgba(25, 31, 20, .18);
}
.brand { padding: 24px 22px 18px; border-bottom: 1px solid rgba(255,255,255,.09); }
.brand img {
    display: block;
    width: 166px;
    height: 84px;
    margin: 0 auto 8px;
    object-fit: contain;
    border-radius: 14px;
    background: var(--yellow);
}
.brand small {
    display: block;
    color: var(--yellow-2);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .14em;
    text-align: center;
}
.sidebar nav { flex: 1; padding: 12px; }
.nav-heading {
    display: block;
    padding: 17px 13px 7px;
    color: #adb5a4;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .15em;
    text-transform: uppercase;
}
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 43px;
    margin: 2px 0;
    padding: 9px 12px;
    border-radius: 11px;
    color: #dfe4d9;
    font-weight: 650;
}
.sidebar nav a:hover { background: rgba(255,255,255,.07); }
.sidebar nav a.active { color: var(--olive-950); background: var(--yellow); }
.sidebar nav a i {
    width: 22px;
    font-style: normal;
    font-size: 18px;
    text-align: center;
}
.sidebar nav .sidebar-guide-link { margin-top: 3px; border: 1px solid rgba(242,214,72,.32); background: rgba(242,214,72,.08); }
.sidebar nav .sidebar-guide-link:hover { border-color: rgba(242,214,72,.58); background: rgba(242,214,72,.14); }
.sidebar-guide-link > span { display: grid; gap: 1px; }
.sidebar-guide-link small { color: #adb5a4; font-size: 9px; font-weight: 700; }
.sidebar-nav-item { position: relative; }
.sidebar-nav-row { display: flex; align-items: center; }
.sidebar-nav-row > .sidebar-nav-link { min-width: 0; flex: 1; }
.sidebar-nav-item.has-submenu .sidebar-nav-link { padding-right: 44px; }
.sidebar-submenu-toggle {
    display: grid;
    width: 28px;
    height: 34px;
    margin-left: -38px;
    padding: 0;
    place-items: center;
    cursor: pointer;
    color: #cbd2c5;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    transition: transform .16s ease, background .16s ease;
}
.sidebar-nav-item.current .sidebar-submenu-toggle { color: var(--olive-950); }
.sidebar-submenu-toggle:hover, .sidebar-submenu-toggle:focus-visible { background: rgba(255,255,255,.12); outline: none; }
.sidebar-nav-item.current .sidebar-submenu-toggle:hover, .sidebar-nav-item.current .sidebar-submenu-toggle:focus-visible { background: rgba(38,48,30,.1); }
.sidebar-nav-item:hover .sidebar-submenu-toggle,
.sidebar-nav-item:focus-within .sidebar-submenu-toggle,
.sidebar-nav-item.submenu-open .sidebar-submenu-toggle { transform: rotate(90deg); }
.sidebar-flyout {
    position: fixed;
    z-index: 60;
    left: 238px;
    top: 12px;
    width: min(310px, calc(100vw - 250px));
    max-height: calc(100vh - 24px);
    padding: 9px;
    overflow-y: auto;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--paper);
    box-shadow: 0 18px 45px rgba(25,31,20,.24);
    transform: translateX(-6px);
    transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}
.sidebar-nav-item:hover > .sidebar-flyout,
.sidebar-nav-item:focus-within > .sidebar-flyout,
.sidebar-nav-item.submenu-open > .sidebar-flyout {
    pointer-events: auto;
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
}
.sidebar-flyout-heading { display: grid; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); }
.sidebar-flyout-heading strong { color: var(--olive-950); font-size: 13px; }
.sidebar-flyout-heading small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.sidebar-menu-search {
    position: sticky;
    z-index: 4;
    top: -12px;
    margin: -12px -12px 3px;
    padding: 12px 12px 10px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    background: #26301e;
}
.sidebar-menu-search label { color: #dfe4d9; }
.sidebar-menu-search label > span { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-menu-search input { min-height: 37px; padding: 7px 9px; color: var(--ink); border-color: rgba(255,255,255,.25); border-radius: 9px; background: var(--paper); font-size: 11px; }
.sidebar-menu-search small { color: #adb5a4; font-size: 9px; font-weight: 700; }
.sidebar-menu-results { padding: 7px 0 4px; }
.sidebar-menu-results[hidden] { display: none; }
.sidebar nav .sidebar-menu-result { display: grid; align-items: start; gap: 2px; min-height: 0; padding: 9px 11px; }
.sidebar nav .sidebar-menu-result[hidden] { display: none; }
.sidebar-menu-result span { font-size: 12px; }
.sidebar-menu-result small { color: #adb5a4; font-size: 9px; font-weight: 700; }
.sidebar-menu-search-empty { margin: 5px 0; padding: 14px 9px; color: #adb5a4; border: 1px dashed rgba(255,255,255,.16); border-radius: 9px; font-size: 10px; text-align: center; }
.sidebar nav.sidebar-searching > .nav-heading,
.sidebar nav.sidebar-searching > .sidebar-nav-item { display: none; }
.sidebar nav .sidebar-flyout a {
    display: flex;
    min-height: 36px;
    margin: 3px 0 0;
    padding: 8px 10px;
    color: var(--olive-900);
    border-radius: 9px;
    font-size: 12px;
    font-weight: 720;
}
.sidebar nav .sidebar-flyout a[hidden] { display: none; }
.sidebar nav .sidebar-flyout a:hover,
.sidebar nav .sidebar-flyout a.workspace-link-active { color: var(--olive-950); background: var(--yellow); }
.logout-form { padding: 12px 18px 20px; }
.logout-form button {
    width: 100%;
    padding: 10px;
    cursor: pointer;
    color: #fff;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 10px;
    background: transparent;
}
.main-shell { width: calc(100% - 255px); margin-left: 255px; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 80px;
    padding: 13px 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(247,245,231,.94);
    backdrop-filter: blur(14px);
}
.topbar h1 { margin: 1px 0 0; font-size: 23px; line-height: 1.1; }
.eyebrow { color: var(--olive-700); font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.branch-select { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.branch-select select { min-width: 190px; }
.branch-badge { padding: 9px 12px; color: var(--olive-800); border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-weight: 700; }
.user-chip { display: flex; align-items: center; gap: 9px; }
.user-chip > span {
    display: grid;
    width: 37px;
    height: 37px;
    place-items: center;
    color: var(--olive-950);
    border-radius: 50%;
    background: var(--yellow);
    font-weight: 900;
}
.user-chip div { display: flex; flex-direction: column; }
.user-chip small { color: var(--muted); font-size: 11px; }
.tooltip-preference {
    display: inline-flex;
    min-height: 39px;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    font-size: 11px;
}
.tooltip-preference input { width: 17px; min-height: 17px; margin: 0; }
.menu-toggle { display: none !important; }
.content { padding: 26px 28px 48px; }
.page-head { display: flex; align-items: flex-end; gap: 18px; margin-bottom: 22px; }
.page-head > div:first-child { max-width: 680px; }
.page-head h2 { margin: 0 0 5px; font-size: 28px; letter-spacing: -.02em; }
.page-head p { margin: 0; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-left: auto; }
.grid { display: grid; gap: 18px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: 0 3px 14px rgba(38,48,30,.04);
}
.card-body { padding: 20px; }
.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 17px 20px;
    border-bottom: 1px solid var(--line);
}
.card-header h3 { margin: 0; font-size: 16px; }
.card-header h4 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; }
.card-header p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.card-header .actions { margin-left: auto; }
.stat-card { position: relative; min-height: 148px; padding: 20px; }
.stat-card::after {
    position: absolute;
    right: -18px;
    bottom: -25px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--olive-100);
    content: "";
}
.stat-card.yellow::after { background: #fff3ae; }
.stat-card.green::after { background: #d8f0df; }
.stat-card.red::after { background: #f5dbd7; }
.stat-label { display: block; color: var(--muted); font-weight: 700; }
.stat-card .money { margin-top: 18px; }
.stat-card > strong { display: block; margin-top: 15px; font-size: 27px; }
.stat-note { display: block; margin-top: 12px; color: var(--muted); font-size: 12px; }
.money { display: inline-flex; flex-direction: column; line-height: 1.1; }
.money strong { color: var(--ink); font-size: 19px; font-weight: 900; letter-spacing: -.02em; }
.money small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.money.large strong { font-size: 30px; }
.money.small strong { font-size: 14px; }
.money.small small { font-size: 10px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
th { color: var(--muted); background: #f7f7ee; font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(238,240,223,.42); }
.workspace-panel td > small { display: block; margin-top: 3px; color: var(--muted); }
.product-cell { display: flex; align-items: center; gap: 10px; white-space: normal; }
.product-cell img, .product-thumb {
    width: 45px;
    height: 45px;
    flex: none;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--olive-100);
}
.product-placeholder { display: grid; width: 45px; height: 45px; flex: none; place-items: center; border-radius: 11px; background: var(--olive-100); font-size: 19px; }
.product-cell small { display: block; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; color: var(--olive-800); background: var(--olive-100); font-size: 11px; font-weight: 800; text-transform: capitalize; }
.badge.green { color: #23643d; background: #dff2e5; }
.badge.red { color: #9c362e; background: #f6dfdc; }
.badge.yellow { color: #775f00; background: #fff2a7; }
.badge.blue { color: #315d8b; background: #dfeafb; }
.btn {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 14px;
    cursor: pointer;
    color: var(--olive-900);
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    font-weight: 800;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 13px rgba(38,48,30,.09); }
.btn.primary { color: var(--olive-950); border-color: #dcc330; background: var(--yellow); }
.btn.dark { color: #fff; border-color: var(--olive-900); background: var(--olive-900); }
.btn.danger { color: #fff; border-color: var(--red); background: var(--red); }
.btn.small { min-height: 32px; padding: 5px 9px; font-size: 11px; }
.btn.wide { width: 100%; }
.icon-btn { display: inline-grid; width: 40px; height: 40px; cursor: pointer; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
form.stack, .stack { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.full { grid-column: 1 / -1; }
label { display: grid; gap: 6px; color: var(--olive-900); font-size: 12px; font-weight: 800; }
.quick-master-link { width: max-content; padding: 1px 2px; cursor: pointer; justify-self: end; color: var(--olive-800); border: 0; background: transparent; font-size: 10px; font-weight: 900; text-decoration: underline; text-underline-offset: 2px; }
.quick-master-link:hover { color: var(--olive-950); }
.quick-master-link:focus-visible { border-radius: 4px; outline: 2px solid var(--yellow); outline-offset: 2px; }
input, select, textarea {
    width: 100%;
    min-height: 41px;
    padding: 9px 11px;
    color: var(--ink);
    border: 1px solid #cfd2bf;
    border-radius: 10px;
    outline: none;
    background: #fff;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--olive-700); box-shadow: 0 0 0 3px rgba(98,110,73,.14); }
.input-row { display: flex; gap: 9px; }
.input-row > * { flex: 1; }
.check { display: flex; min-height: 41px; align-items: center; gap: 9px; }
.check input { width: 18px; min-height: 18px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #fbfbf4; }
.toolbar .search { min-width: 240px; flex: 1; }
.reactive-list-toolbar { border-top: 1px solid var(--line); }
.reactive-list-toolbar:first-child { border-top: 0; }
.reactive-list-count { margin-left: auto; white-space: nowrap; }
.reactive-search-hidden { display: none !important; }
.alert { margin: 0 0 15px; padding: 12px 15px; border: 1px solid #cfddbd; border-radius: 11px; color: #3a6028; background: #edf7e8; font-weight: 650; }
.alert.error { color: #93352f; border-color: #efc6c2; background: #fce9e7; }
.alert.warning { color: #765d00; border-color: #eedb75; background: #fff6c9; }
.empty { padding: 42px 20px; color: var(--muted); text-align: center; }
.empty strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 17px; }
.list { margin: 0; padding: 0; list-style: none; }
.list li { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .grow { min-width: 0; flex: 1; }
.list .grow strong, .list .grow small { display: block; }
.list .grow small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 7px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: var(--olive-100); }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--yellow); }
.insight { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fbfbf1; }
.insight + .insight { margin-top: 10px; }
.insight strong { display: block; margin-bottom: 4px; }
.insight p { margin: 0; color: var(--muted); }
.insight.urgent { border-left: 5px solid var(--red); }
.insight.opportunity { border-left: 5px solid var(--green); }
.insight.info { border-left: 5px solid var(--blue); }
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    overflow-y: auto;
    padding: 4vh 16px;
    background: rgba(25,31,20,.58);
    backdrop-filter: blur(3px);
}
.modal.open { display: block; }
.modal-dialog { width: min(780px, 100%); margin: auto; border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-head button { margin-left: auto; }
.modal-head .actions { margin-left: auto; }
.modal-head .actions button { margin-left: 0; }
.modal-body { padding: 20px; }
.quick-master-dialog { width: min(680px, 100%); }
.quick-master-description { margin: 0 0 16px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 20px; border-top: 1px solid var(--line); }
.image-preview { display: grid; width: 150px; height: 120px; place-items: center; overflow: hidden; border: 1px dashed #b9bea8; border-radius: 12px; color: var(--muted); background: var(--olive-100); }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.pos-page-head { align-items: center; margin-bottom: 12px; }
.pos-page-head h2 { margin-bottom: 0; font-size: 24px; }
.pos-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(440px, .9fr); gap: 14px; }
.pos-page-actions { align-items: center; }
.pos-toolbar { align-items: flex-end; }
.pos-toolbar label { display: grid; gap: 5px; }
.pos-toolbar label > span { color: var(--muted); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.pos-search-field { min-width: 280px; flex: 1; }
.pos-category-field { width: min(240px, 34%); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; padding: 10px; }
.product-tile {
    position: relative;
    min-height: 132px;
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
}
.product-tile:hover { border-color: var(--olive-700); box-shadow: var(--shadow); transform: translateY(-2px); }
.product-tile img, .product-tile .tile-image { display: grid; width: 100%; height: 68px; place-items: center; object-fit: cover; background: var(--olive-100); font-size: 26px; }
.product-tile .tile-body { display: block; padding: 7px 8px; }
.product-tile strong { display: block; overflow: hidden; font-size: 12px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.product-tile .tile-body > small { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.product-tile .stock { position: absolute; top: 5px; right: 5px; padding: 3px 6px; border-radius: 99px; background: rgba(255,255,255,.94); font-size: 8px; font-weight: 800; }
.product-tile .money { margin-top: 4px; }
.product-tile .money.small strong { font-size: 11px; }
.product-tile .money.small small { margin-top: 2px; font-size: 8px; }
.cart-panel { position: sticky; top: 92px; height: calc(100vh - 112px); display: flex; min-height: 620px; flex-direction: column; }
.cart-panel > .card-header { flex: none; padding: 12px 14px; }
.cart-panel > .card-header h3 { font-size: 15px; }
.cart-panel > .card-header p { font-size: 10px; }
.cart-items { min-height: 245px; flex: 1 1 52%; overflow-y: auto; overscroll-behavior: contain; padding: 5px 12px; scrollbar-gutter: stable; }
.cart-items .empty { padding: 28px 12px; }
.cart-line { display: grid; grid-template-columns: minmax(110px, 1fr) auto auto; align-items: center; gap: 8px; min-height: 51px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.cart-line-product { min-width: 0; }
.cart-line-product strong { display: block; overflow: hidden; font-size: 12px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.cart-line-product small { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.cart-line-money { display: flex; align-items: baseline; justify-content: flex-end; gap: 5px; white-space: nowrap; }
.cart-line-money strong { font-size: 11px; }
.cart-line-money small { color: var(--muted); font-size: 9px; }
.qty { display: flex; align-items: center; gap: 4px; margin: 0; }
.qty strong { min-width: 22px; font-size: 11px; text-align: center; }
.qty button { display: grid; width: 24px; height: 24px; padding: 0; cursor: pointer; place-items: center; color: var(--ink); border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 13px; line-height: 1; }
.qty button:hover { border-color: var(--olive-700); background: var(--olive-100); }
.qty button.remove { color: #9c362e; }
.cart-summary { max-height: 46%; flex: 0 1 46%; overflow-y: auto; padding: 10px 14px; border-top: 1px solid var(--line); background: #f9f9ef; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; margin: 7px 0; }
.summary-row.total { align-items: flex-end; margin-top: 14px; padding-top: 13px; border-top: 1px dashed #bdc1ae; font-weight: 900; }
.payment-fields { display: grid; gap: 9px; margin-top: 12px; }
.payment-tenders { display: grid; gap: 6px; }
.payment-tender { display: grid; grid-template-columns: minmax(90px,1fr) 64px minmax(92px,.8fr) minmax(105px,1fr) 30px; gap: 5px; align-items: center; }
.payment-tender select, .payment-tender input { min-width: 0; min-height: 34px; padding: 6px 7px; font-size: 10px; }
.payment-tender .icon-btn { width: 28px; height: 28px; }
.checkout-step { display: grid; gap: 7px; margin: 9px 0; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.checkout-step-head { display: flex; align-items: flex-start; gap: 9px; }
.checkout-step-head > span { display: grid; width: 25px; height: 25px; flex: none; place-items: center; color: var(--olive-950); border-radius: 8px; background: var(--yellow); font-size: 11px; font-weight: 900; }
.checkout-step-head strong, .checkout-step-head small { display: block; }
.checkout-step-head small { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 600; line-height: 1.35; }
.customer-benefits { padding: 9px 10px; color: var(--olive-900); border-radius: 9px; background: var(--olive-100); }
.customer-benefits strong, .customer-benefits small { display: block; }
.customer-benefits small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.checkout-note { margin: 11px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.cart-checkout { display: flex; flex: none; gap: 7px; padding: 9px 14px 12px; }
.cart-checkout .wide { flex: 1; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { margin-left: auto; content: '＋'; font-size: 18px; }
details.card[open] > summary::after { content: '−'; }
.receipt { width: 76mm; margin: 20px auto; padding: 8mm; color: #000; background: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.receipt-logo { display: block; width: 48mm; margin: 0 auto 4mm; }
.receipt h1, .receipt p { margin: 1mm 0; text-align: center; }
.receipt hr { border: 0; border-top: 1px dashed #000; }
.receipt table td, .receipt table th { padding: 1.5mm 0; border: 0; background: #fff; font-size: 10px; }
.receipt .right { text-align: right; }
.sale-document-modal { z-index: 300; padding: 2vh 16px; }
.sale-document-dialog { width: min(980px, 100%); overflow: hidden; }
.sale-document-body { max-height: calc(96vh - 70px); overflow: auto; padding: 12px; background: #eef0e6; }
.sale-document-body .receipt { box-shadow: 0 10px 30px rgba(21,27,17,.18); }
.table-link { padding: 0; cursor: pointer; color: var(--olive-800); border: 0; background: transparent; font: inherit; font-weight: 850; text-decoration: underline; text-underline-offset: 2px; }
.invoice-document { width: min(210mm, 100%); min-height: 275mm; margin: 12px auto; padding: 16mm; color: #161914; background: #fff; box-shadow: 0 10px 30px rgba(21,27,17,.18); }
.invoice-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 3px solid var(--olive-800); }
.invoice-heading img { width: 190px; max-height: 90px; object-fit: contain; }
.invoice-heading p { margin: 5px 0 0; color: var(--olive-700); font-size: 11px; letter-spacing: .12em; }
.invoice-title { display: grid; justify-items: end; gap: 6px; text-align: right; }
.invoice-title h1 { margin: 0; color: var(--olive-950); font-size: 30px; letter-spacing: .05em; }
.invoice-parties { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 24px 0; }
.invoice-parties > div { padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.invoice-parties span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.invoice-parties strong { display: block; margin-bottom: 5px; }
.invoice-parties p { margin: 3px 0; }
.invoice-items table { min-width: 720px; }
.invoice-items th { color: #fff; background: var(--olive-800); }
.invoice-totals { display: grid; grid-template-columns: 1fr minmax(280px, 38%); gap: 24px; align-items: start; margin-top: 24px; }
.invoice-totals > div { color: var(--muted); }
.invoice-totals table td { background: #fff; }
.invoice-totals table tr:last-child td { font-size: 17px; border-top: 2px solid var(--olive-800); }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 200; max-width: 360px; padding: 13px 16px; color: #fff; border-radius: 11px; background: var(--olive-950); box-shadow: var(--shadow); }
.field-tooltip {
    position: fixed;
    z-index: 400;
    width: max-content;
    padding: 8px 10px;
    pointer-events: none;
    color: #fff;
    border-radius: 8px;
    background: var(--olive-950);
    box-shadow: var(--shadow);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.35;
}
.workspace-current {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: -5px 0 18px;
    padding: 11px 14px;
    color: var(--olive-900);
    border: 1px solid var(--line);
    border-left: 4px solid var(--yellow);
    border-radius: 12px;
    background: #fbfbf4;
}
.workspace-current > span { display: grid; min-width: 0; gap: 2px; }
.workspace-current strong { color: var(--olive-950); }
.workspace-current small { color: var(--muted); }
.workspace-current .badge { margin-left: auto; white-space: nowrap; }
.workspace-panel { grid-column: 1 / -1; scroll-margin-top: 100px; }
.workspace-panel[hidden] { display: none !important; }
.workspace-panel.workspace-panel-active { width: 100%; margin-top: 0 !important; }
.workspace-panel.workspace-panel-active > .card-header { background: var(--paper); }
.form-guide-button { grid-column: 1 / -1; width: max-content; margin-left: auto; }
.form-guide-button.compact { grid-column: auto; width: auto; margin-left: 0; }
.guide-dialog { width: min(780px, 100%); }
.guide-section + .guide-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.guide-section h4 { margin: 0 0 10px; color: var(--ink); font-size: 1rem; }
.guide-purpose p,
.guide-empty { margin: 0; color: var(--muted); line-height: 1.6; }
.guide-step-list,
.guide-field-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.guide-step-list li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 12px; border-radius: 10px; background: #f5f4e8; }
.guide-step-list strong { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: #fff; background: var(--olive-800); font-size: .8rem; }
.guide-step-list span,
.guide-field-list span { color: var(--muted); line-height: 1.5; }
.guide-field-list li { display: grid; grid-template-columns: minmax(150px, .55fr) minmax(0, 1.45fr); gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfbf4; }
.test-option { display: flex; min-height: 255px; flex-direction: column; }
.test-option .card-body { display: flex; flex: 1; flex-direction: column; }
.test-option .btn { margin-top: auto; }
.test-status { display: inline-flex; min-width: 62px; justify-content: center; }
.test-status.pass { color: #23643d; background: #dff2e5; }
.test-status.fail { color: #9c362e; background: #f6dfdc; }
.test-status.warning { color: #775f00; background: #fff2a7; }
.test-status.running { color: #315d8b; background: #dfeafb; }
.test-status.scrubbed { color: var(--muted); background: var(--olive-100); }
.test-summary { display: flex; flex-wrap: wrap; gap: 9px; margin: 14px 0; }
.test-summary .badge { min-width: 82px; justify-content: center; }
.test-details { max-width: 460px; white-space: normal; }
.test-details small { display: block; margin-top: 3px; color: var(--muted); }
.test-run-link { color: var(--olive-800); font-weight: 850; text-decoration: underline; text-underline-offset: 2px; }
.test-batch-directory { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding: 14px; }
.test-batch-link { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 13px 14px; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; background: #fbfbf4; }
.test-batch-link:hover, .test-batch-link:focus-visible { border-color: var(--olive-700); outline: none; }
.test-batch-link.active { border-color: var(--olive-800); box-shadow: 0 0 0 2px rgba(98,110,73,.12); background: var(--olive-100); }
.test-batch-link span:not(.badge), .test-batch-link strong, .test-batch-link small { display: block; min-width: 0; }
.test-batch-link small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.test-result-toolbar { display: grid; grid-template-columns: minmax(260px,2fr) minmax(150px,.7fr) minmax(210px,1fr) auto auto; align-items: end; gap: 10px; margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fbfbf4; }
.test-result-toolbar .btn, .test-result-toolbar .badge { min-height: 41px; align-items: center; justify-content: center; }
.test-branch-actions { justify-content: flex-start; margin: -4px 0 14px; }
.danger-zone { border-color: #e6b9b5; }
.danger-zone .card-header { background: #fff4f2; }
.login-body { display: grid; min-height: 100vh; padding: 24px; place-items: center; background: radial-gradient(circle at top, #ffffdf, var(--olive-100)); }
.login-card { width: min(430px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); }
.login-card > img { display: block; width: 260px; max-height: 135px; margin: 0 auto; object-fit: contain; border-radius: 16px; background: var(--yellow); }
.login-card h1 { margin: 24px 0 4px; font-size: 27px; }
.login-card > p:not(.slogan) { margin: 0 0 20px; color: var(--muted); }
.login-card .slogan { margin: 10px 0 0; color: var(--olive-700); font-size: 11px; font-weight: 900; letter-spacing: .15em; text-align: center; }
.login-note { display: block; margin-top: 15px; color: var(--muted); text-align: center; }
.standalone-screen { min-height: 100vh; padding: 28px; background: radial-gradient(circle at top, #ffffdf, var(--olive-100)); }
.standalone-panel { width: min(760px, 100%); margin: 0 auto; padding: 30px; border: 1px solid var(--line); border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); text-align: center; }
.standalone-logo { width: min(300px, 70%); max-height: 140px; object-fit: contain; }
.checker-form { display: grid; max-width: 520px; margin: 24px auto; gap: 14px; text-align: left; }
.checker-form input { min-height: 64px; font-size: 28px; text-align: center; }
.price-result { margin-top: 24px; padding: 28px; border: 2px solid var(--yellow); border-radius: 22px; background: var(--yellow-soft); }
.price-result h2 { margin: 6px 0 15px; font-size: 34px; }
.price-result .money strong { font-size: 46px; }
.price-result small { display: block; margin-top: 14px; color: var(--muted); }
.label-panel { width: min(1200px, 100%); margin: 0 auto; }
.label-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 16px; }
.label-toolbar > div { display: flex; align-items: center; gap: 14px; }
.label-toolbar img { width: 120px; max-height: 70px; object-fit: contain; }
.label-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8mm; margin-top: 20px; }
.barcode-label { display: grid; min-height: 48mm; padding: 5mm; border: 1px dashed #777; align-content: center; justify-items: center; background: #fff; text-align: center; break-inside: avoid; }
.barcode-label svg { width: 100%; max-height: 62px; }
.barcode-label strong { font-size: 15px; }
.kiosk-screen { min-height: 100vh; background: var(--olive-100); }
.kiosk-header { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 7px 14px; border-bottom: 1px solid var(--line); background: var(--paper); }
.kiosk-header img { width: 90px; max-height: 44px; object-fit: contain; }
.kiosk-header div { display: grid; }
.kiosk-header strong { font-size: 17px; }
.kiosk-header small { color: var(--muted); }
.kiosk-header .btn { margin-left: auto; }
.kiosk-screen .content { max-width: 1900px; margin: 0 auto; padding: 10px; }
.kiosk-screen .page-head { display: none; }
.kiosk-screen .pos-layout { grid-template-columns: minmax(0, 1.05fr) minmax(520px, .95fr); gap: 10px; }
.kiosk-screen .pos-toolbar { padding: 9px 10px; }
.kiosk-screen .product-grid { grid-template-columns: repeat(auto-fill,minmax(110px,1fr)); gap: 7px; padding: 8px; }
.kiosk-screen .cart-panel { top: 8px; height: calc(100vh - 80px); min-height: 600px; }
.kiosk-screen .cart-summary { max-height: 44%; flex-basis: 44%; }
.kiosk-screen .checkout-step-head small, .kiosk-screen .checkout-note { display: none; }
.kiosk-screen .checkout-step { margin: 7px 0; padding: 8px; }
.kiosk-screen .customer-benefits { padding: 7px 8px; }
.kiosk-screen .payment-tender { grid-template-columns: minmax(82px,1fr) 58px minmax(80px,.75fr) minmax(92px,.9fr) 28px; }
.inline-actions input { min-width: 100px; }
code { overflow-wrap: anywhere; white-space: normal; }

@media (max-width: 1280px) {
    .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
}
@media (max-width: 980px) {
    .sidebar { transform: translateX(-105%); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-flyout {
        position: static;
        display: none;
        width: auto;
        max-height: none;
        margin: 2px 4px 8px 35px;
        padding: 6px;
        overflow: visible;
        pointer-events: auto;
        visibility: visible;
        opacity: 1;
        border-color: rgba(255,255,255,.12);
        background: rgba(255,255,255,.06);
        box-shadow: none;
        transform: none;
    }
    .sidebar-nav-item.submenu-open > .sidebar-flyout { display: block; }
    .sidebar-flyout-heading { border-color: rgba(255,255,255,.1); }
    .sidebar-flyout-heading strong { color: #fff; }
    .sidebar-flyout-heading small { color: #adb5a4; }
    .sidebar nav .sidebar-flyout a { color: #dfe4d9; }
    .main-shell { width: 100%; margin-left: 0; }
    .menu-toggle { display: inline-grid !important; }
    .topbar { padding: 12px 18px; }
    .content { padding: 20px 18px 40px; }
    .test-batch-directory { grid-template-columns: 1fr; }
    .test-result-toolbar { grid-template-columns: 1fr 1fr; }
    .test-result-search { grid-column: 1 / -1; }
    .pos-layout { grid-template-columns: 1fr; }
    .cart-panel { position: static; height: auto; min-height: 500px; }
    .kiosk-screen .pos-layout { grid-template-columns: 1fr; }
    .kiosk-screen .cart-panel { height: auto; min-height: 650px; }
}
@media (max-width: 700px) {
    .topbar .eyebrow, .user-chip div, .branch-select > span, .tooltip-preference span { display: none; }
    .topbar h1 { font-size: 18px; }
    .topbar-actions { gap: 6px; }
    .branch-select select { min-width: 120px; max-width: 155px; }
    .page-head { align-items: flex-start; flex-direction: column; }
    .page-actions { width: 100%; margin-left: 0; }
    .grid.cols-4, .grid.cols-3, .grid.cols-2, .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
    .span-2 { grid-column: span 1; }
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 10px; }
    .product-tile { min-height: 135px; }
    .invoice-document { min-height: auto; padding: 18px; }
    .invoice-heading, .invoice-totals { grid-template-columns: 1fr; flex-direction: column; }
    .invoice-title { justify-items: start; text-align: left; }
    .invoice-parties { grid-template-columns: 1fr; }
    .toolbar { align-items: stretch; }
    .toolbar > * { width: 100%; }
    .pos-category-field { width: 100%; }
    .label-grid { grid-template-columns: 1fr; }
    .label-toolbar { align-items: flex-start; flex-direction: column; }
    .workspace-current { align-items: flex-start; }
    .workspace-current .badge { display: none; }
    .guide-field-list li { grid-template-columns: 1fr; }
    .test-batch-link { grid-template-columns: 1fr auto; }
    .test-batch-link > span:nth-child(2) { display: none; }
    .test-result-toolbar { grid-template-columns: 1fr; }
    .test-result-search { grid-column: auto; }
    .cart-line { grid-template-columns: minmax(0,1fr) auto; }
    .cart-line .qty { grid-column: 1 / -1; justify-content: flex-end; }
}
@media print {
    body { background: #fff; }
    .no-print, .sidebar, .topbar, .content > *:not(.receipt):not(.invoice-document) { display: none !important; }
    .main-shell { width: 100%; margin: 0; }
    .content { padding: 0; }
    .receipt { margin: 0 auto; padding: 2mm; }
    .invoice-document { min-height: 0; margin: 0; padding: 8mm; box-shadow: none; }
    body.printing-sale-document .app-shell,
    body.printing-sale-document .toast { display: none !important; }
    body.printing-sale-document .sale-document-modal {
        position: static;
        display: block !important;
        padding: 0;
        overflow: visible;
        background: #fff;
        backdrop-filter: none;
    }
    body.printing-sale-document .sale-document-dialog { width: 100%; box-shadow: none; }
    body.printing-sale-document .sale-document-body { max-height: none; overflow: visible; padding: 0; background: #fff; }
    body.printing-sale-document .receipt,
    body.printing-sale-document .invoice-document { box-shadow: none; }
    .label-screen { padding: 0; background: #fff; }
    .label-screen .no-print, .label-screen .label-toolbar { display: none !important; }
    .label-screen .label-grid { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 4mm; margin: 0; }
    .label-screen .barcode-label { display: grid !important; }
}
