:root {
    --bg: #f4f1ea;
    --bg-2: #eef4f5;
    --panel: rgba(255, 255, 255, 0.92);
    --panel-strong: #ffffff;
    --panel-soft: #fbfaf7;
    --text: #1f2937;
    --muted: #6b7280;
    --muted-2: #8b97a6;
    --line: #d8e0e6;
    --primary: #0f766e;
    --primary-strong: #0b5e58;
    --primary-soft: rgba(15, 118, 110, 0.12);
    --accent: #d97706;
    --accent-soft: rgba(217, 119, 6, 0.12);
    --success: #15803d;
    --success-soft: rgba(21, 128, 61, 0.12);
    --danger: #b91c1c;
    --danger-soft: rgba(185, 28, 28, 0.12);
    --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.05);
    --radius: 24px;
    --radius-sm: 16px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    font-family: "Manrope", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.15), transparent 28%),
        radial-gradient(circle at top right, rgba(217, 119, 6, 0.12), transparent 26%),
        linear-gradient(180deg, #f7f4ee 0%, #eef4f5 55%, #f8f7f2 100%);
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 80%);
    opacity: 0.35;
}

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

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

button {
    cursor: pointer;
}

.app-shell {
    width: min(1520px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 42px;
    display: grid;
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
    gap: 20px;
}

.sidebar {
    position: sticky;
    top: 28px;
    align-self: start;
    display: grid;
    gap: 18px;
    padding: 24px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.sidebar-brand {
    display: grid;
    gap: 16px;
}

.sidebar-brand .brand-mark {
    width: 72px;
    height: 72px;
    border-radius: 22px;
}

.sidebar-brand .brand-copy h1 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.25rem, 1.8vw, 1.7rem);
    line-height: 1.08;
}

.sidebar-nav {
    display: grid;
    gap: 10px;
}

.menu-link {
    display: grid;
    gap: 4px;
    padding: 15px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-soft);
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.menu-link span {
    font-weight: 800;
}

.menu-link small {
    color: var(--muted);
    font-weight: 700;
}

.menu-link:hover {
    transform: translateY(-1px);
    background: #fff;
    box-shadow: var(--shadow);
}

.menu-link.is-active {
    background: linear-gradient(145deg, var(--primary), var(--primary-strong));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 18px 30px rgba(15, 118, 110, 0.24);
}

.menu-link.is-active small {
    color: rgba(255, 255, 255, 0.82);
}

.sidebar-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(15, 118, 110, 0.14);
    background: linear-gradient(145deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.94));
    box-shadow: var(--shadow-soft);
}

.sidebar-kicker {
    margin: 0;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    font-weight: 800;
}

.sidebar-card strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.02rem;
}

.sidebar-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.page-stack {
    min-width: 0;
    display: grid;
    gap: 18px;
}

.page-stack > .page-hero,
.page-stack > .flash,
.page-stack > .stats-grid,
.page-stack > .card {
    margin-top: 0;
}

.page-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 28px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.82);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.page-hero h2 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.5rem, 2.4vw, 2.25rem);
    line-height: 1.1;
}

.page-hero .subtitle {
    max-width: 66ch;
}

.page-hero-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(217, 119, 6, 0.12);
    background: var(--accent-soft);
    color: #8a5b0e;
    font-weight: 800;
    white-space: nowrap;
}

.page-hero-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.page-hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(216, 224, 230, 0.9);
    box-shadow: var(--shadow-soft);
    color: var(--muted);
    font-weight: 700;
}

.page-hero-chip strong {
    color: var(--text);
}

.topbar {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.58);
    backdrop-filter: blur(18px);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.brand {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    color: #fff;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    background: linear-gradient(145deg, var(--primary), #1d4ed8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.brand-copy {
    min-width: 0;
}

.eyebrow,
.card-kicker,
.report-label {
    margin: 0 0 6px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    font-weight: 800;
}

.brand h1 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.2rem, 2vw, 1.85rem);
    line-height: 1.1;
}

.subtitle {
    margin: 8px 0 0;
    color: var(--muted);
    max-width: 65ch;
}

.nav-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

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

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(216, 224, 230, 0.9);
    box-shadow: var(--shadow-soft);
    color: var(--muted);
    font-weight: 700;
}

.user-chip strong {
    color: var(--text);
}

.logout-form {
    margin: 0;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
    color: var(--text);
    font-weight: 800;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn-ghost:hover {
    transform: translateY(-1px);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.55);
    color: var(--muted);
    font-weight: 700;
    box-shadow: var(--shadow-soft);
    transition: transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.tab:hover {
    transform: translateY(-1px);
    color: var(--text);
}

.tab.is-active {
    background: linear-gradient(145deg, var(--primary), var(--primary-strong));
    color: #fff;
    box-shadow: 0 18px 30px rgba(15, 118, 110, 0.24);
}

.flash {
    margin-top: 18px;
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-weight: 700;
    box-shadow: var(--shadow-soft);
}

.flash-success {
    border-color: rgba(21, 128, 61, 0.24);
    background: linear-gradient(145deg, rgba(21, 128, 61, 0.14), rgba(255, 255, 255, 0.95));
    color: var(--success);
}

.flash-error {
    border-color: rgba(185, 28, 28, 0.24);
    background: linear-gradient(145deg, rgba(185, 28, 28, 0.14), rgba(255, 255, 255, 0.95));
    color: var(--danger);
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.75fr);
    gap: 18px;
    margin-top: 18px;
}

.auth-card,
.auth-aside {
    min-height: 100%;
}

.auth-copy {
    margin: 0 0 16px;
    color: var(--muted);
}

.auth-form .field-actions {
    grid-column: span 2;
}

.feature-list {
    margin: 0;
    padding-left: 20px;
    color: var(--text);
}

.feature-list li + li {
    margin-top: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.stat-card {
    padding: 22px 22px 20px;
    border-radius: var(--radius);
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(14px);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: auto -25% -65% auto;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15, 118, 110, 0.12), transparent 68%);
}

.stat-label {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.stat-value {
    display: block;
    margin-top: 10px;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.15rem);
    letter-spacing: -0.03em;
}

.stat-meta {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.92rem;
}

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

.card {
    margin-top: 18px;
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.82);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.card-head-actions {
    display: grid;
    justify-items: end;
    gap: 10px;
}

.card h2,
.report-header h3 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    line-height: 1.1;
}

.card-badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    color: var(--primary-strong);
    background: var(--primary-soft);
    border: 1px solid rgba(15, 118, 110, 0.12);
    font-size: 0.84rem;
    font-weight: 800;
    white-space: nowrap;
}

.card-badge-soft {
    color: #8a5b0e;
    background: var(--accent-soft);
    border-color: rgba(217, 119, 6, 0.12);
}

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

.field {
    display: grid;
    gap: 8px;
}

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

.field-actions {
    display: flex;
    align-items: end;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-form {
    grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.2fr) minmax(220px, 0.75fr) auto;
    align-items: end;
}

.filter-note {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.field > span {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 14px 15px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--panel-strong);
    color: var(--text);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.field textarea {
    resize: vertical;
    min-height: 104px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: rgba(15, 118, 110, 0.42);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.field input[readonly] {
    background: #f4f7f8;
    color: var(--muted);
    cursor: not-allowed;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    font-weight: 800;
    letter-spacing: 0.01em;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(145deg, var(--primary), var(--primary-strong));
    box-shadow: 0 18px 28px rgba(15, 118, 110, 0.22);
}

.btn-secondary {
    color: #fff;
    background: linear-gradient(145deg, #2563eb, #1d4ed8);
    box-shadow: 0 18px 28px rgba(29, 78, 216, 0.2);
}

.btn-danger {
    color: #fff;
    background: linear-gradient(145deg, #dc2626, #b91c1c);
    box-shadow: 0 18px 28px rgba(185, 28, 28, 0.2);
}

.btn-small {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
}

.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-1px);
    filter: brightness(1.02);
}

.empty-inline,
.empty-state {
    padding: 22px;
    border-radius: var(--radius-sm);
    border: 1px dashed rgba(107, 114, 128, 0.34);
    background: rgba(255, 255, 255, 0.68);
    color: var(--muted);
}

.empty-error {
    border-color: rgba(185, 28, 28, 0.3);
    background: rgba(185, 28, 28, 0.06);
    color: var(--danger);
}

.ledger-table-shell {
    overflow-x: auto;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--panel-soft);
}

.product-table-shell {
    overflow-x: auto;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--panel-soft);
}

.ledger-table-header,
.ledger-row {
    display: grid;
    grid-template-columns: 1.05fr 1.45fr 1.1fr 0.8fr 0.95fr 0.85fr 0.9fr 0.9fr 0.9fr auto;
    gap: 12px;
    align-items: center;
    min-width: 1460px;
}

.ledger-table-header {
    padding: 14px 16px;
    background: linear-gradient(145deg, rgba(15, 118, 110, 0.08), rgba(217, 119, 6, 0.08));
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.ledger-row {
    padding: 12px 16px;
    border-top: 1px solid rgba(216, 224, 230, 0.8);
    background: rgba(255, 255, 255, 0.82);
}

.ledger-row:nth-child(even) {
    background: rgba(251, 250, 247, 0.92);
}

.product-table-header,
.product-row {
    display: grid;
    grid-template-columns: 1fr 1.4fr 2fr 0.9fr 0.9fr auto;
    gap: 12px;
    align-items: stretch;
    min-width: 1220px;
}

.product-table-header {
    padding: 14px 16px;
    background: linear-gradient(145deg, rgba(15, 118, 110, 0.08), rgba(217, 119, 6, 0.08));
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.product-row {
    padding: 12px 16px;
    border-top: 1px solid rgba(216, 224, 230, 0.8);
    background: rgba(255, 255, 255, 0.82);
}

.product-row:nth-child(even) {
    background: rgba(251, 250, 247, 0.92);
}

.ledger-row.status-low {
    background: linear-gradient(145deg, rgba(185, 28, 28, 0.06), rgba(255, 255, 255, 0.92));
}

.ledger-row.status-ok {
    background: linear-gradient(145deg, rgba(21, 128, 61, 0.05), rgba(255, 255, 255, 0.92));
}

.ledger-cell input {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.ledger-cell input:focus {
    border-color: rgba(15, 118, 110, 0.42);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.ledger-cell input[readonly] {
    background: #f4f7f8;
    color: var(--muted);
}

.product-cell {
    display: flex;
    align-items: stretch;
}

.product-cell input,
.product-cell textarea {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.product-cell textarea {
    resize: vertical;
    min-height: 84px;
}

.product-cell input:focus,
.product-cell textarea:focus {
    border-color: rgba(15, 118, 110, 0.42);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.product-actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

.ledger-actions {
    display: flex;
    justify-content: flex-end;
}

.ledger-actions-stack {
    gap: 10px;
    flex-wrap: wrap;
}

.audit-table,
.inventory-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1120px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: #fff;
}

.audit-table thead th,
.report-table thead th,
.inventory-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafb;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    font-weight: 800;
}

.audit-table th,
.audit-table td,
.report-table th,
.report-table td,
.inventory-table th,
.inventory-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(216, 224, 230, 0.8);
    vertical-align: top;
}

.audit-table tbody tr:hover,
.report-table tbody tr:hover,
.inventory-table tbody tr:hover {
    background: rgba(15, 118, 110, 0.04);
}

.num {
    text-align: right;
    white-space: nowrap;
}

.inventory-stock {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 800;
}

.type-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
}

.type-delivery {
    color: var(--success);
    background: var(--success-soft);
}

.type-cogs {
    color: var(--danger);
    background: var(--danger-soft);
}

.type-beginning {
    color: var(--muted);
    background: rgba(107, 114, 128, 0.12);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
}

.status-active {
    color: var(--success);
    background: var(--success-soft);
}

.status-voided {
    color: var(--muted);
    background: rgba(107, 114, 128, 0.12);
}

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

.status-low {
    color: var(--danger);
    background: var(--danger-soft);
}

.alert-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
    padding: 20px 24px;
    border-radius: var(--radius);
    border: 1px solid rgba(185, 28, 28, 0.18);
    background: linear-gradient(145deg, rgba(185, 28, 28, 0.09), rgba(255, 255, 255, 0.92));
    box-shadow: var(--shadow-soft);
}

.alert-banner h2 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
}

.alert-banner p {
    margin: 8px 0 0;
    color: var(--muted);
}

.report-panel {
    padding-bottom: 28px;
}

.history-card .audit-table tbody tr.is-voided {
    opacity: 0.7;
    background: rgba(107, 114, 128, 0.04);
}

.auth-shell {
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    align-items: start;
}

.auth-landing {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 20px;
    min-height: calc(100vh - 70px);
    padding: 34px;
    background:
        radial-gradient(circle at top right, rgba(217, 119, 6, 0.14), transparent 26%),
        linear-gradient(160deg, rgba(15, 118, 110, 0.1), rgba(255, 255, 255, 0.96));
}

.auth-landing::before {
    content: "";
    position: absolute;
    inset: auto -10% -22% auto;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15, 118, 110, 0.16), transparent 72%);
    pointer-events: none;
}

.auth-landing h1 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2.1rem, 4vw, 4rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
    max-width: 12ch;
}

.auth-stack {
    display: grid;
    gap: 18px;
    align-self: start;
}

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

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

.feature-tile {
    display: grid;
    gap: 8px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-soft);
}

.feature-tile strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1rem;
}

.feature-tile span {
    color: var(--muted);
    line-height: 1.55;
}

.auth-note {
    padding: 18px 20px;
    border-radius: 22px;
    border: 1px solid rgba(217, 119, 6, 0.18);
    background: linear-gradient(145deg, rgba(217, 119, 6, 0.12), rgba(255, 255, 255, 0.96));
    box-shadow: var(--shadow-soft);
}

.auth-note span {
    display: block;
    color: #8a5b0e;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.78rem;
    font-weight: 800;
}

.auth-note p {
    margin: 8px 0 0;
    color: var(--text);
    font-weight: 700;
    line-height: 1.55;
}

.auth-form {
    margin-top: 4px;
}

.directory-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
    gap: 18px;
    margin-top: 18px;
    align-items: start;
}

.directory-list-card,
.directory-detail-card {
    align-self: start;
}

.directory-detail-card {
    position: sticky;
    top: 28px;
}

.directory-category-list {
    display: grid;
    gap: 16px;
}

.directory-category-list-subgroups {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.84);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.directory-category-list-subgroups .directory-category {
    border-radius: 0;
    border: 0;
    border-inline-start: 1px solid var(--line);
    background: transparent;
    box-shadow: none;
}

.directory-category-list-subgroups .directory-category:first-child {
    border-inline-start: 0;
}

.directory-category {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.84);
    box-shadow: var(--shadow-soft);
}

.directory-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.directory-category-head strong {
    display: block;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.05rem;
}

.directory-category-head span {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.category-stock-total {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(15, 118, 110, 0.14);
    background: rgba(15, 118, 110, 0.08);
    color: var(--primary-strong);
    font-weight: 800;
    white-space: nowrap;
}

.directory-product-list {
    display: grid;
    gap: 10px;
}

.directory-product-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-soft);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.directory-product-card:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 118, 110, 0.24);
    box-shadow: var(--shadow);
}

.directory-product-card.is-selected {
    border-color: rgba(15, 118, 110, 0.42);
    background: linear-gradient(145deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.98));
}

.directory-product-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.directory-product-head strong {
    font-size: 0.98rem;
    line-height: 1.45;
}

.directory-product-card p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.directory-product-meta {
    display: grid;
    justify-items: end;
    gap: 4px;
    min-width: 84px;
    text-align: right;
}

.directory-product-meta strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.12rem;
}

.directory-product-meta span {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.profile-summary {
    display: grid;
    gap: 12px;
    padding: 20px;
    border-radius: 22px;
    border: 1px solid rgba(15, 118, 110, 0.16);
    background: linear-gradient(145deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.96));
    box-shadow: var(--shadow-soft);
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.profile-summary h3 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.2rem, 2vw, 1.7rem);
    line-height: 1.1;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.profile-stat {
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-soft);
}

.profile-stat span {
    display: block;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    font-weight: 800;
}

.profile-stat strong {
    display: block;
    margin-top: 8px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.18rem;
}

.profile-meta-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.profile-meta-strip div {
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
}

.profile-meta-strip span {
    display: block;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    font-weight: 800;
}

.profile-meta-strip strong {
    display: block;
    margin-top: 8px;
    font-weight: 800;
}

.profile-history {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.profile-history-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-soft);
}

.profile-history-item strong {
    display: block;
    margin-top: 6px;
    font-family: "Space Grotesk", sans-serif;
}

.profile-history-item p {
    margin: 6px 0 0;
    color: var(--muted);
}

.product-detail-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.directory-filter-form {
    grid-template-columns: minmax(0, 1.25fr) minmax(180px, 0.6fr) auto;
    align-items: end;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.category-tab {
    display: grid;
    gap: 6px;
    min-width: 180px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow-soft);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.category-tab:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 118, 110, 0.24);
    box-shadow: var(--shadow);
}

.category-tab strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.98rem;
}

.category-tab span {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.category-tab.is-active {
    background: linear-gradient(145deg, var(--primary), var(--primary-strong));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 18px 30px rgba(15, 118, 110, 0.24);
}

.category-tab.is-active span {
    color: rgba(255, 255, 255, 0.84);
}

.toggle-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-soft);
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
}

.toggle-pill input {
    margin: 0;
    width: auto;
    accent-color: var(--primary);
}

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

.overview-actions-tight {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.overview-action {
    display: grid;
    gap: 8px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow-soft);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.overview-action:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 118, 110, 0.24);
    box-shadow: var(--shadow);
}

.overview-action strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1rem;
}

.overview-action span {
    color: var(--muted);
    line-height: 1.5;
}

.dashboard-list {
    display: grid;
    gap: 12px;
}

.dashboard-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-soft);
}

.dashboard-link-item {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dashboard-link-item:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 118, 110, 0.24);
    box-shadow: var(--shadow);
}

.dashboard-item strong {
    display: block;
    margin-top: 6px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.98rem;
}

.dashboard-item p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.dashboard-meter {
    display: grid;
    place-items: center;
    min-width: 58px;
    min-height: 58px;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid rgba(15, 118, 110, 0.14);
    background: rgba(15, 118, 110, 0.08);
    color: var(--primary-strong);
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
}

.dashboard-forecast-qty {
    display: grid;
    gap: 4px;
    justify-items: end;
    min-width: 110px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
    text-align: right;
}

.dashboard-forecast-qty span {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.74rem;
    font-weight: 800;
}

.dashboard-forecast-qty strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.12rem;
}

.transaction-preview-card {
    display: grid;
    gap: 14px;
    align-self: start;
    position: sticky;
    top: 28px;
}

.transaction-preview-state {
    display: grid;
    gap: 10px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(15, 118, 110, 0.16);
    background: linear-gradient(145deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.96));
    box-shadow: var(--shadow-soft);
}

.transaction-preview-state strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.08rem;
}

.transaction-preview-state p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.transaction-help {
    padding: 16px 18px;
    border-radius: 22px;
    border: 1px solid rgba(217, 119, 6, 0.16);
    background: linear-gradient(145deg, rgba(217, 119, 6, 0.09), rgba(255, 255, 255, 0.96));
    box-shadow: var(--shadow-soft);
}

.transaction-help p:last-child {
    margin-bottom: 0;
}

.scanner-card {
    display: grid;
    gap: 14px;
    width: min(760px, 100%);
}

.scanner-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 22px;
    background: #0f172a;
    object-fit: cover;
    border: 1px solid rgba(15, 23, 42, 0.18);
}

.scanner-result {
    display: flex;
    align-items: center;
    min-height: 54px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(15, 118, 110, 0.08);
    font-weight: 700;
    color: var(--text);
}

.status-good {
    color: var(--success);
    background: var(--success-soft);
}

.status-warning {
    color: #b45309;
    background: rgba(245, 158, 11, 0.14);
}

.status-stable {
    color: #475569;
    background: rgba(71, 85, 105, 0.12);
}

.status-damaged {
    color: var(--danger);
    background: var(--danger-soft);
}

.type-return {
    color: #8a5b0e;
    background: var(--accent-soft);
}

.row-return {
    background: rgba(217, 119, 6, 0.04);
}

.row-damaged {
    background: rgba(185, 28, 28, 0.06);
}

@media print {
    body {
        background: #fff;
    }

    body::before {
        display: none;
    }

    .app-shell {
        width: 100%;
        padding: 0;
    }

    .flash,
    .sidebar,
    .page-hero,
    .page-hero-actions,
    .page-hero-badge,
    .stats-grid,
    .filter-card,
    .transaction-entry-card,
    .no-print {
        display: none !important;
    }

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

    .card {
        box-shadow: none;
        background: #fff;
        border-color: #d1d5db;
    }

    .report-panel,
    .history-card,
    .billing-box,
    .signature-grid {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .table-wrap {
        overflow: visible;
        border-color: #d1d5db;
    }

    .audit-table,
    .report-table,
    .inventory-table {
        min-width: 0;
    }

    .audit-table thead th,
    .report-table thead th,
    .inventory-table thead th {
        position: static;
    }

    .history-card .audit-table th:last-child,
    .history-card .audit-table td:last-child {
        display: none;
    }
}

.report-filter {
    display: grid;
    grid-template-columns: 1.5fr 0.9fr auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 22px;
}

.report-header {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
    gap: 20px;
    align-items: stretch;
    margin-bottom: 18px;
    padding: 18px;
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.92));
    border: 1px solid rgba(15, 118, 110, 0.14);
}

.report-header h3 {
    font-size: clamp(1.15rem, 2vw, 1.65rem);
}

.report-subtitle {
    margin: 10px 0 0;
    color: var(--muted);
}

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

.report-meta-grid div {
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.86);
}

.report-meta-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.report-meta-grid strong {
    display: block;
    margin-top: 8px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.1rem;
}

.report-table-wrap {
    margin-top: 12px;
}

.row-beginning {
    background: rgba(15, 118, 110, 0.04);
}

.row-delivery {
    background: rgba(21, 128, 61, 0.04);
}

.row-cogs {
    background: rgba(185, 28, 28, 0.04);
}

.row-summary {
    font-weight: 800;
    background: linear-gradient(145deg, rgba(217, 119, 6, 0.1), rgba(15, 118, 110, 0.08));
}

.report-particulars {
    display: grid;
    gap: 4px;
}

.report-particulars span {
    color: var(--muted);
    font-size: 0.88rem;
}

.billing-box {
    margin-top: 18px;
    padding: 22px 24px;
    border-radius: 22px;
    border: 1px solid rgba(217, 119, 6, 0.18);
    background: linear-gradient(145deg, rgba(217, 119, 6, 0.14), rgba(255, 255, 255, 0.96));
    box-shadow: var(--shadow-soft);
}

.billing-box span {
    display: block;
    color: #8a5b0e;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.78rem;
    font-weight: 800;
}

.billing-box strong {
    display: block;
    margin-top: 8px;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.6rem, 3vw, 2.3rem);
}

.billing-box p {
    margin: 10px 0 0;
    color: var(--muted);
}

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

.signature-box {
    padding: 22px 22px 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
}

.signature-box span {
    display: block;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    font-weight: 800;
}

.signature-box strong {
    display: block;
    margin-top: 8px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.1rem;
}

.signature-line {
    height: 1px;
    margin-top: 32px;
    background: linear-gradient(90deg, transparent, #1f2937 20%, #1f2937 80%, transparent);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(8px);
}

.modal-backdrop.is-open,
.modal-backdrop[aria-hidden="false"] {
    display: flex;
}

.modal-card {
    position: relative;
    width: min(720px, 100%);
    padding: 28px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.25);
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-weight: 800;
}

.modal-copy {
    margin: 10px 0 0;
    color: var(--muted);
}

.restock-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.restock-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px 16px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(185, 28, 28, 0.14);
    background: rgba(185, 28, 28, 0.05);
}

.restock-item-copy {
    display: grid;
    gap: 6px;
}

.restock-item strong {
    font-family: "Space Grotesk", sans-serif;
}

.restock-item-copy > span:not(.status-pill) {
    color: var(--muted);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

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

@media (max-width: 1180px) {
    .app-shell {
        grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    }

    .page-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid,
    .dashboard-grid,
    .report-header,
    .signature-grid,
    .report-filter,
    .auth-layout {
        grid-template-columns: 1fr 1fr;
    }

    .directory-layout {
        grid-template-columns: 1fr;
    }

    .report-header {
        grid-template-columns: 1fr;
    }

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

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

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

@media (max-width: 820px) {
    .app-shell {
        width: min(100% - 20px, 1520px);
        padding-top: 12px;
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .page-hero {
        padding: 18px;
    }

    .page-hero-actions {
        justify-content: flex-start;
    }

    .stats-grid,
    .dashboard-grid,
    .signature-grid,
    .report-filter,
    .report-meta-grid,
    .form-grid,
    .auth-layout {
        grid-template-columns: 1fr;
    }

    .auth-highlight-grid,
    .overview-actions,
    .directory-layout,
    .profile-grid,
    .profile-meta-strip,
    .directory-filter-form {
        grid-template-columns: 1fr;
    }

    .category-tabs {
        flex-direction: column;
    }

    .category-tab {
        min-width: 0;
    }

    .field-wide,
    .report-filter .field-actions,
    .auth-form .field-actions {
        grid-column: auto;
    }

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

    .filter-form .field-actions {
        grid-column: auto;
    }

    .directory-detail-card,
    .transaction-preview-card {
        position: static;
    }

    .directory-category-list-subgroups {
        grid-template-columns: 1fr;
    }

    .directory-category-list-subgroups .directory-category {
        border-inline-start: 0;
        border-top: 1px solid var(--line);
    }

    .directory-category-list-subgroups .directory-category:first-child {
        border-top: 0;
    }

    .card-head-actions {
        justify-items: start;
    }

    .restock-item {
        grid-template-columns: 1fr;
    }

    .restock-item a {
        justify-self: start;
    }

    .directory-product-card,
    .dashboard-item,
    .profile-history-item {
        flex-direction: column;
    }

    .directory-product-meta,
    .dashboard-forecast-qty {
        justify-items: start;
        text-align: left;
    }

    .directory-category-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .card,
    .page-hero,
    .sidebar,
    .billing-box,
    .signature-box,
    .auth-card,
    .auth-aside,
    .auth-landing,
    .auth-form-card,
    .modal-card,
    .alert-banner {
        padding: 18px;
    }

    .alert-banner {
        flex-direction: column;
        align-items: flex-start;
    }
}
