/* Warehouse Information Management System: shared design for every signed-in page.
   Same tokens as the sign-in page. Legacy class names used by the existing pages are styled here
   so the page logic and markup keep working. */
:root {
    --ink: #16222e;
    --steel: #243746;
    --steel-dark: #1c2e3d;
    --line: #d9dee4;
    --paper: #f4f6f8;
    --white: #ffffff;
    --blue: #1d5fbf;
    --blue-dark: #174c9a;
    --accent: #4d8fe6;
    --muted: #5b6b7a;
    --danger-bg: #fdeceb;  --danger-ink: #8f1d17;  --danger-line: #f3bcb8;
    --ok-bg: #eaf6ee;      --ok-ink: #17603a;      --ok-line: #b7dec5;
    --info-bg: #eaf1fb;    --info-ink: #174c9a;    --info-line: #bfd3f2;
    --warn-bg: #fff4e0;    --warn-ink: #7a4a00;    --warn-line: #f1d49a;
    --nav-w: 264px;
    --topbar-h: 64px;
    --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

/* ======================= Sidebar ======================= */
.sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
    width: var(--nav-w);
    display: flex; flex-direction: column;
    color: #dbe5ee;
    background: var(--steel-dark);
    transition: transform .3s var(--ease);
}
.sidebar-head {
    flex: none;
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 12px;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    color: #fff; font-size: .85rem; font-weight: 600; line-height: 1.25;
}
.logo {
    flex: none;
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border-radius: 8px;
    background: var(--blue);
    color: var(--white);
}
.nav { flex: 1; overflow-y: auto; padding: 14px 12px 24px; }
.nav a, .nav-group {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%;
    padding: 9px 12px;
    font: inherit; font-size: .95rem;
    color: rgba(255,255,255,.78);
    text-decoration: none; text-align: left;
    background: transparent;
    border: 0; border-left: 3px solid transparent; border-radius: 6px;
    cursor: pointer;
}
.nav > a, .nav > .nav-item { margin-bottom: 2px; }
.nav a:hover, .nav-group:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a[aria-current="page"] { color: #fff; background: rgba(77,143,230,.2); border-left-color: var(--accent); }
.nav a:focus-visible, .nav-group:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255,255,255,.45); }
.caret { flex: none; transition: transform .25s var(--ease); }
.nav-item.open .caret { transform: rotate(180deg); }
.nav-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s var(--ease); }
.nav-item.open .nav-sub { grid-template-rows: 1fr; }
.nav-sub-inner { min-height: 0; overflow: hidden; }
.nav-sub a { padding-left: 28px; font-size: .9rem; color: rgba(255,255,255,.66); }
.nav-sub-inner > a:first-child { margin-top: 2px; }
.nav-backdrop { display: none; position: fixed; inset: 0; z-index: 40; background: rgba(12, 22, 32, .5); }

/* ======================= App area ======================= */
.app {
    margin-left: var(--nav-w);
    min-height: 100vh;
    display: flex; flex-direction: column;
    transition: margin-left .3s var(--ease);
}
body.nav-collapsed .sidebar { transform: translateX(-100%); }
body.nav-collapsed .app { margin-left: 0; }

.topbar {
    position: sticky; top: 0; z-index: 30;
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 12px;
    padding: 0 clamp(16px, 3vw, 32px);
    background: var(--white);
    border-bottom: 1px solid var(--line);
}
.icon-btn {
    flex: none;
    width: 40px; height: 40px;
    display: grid; place-items: center;
    padding: 0;
    color: var(--steel);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
}
.icon-btn:hover { border-color: #8a97a4; }
.spacer { flex: 1; }
.user { display: flex; align-items: center; gap: 10px; font-size: .9rem; min-width: 0; }
.avatar {
    flex: none;
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 50%;
    color: #fff; background: var(--steel); font-weight: 600; font-size: .85rem;
}
.user-meta { line-height: 1.2; min-width: 0; }
.user-meta strong { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.user-meta small { color: var(--muted); font-size: .78rem; }
.btn-ghost {
    height: 40px; padding: 0 16px;
    display: inline-flex; align-items: center;
    font: inherit; font-size: .9rem; font-weight: 500;
    color: var(--ink); text-decoration: none;
    background: var(--white);
    border: 1px solid #b8c1ca; border-radius: 6px;
    cursor: pointer;
}
.btn-ghost:hover { border-color: #8a97a4; background: #f8fafc; }

.content { flex: 1; width: 100%; max-width: 1180px; padding: 32px clamp(16px, 3vw, 40px) 56px; }

/* ======================= Messages ======================= */
.notices { margin-bottom: 20px; }
.notices:empty { display: none; }
.alert {
    display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: flex-start; gap: 12px;
    margin-bottom: 10px;
    padding: 12px 14px;
    font-size: .92rem;
    color: var(--danger-ink); background: var(--danger-bg);
    border: 1px solid var(--danger-line); border-radius: 6px;
}
.alert-error   { color: var(--danger-ink); background: var(--danger-bg); border-color: var(--danger-line); }
.alert-success { color: var(--ok-ink);     background: var(--ok-bg);     border-color: var(--ok-line); }
.alert-info    { color: var(--info-ink);   background: var(--info-bg);   border-color: var(--info-line); }
.alert .closebtn { flex: none; font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 0 4px; border-radius: 4px; }

/* ======================= Page content ======================= */
.content .container,
.surface {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(22, 34, 46, .06);
}
.content .container { padding: clamp(20px, 3vw, 32px); margin-bottom: 24px; }

.content h1 { margin: 0 0 18px; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
.content h2 { margin: 0 0 14px; font-size: 1.2rem; font-weight: 600; line-height: 1.25; }
.content h3 { margin: 0 0 10px; font-size: 1.05rem; font-weight: 600; }
.content p  { margin: 0 0 12px; }
.content hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.content a  { color: var(--blue); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: -6px 0 18px; font-size: .85rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend .l-low  { background: #f6c9c5; border: 1px solid var(--danger-line); }
.legend .l-warn { background: #fde7bd; border: 1px solid var(--warn-line); }

/* ----- Forms ----- */
.content label { display: block; margin: 0 0 6px; font-size: .875rem; font-weight: 500; }
.content input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
.content select,
.content textarea {
    width: 100%; height: 44px;
    padding: 0 12px;
    font: inherit; color: var(--ink);
    background: var(--white);
    border: 1px solid #b8c1ca; border-radius: 6px;
    transition: border-color .15s, box-shadow .15s;
}
.content textarea { height: auto; min-height: 96px; padding: 10px 12px; }
.content input:hover, .content select:hover, .content textarea:hover { border-color: #8a97a4; }
.content input:focus-visible, .content select:focus-visible, .content textarea:focus-visible,
.content a:focus-visible, .content button:focus-visible,
.content input[type="submit"]:focus-visible, .btn:focus-visible, .btn-ghost:focus-visible, .icon-btn:focus-visible {
    outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29, 95, 191, .25);
}
.content input[disabled], .content select[disabled] { color: var(--muted) !important; background: #eef1f4 !important; border-color: var(--line) !important; cursor: not-allowed; }
.content select {
    appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%235b6b7a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
.content input[type="file"] { width: 100%; padding: 8px 0; font: inherit; font-size: .9rem; }
.content input[type="file"]::file-selector-button {
    margin-right: 12px; height: 36px; padding: 0 14px;
    font: inherit; font-weight: 500; color: var(--ink);
    background: var(--white); border: 1px solid #b8c1ca; border-radius: 6px; cursor: pointer;
}
.content input[type="checkbox"], .content input[type="radio"] { width: 18px; height: 18px; accent-color: var(--blue); margin-right: 8px; vertical-align: -3px; }

/* ----- Buttons ----- */
.content input[type="submit"], .content button[type="submit"], .btn {
    height: 44px; padding: 0 24px;
    font: inherit; font-weight: 600;
    color: var(--white); background: var(--blue);
    border: 0; border-radius: 6px;
    cursor: pointer;
    transition: background .15s;
}
.content input[type="submit"]:hover, .content button[type="submit"]:hover, .btn:hover { background: var(--blue-dark); }
.content input[type="submit"]:disabled, .content button[type="submit"]:disabled, .btn:disabled { background: #c3ccd6; cursor: not-allowed; }
.content td input[type="submit"] { height: 34px; padding: 0 14px; font-size: .85rem; }

.content .print-btn, .content .refresh, .content .submit-div a, .content .restore-button, .btn-secondary {
    display: inline-flex; align-items: center; justify-content: center;
    height: 40px; padding: 0 18px;
    font: inherit; font-size: .9rem; font-weight: 600;
    color: var(--blue); text-decoration: none;
    background: var(--white);
    border: 1px solid var(--blue); border-radius: 6px;
    cursor: pointer;
}
.content .restore-button { width: auto; height: 44px; padding: 0 24px; }
.content .print-btn:hover, .content .refresh:hover, .content .submit-div a:hover, .content .restore-button:hover, .btn-secondary:hover { background: #eef3fb; }
.content input.restore-button[type="submit"] { color: var(--blue); background: var(--white); border: 1px solid var(--blue); }
.content input.restore-button[type="submit"]:hover { background: #eef3fb; }

.print-btn-div, .table-tools { display: flex; justify-content: flex-end; gap: 10px; margin: 0 0 14px; }
.button-div, .submit-div { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.submit-div form { margin: 0; }

/* ----- Search and filter rows ----- */
.search-form, .search-form > form, .flexContainer {
    display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
}
.search-form { margin: 0 0 16px; }
.search-form > form { margin: 0; width: 100%; }
.search-form label { margin: 0; }
.search-form input[type="text"], .search-form input[type="search"] { flex: 1 1 220px; max-width: 420px; width: auto; }
.flexContainer { margin-bottom: 14px; }
.flexContainer select { flex: 1 1 220px; max-width: 420px; width: auto; }
.storeLabel { margin-top: 14px; }
.content .container > form > input[type="date"], .content .container > form > select { max-width: 320px; margin-bottom: 4px; }
.content .container > .form { margin-bottom: 18px; }
.content .container > .form form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.content .container > .form input[type="text"] { flex: 1 1 220px; max-width: 360px; width: auto; }
.content .container > .form label { margin: 0; }

/* ----- Two-column form layouts ----- */
.content [class$="-grid"], .content .grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; align-items: start;
}
.content [class$="-grid"] > .grid-1, .content [class$="-grid"] > .grid-2 { display: flex; flex-direction: column; }
.content [class$="-grid"] label { margin-top: 16px; }
.content [class$="-grid"] label:first-child { margin-top: 0; }
.content .grid .received-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0; }
.content .grid .received-form input[type="text"] { flex: 1 1 200px; width: auto; }
.content .grid .search-form label, .content .grid .received-form label { margin: 0; }

/* ----- Label / value rows (profile, edit, order forms) ----- */
.content div.info { display: grid; grid-template-columns: minmax(130px, 220px) minmax(0, 1fr); gap: 8px 20px; align-items: center; margin-bottom: 16px; max-width: 760px; }
.content div.info label { margin: 0; }
.content .div-info { display: grid; grid-template-columns: minmax(130px, 220px) minmax(0, 1fr); gap: 8px 20px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); max-width: 760px; }
.content .div-info p { margin: 0; }
.content .div-info .info { font-size: .875rem; font-weight: 500; color: var(--muted); }
.content .div-info .info1 { color: var(--ink); }
.content h3.name { margin: 0 0 8px; font-size: 1.3rem; }
.content form > h3 { margin: 6px 0 16px; }

/* ----- Billing summary ----- */
.total-price { display: flex; align-items: baseline; justify-content: flex-end; gap: 28px; margin: 18px 0 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.total-price h3 { margin: 0; font-size: 1.15rem; }

/* ======================= Tables ======================= */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.content table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.content th {
    padding: 11px 14px;
    text-align: left; white-space: nowrap;
    font-size: .8rem; font-weight: 600; color: var(--muted);
    background: #f8fafc; border-bottom: 1px solid var(--line);
}
.content td { padding: 11px 14px; vertical-align: middle; border-bottom: 1px solid #eaeef2; }
.content tbody tr:last-child td { border-bottom: 0; }
.content tbody tr:hover td { background: #f8fafc; }
.content td h1, .content td h3 { margin: 0; font-size: 1rem; }
.content td.cell-low,  .content tbody tr:hover td.cell-low  { background: var(--danger-bg); color: var(--danger-ink); }
.content td.cell-warn, .content tbody tr:hover td.cell-warn { background: var(--warn-bg);   color: var(--warn-ink); }

/* ======================= Help page ======================= */
.accordion {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; margin-top: 10px; padding: 14px 16px;
    font: inherit; font-weight: 500; text-align: left; color: var(--ink);
    background: var(--white);
    border: 1px solid var(--line); border-radius: 6px;
    cursor: pointer;
}
.accordion:hover { border-color: #8a97a4; }
.accordion::after {
    content: ""; flex: none; width: 8px; height: 8px; margin-left: 12px;
    border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
    transform: rotate(45deg); transition: transform .2s var(--ease);
}
.accordion.clicked { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.accordion.clicked::after { transform: rotate(-135deg); }
.content .panel {
    max-height: 0; overflow: hidden; transition: max-height .25s var(--ease);
    background: var(--white);
    border: 0 solid var(--line); border-radius: 0 0 6px 6px;
}
.content .accordion.clicked + .panel { border-width: 0 1px 1px; }
.content .panel > * { margin-left: 16px; margin-right: 16px; }
.content .panel > :first-child { margin-top: 14px; }
.content .panel > :last-child { margin-bottom: 14px; }
.content .panel ul { padding-left: 38px; }
.content p.info { color: var(--ink); }
.note { padding: 10px 12px; font-size: .9rem; color: var(--info-ink); background: var(--info-bg); border-left: 3px solid var(--accent); border-radius: 4px; }

/* ======================= Gallery ======================= */
.content .formContainer { margin-bottom: 8px; }
.content .formContainer .form-control { margin-bottom: 14px; max-width: 520px; }
.content .formContainer h2 { margin-bottom: 4px; }
.slideshow-container { position: relative; max-width: 780px; margin: 32px auto 0; overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 8px; }
.fade { animation: fadein .5s ease; }
@keyframes fadein { from { opacity: .4; } to { opacity: 1; } }
.Containers { display: none; position: relative; }
.Containers img { display: block; width: 100%; height: auto; max-height: 520px; object-fit: cover; }
.MessageInfo { position: absolute; top: 12px; left: 12px; padding: 2px 12px; font-size: .8rem; color: #fff; background: rgba(0,0,0,.55); border-radius: 999px; }
.details { padding: 16px 20px 18px; }
.details h1 { margin: 0 0 4px; font-size: 1.15rem; }
.details p { margin: 0; color: var(--muted); font-size: .95rem; }
.Back, .forward {
    position: absolute; top: 38%; z-index: 2;
    width: 44px; height: 44px; display: grid; place-items: center;
    color: var(--ink); background: rgba(255,255,255,.92);
    border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.25);
    cursor: pointer; user-select: none; text-decoration: none;
}
.Back { left: 12px; } .forward { right: 12px; }
.Back:hover, .forward:hover { background: #fff; }

/* ======================= Dialogs ======================= */
.modal { display: none; position: fixed; inset: 0; z-index: 100; padding: 5vh 16px; overflow-y: auto; background: rgba(12, 22, 32, .55); }
.modal-content { position: relative; max-width: 720px; margin: 0 auto; padding: 24px 28px; background: var(--white); border-radius: 8px; }
.modal .close { position: absolute; top: 10px; right: 16px; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; }
dialog {
    width: calc(100% - 32px); max-width: 720px;
    max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
    padding: 0; color: var(--ink); background: var(--white);
    border: 0; border-radius: 8px; box-shadow: 0 24px 70px rgba(0,0,0,.35);
}
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: rgba(12, 22, 32, .55); }
.dlg-head { flex: none; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; font-size: 1.15rem; font-weight: 600; }
.dlg-body { flex: 1; overflow-y: auto; padding: 8px 24px 20px; }
.dlg-body h3 { margin: 22px 0 6px; font-size: 1rem; font-weight: 600; }
.dlg-body h4 { margin: 18px 0 4px; font-size: .95rem; font-weight: 600; }
.dlg-body p { margin: 0 0 10px; color: #3c4b59; font-size: .93rem; }
.dlg-foot { flex: none; display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); background: #fafbfc; border-radius: 0 0 8px 8px; }

/* ======================= Registration page ======================= */
.page-head { margin-bottom: 24px; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { margin: 0; color: var(--muted); max-width: 62ch; }
.section { padding: 28px clamp(20px, 3vw, 32px); }
.section + .section { border-top: 1px solid var(--line); }
.section h2 { margin: 0 0 2px; font-size: 1.05rem; }
.section > p { margin: 0 0 20px; color: var(--muted); font-size: .9rem; }
.section .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.span-2 { grid-column: 1 / -1; }
.hint { margin: 6px 0 0; font-size: .8rem; color: var(--muted); }
.actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px clamp(20px, 3vw, 32px); background: #fafbfc; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; }
.check { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 400; font-size: .92rem; }
.link-btn { padding: 0; font: inherit; color: var(--blue); background: none; border: 0; border-radius: 3px; cursor: pointer; text-decoration: underline; }
.btn-secondary:disabled { opacity: .5; }

/* ======================= Public pages (forgot password) ======================= */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--paper); }
.auth-card { width: 100%; max-width: 420px; padding: 36px 32px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 1px 2px rgba(22,34,46,.06); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; font-size: .9rem; font-weight: 600; line-height: 1.25; }
.auth-card h1 { margin: 0 0 4px; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; }
.auth-card .sub { margin: 0 0 22px; color: var(--muted); font-size: .95rem; }
.auth-card .field { margin-bottom: 18px; }
.auth-card label { display: block; margin-bottom: 6px; font-size: .875rem; font-weight: 500; }
.auth-card input[type="text"], .auth-card input[type="email"] { width: 100%; height: 44px; padding: 0 12px; font: inherit; color: var(--ink); background: var(--white); border: 1px solid #b8c1ca; border-radius: 6px; }
.auth-card input:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29, 95, 191, .25); }
.auth-card .btn { width: 100%; }
.auth-card .back { display: block; margin-top: 18px; text-align: center; font-size: .92rem; color: var(--blue); text-decoration: none; }
.auth-card .back:hover { text-decoration: underline; }
.auth-card .notices { margin-bottom: 18px; }

/* ======================= Product registration + add price ======================= */
.content .container2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; align-items: start; }
.content .container2 .grid1, .content .container2 .grid2 { display: flex; flex-direction: column; }
.content .container2 label { margin-top: 16px; }
.content .container2 .grid1 > label:first-child, .content .container2 .grid2 > label:first-child { margin-top: 0; }
.content .container2 br { display: none; }
.content #grid3 { margin-top: 24px; }
.back-link { display: inline-block; margin-bottom: 14px; font-size: .9rem; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.add-product { max-width: 640px; }
.add-product .form-info { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr); gap: 0 20px; margin: 18px 0 20px; }
.add-product .form-info p { margin: 0; padding: 9px 0; font-size: .95rem; line-height: 1.5; border-bottom: 1px solid var(--line); }
.add-product .form-info > div:first-child p { color: var(--muted); }
.add-product .price-div { margin-bottom: 18px; }
.add-product label.add-label { margin-top: 4px; }
.add-product input.add-input { margin-bottom: 4px; }

/* ======================= Small screens ======================= */
@media (max-width: 960px) {
    .app { margin-left: 0; }
    .sidebar { transform: translateX(-100%); box-shadow: 8px 0 40px rgba(0,0,0,.3); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .nav-backdrop { display: block; }
    .user-meta { display: none; }
}
@media (max-width: 720px) {
    .content { padding-top: 24px; }
    .content [class$="-grid"], .content .grid, .section .grid, .content .container2 { grid-template-columns: 1fr; }
    .content div.info, .content .div-info { grid-template-columns: 1fr; gap: 4px; }
    .content .container2 .grid2, .content [class$="-grid"] > .grid-2 { margin-top: 16px; }
    .actions { flex-direction: column; align-items: stretch; }
    .actions .btn { width: 100%; }
    .print-btn-div, .table-tools { justify-content: stretch; }
    .search-form input[type="text"], .flexContainer select { max-width: none; }
    .total-price { justify-content: space-between; }
}
@media print {
    .sidebar, .topbar, .nav-backdrop, .print-btn-div, .table-tools { display: none !important; }
    .app { margin: 0; }
    body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) {
    .sidebar, .app, .nav-sub, .caret, .panel, .fade { transition: none; animation: none; }
}

/* ---------- Client logo (includes/brand.php) ---------- */
.brand-img { flex: none; height: 36px; width: auto; max-width: 150px; object-fit: contain; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Inventory pages (grids, tabs, badges, pager, dashboard) ---------- */
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 20px; margin-top: 12px; }
.grid-form .span-2 { grid-column: span 2; }
@media (max-width: 640px) { .grid-form .span-2 { grid-column: auto; } }
.field label { display: block; margin-bottom: 4px; }
.field small, .hint { color: var(--muted); }
.inline-form { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.btn-sm { height: 34px !important; padding: 0 14px !important; font-size: .85rem !important; display: inline-flex; align-items: center; text-decoration: none; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.page-head h2 { margin: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 16px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; font-weight: 500; }
.tabs a[aria-current="page"] { color: var(--blue); border-bottom-color: var(--blue); }
.badge { display: inline-block; padding: 2px 10px; font-size: .78rem; font-weight: 600; border-radius: 999px; white-space: nowrap; }
.badge-ok { color: var(--ok-ink); background: var(--ok-bg); }
.badge-warn { color: var(--warn-ink); background: var(--warn-bg); }
.badge-danger { color: var(--danger-ink); background: var(--danger-bg); }
.badge-info { color: var(--info-ink); background: var(--info-bg); }
.badge-muted { color: var(--muted); background: #eef1f4; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 14px; }
.pager a, .pager strong { min-width: 36px; padding: 6px 10px; text-align: center; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: var(--ink); background: var(--white); }
.pager strong { background: var(--blue); border-color: var(--blue); color: #fff; }
.pager-note { color: var(--muted); font-size: .9rem; margin: 10px 12px 0 0; }
.legend span { display: inline-block; padding: 2px 10px; border-radius: 4px; margin-right: 8px; font-size: .85rem; }
.line-row { display: grid; grid-template-columns: minmax(200px, 3fr) 100px 120px 40px; gap: 10px; align-items: end; margin-bottom: 10px; }
.line-row.line-narrow { grid-template-columns: minmax(200px, 3fr) 100px 40px; }
@media (max-width: 640px) { .line-row, .line-row.line-narrow { grid-template-columns: 1fr 1fr; } }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; }
.kpi span { display: block; color: var(--muted); font-size: .85rem; }
.kpi strong { display: block; font-size: 1.7rem; letter-spacing: -.01em; }
.kpi.kpi-alert strong { color: var(--danger-ink); }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.chart-card { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; }
.chart-card h3 { margin: 0 0 10px; font-size: 1rem; }
.hbar { display: grid; grid-template-columns: 120px 1fr 56px; gap: 8px; align-items: center; margin: 6px 0; font-size: .88rem; }
.hbar i { display: block; height: 14px; border-radius: 3px; background: var(--accent); }
.scan-dialog { border: 0; border-radius: 10px; padding: 20px; text-align: center; }
textarea.serials { min-height: 64px; font-family: ui-monospace, Menlo, Consolas, monospace; }
@media print { .sidebar, .topbar, .nav-backdrop, .btn, .btn-ghost, .btn-secondary, .tabs, .search-form, .submit-div { display: none !important; } .content { margin: 0 !important; } }
