:root {
    --ink: #172a2a;
    --muted: #687b79;
    --line: #dfe8e6;
    --surface: #ffffff;
    --canvas: #f3f7f6;
    --brand: #123f3b;
    --brand-2: #1f6860;
    --brand-soft: #e6f2ef;
    --accent: #d7aa4d;
    --danger: #b83b43;
    --danger-soft: #fcebed;
    --warning: #aa6d13;
    --warning-soft: #fff4db;
    --success: #1e7252;
    --success-soft: #e6f5ee;
    --blue: #2e6591;
    --shadow: 0 16px 45px rgba(20, 55, 52, .08);
    --radius: 18px;
    --sidebar: 250px;
    color-scheme: light;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--canvas); }
body, button, input, select, textarea { font: inherit; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { color: var(--brand); }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
input, select, textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid #cad8d5;
    border-radius: 11px;
    color: var(--ink);
    background: #fff;
    padding: 10px 13px;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(31, 104, 96, .12); }
input::placeholder, textarea::placeholder { color: #9aaba9; }
label > span:first-child, fieldset > legend { display: block; margin-bottom: 7px; color: #3c5250; font-size: 13px; font-weight: 700; }
label > span b { color: var(--danger); }
label > small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: var(--sidebar);
    display: flex;
    flex-direction: column;
    padding: 26px 18px 20px;
    color: #fff;
    background: linear-gradient(165deg, #0d3330 0%, #174c47 62%, #1d5a53 100%);
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; }
.brand:hover { color: inherit; }
.brand-mark {
    display: inline-grid;
    flex: 0 0 auto;
    width: 39px;
    height: 39px;
    place-items: center;
    border-radius: 12px;
    color: #113c38;
    background: linear-gradient(145deg, #efd386, #cda03f);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.4);
    font-family: Georgia, serif;
    font-size: 23px;
    font-weight: 700;
}
.brand span:last-child { display: flex; flex-direction: column; }
.brand strong { color: #fff; font-size: 16px; letter-spacing: .01em; }
.brand small { margin-top: 2px; color: rgba(255,255,255,.58); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.side-nav { display: grid; gap: 7px; margin-top: 48px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px; border-radius: 11px; color: rgba(255,255,255,.72); font-size: 14px; font-weight: 650; }
.nav-link span { width: 22px; color: rgba(255,255,255,.52); font-size: 20px; text-align: center; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-link.is-active { color: #fff; background: rgba(255,255,255,.13); box-shadow: inset 3px 0 0 var(--accent); }
.nav-link.is-active span { color: var(--accent); }
.sidebar-footer { display: grid; gap: 12px; margin-top: auto; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 12px 5px; border-top: 1px solid rgba(255,255,255,.12); color: #fff; }
.user-card > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.user-card strong { overflow: hidden; color: #fff; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.user-card small { margin-top: 3px; color: rgba(255,255,255,.55); font-size: 11px; }
.avatar { display: inline-grid; flex: 0 0 auto; width: 36px; height: 36px; place-items: center; border-radius: 50%; color: #fff; background: #2a726a; font-size: 14px; font-weight: 800; }
.link-button { width: 100%; border: 0; color: rgba(255,255,255,.62); background: transparent; font-size: 12px; text-align: left; }
.link-button:hover { color: #fff; }

.app-shell { min-height: 100vh; margin-left: var(--sidebar); }
.main-content { width: min(1480px, 100%); margin: 0 auto; padding: 38px 42px 68px; }
.mobile-header, .bottom-nav { display: none; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.page-heading h1 { margin: 2px 0 7px; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: clamp(30px, 3.2vw, 44px); font-weight: 500; line-height: 1.05; letter-spacing: -.025em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.heading-actions { display: flex; align-items: center; gap: 9px; }
.compact-heading { align-items: flex-start; }
.item-card-cover { display: grid; width: 128px; height: 96px; flex: 0 0 auto; place-items: center; overflow: hidden; border: 1px solid #c7d7d4; border-radius: 16px; color: var(--brand-2); background: #eef4f2; box-shadow: 0 10px 26px rgba(18,63,59,.09); }
.item-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.item-card-cover span { font-size: 30px; }
.item-card-cover small { align-self: start; margin-top: -21px; font-size: 9px; font-weight: 750; }
.eyebrow { color: var(--brand-2) !important; font-size: 11px !important; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.back-link { display: inline-block; margin-bottom: 14px; color: var(--muted); font-size: 13px; font-weight: 650; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid transparent; border-radius: 11px; padding: 9px 17px; font-size: 13px; font-weight: 750; line-height: 1; white-space: nowrap; transition: transform .15s, background .15s, border-color .15s; }
.button:active { transform: translateY(1px); }
.button-primary { color: #fff; background: var(--brand-2); box-shadow: 0 8px 20px rgba(31,104,96,.15); }
.button-primary:hover { color: #fff; background: var(--brand); }
.button-secondary { color: var(--brand); border-color: #bdd0cd; background: #fff; }
.button-secondary:hover { color: var(--brand); border-color: var(--brand-2); background: var(--brand-soft); }
.button-ghost { color: var(--muted); border-color: var(--line); background: transparent; box-shadow: none; }
.button-ghost:hover { color: var(--brand); background: #fff; }
.button-danger-ghost { color: var(--danger); border-color: #edc5c9; background: #fff; }
.button-danger { color: #fff; background: var(--danger); box-shadow: 0 8px 20px rgba(184,59,67,.16); }
.button-danger:hover { color: #fff; background: #952d35; }
.button-large { width: 100%; min-height: 51px; font-size: 14px; }
.button-small { min-height: 36px; padding: 7px 11px; font-size: 11px; }

.panel { border: 1px solid rgba(197, 215, 212, .78); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 22px 24px 16px; }
.panel-heading h2 { margin: 0 0 4px; font-size: 17px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.panel-heading > a { font-size: 12px; font-weight: 750; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { display: flex; align-items: center; gap: 14px; min-height: 106px; padding: 20px; border: 1px solid rgba(197, 215, 212, .78); border-radius: 16px; color: var(--ink); background: #fff; box-shadow: 0 10px 25px rgba(20,55,52,.05); }
.stat-card:hover { color: var(--ink); border-color: #b9ceca; transform: translateY(-1px); }
.stat-icon { display: grid; flex: 0 0 auto; width: 44px; height: 44px; place-items: center; border-radius: 13px; font-size: 21px; font-weight: 800; }
.stat-teal { color: var(--brand-2); background: var(--brand-soft); }
.stat-amber { color: var(--warning); background: var(--warning-soft); }
.stat-red { color: var(--danger); background: var(--danger-soft); }
.stat-blue { color: var(--blue); background: #e7f0f7; }
.stat-card > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.stat-card small { color: var(--muted); font-size: 11px; font-weight: 650; }
.stat-card strong { margin-top: 5px; font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .8fr); gap: 20px; }
.activity-list, .low-stock-list { padding: 0 24px 12px; }
.activity-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid #edf2f1; }
.movement-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; font-size: 17px; font-weight: 800; }
.movement-receipt { color: var(--success); background: var(--success-soft); }
.movement-issue { color: var(--danger); background: var(--danger-soft); }
.movement-adjustment { color: var(--blue); background: #e8f1f8; }
.activity-main, .activity-value { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.activity-main strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.activity-main span, .activity-value span { color: var(--muted); font-size: 11px; }
.activity-value { align-items: flex-end; text-align: right; }
.activity-value strong { font-size: 12px; }
.positive { color: var(--success); }
.negative { color: var(--danger); }
.low-stock-list article { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 0; border-top: 1px solid #edf2f1; }
.low-stock-list article > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.low-stock-list article > div:last-child { align-items: flex-end; text-align: right; }
.low-stock-list strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.low-stock-list span { color: var(--muted); font-size: 10px; }

.filter-bar { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 17px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.75); }
.filter-bar > label { margin: 0; }
.filter-bar > label > span:first-child { margin-bottom: 5px; }
.search-field { position: relative; flex: 1 1 360px; }
.search-field > span { position: absolute; z-index: 1; left: 13px; bottom: 12px; color: var(--muted); font-size: 19px; }
.search-field input { padding-left: 42px; }
.select-field { flex: 0 1 190px; }
.history-filters { flex-wrap: wrap; }
.history-filters label { flex: 1 1 150px; }
.history-filters .select-field { flex-basis: 210px; }

.autocomplete-field { position: relative; }
.autocomplete-list, .search-field > .autocomplete-list { position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; bottom: auto; left: 0; display: block; max-height: min(390px, 58vh); overflow-y: auto; margin: 0; padding: 5px; border: 1px solid #bfd1ce; border-radius: 13px; color: var(--ink); background: #fff; box-shadow: 0 16px 38px rgba(18,63,59,.18); font-size: inherit; }
.autocomplete-list[hidden], .search-field > .autocomplete-list[hidden] { display: none; }
.autocomplete-option { display: grid; width: 100%; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 54px; padding: 7px; border: 0; border-radius: 9px; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.autocomplete-option:hover, .autocomplete-option.is-active { background: var(--brand-soft); }
.autocomplete-option:disabled { opacity: .62; cursor: not-allowed; }
.autocomplete-option img, .autocomplete-image-placeholder { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 8px; background: #e8efed; object-fit: cover; }
.autocomplete-image-placeholder { color: var(--muted); font-size: 18px; }
.autocomplete-details, .autocomplete-balance { display: flex; min-width: 0; flex-direction: column; gap: 3px; margin: 0; }
.autocomplete-details strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.autocomplete-details small, .autocomplete-balance small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.autocomplete-balance { align-items: flex-end; text-align: right; }
.autocomplete-balance strong { color: var(--success); font-size: 10px; white-space: nowrap; }
.autocomplete-balance small.is-archived { color: var(--danger); font-weight: 750; }
.autocomplete-empty { display: block; padding: 16px 12px; color: var(--muted); font-size: 11px; text-align: center; }
.category-hint.is-existing { color: var(--success); font-weight: 700; }
.category-hint.is-new { color: var(--brand-2); font-weight: 700; }

.table-panel { overflow: hidden; }
.responsive-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { padding: 14px 18px; color: var(--muted); background: #f8faf9; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 17px 18px; border-top: 1px solid #e8efed; color: #344b49; vertical-align: middle; }
.data-table td > strong { color: var(--ink); }
.table-subline { display: block; max-width: 240px; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.item-cell { display: flex; min-width: 210px; align-items: center; gap: 11px; }
.item-cell > img, .item-image-placeholder { width: 43px; height: 43px; flex: 0 0 auto; border-radius: 10px; object-fit: cover; }
.item-image-placeholder { display: grid; place-items: center; color: #91a4a1; background: #edf3f2; font-size: 19px; }
.item-cell > span:last-child { min-width: 0; }
.item-cell strong { display: block; overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.stock-value { display: inline-block; padding: 5px 8px; border-radius: 8px; }
.stock-ok { color: var(--success); background: var(--success-soft); }
.stock-low { color: var(--warning); background: var(--warning-soft); }
.stock-out { color: var(--danger); background: var(--danger-soft); }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.row-actions form { display: inline; }
.icon-button { display: inline-grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #fff; font-size: 16px; }
button.icon-button { padding: 0; }
.icon-button:hover { color: var(--brand); border-color: #b9ceca; background: var(--brand-soft); }
.primary-icon { color: var(--brand-2); border-color: #bdd5d1; background: var(--brand-soft); }
.danger-icon { color: var(--danger); border-color: #efc7ca; background: var(--danger-soft); }
.danger-icon:hover { color: #fff; border-color: var(--danger); background: var(--danger); }
.badge { display: inline-flex; min-height: 25px; align-items: center; border-radius: 999px; padding: 4px 9px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge-receipt { color: var(--success); background: var(--success-soft); }
.badge-issue { color: var(--danger); background: var(--danger-soft); }
.badge-adjustment { color: var(--blue); background: #e7f0f7; }
.badge-neutral { color: #516563; background: #eaf0ef; }
.badge-archived { color: var(--danger); background: var(--danger-soft); }

.form-panel { max-width: 940px; margin: 0 auto; padding: 27px; }
.form-section-heading { display: flex; align-items: center; gap: 12px; margin: 3px 0 21px; }
.form-section-heading:not(:first-of-type) { margin-top: 34px; padding-top: 25px; border-top: 1px solid var(--line); }
.form-section-heading > span { display: grid; flex: 0 0 auto; width: 36px; height: 36px; place-items: center; border-radius: 10px; color: var(--brand-2); background: var(--brand-soft); font-size: 11px; font-weight: 800; }
.form-section-heading h2 { margin: 0 0 3px; font-size: 16px; }
.form-section-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.form-grid { display: grid; gap: 18px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full-width { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 27px; padding-top: 22px; border-top: 1px solid var(--line); }
.current-stock-note { display: flex; align-items: center; gap: 14px; margin-top: 24px; padding: 15px; border-radius: 12px; background: #f2f7f6; }
.current-stock-note span { color: var(--muted); font-size: 12px; }
.current-stock-note strong { font-size: 16px; }
.current-stock-note a { margin-left: auto; font-size: 12px; font-weight: 750; }
.selected-item-preview { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 15px; align-items: center; padding: 13px; border: 1px solid #cadbd8; border-radius: 13px; background: #f4f8f7; }
.selected-item-preview[hidden] { display: none; }
.selected-item-preview > img, .selected-item-placeholder { width: 82px; height: 68px; border-radius: 10px; object-fit: cover; }
.selected-item-placeholder { display: grid; place-items: center; color: #8ba09d; background: #e5eeec; font-size: 25px; }
.selected-item-placeholder[hidden], .selected-item-preview > img[hidden] { display: none; }
.selected-item-preview > div { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.selected-item-preview > div small { color: var(--brand-2); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.selected-item-preview > div strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.selected-item-preview > div span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.operation-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin: 0 0 28px; padding: 0; border: 0; }
.operation-switch legend { grid-column: 1 / -1; }
.operation-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.operation-switch label > span { display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; column-gap: 10px; min-height: 74px; align-items: center; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; cursor: pointer; }
.operation-switch b { grid-row: 1 / 3; display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; font-size: 19px; }
.operation-switch strong { align-self: end; font-size: 13px; }
.operation-switch small { align-self: start; color: var(--muted); font-size: 10px; }
.operation-receipt b { color: var(--success); background: var(--success-soft); }
.operation-issue b { color: var(--danger); background: var(--danger-soft); }
.operation-adjustment b { color: var(--blue); background: #e7f0f7; }
.operation-switch input:checked + span { border-color: var(--brand-2); box-shadow: 0 0 0 2px rgba(31,104,96,.12); }
.item-source-switch { display: flex; align-items: center; gap: 8px; margin: -7px 0 20px; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: #f5f8f7; }
.item-source-switch[hidden] { display: none; }
.item-source-switch > span { margin: 0 8px; color: var(--muted); font-size: 11px; font-weight: 750; }
.item-source-switch label { flex: 1; }
.item-source-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.item-source-switch label > span { display: flex; min-height: 38px; align-items: center; justify-content: center; margin: 0; border: 1px solid transparent; border-radius: 9px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 750; cursor: pointer; }
.item-source-switch input:checked + span { color: var(--brand); border-color: #c6d8d5; background: #fff; box-shadow: 0 4px 12px rgba(20,55,52,.06); }
.new-item-fields { margin: 0 0 24px; padding: 20px; border: 1px solid #cfe0dd; border-radius: 14px; background: #f8fbfa; }
.new-item-fields[hidden], [data-existing-item-fields][hidden] { display: none; }
.new-item-fields .form-section-heading { margin: 0 0 18px; }
.movement-details { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.movement-lines, .reservation-lines { display: grid; gap: 12px; }
.movement-line { display: grid; grid-template-columns: minmax(0, 1fr) 180px 36px; gap: 12px; align-items: end; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #f8fbfa; }
.movement-line select[data-item-select] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.movement-line-remove { margin-bottom: 18px; }
.movement-line-remove[hidden], .add-line-button[hidden] { display: none; }
.add-line-button { margin-top: 12px; }
.reservation-details { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.create-reservation-panel { margin-bottom: 20px; overflow: hidden; }
.create-reservation-panel > summary { display: flex; align-items: center; justify-content: space-between; padding: 19px 22px; list-style: none; cursor: pointer; }
.create-reservation-panel > summary::-webkit-details-marker { display: none; }
.create-reservation-panel > summary > span { display: flex; align-items: center; gap: 12px; }
.create-reservation-panel > summary b { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; color: var(--brand-2); background: var(--brand-soft); font-size: 20px; }
.create-reservation-panel > summary span span { display: flex; flex-direction: column; gap: 3px; }
.create-reservation-panel > summary strong { font-size: 14px; }
.create-reservation-panel > summary small { color: var(--muted); font-size: 10px; }
.create-reservation-panel > summary i { font-style: normal; transition: transform .2s; }
.create-reservation-panel[open] > summary i { transform: rotate(180deg); }
.create-reservation-panel > form { padding: 4px 22px 22px; border-top: 1px solid var(--line); }
.create-reservation-panel .reservation-lines { margin-top: 18px; }
.reservation-filter { margin-top: 20px; }
.reservation-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.reservation-card { overflow: hidden; }
.reservation-card.is-released { opacity: .78; }
.reservation-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 20px 20px 14px; }
.reservation-number { color: var(--brand-2); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.reservation-card h2 { margin: 5px 0; font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.reservation-card-head p { margin: 0; color: var(--muted); font-size: 10px; }
.badge-reserved { color: #765718; background: var(--warning-soft); }
.reservation-meta { display: flex; flex-direction: column; gap: 5px; margin: 0 20px 14px; padding: 11px 13px; border-radius: 10px; background: #f4f7f6; }
.reservation-meta strong { font-size: 11px; }
.reservation-meta span { color: var(--muted); font-size: 10px; line-height: 1.45; }
.reservation-item-list { border-top: 1px solid var(--line); }
.reservation-item { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 20px; border-bottom: 1px solid var(--line); }
.reservation-item img, .reservation-item > .item-image-placeholder { width: 42px; height: 36px; border-radius: 8px; object-fit: cover; }
.reservation-item > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.reservation-item strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.reservation-item small { color: var(--muted); font-size: 9px; }
.reservation-item > b { color: var(--brand); font-size: 11px; white-space: nowrap; }
.reservation-card-footer { display: flex; min-height: 58px; align-items: center; justify-content: flex-end; padding: 10px 20px; background: #fafcfb; }
.reservation-card-footer > span { color: var(--muted); font-size: 9px; }
.form-warning { display: flex; gap: 11px; margin-top: 22px; padding: 13px 15px; border-radius: 12px; color: #70551f; background: var(--warning-soft); }
.form-warning > span { display: grid; flex: 0 0 auto; width: 21px; height: 21px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 11px; font-weight: 800; }
.form-warning p { margin: 0; font-size: 11px; line-height: 1.5; }

.audit-panel { padding: 25px; }
.audit-timeline { position: relative; max-width: 960px; }
.audit-timeline::before { position: absolute; inset: 5px auto 10px 7px; width: 1px; content: ""; background: #cbdad7; }
.audit-entry { position: relative; display: grid; grid-template-columns: 15px 1fr; gap: 18px; padding-bottom: 21px; }
.audit-dot { z-index: 1; width: 15px; height: 15px; margin-top: 5px; border: 3px solid #d8eae7; border-radius: 50%; background: var(--brand-2); }
.audit-card { padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.audit-entry:last-child .audit-card { border-bottom: 0; }
.audit-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.audit-meta time { color: var(--muted); font-size: 10px; }
.audit-card h2 { margin: 0 0 6px; font-size: 14px; line-height: 1.4; }
.audit-card > p { margin: 0; color: var(--muted); font-size: 10px; }
.audit-card details { margin-top: 12px; }
.audit-card summary { color: var(--brand-2); font-size: 10px; font-weight: 750; cursor: pointer; }
.change-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.change-details > div { min-width: 0; padding: 10px; border-radius: 10px; background: #f5f8f7; }
.change-details strong { font-size: 10px; }
.change-details pre { max-height: 240px; margin: 8px 0 0; overflow: auto; color: #435855; font: 10px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }

.create-user-panel { margin-bottom: 20px; overflow: hidden; }
.create-user-panel > summary { display: flex; align-items: center; justify-content: space-between; padding: 19px 22px; list-style: none; cursor: pointer; }
.create-user-panel > summary::-webkit-details-marker { display: none; }
.create-user-panel > summary > span { display: flex; align-items: center; gap: 12px; }
.create-user-panel > summary b { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; color: var(--brand-2); background: var(--brand-soft); font-size: 20px; }
.create-user-panel > summary span span { display: flex; flex-direction: column; gap: 3px; }
.create-user-panel > summary strong { font-size: 14px; }
.create-user-panel > summary small { color: var(--muted); font-size: 10px; }
.create-user-panel > summary i { font-style: normal; transition: transform .2s; }
.create-user-panel[open] > summary i { transform: rotate(180deg); }
.user-create-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0 22px 22px; }
.user-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.user-panel { padding: 20px; }
.user-panel.is-disabled { opacity: .7; box-shadow: none; }
.user-panel-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; }
.large-avatar { width: 43px; height: 43px; }
.user-panel h2 { overflow: hidden; margin: 0 0 3px; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.user-panel p { margin: 0; color: var(--muted); font-size: 10px; }
.status-dot { color: var(--muted); font-size: 9px; font-weight: 750; }
.status-dot::before { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; content: ""; background: #a7b4b2; }
.status-dot.online { color: var(--success); }
.status-dot.online::before { background: var(--success); }
.user-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin: 19px 0; padding: 14px 0; border-block: 1px solid var(--line); }
.user-meta div { min-width: 0; }
.user-meta dt { margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.user-meta dd { overflow: hidden; margin: 0; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.user-actions { display: flex; align-items: flex-start; gap: 8px; }
.password-reset { position: relative; }
.password-reset > summary { list-style: none; cursor: pointer; }
.password-reset > summary::-webkit-details-marker { display: none; }
.password-reset form { position: absolute; z-index: 5; right: 0; bottom: calc(100% + 8px); width: 260px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.password-reset form label span { font-size: 10px; }
.password-reset form input { min-height: 38px; margin-bottom: 8px; }

.profile-grid { display: grid; grid-template-columns: 300px minmax(0, 650px); gap: 20px; align-items: start; }
.profile-card { padding: 30px 24px; text-align: center; }
.profile-avatar { width: 75px; height: 75px; margin: 0 auto 15px; font-size: 27px; }
.profile-card h2 { margin: 0 0 4px; font-family: Georgia, serif; font-size: 22px; font-weight: 500; }
.profile-card > p { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.profile-card dl { margin: 22px 0 0; text-align: left; }
.profile-card dl div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.profile-card dt { color: var(--muted); font-size: 10px; }
.profile-card dd { margin: 0; font-size: 10px; font-weight: 700; text-align: right; }
.password-panel { margin: 0; }
.stack-form { display: grid; gap: 17px; }
.password-field { position: relative; display: block; margin: 0; }
.password-field input { padding-right: 82px; }
.password-field button { position: absolute; top: 50%; right: 8px; border: 0; color: var(--brand-2); background: transparent; font-size: 10px; font-weight: 750; transform: translateY(-50%); }

.photo-library { max-width: 940px; margin: 20px auto 0; overflow: hidden; }
.photo-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0 24px 22px; }
.photo-tile { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #f7faf9; }
.photo-tile > a { display: block; aspect-ratio: 4 / 3; background: #e8efed; }
.photo-tile img { width: 100%; height: 100%; display: block; object-fit: cover; }
.photo-tile > div { display: flex; justify-content: space-between; gap: 8px; padding: 9px 10px; }
.photo-tile > div span, .photo-tile > div small { color: var(--muted); font-size: 9px; }
.photo-tile > form { position: absolute; top: 8px; right: 8px; }
.photo-tile .icon-button { width: 30px; height: 30px; border: 0; box-shadow: 0 4px 12px rgba(27,45,43,.18); }
.photo-empty { display: flex; align-items: center; gap: 13px; margin: 0 24px 20px; padding: 17px; border: 1px dashed #bfd1ce; border-radius: 13px; background: #f8fbfa; }
.photo-empty > span { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 11px; color: var(--brand-2); background: var(--brand-soft); font-size: 21px; }
.photo-empty strong { font-size: 12px; }
.photo-empty p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.photo-upload-form { display: flex; align-items: center; gap: 10px; padding: 18px 24px; border-top: 1px solid var(--line); background: #f8faf9; }
.photo-upload-form > small { margin-left: auto; color: var(--muted); font-size: 9px; }
.photo-upload-actions { display: flex; align-items: center; gap: 8px; }
.photo-file-button { margin: 0; }
.photo-file-button input, .photo-source-actions input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.photo-file-button > span { display: inline-flex; min-height: 42px; align-items: center; margin: 0; padding: 8px 14px; border: 1px solid #bed1cd; border-radius: 10px; color: var(--brand); background: #fff; font-size: 11px; font-weight: 750; cursor: pointer; }
.photo-camera-button > span { color: #fff; border-color: var(--brand-2); background: var(--brand-2); }
.photo-upload-preview { display: flex; min-width: 0; align-items: center; gap: 8px; }
.photo-upload-preview[hidden] { display: none; }
.photo-upload-preview img { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; }
.photo-upload-preview span { max-width: 150px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.search-method-section { margin-bottom: 26px; }
.search-method-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 12px; }
.search-method-heading > span { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border-radius: 13px; color: var(--brand-2); background: var(--brand-soft); font-size: 21px; font-weight: 800; }
.search-method-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.search-method-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.product-search-bar { margin-bottom: 0; }
.product-search-results { margin-bottom: 30px; }
.photo-search-method { margin-top: 30px; margin-bottom: 0; }
.photo-index-count { display: flex; min-width: 116px; align-items: center; justify-content: center; flex-direction: column; padding: 12px 16px; border: 1px solid #c7dad6; border-radius: 13px; background: var(--brand-soft); }
.photo-index-count strong { color: var(--brand-2); font-family: Georgia, serif; font-size: 22px; }
.photo-index-count small { color: var(--muted); font-size: 9px; }
.photo-search-panel { overflow: hidden; }
.photo-search-dropzone { display: grid; min-height: 355px; place-items: center; align-content: center; padding: 35px; text-align: center; background: radial-gradient(circle at 50% 15%, rgba(31,104,96,.08), transparent 42%), #fff; }
.camera-mark { display: grid; width: 68px; height: 68px; place-items: center; margin-bottom: 15px; border: 1px solid #bcd5d0; border-radius: 21px; color: var(--brand-2); background: var(--brand-soft); font-size: 34px; }
.photo-search-dropzone h2 { margin: 0 0 7px; font-family: Georgia, serif; font-size: 24px; font-weight: 500; }
.photo-search-dropzone > p { margin: 0 0 22px; color: var(--muted); font-size: 11px; }
.photo-source-actions { display: flex; justify-content: center; gap: 9px; }
.photo-source-actions label { margin: 0; cursor: pointer; }
.photo-source-actions label > span { margin: 0; color: inherit; font-size: inherit; }
.photo-search-preview { display: flex; width: min(480px, 100%); align-items: center; gap: 13px; margin-top: 20px; padding: 11px; border: 1px solid var(--line); border-radius: 13px; background: #f7faf9; text-align: left; }
.photo-search-preview[hidden] { display: none; }
.photo-search-preview img { width: 64px; height: 64px; flex: 0 0 auto; border-radius: 10px; object-fit: cover; }
.photo-search-preview > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.photo-search-preview strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.photo-search-preview small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.photo-search-submit { margin-top: 15px; }
.photo-search-submit:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.photo-search-note { display: flex; align-items: flex-start; gap: 11px; margin-top: 14px; padding: 13px 16px; border-radius: 12px; color: #49615e; background: #e9f1ef; }
.photo-search-note > span { display: grid; width: 20px; height: 20px; flex: 0 0 auto; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 10px; font-weight: 800; }
.photo-search-note p { margin: 0; font-size: 10px; line-height: 1.55; }
.photo-results-section { margin-top: 25px; }
.standalone-heading { padding-inline: 0; }
.photo-result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.photo-result-card { position: relative; overflow: hidden; }
.result-image { display: block; aspect-ratio: 4 / 3; background: #e8efed; }
.result-image img { width: 100%; height: 100%; display: block; object-fit: cover; }
.result-score { position: absolute; top: 12px; right: 12px; display: flex; align-items: flex-end; flex-direction: column; padding: 8px 10px; border-radius: 10px; color: #fff; box-shadow: 0 5px 16px rgba(0,0,0,.18); }
.result-score strong { font-size: 15px; }
.result-score span { font-size: 8px; }
.score-high { background: rgba(25,105,73,.94); }
.score-medium { background: rgba(166,103,13,.94); }
.score-low { background: rgba(82,100,97,.94); }
.result-body { padding: 17px 18px 13px; }
.result-sku { color: var(--brand-2); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.result-body h2 { margin: 5px 0 5px; font-size: 15px; }
.result-body > p { margin: 0; color: var(--muted); font-size: 10px; }
.result-stock { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); }
.result-stock span { color: var(--muted); font-size: 9px; }
.result-stock strong { color: var(--success); font-size: 12px; }
.result-actions { display: flex; gap: 8px; padding: 0 18px 18px; }
.result-actions .button { flex: 1; }

.delete-confirm-panel { max-width: 700px; margin: 0 auto; padding: 28px; }
.delete-warning-icon { display: grid; width: 54px; height: 54px; place-items: center; margin-bottom: 20px; border-radius: 16px; color: var(--danger); background: var(--danger-soft); font-family: Georgia, serif; font-size: 30px; font-weight: 700; }
.delete-facts { margin: 0; border-top: 1px solid var(--line); }
.delete-facts div { display: grid; grid-template-columns: minmax(140px, .65fr) minmax(0, 1.35fr); gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.delete-facts dt { color: var(--muted); font-size: 11px; }
.delete-facts dd { margin: 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 750; }
.delete-checkbox { display: flex; align-items: flex-start; gap: 12px; margin-top: 24px; padding: 15px; border: 1px solid #ecc4c8; border-radius: 12px; background: #fff8f8; cursor: pointer; }
.delete-checkbox input { flex: 0 0 auto; width: 20px; min-height: 20px; margin: 1px 0 0; accent-color: var(--danger); }
.delete-checkbox > span { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.delete-checkbox strong { color: #7e252c; font-size: 12px; }
.delete-checkbox small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.delete-blocked { margin-top: 22px; padding: 15px; border-radius: 12px; color: var(--warning); background: var(--warning-soft); }
.delete-blocked strong { font-size: 12px; }
.delete-blocked p { margin: 5px 0 0; font-size: 11px; line-height: 1.5; }
.delete-related-section { margin-top: 26px; }
.delete-related-warning { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 12px; padding: 13px 16px; border-radius: 12px; color: var(--warning); background: var(--warning-soft); }
.delete-related-warning > span { display: grid; width: 20px; height: 20px; flex: 0 0 auto; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 10px; font-weight: 800; }
.delete-related-warning p { margin: 0; font-size: 10px; line-height: 1.5; }
.delete-related-empty { display: flex; align-items: center; gap: 13px; padding: 20px; }
.delete-related-empty > span { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: var(--success); background: var(--success-soft); font-size: 20px; font-weight: 800; }
.delete-related-empty strong { font-size: 12px; }
.delete-related-empty p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }

.flash { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; padding: 12px 15px; border: 1px solid; border-radius: 12px; font-size: 12px; font-weight: 650; }
.flash button { border: 0; color: inherit; background: transparent; font-size: 19px; }
.flash-success { color: var(--success); border-color: #b8dfcb; background: var(--success-soft); }
.flash-error { color: var(--danger); border-color: #efc2c6; background: var(--danger-soft); }
.flash-warning { color: var(--warning); border-color: #efd79b; background: var(--warning-soft); }
.empty-state, .error-state { display: grid; place-items: center; padding: 70px 24px; text-align: center; }
.empty-state > span, .error-state > span { display: grid; width: 54px; height: 54px; place-items: center; margin-bottom: 13px; border-radius: 16px; color: var(--brand-2); background: var(--brand-soft); font-size: 25px; font-weight: 800; }
.empty-state h2, .error-state h1 { margin: 0 0 7px; font-family: Georgia, serif; font-weight: 500; }
.empty-state p, .error-state p { margin: 0 0 20px; color: var(--muted); font-size: 12px; }
.compact { min-height: 270px; padding: 30px; }
.compact > span { width: 45px; height: 45px; }
.success-state > span { color: var(--success); background: var(--success-soft); }
.error-state { min-height: 70vh; }

.auth-page { background: #f3f7f6; }
.login-shell { display: grid; grid-template-columns: minmax(360px, .85fr) minmax(480px, 1.15fr); min-height: 100vh; }
.login-intro { display: flex; flex-direction: column; justify-content: space-between; padding: 42px clamp(34px, 6vw, 88px); color: #fff; background: radial-gradient(circle at 75% 15%, rgba(216,172,80,.2), transparent 28%), linear-gradient(150deg, #0b2f2d, #164c47 60%, #1f625a); }
.login-intro h1 { margin: 12px 0 20px; font-family: Georgia, serif; font-size: clamp(40px, 5vw, 68px); font-weight: 500; line-height: .98; letter-spacing: -.035em; }
.login-intro > div > p:last-child { max-width: 470px; color: rgba(255,255,255,.66); font-size: 15px; line-height: 1.65; }
.login-intro .eyebrow { color: #d9b867 !important; }
.login-note { margin: 0; color: rgba(255,255,255,.45); font-size: 11px; }
.login-panel { display: grid; place-items: center; padding: 34px; }
.login-card { width: min(420px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 23px; background: #fff; box-shadow: 0 25px 70px rgba(18,63,59,.12); }
.login-card h2 { margin: 3px 0 8px; font-family: Georgia, serif; font-size: 32px; font-weight: 500; }
.login-card > .muted { margin: 0 0 25px; color: var(--muted); font-size: 12px; }
.security-note { margin: 21px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; text-align: center; }
.mobile-login-brand { display: none; }

@media (max-width: 1120px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .user-create-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .login-shell { grid-template-columns: minmax(330px, .75fr) minmax(440px, 1fr); }
}

@media (max-width: 820px) {
    :root { --radius: 15px; }
    .sidebar { display: none; }
    .app-shell { margin-left: 0; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
    .mobile-header { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; height: 63px; padding: 9px 17px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.93); backdrop-filter: blur(14px); }
    .mobile-brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 14px; }
    .mobile-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 19px; }
    .bottom-nav { position: fixed; z-index: 20; inset: auto 0 0; display: grid; grid-template-columns: repeat(6, 1fr); height: calc(63px + env(safe-area-inset-bottom)); padding: 6px 8px env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(14px); }
    .bottom-nav-admin { grid-template-columns: repeat(7, 1fr); }
    .bottom-nav a { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 1px; border-radius: 9px; color: #7b8c8a; }
    .bottom-nav a span { font-size: 20px; }
    .bottom-nav a small { font-size: 9px; font-weight: 700; }
    .bottom-nav a.is-active { color: var(--brand-2); background: var(--brand-soft); }
    .main-content { padding: 24px 16px 26px; }
    .page-heading { align-items: flex-start; margin-bottom: 20px; }
    .page-heading h1 { font-size: 34px; }
    .item-card-cover { width: 96px; height: 78px; border-radius: 13px; }
    .page-heading > .button { min-width: 44px; }
    .stat-grid { gap: 10px; }
    .stat-card { min-height: 92px; padding: 14px; }
    .stat-icon { width: 39px; height: 39px; }
    .stat-card strong { font-size: 23px; }
    .filter-bar { flex-wrap: wrap; padding: 11px; }
    .search-field { flex-basis: 100%; }
    .select-field { flex: 1 1 160px; }
    .filter-bar .button { flex: 0 0 auto; }
    .form-panel { padding: 20px; }
    .reservation-list { grid-template-columns: 1fr; }
    .user-grid { grid-template-columns: 1fr; }
    .profile-grid { grid-template-columns: 1fr; }
    .photo-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .profile-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 14px; text-align: left; }
    .profile-avatar { grid-row: 1 / 4; width: 60px; height: 60px; margin: 0; }
    .profile-card h2, .profile-card > p { margin: 0; }
    .profile-card > .badge { grid-column: 3; grid-row: 1 / 3; }
    .profile-card dl { grid-column: 1 / -1; }
    .login-shell { grid-template-columns: 1fr; }
    .login-intro { display: none; }
    .login-panel { min-height: 100vh; padding: 20px; background: radial-gradient(circle at 15% 0, rgba(31,104,96,.13), transparent 35%), #f3f7f6; }
    .login-card { padding: 30px 24px; }
    .mobile-login-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 34px; }
    .mobile-login-brand strong { font-size: 15px; }
}

@media (max-width: 620px) {
    .page-heading { gap: 12px; }
    .page-heading > .button { width: 44px; overflow: hidden; padding: 0; font-size: 0; }
    .page-heading > .button span { font-size: 20px; }
    .heading-actions { gap: 6px; }
    .heading-actions .button { width: 44px; overflow: hidden; padding: 0; font-size: 0; }
    .heading-actions .button span { font-size: 20px; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-card { display: block; min-height: 114px; }
    .stat-icon { width: 34px; height: 34px; margin-bottom: 11px; font-size: 17px; }
    .stat-card strong { font-size: 21px; }
    .panel-heading { padding: 18px 17px 13px; }
    .activity-list, .low-stock-list { padding-inline: 17px; }
    .activity-row { grid-template-columns: 34px minmax(0, 1fr); }
    .activity-value { grid-column: 2; align-items: flex-start; flex-direction: row; justify-content: space-between; text-align: left; }
    .responsive-table-wrap { overflow: visible; }
    .data-table, .data-table tbody { display: block; }
    .data-table thead { display: none; }
    .data-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 16px; padding: 17px; border-top: 1px solid var(--line); }
    .data-table tr:first-child { border-top: 0; }
    .data-table td { display: block; min-width: 0; padding: 0; border: 0; }
    .data-table td::before { display: block; margin-bottom: 5px; color: var(--muted); content: attr(data-label); font-size: 9px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
    .data-table td:first-child { grid-column: 1 / -1; }
    .data-table .row-actions { grid-column: 1 / -1; justify-content: flex-start; padding-top: 4px; }
    .movement-table td:nth-child(3) { grid-column: 1 / -1; grid-row: 1; }
    .movement-table td:last-child { grid-column: 1 / -1; }
    .two-columns { grid-template-columns: 1fr; }
    .full-width { grid-column: auto; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .button { width: 100%; }
    .current-stock-note { align-items: flex-start; flex-wrap: wrap; }
    .current-stock-note a { width: 100%; margin-left: 0; }
    .selected-item-preview { grid-template-columns: 68px minmax(0, 1fr); }
    .selected-item-preview > img, .selected-item-placeholder { width: 68px; height: 58px; }
    .operation-switch { grid-template-columns: 1fr; }
    .operation-switch label > span { min-height: 66px; }
    .item-source-switch { display: grid; grid-template-columns: 1fr 1fr; }
    .item-source-switch > span { grid-column: 1 / -1; margin: 3px 5px 0; }
    .new-item-fields { padding: 16px; }
    .movement-line { grid-template-columns: minmax(0, 1fr) 36px; padding: 12px; }
    .movement-line-item { grid-column: 1 / -1; }
    .movement-line-quantity { grid-column: 1; }
    .movement-line-remove { grid-column: 2; margin-bottom: 18px; }
    .create-reservation-panel > form { padding: 4px 16px 18px; }
    .reservation-item { padding-inline: 16px; }
    .autocomplete-list, .search-field > .autocomplete-list { max-height: min(330px, 48vh); }
    .autocomplete-option { grid-template-columns: 38px minmax(0, 1fr) auto; }
    .autocomplete-option img, .autocomplete-image-placeholder { width: 38px; height: 38px; }
    .audit-panel { padding: 17px 13px; }
    .audit-entry { gap: 12px; }
    .change-details { grid-template-columns: 1fr; }
    .user-create-grid { grid-template-columns: 1fr; }
    .user-panel-head { grid-template-columns: auto minmax(0, 1fr); }
    .status-dot { grid-column: 2; }
    .user-meta { grid-template-columns: 1fr 1fr; }
    .user-actions { flex-wrap: wrap; }
    .user-actions > form, .user-actions > .password-reset, .user-actions > a { flex: 1 1 100%; }
    .user-actions .button { width: 100%; }
    .password-reset form { position: fixed; inset: auto 16px calc(75px + env(safe-area-inset-bottom)); width: auto; }
    .profile-card { grid-template-columns: auto 1fr; }
    .profile-card > .badge { grid-column: 2; grid-row: auto; justify-self: start; }
    .delete-confirm-panel { padding: 20px; }
    .delete-facts div { grid-template-columns: 1fr; gap: 5px; }
    .photo-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 16px 17px; }
    .photo-upload-form { align-items: stretch; flex-direction: column; padding: 16px; }
    .photo-upload-form > small { margin-left: 0; }
    .photo-upload-actions { align-items: stretch; flex-direction: column; }
    .photo-file-button > span, .photo-upload-form .button { width: 100%; justify-content: center; }
    .photo-index-count { min-width: 92px; padding: 9px 10px; }
    .search-method-heading { align-items: flex-start; }
    .search-method-heading > span { width: 40px; height: 40px; border-radius: 11px; font-size: 19px; }
    .photo-search-dropzone { min-height: 390px; padding: 26px 16px; }
    .photo-source-actions { width: 100%; flex-direction: column; }
    .photo-source-actions .button { width: 100%; }
    .photo-result-grid { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
    .bottom-nav { padding-right: 4px; padding-left: 4px; }
    .bottom-nav a span { font-size: 18px; }
    .bottom-nav a small { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
