:root {
    --navy-950: #071827;
    --navy-900: #0b2239;
    --navy-800: #11324f;
    --navy-700: #234966;
    --slate-700: #42556a;
    --slate-600: #617184;
    --slate-500: #7f8c9b;
    --slate-300: #c8d0d8;
    --slate-200: #dfe4e9;
    --slate-100: #eef1f4;
    --paper: #f6f7f8;
    --white: #ffffff;
    --red: #df3f49;
    --red-dark: #bd2e38;
    --red-soft: #fff0f1;
    --green: #24755d;
    --green-soft: #e8f5ef;
    --amber: #a85f13;
    --amber-soft: #fff4df;
    --blue-soft: #eaf2f8;
    --shadow-sm: 0 1px 2px rgba(7, 24, 39, .05), 0 6px 20px rgba(7, 24, 39, .04);
    --shadow-lg: 0 24px 70px rgba(7, 24, 39, .22);
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --sidebar-width: 254px;
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--paper);
    color: var(--navy-900);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3,
strong,
b {
    letter-spacing: -.025em;
}

h1 {
    margin-bottom: 8px;
    font-size: clamp(2rem, 3vw, 3.25rem);
    line-height: 1.05;
}

h2 {
    margin-bottom: 6px;
    font-size: 1.25rem;
    line-height: 1.2;
}

small {
    color: var(--slate-600);
}

[hidden] {
    display: none !important;
}

.icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.eyebrow {
    margin-bottom: 7px;
    color: var(--slate-600);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.muted {
    color: var(--slate-600);
}

.positive {
    color: var(--green) !important;
}

.negative,
.danger-text {
    color: var(--red-dark) !important;
}

.brand-mark {
    position: relative;
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    overflow: hidden;
    border-radius: 11px 11px 15px 11px;
    background: var(--red);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}

.brand-mark::before,
.brand-mark::after {
    position: absolute;
    content: "";
    border-radius: 1px;
    background: var(--white);
}

.brand-mark::before {
    width: 20px;
    height: 6px;
}

.brand-mark::after {
    width: 6px;
    height: 20px;
}

.brand-mark span {
    position: absolute;
    right: -5px;
    bottom: -5px;
    width: 15px;
    height: 15px;
    transform: rotate(45deg);
    background: var(--navy-900);
}

.brand-mark.large {
    width: 58px;
    height: 58px;
    border-radius: 17px 17px 23px 17px;
}

.brand-mark.large::before {
    width: 29px;
    height: 8px;
}

.brand-mark.large::after {
    width: 8px;
    height: 29px;
}

.brand-mark.mini {
    width: 26px;
    height: 26px;
    border-radius: 7px 7px 10px 7px;
}

.brand-mark.mini::before {
    width: 14px;
    height: 4px;
}

.brand-mark.mini::after {
    width: 4px;
    height: 14px;
}

.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 17px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 750;
    line-height: 1;
    transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button:active {
    transform: translateY(0);
}

.button:focus-visible,
.icon-button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(36, 107, 137, .22);
    outline-offset: 2px;
}

.button.primary {
    color: var(--white);
    background: var(--red);
    box-shadow: 0 7px 18px rgba(223, 63, 73, .18);
}

.button.primary:hover {
    background: var(--red-dark);
    box-shadow: 0 10px 22px rgba(223, 63, 73, .24);
}

.button.secondary {
    border-color: var(--slate-200);
    color: var(--navy-900);
    background: var(--white);
}

.button.secondary:hover {
    border-color: var(--slate-300);
    background: var(--slate-100);
}

.button.compact {
    min-height: 39px;
    padding: 8px 14px;
    font-size: .88rem;
}

.button.wide {
    width: 100%;
}

.button.disabled {
    pointer-events: none;
    opacity: .45;
}

.icon-button {
    display: inline-grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid var(--slate-200);
    border-radius: 9px;
    cursor: pointer;
    place-items: center;
    color: var(--slate-700);
    background: var(--white);
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.icon-button .icon {
    width: 17px;
    height: 17px;
}

.icon-button:hover {
    border-color: var(--slate-300);
    color: var(--navy-900);
    background: var(--slate-100);
}

.icon-button.ghost {
    border-color: transparent;
    background: transparent;
}

.icon-button.primary-icon {
    border-color: var(--red);
    color: var(--white);
    background: var(--red);
}

.text-link,
.panel-head > a {
    color: var(--navy-700);
    font-size: .86rem;
    font-weight: 750;
    text-decoration: underline;
    text-decoration-color: var(--slate-300);
    text-underline-offset: 4px;
}

.text-button {
    padding: 5px 4px;
    border: 0;
    cursor: pointer;
    font-size: .78rem;
    font-weight: 750;
    background: none;
}

.inline-form {
    display: inline-flex;
}

/* Authentication and installation */
.auth-body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px;
    background:
        linear-gradient(135deg, rgba(223, 63, 73, .06), transparent 36%),
        var(--paper);
}

.login-shell,
.install-shell {
    display: grid;
    width: min(1120px, 100%);
    min-height: 680px;
    overflow: hidden;
    border: 1px solid rgba(11, 34, 57, .08);
    border-radius: 28px;
    background: var(--white);
    box-shadow: 0 40px 100px rgba(7, 24, 39, .13);
}

.login-shell {
    grid-template-columns: 1.1fr .9fr;
}

.login-panel,
.install-intro {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 56px;
    color: var(--white);
    background:
        radial-gradient(circle at 86% 17%, rgba(62, 105, 135, .62), transparent 26%),
        linear-gradient(145deg, var(--navy-800), var(--navy-950));
}

.login-panel::before,
.install-intro::before {
    position: absolute;
    right: -120px;
    bottom: -100px;
    width: 360px;
    height: 360px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    box-shadow: 0 0 0 55px rgba(255, 255, 255, .025), 0 0 0 110px rgba(255, 255, 255, .018);
    content: "";
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.login-brand > div:last-child,
.side-brand > div:last-child {
    display: flex;
    flex-direction: column;
    line-height: .9;
}

.login-brand span,
.side-brand span {
    font-size: .72rem;
    font-weight: 650;
    letter-spacing: .2em;
}

.login-brand strong,
.side-brand strong {
    margin-top: 5px;
    font-size: 1.18rem;
    letter-spacing: .055em;
}

.login-copy {
    position: relative;
    z-index: 1;
    margin: auto 0;
}

.login-copy .eyebrow,
.install-intro .eyebrow {
    color: rgba(255, 255, 255, .6);
}

.login-copy h1,
.install-intro h1 {
    margin-bottom: 22px;
    font-size: clamp(2.5rem, 5vw, 4.6rem);
    letter-spacing: -.055em;
}

.login-copy > p:last-child,
.install-intro > p {
    max-width: 470px;
    color: rgba(255, 255, 255, .68);
    font-size: 1.02rem;
}

.login-stripe {
    position: absolute;
    right: 55px;
    bottom: -22px;
    width: 9px;
    height: 190px;
    transform: rotate(28deg);
    border-radius: 8px;
    background: var(--red);
    box-shadow: 28px 0 0 rgba(255, 255, 255, .1), 56px 0 0 rgba(255, 255, 255, .04);
}

.login-card,
.install-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(34px, 6vw, 70px);
}

.login-card h2,
.install-card h2 {
    margin-bottom: 8px;
    font-size: 2rem;
}

.login-form {
    margin-top: 27px;
}

.security-note {
    margin: 28px 0 0;
    color: var(--slate-500);
    font-size: .76rem;
    text-align: center;
}

.install-shell {
    grid-template-columns: .78fr 1.22fr;
    min-height: 760px;
}

.install-intro {
    padding: 48px;
}

.install-intro h1 {
    margin-top: 68px;
    font-size: clamp(2.6rem, 4vw, 4rem);
}

.install-steps {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 15px;
    margin: auto 0 0;
    padding: 0;
    list-style: none;
}

.install-steps li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, .72);
    font-size: .88rem;
}

.install-steps span {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    color: var(--white);
    font-weight: 800;
}

.install-card {
    justify-content: flex-start;
    overflow-y: auto;
    padding: 42px clamp(32px, 5vw, 64px);
}

.install-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.requirement-list {
    display: flex;
    gap: 6px;
}

.requirement {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 50%;
    font-size: .73rem;
    font-weight: 900;
}

.requirement.ok {
    color: var(--green);
    background: var(--green-soft);
}

.requirement.error {
    color: var(--red-dark);
    background: var(--red-soft);
}

/* Forms */
.form-stack {
    display: grid;
    gap: 17px;
}

.form-stack fieldset {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 18px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
}

.form-stack legend {
    padding: 0 7px;
    color: var(--navy-800);
    font-size: .78rem;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

label {
    display: grid;
    gap: 7px;
    color: var(--slate-700);
    font-size: .82rem;
    font-weight: 730;
}

label small {
    font-weight: 500;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--slate-300);
    border-radius: 9px;
    color: var(--navy-900);
    background: var(--white);
    transition: border-color .15s ease, box-shadow .15s ease;
}

textarea {
    min-height: 76px;
    resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--slate-500);
}

input:focus,
select:focus,
textarea:focus {
    border-color: #2c708f;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(44, 112, 143, .1);
}

.form-grid {
    display: grid;
    gap: 14px;
}

.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-span-2 {
    grid-column: span 2;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.check-row input {
    width: 18px;
    height: 18px;
    min-height: 0;
    margin-top: 1px;
    accent-color: var(--red);
}

.form-hint {
    margin: 0;
    color: var(--slate-500);
    font-size: .77rem;
}

.form-hint.center {
    text-align: center;
}

.alert {
    padding: 13px 15px;
    border: 1px solid;
    border-radius: 10px;
    font-size: .84rem;
}

.alert ul {
    margin: 7px 0 0;
    padding-left: 20px;
}

.alert.danger {
    border-color: #efb8bc;
    color: #8d2028;
    background: var(--red-soft);
}

.alert.success {
    border-color: #acd8c7;
    color: #155b45;
    background: var(--green-soft);
}

/* Application shell */
.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    z-index: 40;
    inset: 0 auto 0 0;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    color: var(--white);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 35%),
        var(--navy-950);
}

.side-brand {
    display: flex;
    min-height: 88px;
    align-items: center;
    gap: 12px;
    padding: 22px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.side-nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 5px;
    padding: 20px 13px;
}

.nav-label {
    margin: 14px 12px 6px;
    color: rgba(255, 255, 255, .34);
    font-size: .65rem;
    font-weight: 850;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.nav-label:first-child {
    margin-top: 0;
}

.side-nav a {
    position: relative;
    display: flex;
    min-height: 45px;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 9px;
    color: rgba(255, 255, 255, .67);
    font-size: .9rem;
    font-weight: 650;
    transition: color .15s ease, background .15s ease;
}

.side-nav a:hover {
    color: var(--white);
    background: rgba(255, 255, 255, .055);
}

.side-nav a.active {
    color: var(--white);
    background: rgba(255, 255, 255, .095);
}

.side-nav a.active::before {
    position: absolute;
    left: -13px;
    width: 4px;
    height: 25px;
    border-radius: 0 5px 5px 0;
    background: var(--red);
    content: "";
}

.side-nav kbd {
    margin-left: auto;
    padding: 2px 6px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 4px;
    color: rgba(255, 255, 255, .38);
    font-family: inherit;
    font-size: .64rem;
}

.side-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 17px 15px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.side-user {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.side-user > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.side-user strong {
    overflow: hidden;
    font-size: .82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-user small {
    color: rgba(255, 255, 255, .4);
    font-size: .68rem;
}

.avatar {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    color: var(--white);
    background: var(--navy-700);
    font-size: .78rem;
    font-weight: 850;
}

.avatar.admin {
    background: var(--red);
}

.avatar.lager {
    background: #2c708f;
}

.side-footer .icon-button {
    color: rgba(255, 255, 255, .55);
}

.side-footer .icon-button:hover {
    color: var(--white);
    background: rgba(255, 255, 255, .08);
}

.main-column {
    display: flex;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    flex-direction: column;
}

.topbar {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    min-height: 65px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 clamp(20px, 3vw, 42px);
    border-bottom: 1px solid var(--slate-200);
    background: rgba(246, 247, 248, .93);
    backdrop-filter: blur(12px);
}

.topbar-context {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--slate-600);
    font-size: .78rem;
    font-weight: 700;
}

.live-dot,
.scanner-ready i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(36, 117, 93, .1);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quick-scan {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--navy-800);
    font-size: .8rem;
    font-weight: 800;
}

.quick-scan .icon {
    width: 17px;
}

.date-chip {
    padding-left: 12px;
    border-left: 1px solid var(--slate-200);
    color: var(--slate-600);
    font-size: .76rem;
}

.menu-button,
.sidebar-backdrop {
    display: none;
}

.content {
    width: min(100%, 1580px);
    flex: 1;
    align-self: center;
    padding: clamp(24px, 3vw, 44px);
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 29px;
}

.page-heading > div:first-child > p:last-child {
    margin-bottom: 0;
    color: var(--slate-600);
}

.heading-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.panel {
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.panel.slim {
    border-radius: 12px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 21px 23px;
    border-bottom: 1px solid var(--slate-100);
}

.panel-head h2,
.panel-head p {
    margin-bottom: 0;
}

.panel-head .eyebrow {
    margin-bottom: 5px;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 14px clamp(20px, 3vw, 42px) 20px;
    color: var(--slate-500);
    font-size: .7rem;
}

.toast-stack {
    position: fixed;
    z-index: 100;
    top: 80px;
    right: 24px;
    display: grid;
    width: min(390px, calc(100vw - 32px));
    gap: 9px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 15px;
    border: 1px solid;
    border-radius: 11px;
    box-shadow: var(--shadow-lg);
    font-size: .84rem;
    font-weight: 650;
    animation: toast-in .25s ease both;
}

.toast.success {
    border-color: #b3dacc;
    color: #155b45;
    background: #f1fbf7;
}

.toast.danger {
    border-color: #efb8bc;
    color: #8d2028;
    background: #fff7f7;
}

.toast .icon {
    width: 18px;
}

.toast.leaving {
    animation: toast-out .3s ease both;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-8px); }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateX(30px); }
}

/* Dashboard */
.dashboard-heading h1 {
    max-width: 760px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    display: flex;
    min-height: 144px;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.stat-card.navy {
    border-color: var(--navy-900);
    color: var(--white);
    background: linear-gradient(145deg, var(--navy-800), var(--navy-950));
}

.stat-card.warning {
    border-color: #efd3a9;
    background: linear-gradient(145deg, #fffaf0, var(--amber-soft));
}

.stat-icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    color: var(--navy-700);
    background: var(--slate-100);
}

.navy .stat-icon {
    color: var(--white);
    background: rgba(255, 255, 255, .1);
}

.warning .stat-icon {
    color: var(--amber);
    background: rgba(168, 95, 19, .1);
}

.stat-card > div:last-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.stat-card span {
    color: var(--slate-600);
    font-size: .72rem;
    font-weight: 750;
}

.stat-card.navy span,
.stat-card.navy small {
    color: rgba(255, 255, 255, .55);
}

.stat-card strong {
    margin: 6px 0 0;
    font-size: 2.25rem;
    line-height: 1;
}

.stat-card small {
    margin-top: 8px;
    font-size: .68rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, .8fr);
    gap: 20px;
    margin-bottom: 20px;
}

.critical-list {
    padding: 2px 0 7px;
}

.critical-row {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) minmax(160px, .5fr);
    align-items: center;
    gap: 13px;
    padding: 14px 23px;
    transition: background .14s ease;
}

.critical-row:hover {
    background: var(--slate-100);
}

.category-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--dot);
}

.critical-main,
.movement-main {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.critical-main strong,
.movement-main strong {
    overflow: hidden;
    font-size: .88rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.critical-main small,
.movement-main small {
    margin-top: 2px;
    font-size: .69rem;
}

.stock-meter {
    display: grid;
    grid-template-columns: minmax(55px, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.stock-meter > strong {
    font-size: .82rem;
    white-space: nowrap;
}

.stock-meter small {
    font-size: .65rem;
    font-weight: 500;
}

.meter {
    height: 5px;
    overflow: hidden;
    border-radius: 4px;
    background: var(--slate-100);
}

.meter i {
    display: block;
    width: min(100%, var(--level));
    height: 100%;
    border-radius: inherit;
    background: var(--amber);
}

.meter.empty i {
    background: var(--red);
}

.scan-promo {
    position: relative;
    min-height: 390px;
    overflow: hidden;
    border: 0;
    color: var(--white);
    background:
        radial-gradient(circle at 85% 15%, rgba(61, 105, 135, .7), transparent 30%),
        linear-gradient(150deg, var(--navy-800), var(--navy-950));
}

.scan-promo::after {
    position: absolute;
    right: -70px;
    bottom: -130px;
    width: 280px;
    height: 280px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    box-shadow: 0 0 0 42px rgba(255, 255, 255, .025), 0 0 0 84px rgba(255, 255, 255, .018);
    content: "";
}

.scan-promo-copy {
    position: relative;
    z-index: 2;
    display: flex;
    height: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding: 28px;
}

.scan-promo .eyebrow {
    color: rgba(255, 255, 255, .45);
}

.scan-promo h2 {
    margin: 4px 0 13px;
    font-size: 2.25rem;
    line-height: 1.02;
}

.scan-promo p:not(.eyebrow) {
    max-width: 315px;
    color: rgba(255, 255, 255, .58);
    font-size: .83rem;
}

.light-button {
    margin-top: auto;
    color: var(--navy-900);
    background: var(--white);
}

.scan-art {
    position: absolute;
    z-index: 1;
    top: 27px;
    right: 26px;
    display: flex;
    width: 82px;
    height: 82px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 17px;
    background: rgba(255, 255, 255, .05);
}

.scan-art span {
    width: 3px;
    height: 39px;
    background: rgba(255, 255, 255, .55);
}

.scan-art span:nth-child(2) { width: 6px; }
.scan-art span:nth-child(3) { height: 31px; }
.scan-art span:nth-child(4) { width: 2px; }
.scan-art i {
    position: absolute;
    top: 14px;
    right: 10px;
    bottom: 14px;
    width: 1px;
    background: var(--red);
    box-shadow: 0 0 8px var(--red);
}

.movements-panel {
    overflow: hidden;
}

.movement-list.compact {
    display: grid;
    padding: 4px 0 8px;
}

.movement-row {
    display: grid;
    grid-template-columns: 37px minmax(0, 1fr) 110px minmax(110px, auto);
    align-items: center;
    gap: 13px;
    padding: 11px 23px;
}

.movement-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 9px;
}

.movement-icon .icon {
    width: 16px;
}

.movement-icon.in {
    color: var(--green);
    background: var(--green-soft);
}

.movement-icon.out {
    color: var(--red-dark);
    background: var(--red-soft);
}

.movement-type {
    color: var(--slate-600);
    font-size: .75rem;
}

.movement-quantity {
    font-size: .84rem;
    text-align: right;
    white-space: nowrap;
}

.empty-inline {
    display: flex;
    min-height: 145px;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 25px;
    color: var(--slate-600);
}

.empty-inline > .icon,
.empty-inline .empty-icon {
    width: 38px;
    height: 38px;
    padding: 9px;
    border-radius: 10px;
    color: var(--slate-600);
    background: var(--slate-100);
}

.empty-inline.success-empty > .icon {
    color: var(--green);
    background: var(--green-soft);
}

.empty-inline div {
    display: flex;
    flex-direction: column;
}

.empty-inline strong {
    color: var(--navy-900);
}

.empty-inline span {
    font-size: .78rem;
}

/* Toolbars and data tables */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
    padding: 12px;
}

.search-form {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    gap: 9px;
}

.search-field {
    position: relative;
    display: block;
    width: min(480px, 100%);
}

.search-field .icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 12px;
    width: 17px;
    transform: translateY(-50%);
    color: var(--slate-500);
}

.search-field input {
    padding-left: 39px;
}

.search-form select {
    width: auto;
    min-width: 155px;
}

.result-count {
    padding-right: 7px;
    color: var(--slate-500);
    font-size: .75rem;
    white-space: nowrap;
}

.table-panel {
    overflow: hidden;
}

.data-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}

.data-table th {
    padding: 12px 16px;
    border-bottom: 1px solid var(--slate-200);
    color: var(--slate-500);
    background: #fafbfc;
    font-size: .66rem;
    font-weight: 850;
    letter-spacing: .075em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--slate-100);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr {
    transition: background .14s ease;
}

.data-table tbody tr:hover {
    background: #fafbfc;
}

.created-row {
    animation: row-highlight 2.2s ease both;
}

@keyframes row-highlight {
    0%, 45% { background: var(--green-soft); }
}

.material-name,
.user-cell {
    display: flex;
    min-width: 220px;
    align-items: center;
    gap: 11px;
}

.material-name > div,
.user-cell > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.material-name strong,
.user-cell strong {
    max-width: 290px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.material-name small,
.user-cell small,
.cell-subline {
    display: block;
    margin-top: 3px;
    color: var(--slate-500);
    font-size: .68rem;
}

.category-swatch {
    width: 8px;
    height: 31px;
    flex: 0 0 auto;
    border-radius: 5px;
    background: var(--swatch);
}

.category-swatch.large {
    width: 12px;
    height: 35px;
}

.barcode-cell {
    display: flex;
    width: 132px;
    flex-direction: column;
}

.barcode-cell small {
    margin-top: 3px;
    color: var(--slate-500);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .61rem;
    letter-spacing: .02em;
}

.barcode.mini {
    width: 126px;
    height: 29px;
    color: var(--navy-950);
}

.stock-number {
    font-size: 1rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-badge i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.ok {
    color: var(--green);
    background: var(--green-soft);
}

.status-badge.ok i { background: var(--green); }
.status-badge.low {
    color: var(--amber);
    background: var(--amber-soft);
}
.status-badge.low i { background: var(--amber); }
.status-badge.empty {
    color: var(--red-dark);
    background: var(--red-soft);
}
.status-badge.empty i { background: var(--red); }
.status-badge.archived {
    color: var(--slate-600);
    background: var(--slate-100);
}
.status-badge.archived i { background: var(--slate-500); }

.row-actions {
    display: flex;
    min-width: 140px;
    justify-content: flex-end;
    gap: 6px;
}

.adjust-stock-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
}

.adjust-stock-field input {
    border-radius: 9px 0 0 9px;
}

.adjust-stock-field span {
    display: flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--slate-300);
    border-left: 0;
    border-radius: 0 9px 9px 0;
    color: var(--slate-600);
    background: var(--slate-100);
    font-size: .76rem;
}

.empty-state {
    display: flex;
    min-height: 370px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.empty-state .empty-icon {
    display: grid;
    width: 54px;
    height: 54px;
    margin-bottom: 15px;
    place-items: center;
    border-radius: 15px;
    color: var(--slate-600);
    background: var(--slate-100);
}

.empty-state h2 {
    margin-bottom: 6px;
}

.empty-state p {
    max-width: 420px;
    margin-bottom: 18px;
    color: var(--slate-600);
}

.table-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 13px 17px;
    border-bottom: 1px solid var(--slate-100);
    color: var(--slate-600);
    font-size: .75rem;
}

.table-summary strong {
    color: var(--navy-900);
}

.filter-grid {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(250px, 1.5fr) minmax(150px, .55fr) minmax(145px, .45fr) minmax(145px, .45fr) auto auto;
    align-items: end;
    gap: 9px;
}

.filter-grid .search-field {
    width: 100%;
}

.date-filter {
    gap: 2px;
}

.date-filter > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.movement-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 7px;
    font-size: .68rem;
    font-weight: 800;
}

.movement-badge .icon {
    width: 14px;
    height: 14px;
}

.movement-badge.in,
.movement-badge.initial {
    color: var(--green);
    background: var(--green-soft);
}

.movement-badge.out {
    color: var(--red-dark);
    background: var(--red-soft);
}

.movement-badge.adjustment {
    color: var(--amber);
    background: var(--amber-soft);
}

.stock-arrow {
    margin: 0 6px;
    color: var(--slate-300);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 18px;
    border-top: 1px solid var(--slate-100);
    font-size: .78rem;
}

/* Modals */
dialog {
    color: inherit;
}

dialog::backdrop {
    background: rgba(7, 24, 39, .6);
    backdrop-filter: blur(4px);
}

.modal {
    width: min(680px, calc(100vw - 30px));
    max-height: calc(100vh - 30px);
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-lg);
}

.modal.small {
    width: min(520px, calc(100vw - 30px));
}

.modal-card {
    display: block;
    margin: 0;
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 23px 25px;
    border-bottom: 1px solid var(--slate-100);
}

.modal-head h2,
.modal-head p {
    margin-bottom: 0;
}

.modal-body {
    padding: 23px 25px;
}

.modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    padding: 17px 25px;
    border-top: 1px solid var(--slate-100);
    background: #fafbfc;
}

.generated-barcode-note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    border-radius: 9px;
    color: var(--navy-700);
    background: var(--blue-soft);
    font-size: .77rem;
}

.generated-barcode-note .icon {
    width: 18px;
}

/* Scanner */
.scanner-heading {
    align-items: center;
}

.scanner-ready {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    border: 1px solid #bddbce;
    border-radius: 999px;
    color: var(--green);
    background: var(--green-soft);
    font-size: .72rem;
    font-weight: 800;
}

.scanner-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(315px, .65fr);
    align-items: start;
    gap: 20px;
}

.scanner-console {
    padding: clamp(24px, 4vw, 44px);
}

.scanner-console-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
}

.scanner-console-head h2 {
    font-size: 1.5rem;
}

.shortcut-chip {
    padding: 7px 10px;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    color: var(--slate-500);
    background: var(--slate-100);
    font-size: .68rem;
    font-weight: 700;
}

.scan-input-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.scan-input-wrap {
    position: relative;
    display: block;
}

.scan-input-wrap input {
    min-height: 70px;
    padding: 14px 18px 14px 60px;
    border: 2px solid var(--navy-700);
    border-radius: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1.2rem;
    font-weight: 750;
    letter-spacing: .045em;
}

.scan-input-icon {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 21px;
    width: 25px;
    height: 25px;
    transform: translateY(-50%);
    color: var(--navy-700);
}

.scan-submit {
    min-width: 105px;
}

.scan-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: var(--slate-500);
    font-size: .7rem;
    font-weight: 750;
    text-transform: uppercase;
}

.scan-divider::before,
.scan-divider::after {
    height: 1px;
    flex: 1;
    background: var(--slate-200);
    content: "";
}

.camera-button {
    display: grid;
    width: 100%;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 13px;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    cursor: pointer;
    color: var(--navy-900);
    text-align: left;
    background: var(--white);
    transition: border-color .15s ease, background .15s ease;
}

.camera-button:hover {
    border-color: var(--slate-300);
    background: var(--slate-100);
}

.camera-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 11px;
    color: var(--navy-700);
    background: var(--blue-soft);
}

.camera-button > span:nth-child(2) {
    display: flex;
    flex-direction: column;
}

.camera-button small {
    margin-top: 2px;
    font-size: .7rem;
}

.camera-arrow {
    color: var(--slate-500);
    font-size: 1.3rem;
}

.camera-support {
    margin: 8px 0 0;
    color: var(--slate-500);
    font-size: .68rem;
}

.scanner-status {
    display: flex;
    min-height: 100px;
    align-items: center;
    gap: 15px;
    margin-top: 25px;
    padding: 17px;
    border: 1px dashed var(--slate-300);
    border-radius: 12px;
    background: #fafbfc;
}

.scanner-status .status-visual {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    color: var(--slate-500);
    background: var(--slate-100);
}

.scanner-status div {
    display: flex;
    flex-direction: column;
}

.scanner-status p {
    margin: 3px 0 0;
    color: var(--slate-600);
    font-size: .78rem;
}

.scanner-status.loading .status-visual {
    color: #2c708f;
    background: var(--blue-soft);
    animation: pulse 1.1s ease infinite;
}

.scanner-status.found,
.scanner-status.success {
    border-style: solid;
    border-color: #acd8c7;
    background: #f4fbf8;
}

.scanner-status.found .status-visual,
.scanner-status.success .status-visual {
    color: var(--green);
    background: var(--green-soft);
}

.scanner-status.error {
    border-style: solid;
    border-color: #efb8bc;
    background: #fff8f8;
}

.scanner-status.error .status-visual {
    color: var(--red-dark);
    background: var(--red-soft);
}

@keyframes pulse {
    50% { opacity: .5; transform: scale(.93); }
}

.recent-scan-panel {
    overflow: hidden;
}

.recent-scan-list {
    display: grid;
    padding: 5px 0;
}

.recent-scan-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
}

.recent-scan-row.new {
    animation: row-highlight 1.8s ease both;
}

.recent-scan-row > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.recent-scan-row strong {
    overflow: hidden;
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-scan-row small {
    font-size: .64rem;
}

.recent-scan-row > b {
    font-size: .72rem;
    white-space: nowrap;
}

.empty-mini {
    padding: 32px 20px;
    color: var(--slate-500);
    font-size: .77rem;
    text-align: center;
}

.scanner-tips {
    margin: 12px;
    padding: 14px;
    border-radius: 10px;
    color: var(--navy-700);
    background: var(--blue-soft);
}

.scanner-tips strong {
    font-size: .75rem;
}

.scanner-tips p {
    margin: 4px 0 0;
    color: var(--slate-600);
    font-size: .68rem;
}

.camera-dialog {
    width: min(760px, calc(100vw - 24px));
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius-lg);
    color: var(--white);
    background: var(--navy-950);
    box-shadow: var(--shadow-lg);
}

.camera-card {
    padding: 19px;
}

.camera-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 4px 3px 16px;
}

.camera-head h2,
.camera-head p {
    margin-bottom: 0;
}

.camera-head .eyebrow {
    color: rgba(255, 255, 255, .45);
}

.camera-close {
    color: var(--white);
    background: rgba(255, 255, 255, .08);
}

.video-wrap {
    position: relative;
    min-height: 350px;
    overflow: hidden;
    border-radius: 14px;
    background: #020a11;
}

.video-wrap video {
    display: block;
    width: 100%;
    height: min(58vh, 480px);
    object-fit: cover;
}

.camera-frame {
    position: absolute;
    inset: 18% 14%;
    border: 2px solid rgba(255, 255, 255, .7);
    border-radius: 16px;
    box-shadow: 0 0 0 999px rgba(2, 10, 17, .34);
}

.camera-frame i {
    position: absolute;
    top: 50%;
    right: 6%;
    left: 6%;
    height: 2px;
    background: var(--red);
    box-shadow: 0 0 10px var(--red);
    animation: scan-line 2s ease-in-out infinite;
}

@keyframes scan-line {
    0%, 100% { transform: translateY(-65px); }
    50% { transform: translateY(65px); }
}

.camera-card > p {
    margin: 12px 3px 0;
    color: rgba(255, 255, 255, .62);
    font-size: .75rem;
    text-align: center;
}

.booking-modal {
    width: min(620px, calc(100vw - 30px));
}

.booking-head p:last-child {
    margin-top: 5px;
    color: var(--slate-500);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .67rem;
}

.current-stock-banner {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 14px;
    padding: 14px 25px;
    border-bottom: 1px solid var(--slate-100);
    background: #fafbfc;
}

.current-stock-banner > span:first-child {
    color: var(--slate-600);
    font-size: .77rem;
    font-weight: 700;
}

.current-stock-banner > strong {
    font-size: 1.3rem;
}

.current-stock-banner small {
    font-size: .7rem;
}

.booking-direction {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.booking-direction label {
    display: block;
    cursor: pointer;
}

.booking-direction input {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    opacity: 0;
}

.booking-direction span {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 10px;
    padding: 13px;
    border: 1px solid var(--slate-200);
    border-radius: 11px;
    transition: border-color .15s ease, background .15s ease;
}

.booking-direction .icon {
    grid-row: 1 / span 2;
    width: 34px;
    height: 34px;
    padding: 8px;
    border-radius: 9px;
    color: var(--slate-600);
    background: var(--slate-100);
}

.booking-direction small {
    font-size: .67rem;
}

.booking-direction input:checked + span {
    border-color: #7ba895;
    background: var(--green-soft);
    box-shadow: inset 0 0 0 1px #7ba895;
}

.booking-direction label:nth-child(2) input:checked + span {
    border-color: #dc9298;
    background: var(--red-soft);
    box-shadow: inset 0 0 0 1px #dc9298;
}

.booking-direction input:checked + span .icon {
    color: var(--green);
    background: rgba(36, 117, 93, .11);
}

.booking-direction label:nth-child(2) input:checked + span .icon {
    color: var(--red-dark);
    background: rgba(223, 63, 73, .1);
}

.quantity-field > div {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px auto;
}

.quantity-field button {
    border: 1px solid var(--slate-300);
    cursor: pointer;
    color: var(--navy-900);
    background: var(--slate-100);
    font-size: 1.3rem;
}

.quantity-field button:first-child {
    border-radius: 9px 0 0 9px;
}

.quantity-field button:nth-of-type(2) {
    border-radius: 0 9px 9px 0;
}

.quantity-field input {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    font-size: 1.15rem;
    font-weight: 800;
    text-align: center;
}

.quantity-field > div > span {
    display: flex;
    align-items: center;
    padding-left: 11px;
    color: var(--slate-600);
    font-size: .78rem;
}

.booking-details {
    border: 1px solid var(--slate-200);
    border-radius: 10px;
}

.booking-details summary {
    padding: 11px 13px;
    cursor: pointer;
    color: var(--slate-600);
    font-size: .75rem;
    font-weight: 750;
}

.booking-details[open] summary {
    border-bottom: 1px solid var(--slate-100);
}

.booking-details .form-grid {
    padding: 13px;
}

.booking-error {
    display: none;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--red-dark);
    background: var(--red-soft);
    font-size: .77rem;
}

.booking-error.visible {
    display: block;
}

/* Users and settings */
.role-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.role-info {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 16px;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    background: var(--white);
}

.role-info > div {
    display: flex;
    flex-direction: column;
}

.role-info p {
    margin: 2px 0 0;
    color: var(--slate-600);
    font-size: .72rem;
}

.role-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 11px;
}

.role-icon.admin {
    color: var(--red-dark);
    background: var(--red-soft);
}

.role-icon.lager {
    color: #246b89;
    background: var(--blue-soft);
}

.role-badge {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 7px;
    font-size: .68rem;
    font-weight: 800;
}

.role-badge.admin {
    color: var(--red-dark);
    background: var(--red-soft);
}

.role-badge.lager {
    color: #246b89;
    background: var(--blue-soft);
}

.inactive-row {
    opacity: .58;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.settings-card {
    overflow: hidden;
}

.settings-card.general-settings {
    grid-column: span 2;
}

.settings-card > form.form-stack {
    grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr) auto;
    align-items: end;
    padding: 22px;
}

.settings-icon,
.count-chip {
    display: grid;
    min-width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 10px;
    color: var(--slate-600);
    background: var(--slate-100);
    font-size: .75rem;
    font-weight: 850;
}

.prefix-field {
    display: grid;
    grid-template-columns: 100px 1fr;
}

.prefix-field input {
    border-radius: 9px 0 0 9px;
    text-transform: uppercase;
}

.prefix-field span {
    display: flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--slate-300);
    border-left: 0;
    border-radius: 0 9px 9px 0;
    color: var(--slate-500);
    background: var(--slate-100);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .73rem;
}

.inline-create-form {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 38px;
    gap: 8px;
    padding: 15px;
    border-bottom: 1px solid var(--slate-100);
}

.inline-create-form.location-create {
    grid-template-columns: 90px minmax(0, 1fr) 38px;
}

.inline-create-form input[type="color"] {
    min-height: 42px;
    padding: 5px;
}

.master-list {
    display: grid;
    max-height: 355px;
    overflow-y: auto;
    padding: 4px 0;
}

.master-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 11px 16px;
}

.master-row > div {
    display: flex;
    flex-direction: column;
}

.master-row strong {
    font-size: .82rem;
}

.master-row small {
    font-size: .66rem;
}

.location-code {
    display: grid;
    min-width: 48px;
    height: 32px;
    padding: 0 7px;
    place-items: center;
    border-radius: 7px;
    color: var(--navy-700);
    background: var(--blue-soft);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .7rem;
    font-weight: 800;
}

.audit-panel {
    margin-top: 18px;
    overflow: hidden;
}

.audit-list {
    display: grid;
    padding: 6px 0;
}

.audit-row {
    display: grid;
    grid-template-columns: 100px 125px minmax(160px, 1fr) minmax(130px, .5fr);
    gap: 12px;
    padding: 9px 20px;
    color: var(--slate-600);
    font-size: .72rem;
}

.audit-action {
    overflow: hidden;
    padding: 2px 6px;
    border-radius: 5px;
    color: var(--navy-700);
    background: var(--slate-100);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Printable material label */
.label-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 30px;
    background: #e7eaed;
}

.label-sheet {
    display: grid;
    gap: 20px;
    justify-items: center;
}

.material-label {
    width: 100mm;
    min-height: 60mm;
    overflow: hidden;
    border: 1px solid #c7c7c7;
    border-radius: 2mm;
    color: #000;
    background: #fff;
    box-shadow: 0 16px 45px rgba(7, 24, 39, .15);
}

.material-label > header {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 8px;
    padding: 4mm 5mm 3mm;
    border-bottom: .4mm solid #111;
}

.material-label > header strong {
    font-size: 9pt;
    letter-spacing: .08em;
}

.material-label > header small {
    color: #333;
    font-size: 7pt;
    text-align: right;
}

.label-content {
    padding: 3.5mm 5mm 2mm;
}

.label-category {
    margin: 0 0 .5mm;
    color: #555;
    font-size: 7pt;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.label-content h1 {
    margin: 0 0 1.5mm;
    font-size: 15pt;
    line-height: 1.1;
}

.label-meta {
    display: flex;
    justify-content: space-between;
    margin: 0 0 2mm;
    font-size: 8pt;
}

.label-barcode {
    display: block;
    width: 100%;
    height: 17mm;
    color: #000;
}

.barcode-number {
    margin: .8mm 0 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 8pt;
    letter-spacing: .12em;
    text-align: center;
}

.material-label > footer {
    display: flex;
    justify-content: space-between;
    padding: 2mm 5mm 3mm;
    color: #333;
    font-size: 7pt;
}

.label-actions {
    display: flex;
    gap: 9px;
}

@media print {
    @page { size: 100mm 60mm; margin: 0; }
    .label-page { min-height: 0; padding: 0; background: #fff; }
    .material-label { width: 100mm; height: 60mm; border: 0; border-radius: 0; box-shadow: none; }
    .no-print { display: none !important; }
}

/* Responsive */
@media (max-width: 1180px) {
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-grid {
        grid-template-columns: minmax(240px, 1fr) minmax(145px, .55fr) repeat(2, minmax(140px, .5fr));
    }

    .filter-grid .button,
    .filter-grid .text-link {
        grid-row: 2;
    }
}

@media (max-width: 980px) {
    :root { --sidebar-width: 228px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .scan-promo { min-height: 315px; }
    .scanner-layout { grid-template-columns: 1fr; }
    .recent-scan-panel { order: 2; }
    .settings-card > form.form-stack { grid-template-columns: 1fr 1fr; }
    .settings-card > form.form-stack .button { grid-column: span 2; }
}

@media (max-width: 780px) {
    .sidebar {
        width: min(290px, 86vw);
        transform: translateX(-105%);
        box-shadow: 20px 0 50px rgba(7, 24, 39, .24);
        transition: transform .22s ease;
    }

    .menu-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        z-index: 35;
        inset: 0;
        background: rgba(7, 24, 39, .5);
    }

    .menu-open .sidebar-backdrop {
        display: block;
    }

    .main-column {
        margin-left: 0;
    }

    .menu-button {
        display: grid;
        width: 40px;
        height: 40px;
        padding: 10px;
        border: 1px solid var(--slate-200);
        border-radius: 9px;
        background: var(--white);
    }

    .menu-button span {
        display: block;
        height: 2px;
        border-radius: 2px;
        background: var(--navy-800);
    }

    .topbar-context {
        margin-right: auto;
    }

    .date-chip {
        display: none;
    }

    .content {
        padding: 24px 17px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 22px;
    }

    .heading-actions,
    .page-heading > .button,
    .page-heading > a.button {
        width: 100%;
    }

    .heading-actions .button {
        flex: 1;
    }

    .stat-grid,
    .role-info-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .settings-card.general-settings {
        grid-column: auto;
    }

    .toolbar,
    .search-form {
        align-items: stretch;
        flex-direction: column;
    }

    .search-form select,
    .search-field {
        width: 100%;
    }

    .result-count {
        padding: 0 4px 4px;
    }

    .data-table-wrap {
        overflow: visible;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody {
        display: grid;
        gap: 11px;
        padding: 11px;
    }

    .data-table tbody tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        overflow: hidden;
        border: 1px solid var(--slate-200);
        border-radius: 11px;
        background: var(--white);
    }

    .data-table td {
        position: relative;
        padding: 12px;
        border-bottom: 1px solid var(--slate-100);
    }

    .data-table td::before {
        display: block;
        margin-bottom: 5px;
        color: var(--slate-500);
        content: attr(data-label);
        font-size: .61rem;
        font-weight: 850;
        letter-spacing: .06em;
        text-transform: uppercase;
    }

    .data-table td:first-child {
        grid-column: span 2;
    }

    .data-table .row-actions {
        display: flex;
        grid-column: span 2;
        justify-content: flex-end;
        border-bottom: 0;
        background: #fafbfc;
    }

    .data-table .row-actions::before {
        margin-right: auto;
    }

    .material-name,
    .user-cell {
        min-width: 0;
    }

    .barcode-cell {
        width: 100%;
    }

    .filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .filter-grid .search-field {
        grid-column: span 2;
    }

    .filter-grid .button,
    .filter-grid .text-link {
        grid-row: auto;
    }

    .movement-table tbody tr {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .movement-table td:nth-child(2),
    .movement-table td:last-child {
        grid-column: span 2;
    }

    .settings-card > form.form-stack {
        grid-template-columns: 1fr;
    }

    .settings-card > form.form-stack .button {
        grid-column: auto;
    }

    .audit-row {
        grid-template-columns: 85px 1fr;
        gap: 6px 10px;
        padding: 11px 15px;
        border-bottom: 1px solid var(--slate-100);
    }

    .login-shell,
    .install-shell {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .login-panel,
    .install-intro {
        min-height: 330px;
        padding: 34px;
    }

    .login-copy h1,
    .install-intro h1 {
        margin-top: 35px;
        font-size: 2.6rem;
    }

    .install-steps {
        display: none;
    }
}

@media (max-width: 520px) {
    .auth-body {
        display: block;
        padding: 0;
        background: var(--white);
    }

    .login-shell,
    .install-shell {
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .login-panel,
    .install-intro {
        min-height: 285px;
        padding: 28px 24px;
    }

    .login-card,
    .install-card {
        padding: 32px 22px;
    }

    .install-card-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-grid.two,
    .booking-direction {
        grid-template-columns: 1fr;
    }

    .field-span-2 {
        grid-column: auto;
    }

    .topbar {
        padding: 0 14px;
    }

    .topbar-context {
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .quick-scan span {
        display: none;
    }

    .stat-grid {
        gap: 10px;
    }

    .stat-card {
        min-height: 122px;
        padding: 16px;
    }

    .stat-card strong {
        font-size: 1.8rem;
    }

    .critical-row {
        grid-template-columns: 7px minmax(0, 1fr);
    }

    .stock-meter {
        grid-column: 2;
    }

    .movement-row {
        grid-template-columns: 34px minmax(0, 1fr) auto;
    }

    .movement-type {
        display: none;
    }

    .scan-input-form {
        grid-template-columns: 1fr;
    }

    .scan-submit {
        width: 100%;
    }

    .scanner-console {
        padding: 20px 15px;
    }

    .scanner-console-head {
        flex-direction: column;
    }

    .current-stock-banner {
        grid-template-columns: 1fr auto;
    }

    .current-stock-banner .status-badge {
        grid-column: span 2;
        justify-self: start;
    }

    .modal-head,
    .modal-body,
    .modal-actions {
        padding-right: 18px;
        padding-left: 18px;
    }

    .modal-actions .button {
        flex: 1;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .filter-grid .search-field {
        grid-column: auto;
    }

    .inline-create-form.location-create {
        grid-template-columns: 82px minmax(0, 1fr) 38px;
    }

    .material-label {
        width: min(100mm, calc(100vw - 24px));
    }

    .app-footer {
        flex-direction: column;
        gap: 2px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
