:root {
    --blue: #1261e8;
    --blue-dark: #0d4fc2;
    --blue-soft: #eaf2ff;
    --ink: #172238;
    --muted: #64718a;
    --line: #dbe3ef;
    --surface: #ffffff;
    --background: #f5f7fb;
    --success: #16825d;
    --danger: #b42318;
    --danger-soft: #fff0ee;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { min-height: 100vh; margin: 0; background: var(--background); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; border: 0; border-radius: 9px; padding: 0 18px; cursor: pointer; text-decoration: none; font-weight: 750; }
.button-primary { background: var(--blue); color: #fff; }
.button-primary:hover { background: var(--blue-dark); }
.button-store { background: #7f54b3; color: #fff; }
.button-store:hover { background: #684294; }
.button-secondary { border: 1px solid #cbd6e5; background: #fff; color: #35445d; }
.button-secondary:hover { background: #f5f8fc; }
.button-wide { width: 100%; }

.login-body { background: #fff; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 44%) 1fr; }
.login-brand-panel { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 42px 54px; background: linear-gradient(145deg, #0954d8 0%, #1261e8 52%, #347df1 100%); color: #fff; }
.login-brand-panel::after { position: absolute; right: -140px; bottom: -170px; width: 440px; height: 440px; border: 90px solid rgba(255,255,255,.08); border-radius: 50%; content: ""; }
.login-brand { position: relative; z-index: 1; font-size: 22px; font-weight: 850; letter-spacing: -.03em; }
.login-brand-panel > div, .login-brand-foot { position: relative; z-index: 1; }
.login-brand-panel h1 { max-width: 590px; margin: 10px 0 18px; font-size: clamp(38px, 4vw, 62px); line-height: 1.04; letter-spacing: -.045em; }
.login-brand-panel p { max-width: 590px; color: rgba(255,255,255,.83); font-size: 17px; line-height: 1.65; }
.login-brand-panel .eyebrow { margin: 0; color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.login-brand-foot { margin: 0; font-size: 13px !important; }
.login-form-panel { display: grid; place-items: center; padding: 38px; background: var(--background); }
.login-form-wrap { width: min(100%, 430px); }
.mobile-brand { display: none; color: var(--blue); font-size: 22px; font-weight: 850; }
.login-form-wrap h2 { margin: 0 0 8px; font-size: 34px; letter-spacing: -.035em; }
.login-intro { margin: 0 0 28px; color: var(--muted); }
.login-form { display: grid; gap: 10px; }
.login-form label { margin-top: 8px; color: #35445d; font-size: 14px; font-weight: 700; }
.login-form input { width: 100%; height: 48px; border: 1px solid #cbd6e5; border-radius: 9px; outline: none; padding: 0 14px; background: #fff; color: var(--ink); }
.login-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(18,97,232,.12); }
.login-form .button { margin-top: 14px; }
.login-help { margin: 22px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.alert { margin-bottom: 16px; border-radius: 9px; padding: 12px 14px; font-size: 14px; }
.alert-error { border: 1px solid #ffd1cc; background: var(--danger-soft); color: var(--danger); }
.alert-success { border: 1px solid #cdeadd; background: #edf9f4; color: var(--success); }
.alert-warning { border: 1px solid #f4d998; background: #fff8e8; color: #815b0e; }

.layout { min-height: 100vh; display: grid; grid-template-columns: 266px minmax(0, 1fr); transition: grid-template-columns .2s ease; }
.app-column { min-width: 0; }
.sidebar { min-width: 0; overflow-x: hidden; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; transition: opacity .16s ease, transform .2s ease; }
.sidebar-collapsed .layout { grid-template-columns: 0 minmax(0, 1fr); }
.sidebar-collapsed .sidebar { opacity: 0; pointer-events: none; }
.brand { height: 64px; padding: 0 28px; display: flex; align-items: center; gap: 2px; font-size: 19px; font-weight: 800; color: var(--blue); border-bottom: 1px solid var(--line); }
.brand span { color: #33415b; font-weight: 650; }
.sidebar-close { display: none; margin-left: auto; border: 0; padding: 5px 8px; background: transparent; color: #42516a; cursor: pointer; font-size: 25px; line-height: 1; }
.nav { padding: 16px 12px; display: grid; gap: 4px; }
.nav a, .nav-action { width: 100%; color: #40506a; text-decoration: none; font-weight: 650; font-size: 14px; padding: 11px 15px; border: 0; border-radius: 9px; display: flex; gap: 12px; align-items: center; background: transparent; text-align: left; }
.nav a.active { background: var(--blue); color: white; box-shadow: 0 5px 14px rgba(18,97,232,.22); }
.nav a.disabled { cursor: default; }
.nav a.disabled:hover, .nav-action:hover { background: #f5f8fc; }
.nav-action { cursor: pointer; }
.nav-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 999px; background: currentColor; opacity: .72; }
.nav-section { margin: 12px 15px 3px; color: #8a96a9; font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid var(--line); }
.sidebar-bottom form { margin: 0; }
.topbar { height: 64px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 30px; }
.menu-glyph { display: grid; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #42516a; cursor: pointer; font-size: 20px; }
.menu-glyph:hover { background: #f0f4f9; }
.user-menu { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; }
.user-role { color: var(--muted); font-size: 12px; font-weight: 600; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--blue); }
.dashboard { max-width: 1450px; width: 100%; margin: 0 auto; padding: 32px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.page-heading h1 { margin: 0 0 5px; font-size: 29px; line-height: 1.1; letter-spacing: -.025em; }
.page-heading p { margin: 0; color: var(--muted); }
.heading-actions { display: flex; gap: 10px; align-items: center; }
.section-heading { margin: 2px 0 12px; }
.section-heading h2 { margin: 0 0 4px; font-size: 17px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.spaced-heading { margin-top: 28px; }
.secure-session { border: 1px solid #cdeadd; border-radius: 999px; padding: 6px 11px; background: #edf9f4; color: var(--success); font-size: 12px; font-weight: 750; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(170px, 1fr)); gap: 16px; }
.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.card { min-height: 108px; padding: 20px; }
.card-label { color: var(--muted); font-size: 14px; }
.card-value { color: var(--blue); font-size: 26px; font-weight: 800; margin-top: 5px; }
.card-note { color: var(--muted); font-size: 12px; margin-top: 2px; }
.content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-top: 20px; }
.panel { min-height: 285px; padding: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel h2 { margin: 0; font-size: 17px; }
.panel-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; font-size: 12px; font-weight: 750; padding: 5px 10px; }
.badge-success { background: #e6f5ef; color: var(--success); }
.badge-muted { background: #eef1f5; color: #637086; }
.badge-neutral { background: var(--blue-soft); color: var(--blue-dark); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; text-align: left; background: #f8fafd; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); }
.empty { color: var(--muted); text-align: center; padding: 46px 10px; }
.table-panel { min-height: auto; padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
.status-tabs { display: flex; gap: 7px; overflow-x: auto; margin-bottom: 10px; padding: 2px 1px 5px; scrollbar-width: thin; }
.status-tab { flex: 0 0 auto; border: 1px solid #cbd6e5; border-radius: 999px; padding: 8px 11px; background: #fff; color: #40506a; cursor: pointer; font-size: 13px; font-weight: 750; }
.status-tab span { display: inline-grid; min-width: 21px; height: 21px; margin-left: 4px; place-items: center; border-radius: 999px; padding: 0 6px; background: #eef2f7; color: #59667b; font-size: 11px; }
.status-tab:hover { border-color: #9ebdf3; background: #f8fbff; }
.status-tab.is-active { border-color: var(--blue); background: var(--blue); color: #fff; box-shadow: 0 4px 12px rgba(18,97,232,.2); }
.status-tab.is-active span { background: rgba(255,255,255,.2); color: #fff; }
.stock-filters { display: grid; grid-template-columns: minmax(220px, 1.4fr) minmax(150px, .7fr) minmax(200px, 1fr) minmax(170px, .8fr) auto; gap: 12px; align-items: end; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 11px; padding: 16px; background: var(--surface); }
.stock-filters .field label { margin-bottom: 5px; }
.stock-filters .field input:not([type="checkbox"]), .stock-filters .field select { min-height: 40px; padding: 8px 10px; }
.stock-filter-clear { min-height: 40px; }
.simple-search { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 12px; align-items: end; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 11px; padding: 16px; background: var(--surface); }
.simple-search .field input:not([type="checkbox"]) { min-height: 40px; padding: 8px 10px; }
.simple-search .button { min-height: 40px; }
.stock-search-meta { min-height: 24px; padding: 0 4px 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.pagination { display: flex; justify-content: flex-end; gap: 6px; margin-top: 14px; }
.pagination:empty { display: none; }
.pagination button { min-width: 38px; min-height: 36px; border: 1px solid #cbd6e5; border-radius: 7px; padding: 6px 10px; background: #fff; color: #40506a; cursor: pointer; font-weight: 700; }
.pagination button:hover:not(:disabled), .pagination button.is-active { border-color: var(--blue); background: var(--blue); color: #fff; }
.pagination button:disabled { cursor: default; opacity: .45; }
.pagination-links a { min-width: 38px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #cbd6e5; border-radius: 7px; padding: 6px 10px; background: #fff; color: #40506a; text-decoration: none; font-weight: 700; }
.pagination-links a:hover, .pagination-links a.is-active { border-color: var(--blue); background: var(--blue); color: #fff; }
.table-actions { white-space: nowrap; text-align: right; }
.table-actions > * { margin-left: 10px; }
.cell-note { display: block; max-width: 360px; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.unit-description { display: flex; min-width: 230px; align-items: center; gap: 10px; }
.unit-description-copy { min-width: 0; }
.unit-thumbnail { display: block; flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 8px; object-fit: cover; background: #f5f7fb; }
.unit-thumbnail-empty { display: grid; place-items: center; color: #7a879a; font-size: 9px; font-weight: 750; line-height: 1.1; text-align: center; }
.inactive-row { opacity: .62; }
.filter-chip { display: inline-flex; margin: 2px 2px 2px 0; border-radius: 6px; padding: 3px 7px; background: #f0f4f9; color: #53617a; font-size: 11px; }
.link { border: 0; padding: 0; background: transparent; color: var(--blue); cursor: pointer; font-weight: 700; text-decoration: none; }
.link:hover { text-decoration: underline; }
.danger-link { color: var(--danger); }
.inline-form { display: inline; }
.muted { color: var(--muted); }
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.quick-actions-two { grid-template-columns: repeat(2, 1fr); }
.quick-action { display: block; min-height: 92px; border: 1px solid var(--line); border-radius: 9px; padding: 16px; color: var(--ink); text-decoration: none; }
.quick-action:hover { border-color: #a9c5f7; background: #f8fbff; }
.quick-action strong, .quick-action small { display: block; }
.quick-action small { margin-top: 6px; color: var(--muted); line-height: 1.4; }
.form-panel { min-height: auto; padding: 24px; }
.spaced-panel { margin-top: 20px; }
.form-grid { display: grid; gap: 18px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.priority-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 20px; border: 1px solid #cfe0fb; border-radius: 10px; padding: 16px; background: #f8fbff; }
.commercial-fields { margin-top: 12px; background: #fff; }
.commercial-fields .checkbox-card { min-height: 44px; margin-top: 24px; align-items: center; }
.simple-search { grid-template-columns: minmax(260px, 1fr) auto; }
.sale-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 24px 0; }
.cash-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 24px 0; }
.sale-summary > div, .cash-summary article { border: 1px solid #dce5f2; border-radius: 10px; padding: 16px; background: #f8fbff; }
.sale-summary span, .cash-summary span { display: block; color: #64748b; font-size: 12px; margin-bottom: 7px; }
.sale-summary strong, .cash-summary strong { font-size: 21px; }
.sale-summary-total { border-color: #1261e8 !important; background: #edf5ff !important; }
.cash-date-form { display: flex; align-items: end; gap: 12px; margin-bottom: 18px; }
.cash-date-form .field { width: 210px; }
.sale-items-editor { display: grid; gap: 12px; }
.sale-item-row { display: grid; grid-template-columns: minmax(280px, 1fr) 180px auto; gap: 12px; align-items: end; border: 1px solid #dce5f2; border-radius: 10px; padding: 14px; background: #f8fbff; }
.sale-item-row .sale-item-remove { min-height: 44px; }
.sale-item-add { margin-top: 12px; }
.cash-in { color: #087a55; font-weight: 700; }
.cash-out { color: #c4362b; font-weight: 700; }
.field { min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field label:not(.checkbox) { display: block; margin-bottom: 7px; color: #35445d; font-size: 13px; font-weight: 750; }
.field input:not([type="checkbox"]), .field select, .field textarea { width: 100%; border: 1px solid #cbd6e5; border-radius: 8px; outline: none; padding: 11px 12px; background: #fff; color: var(--ink); }
.field input:not([type="checkbox"]), .field select { min-height: 44px; }
.field textarea { resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(18,97,232,.12); }
.field small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.color-swatch { display: inline-grid; width: 32px; height: 32px; border: 1px solid #cbd6e5; border-radius: 50%; box-shadow: inset 0 0 0 2px #fff; vertical-align: middle; }
.color-swatch-empty { place-items: center; background: #f5f7fb; color: var(--muted); box-shadow: none; }
.color-preview-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: center; }
.color-preview { width: 44px; height: 44px; border: 1px solid #cbd6e5; border-radius: 9px; background: linear-gradient(135deg,#f2f4f8 25%,#fff 25%,#fff 50%,#f2f4f8 50%,#f2f4f8 75%,#fff 75%); background-size: 12px 12px; }
.checkbox { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 700; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--blue); }
.form-section-title { margin: 28px 0 16px !important; padding-top: 22px; border-top: 1px solid var(--line); }
.form-group-title { margin: 0 0 18px !important; color: var(--ink); font-size: 18px !important; }
.form-group-title:not(:first-of-type) { margin-top: 30px !important; padding-top: 24px; border-top: 1px solid var(--line); }
.form-help { margin: -8px 0 16px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.checkbox-card { min-height: 44px; border: 1px solid #cbd6e5; border-radius: 8px; padding: 0 13px; background: #fff; }
.intake-defaults { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 18px; border: 1px solid #bdd4fb; border-radius: 10px; padding: 13px 14px; background: #f5f9ff; }
.intake-defaults strong { width: 100%; color: #204a8e; font-size: 13px; }
.intake-defaults span { border-radius: 999px; padding: 5px 9px; background: #e5efff; color: #31588f; font-size: 11px; font-weight: 750; }
.linked-equipment { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(320px, 1.4fr); gap: 22px; margin-bottom: 20px; border: 1px solid #cfe0fb; border-radius: 10px; padding: 18px; background: #f8fbff; }
.linked-equipment h3 { margin: 10px 0 4px; font-size: 18px; }
.linked-equipment p { margin: 0; color: var(--muted); font-size: 13px; }
.linked-equipment dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.linked-equipment dl div { border-left: 2px solid #bdd4fb; padding-left: 10px; }
.linked-equipment dt { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.linked-equipment dd { margin: 4px 0 0; color: var(--ink); font-size: 13px; font-weight: 750; }
.unit-origin-panel { margin-bottom: 20px; border-color: #bdd4fb; background: linear-gradient(135deg, #f8fbff, #fff); }
.unit-origin-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.unit-origin-heading > div { display: flex; align-items: center; gap: 10px; }
.unit-origin-heading h2 { margin: 0; font-size: 18px; }
.unit-origin-data { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.unit-origin-data > div { border: 1px solid #dce7f6; border-radius: 9px; padding: 12px; background: #fff; }
.unit-origin-data dt { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.unit-origin-data dd { margin: 6px 0 0; color: var(--ink); font-size: 14px; font-weight: 750; }
.unit-origin-data dd small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 500; }
.unit-origin-notes { margin: 14px 0 0; border-left: 3px solid #9ebff5; padding: 9px 12px; background: #f5f9ff; font-size: 13px; line-height: 1.45; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.product-image { margin: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.product-image img { display: block; width: 100%; height: 145px; object-fit: cover; background: #f5f7fb; }
.product-image figcaption { overflow: hidden; padding: 9px 10px 3px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.product-image form { padding: 4px 10px 10px; }
.upload-form { display: flex; gap: 12px; align-items: flex-end; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.upload-form .field { flex: 1; }
.gallery-editor { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.gallery-editor[hidden] { display: none !important; }
.gallery-card { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.gallery-card > img { display: block; width: 100%; height: 170px; object-fit: cover; background: #f5f7fb; }
.gallery-card-body { display: grid; gap: 10px; padding: 12px; }
.gallery-card-body > strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.gallery-card-body > label { color: #40506a; font-size: 12px; font-weight: 700; }
.gallery-card-body input[type="number"] { width: 72px; min-height: 34px; margin-left: 6px; border: 1px solid #cbd6e5; border-radius: 7px; padding: 5px 8px; }
.radio-line { display: flex; align-items: center; gap: 7px; }
.radio-line input { accent-color: var(--blue); }
.image-source-block { margin-top: 18px; border: 1px solid #cfe0fb; border-radius: 10px; padding: 16px; background: #f8fbff; }
.image-source-block h3 { margin: 0 0 12px; font-size: 15px; }
.image-source-block .form-help { margin: 0 0 14px; }
.global-image-tools { display: grid; grid-template-columns: minmax(220px, 420px) auto; gap: 14px; align-items: end; margin-bottom: 14px; }
.global-image-tools .field { margin: 0; }
.global-image-tools .field > span { display: block; margin-bottom: 6px; color: #40506a; font-size: 12px; font-weight: 750; }
.global-image-tools > small { padding-bottom: 12px; color: var(--muted); font-size: 11px; }
.model-image-selector { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 12px; }
.model-image-option { position: relative; overflow: hidden; border: 2px solid transparent; border-radius: 9px; background: #fff; cursor: pointer; box-shadow: 0 0 0 1px var(--line); }
.model-image-option:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(18,97,232,.12); }
.model-image-option input { position: absolute; top: 9px; left: 9px; width: 18px; height: 18px; accent-color: var(--blue); }
.model-image-option img { display: block; width: 100%; height: 125px; object-fit: cover; background: #f5f7fb; }
.model-image-option span { display: block; overflow: hidden; padding: 9px; color: #40506a; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.model-image-option small { display: block; overflow: hidden; margin: -5px 9px 9px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.model-image-option[hidden] { display: none !important; }
.image-upload-field { margin-top: 20px; }
.ajax-upload-list { display: grid; gap: 9px; margin-top: 12px; }
.ajax-upload-item { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(120px, 240px) 130px; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #f8fafc; }
.ajax-upload-item strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ajax-upload-item progress { width: 100%; height: 9px; accent-color: var(--blue); }
.ajax-upload-item small { margin: 0; text-align: right; }
.ajax-upload-item.is-success { border-color: #bfe5d4; background: #f0faf6; }
.ajax-upload-item.is-success small { color: var(--success); }
.ajax-upload-item.is-error { border-color: #ffd1cc; background: var(--danger-soft); }
.ajax-upload-item.is-error small { color: var(--danger); }
.record-detail-grid { display: grid; grid-template-columns: minmax(300px, .85fr) minmax(420px, 1.4fr); gap: 20px; margin-top: 20px; align-items: start; }
.record-detail-grid .panel { min-height: auto; }
.note-form { display: grid; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.note-form .button { justify-self: end; }
.note-list { display: grid; gap: 10px; margin-top: 16px; }
.note-item { border: 1px solid var(--line); border-radius: 9px; padding: 12px; background: #f9fbfd; }
.note-item p { margin: 0 0 8px; color: #26354d; font-size: 13px; line-height: 1.45; }
.note-item small { color: var(--muted); font-size: 11px; }
.timeline { display: grid; }
.record-history:not(.is-expanded) .timeline-event:nth-child(n+4) { display: none; }
.timeline-event { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding-bottom: 20px; }
.timeline-event:not(:last-child)::before { content: ''; position: absolute; top: 13px; bottom: -2px; left: 5px; width: 2px; background: #d9e3f1; }
.timeline-dot { position: relative; z-index: 1; width: 12px; height: 12px; margin-top: 3px; border: 3px solid #dce9ff; border-radius: 50%; background: var(--blue); }
.timeline-head { display: flex; justify-content: space-between; gap: 14px; }
.timeline-head strong { font-size: 13px; }
.timeline-head time { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.timeline-actor { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.timeline-source { display: inline-block; margin-right: 7px; border-radius: 999px; padding: 2px 7px; background: #e8f0fd; color: #31588f; font-size: 10px; font-weight: 800; }
.timeline-note { margin: 9px 0 0; border-left: 3px solid #b7cff7; padding: 7px 10px; background: #f8fbff; font-size: 13px; line-height: 1.45; }
.change-list { display: grid; gap: 7px; margin: 10px 0 0; }
.change-list > div { display: grid; grid-template-columns: 130px 1fr; gap: 8px; }
.change-list dt { color: var(--muted); font-size: 11px; font-weight: 750; }
.change-list dd { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; font-size: 11px; line-height: 1.35; }
.change-list dd span { color: #8b4f4f; text-decoration: line-through; }
.change-list dd b { color: #91a0b5; }
.change-list dd strong { color: #216345; }
.stock-adjustment { grid-template-columns: 150px 160px minmax(240px, 1fr) auto; align-items: end; }
code { color: #243754; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.status-list { list-style: none; margin: 0; padding: 0; }
.status-list li { display: flex; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.status-list strong, .status-list small { display: block; }
.status-list strong { margin-bottom: 3px; font-size: 14px; }
.status-list small { color: var(--muted); font-size: 12px; }
.status-check, .status-pending { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; font-size: 12px; font-weight: 850; }
.status-check { background: #e6f5ef; color: var(--success); }
.status-pending { background: var(--blue-soft); color: var(--blue); }
.error-body { display: grid; place-items: center; padding: 24px; }
.error-card { width: min(100%, 520px); border: 1px solid var(--line); border-radius: 14px; padding: 42px; background: #fff; text-align: center; }
.error-code { color: var(--blue); font-size: 48px; font-weight: 850; }
.error-card h1 { margin: 8px 0 26px; font-size: 24px; }

@media (max-width: 1050px) {
    .cards { grid-template-columns: repeat(2, 1fr); }
    .content-grid { grid-template-columns: 1fr; }
    .login-shell { grid-template-columns: 40% 1fr; }
    .login-brand-panel { padding: 38px; }
    .quick-actions { grid-template-columns: 1fr; }
    .stock-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stock-filter-clear { width: max-content; }
    .record-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-brand-panel { display: none; }
    .login-form-panel { padding: 28px 20px; }
    .mobile-brand { display: block; margin-bottom: 42px; }
    .layout, .sidebar-collapsed .layout { grid-template-columns: minmax(0, 1fr); }
    .sidebar, .sidebar-collapsed .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(86vw, 310px); opacity: 1; pointer-events: auto; transform: translateX(-105%); box-shadow: 12px 0 28px rgba(24,45,78,.18); }
    .sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-close { display: block; }
    .dashboard { padding: 22px 16px; }
    .topbar { padding: 0 18px; }
    .user-role { display: none; }
    .two-columns { grid-template-columns: 1fr; }
    .linked-equipment { grid-template-columns: 1fr; }
    .unit-origin-data { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .unit-origin-heading { align-items: flex-start; flex-direction: column; }
    .priority-fields { grid-template-columns: 1fr; }
    .sale-summary, .cash-summary { grid-template-columns: 1fr; }
    .sale-item-row { grid-template-columns: 1fr; }
    .cash-date-form { align-items: stretch; flex-direction: column; }
    .cash-date-form .field { width: 100%; }
    .field-full { grid-column: auto; }
    .upload-form { align-items: stretch; flex-direction: column; }
    .ajax-upload-item { grid-template-columns: 1fr; }
    .ajax-upload-item small { text-align: left; }
    .stock-adjustment { grid-template-columns: 1fr; }
    .stock-filters { grid-template-columns: 1fr; }
    .global-image-tools { grid-template-columns: 1fr; }
    .global-image-tools > small { padding-bottom: 0; }
    .simple-search { grid-template-columns: 1fr; }
    .stock-filter-clear { width: 100%; }
    .pagination { justify-content: center; flex-wrap: wrap; }
    .change-list > div { grid-template-columns: 1fr; }
    .heading-actions { width: 100%; align-items: stretch; flex-direction: column; }
    .heading-actions .button { width: 100%; }
}

@media (max-width: 480px) {
    .cards { grid-template-columns: 1fr; }
    .page-heading { gap: 12px; }
    .secure-session { display: none; }
}

.report-filter { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin: 0 0 20px; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.report-filter .field { min-width: 170px; }
.report-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 14px; }
.report-kpis.client-history-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 18px; }
.report-kpis article { display: flex; flex-direction: column; gap: 5px; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.report-kpis span { color: var(--muted); font-size: 13px; }
.report-kpis strong { color: var(--ink); font-size: 24px; }
.report-kpis small { color: var(--muted); }
.report-note { margin: 0 0 20px; padding: 11px 14px; border-left: 3px solid var(--blue); border-radius: 5px; background: #eef5ff; color: #4c5e78; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.report-section { margin-bottom: 18px; }
.report-grid .report-section { margin-bottom: 0; }
.report-operations { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.report-operations h2 { margin: 0 0 14px; font-size: 17px; }
.report-operations dl { margin: 0; }
.report-operations dl div { display: flex; justify-content: space-between; gap: 15px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.report-operations dl div:last-child { border-bottom: 0; }
.report-operations dt { color: var(--muted); }
.report-operations dd { margin: 0; font-weight: 700; text-align: right; }
.margin-positive { color: #087a55 !important; }
.priority-condition-field { align-self: start; }
.conditional-battery { margin-top: 12px; border: 1px solid #bcd1f3; border-radius: 9px; padding: 12px; background: #f5f9ff; }
.conditional-battery[hidden] { display: none; }
.conditional-battery > label { margin-bottom: 6px; color: #24466f; }
.conditional-battery small { display: block; margin-top: 6px; color: var(--muted); }
.battery-input { position: relative; }
.battery-input input { padding-right: 36px; }
.battery-input span { position: absolute; top: 50%; right: 13px; transform: translateY(-50%); color: var(--muted); font-weight: 750; pointer-events: none; }
.woo-unit-panel { margin-top: 18px; }
.woo-unit-panel .panel-head { align-items: flex-start; }
.woo-filter-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.woo-filter-summary strong { margin-right: 3px; }
.woo-filter-summary span { border: 1px solid #bcd1f3; border-radius: 999px; padding: 5px 9px; background: #f5f9ff; color: #24466f; font-size: 11px; font-weight: 750; }
.woo-sync-data { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.woo-sync-data > div { border: 1px solid var(--line); border-radius: 9px; padding: 12px; background: #fbfcfe; }
.woo-sync-data dt { margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.woo-sync-data dd { margin: 0; font-weight: 750; }
.woo-unit-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.woo-unit-actions form { margin: 0; }
.woo-unit-help { clear: both; margin: 14px 0 0; line-height: 1.55; }
.woo-overview { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.woo-overview > div:first-child { display: flex; align-items: center; gap: 12px; }
.woo-overview strong, .woo-overview small { display: block; }
.woo-overview small { margin-top: 4px; color: var(--muted); }
.woo-test-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; }
.woo-test-panel h2 { margin: 0 0 5px; }
.woo-test-panel p { margin: 0; }
.button-price-sync { box-shadow: 0 5px 14px rgba(127,84,179,.24); }
.button-price-sync:disabled { cursor: wait; opacity: .7; }
.woo-price-sync-panel { margin: -8px 0 18px; border: 1px solid #d8c9ea; border-radius: 11px; padding: 15px 18px; background: #fbf8ff; }
.woo-price-sync-panel.is-success { border-color: #a9dfc8; background: #f3fcf8; }
.woo-price-sync-panel.is-error { border-color: #ffd1cc; background: #fff7f5; }
.woo-price-sync-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.woo-price-sync-head strong, .woo-price-sync-head small { display: block; }
.woo-price-sync-head small { margin-top: 4px; color: var(--muted); }
.woo-price-sync-panel progress { width: 100%; height: 9px; margin-top: 12px; accent-color: #7f54b3; }
.woo-price-sync-errors { margin: 10px 0 0; padding-left: 20px; color: var(--danger); font-size: 13px; }
.checkbox-readonly { cursor: default; opacity: .88; }
.permission-intro, .superadmin-access { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.permission-intro h2, .superadmin-access h2 { margin: 0 0 5px; font-size: 18px; }
.permission-intro p, .superadmin-access p { margin: 0; color: var(--muted); }
.superadmin-access { justify-content: flex-start; border-color: #a9dfc8; background: #f3fcf8; }
.permission-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 0 0 12px; }
.permissions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.permission-group { padding: 0; overflow: hidden; }
.permission-group .panel-head { margin: 0; padding: 15px 18px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.permission-group .panel-head h2 { font-size: 16px; }
.permission-items { display: grid; }
.permission-item { display: flex; align-items: flex-start; gap: 11px; padding: 14px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.permission-item:last-child { border-bottom: 0; }
.permission-item:hover { background: #f7faff; }
.permission-item input { flex: 0 0 auto; margin-top: 3px; accent-color: var(--blue); }
.permission-item strong, .permission-item small { display: block; }
.permission-item small { margin-top: 3px; color: var(--muted); font-weight: 500; line-height: 1.35; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; margin-top: 18px; border: 1px solid var(--line); border-radius: 11px; padding: 14px 18px; background: rgba(255,255,255,.96); box-shadow: 0 -5px 18px rgba(24,45,78,.08); }
.backup-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.backup-summary article { display: grid; gap: 6px; }
.backup-summary span, .backup-summary small { color: var(--muted); }
.backup-summary strong { color: var(--ink); font-size: 22px; }
.backup-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.backup-actions h2 { margin: 0 0 5px; font-size: 18px; }
.backup-actions p { margin: 0; }
.button-small { min-height: 34px; padding: 7px 11px; font-size: 12px; }

@media (max-width: 1000px) {
    .report-kpis, .report-operations { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-kpis.client-history-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-grid { grid-template-columns: 1fr; }
    .permissions-grid { grid-template-columns: 1fr; }
    .backup-summary { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .report-kpis, .report-operations { grid-template-columns: 1fr; }
    .report-kpis.client-history-kpis { grid-template-columns: 1fr; }
    .report-filter .field { width: 100%; }
    .report-filter .button { width: 100%; }
    .report-kpis strong { font-size: 21px; }
    .woo-overview, .woo-test-panel { align-items: stretch; flex-direction: column; }
    .woo-sync-data { grid-template-columns: 1fr; }
    .woo-unit-actions { align-items: stretch; flex-direction: column; }
    .woo-unit-actions .button, .woo-unit-actions form { width: 100%; }
    .woo-price-sync-head { align-items: flex-start; flex-direction: column; gap: 9px; }
    .permission-intro { align-items: stretch; flex-direction: column; }
    .backup-actions { align-items: stretch; flex-direction: column; }
    .backup-actions .button, .backup-actions form { width: 100%; }
}

