:root {
    --green-950: #103628;
    --green-900: #184f3a;
    --green-800: #226448;
    --green-700: #2e7d5b;
    --green-100: #dcefe7;
    --green-50: #f0f8f4;
    --ink: #183028;
    --muted: #687b74;
    --line: #dce5e1;
    --surface: #ffffff;
    --canvas: #f5f7f5;
    --warning: #c47a16;
    --warning-bg: #fff3dc;
    --danger: #b83c3c;
    --danger-bg: #fde8e8;
    --blue: #3c6faf;
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 26px;
    --shadow-sm: 0 1px 2px rgba(18, 48, 39, .06), 0 8px 24px rgba(18, 48, 39, .04);
    --shadow: 0 14px 40px rgba(18, 48, 39, .09);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--canvas);
}

body {
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--green-700);
    text-decoration: none;
}

.btn {
    --bs-btn-border-radius: 13px;
    --bs-btn-font-weight: 700;
    min-height: 46px;
}

.btn-primary {
    --bs-btn-bg: var(--green-700);
    --bs-btn-border-color: var(--green-700);
    --bs-btn-hover-bg: var(--green-800);
    --bs-btn-hover-border-color: var(--green-800);
    --bs-btn-active-bg: var(--green-900);
}

.btn-outline-primary {
    --bs-btn-color: var(--green-700);
    --bs-btn-border-color: #9fc8b7;
    --bs-btn-hover-bg: var(--green-700);
    --bs-btn-hover-border-color: var(--green-700);
}

.form-control,
.form-select {
    border-color: #cddbd5;
    border-radius: 12px;
    min-height: 46px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--green-700);
    box-shadow: 0 0 0 .2rem rgba(46, 125, 91, .14);
}

.form-label {
    color: #36564a;
    font-size: .86rem;
    font-weight: 700;
    margin-bottom: .45rem;
}

.eyebrow {
    color: var(--green-700);
    display: block;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.brand-lockup {
    align-items: center;
    color: var(--ink);
    display: flex;
    gap: 12px;
}

.brand-logo {
    display: block;
    height: auto;
    max-height: 64px;
    max-width: 100%;
    width: 212px;
}

.brand-logo-auth {
    width: min(380px, 90vw);
}

.brand-logo-sidebar {
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .16));
    width: 204px;
}

.brand-lockup-auth {
    justify-content: center;
}

.brand-lockup:hover {
    color: var(--ink);
}

.brand-lockup > span:last-child {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-lockup strong {
    font-size: 1rem;
}

.brand-lockup small {
    color: var(--muted);
    font-size: .76rem;
    margin-top: 3px;
}

.brand-mark {
    align-items: center;
    background:
        radial-gradient(circle at 72% 24%, rgba(227, 190, 124, .78), transparent 10px),
        linear-gradient(145deg, #1f6a4d, #123d30);
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 14px 30px rgba(17, 62, 45, .2);
    color: #fff;
    display: inline-flex;
    font-size: .82rem;
    font-weight: 900;
    height: 44px;
    justify-content: center;
    letter-spacing: -.02em;
    width: 44px;
}

.brand-mark-logo {
    overflow: hidden;
    position: relative;
}

.brand-mark-logo::before {
    border: 3px solid #fff;
    border-bottom: 0;
    border-radius: 7px 7px 0 0;
    content: "";
    height: 16px;
    left: 12px;
    position: absolute;
    top: 10px;
    transform: rotate(45deg);
    width: 16px;
}

.brand-mark-logo::after {
    background: rgba(255, 255, 255, .95);
    border-radius: 3px;
    bottom: 10px;
    box-shadow: 8px 0 0 rgba(255, 255, 255, .72), 16px 0 0 rgba(255, 255, 255, .52);
    content: "";
    height: 12px;
    left: 10px;
    position: absolute;
    width: 4px;
}

.brand-mark-logo > span {
    background: #e3be7c;
    border-radius: 999px;
    height: 6px;
    position: absolute;
    right: 9px;
    top: 9px;
    width: 6px;
}

.auth-body {
    background:
        radial-gradient(circle at 12% 10%, rgba(142, 203, 177, .34), transparent 32rem),
        radial-gradient(circle at 90% 90%, rgba(227, 190, 124, .2), transparent 30rem),
        var(--canvas);
    min-height: 100vh;
    padding: max(28px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
}

.auth-shell {
    margin: 0 auto;
    max-width: 760px;
}

.auth-card {
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(211, 225, 219, .9);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    max-width: 500px;
    padding: clamp(24px, 5vw, 44px);
}

.auth-card-wide {
    max-width: 760px;
}

.auth-card h1 {
    font-size: clamp(1.9rem, 6vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -.045em;
    margin: .35rem 0 .7rem;
}

.stack-form {
    display: grid;
    gap: 18px;
}

.app-body {
    background: var(--canvas);
    min-height: 100vh;
}

.desktop-sidebar {
    display: none;
}

.app-shell {
    min-height: 100vh;
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
}

.mobile-header {
    align-items: center;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    padding: max(12px, env(safe-area-inset-top)) 18px 12px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.mobile-header small {
    color: var(--muted);
    display: block;
    font-size: .7rem;
}

.location-trigger {
    background: transparent;
    border: 0;
    color: var(--ink);
    font-size: .96rem;
    font-weight: 800;
    padding: 1px 0;
}

.user-avatar {
    align-items: center;
    background: var(--green-100);
    border-radius: 50%;
    color: var(--green-900);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .82rem;
    font-weight: 900;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.desktop-topbar {
    display: none;
}

.page-content {
    margin: 0 auto;
    max-width: 1280px;
    padding: 18px 16px 26px;
}

.mobile-page-title h1 {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -.035em;
    margin: 2px 0 18px;
}

.app-alert {
    border: 0;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.mobile-bottom-nav {
    align-items: center;
    background: rgba(255, 255, 255, .97);
    border-top: 1px solid var(--line);
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    left: 0;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    position: fixed;
    right: 0;
    z-index: 60;
}

.mobile-bottom-nav a {
    align-items: center;
    color: #71817b;
    display: flex;
    flex-direction: column;
    font-size: 1.28rem;
    font-weight: 800;
    gap: 1px;
    justify-content: center;
    min-height: 48px;
}

.mobile-bottom-nav a.active {
    color: var(--green-700);
}

.mobile-bottom-nav small {
    font-size: .64rem;
    font-weight: 700;
}

.mobile-bottom-nav .add-button {
    align-self: start;
    background: var(--green-700);
    border: 5px solid var(--canvas);
    border-radius: 50%;
    box-shadow: 0 7px 18px rgba(46, 125, 91, .26);
    color: #fff;
    font-size: 2rem;
    height: 58px;
    justify-self: center;
    margin-top: -25px;
    width: 58px;
}

.location-canvas {
    border-radius: 24px 24px 0 0;
    height: auto !important;
    max-height: 82vh;
}

.location-canvas .offcanvas-header,
.location-canvas .offcanvas-body {
    margin: 0 auto;
    max-width: 680px;
    width: 100%;
}

.location-canvas h2 {
    font-size: 1.45rem;
    font-weight: 800;
    margin: .2rem 0 0;
}

.location-options,
.location-list {
    display: grid;
    gap: 10px;
}

.location-option,
.location-card {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 15px;
    color: var(--ink);
    display: grid;
    gap: 12px;
    grid-template-columns: auto 1fr auto;
    min-height: 68px;
    padding: 10px 14px;
    text-align: left;
    width: 100%;
}

.location-option.selected,
.location-card:hover {
    background: var(--green-50);
    border-color: #a9cdbd;
}

.location-option span:nth-child(2),
.location-card span:nth-child(2) {
    display: flex;
    flex-direction: column;
}

.location-option small,
.location-card small {
    color: var(--muted);
    font-size: .75rem;
}

.location-icon {
    align-items: center;
    background: var(--green-100);
    border-radius: 12px;
    color: var(--green-800);
    display: inline-flex;
    font-size: 1.4rem;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.status-chip,
.count-badge {
    background: var(--green-100);
    border-radius: 999px;
    color: var(--green-900);
    font-size: .75rem;
    font-weight: 800;
    padding: 5px 9px;
}

.dashboard-hero {
    background:
        radial-gradient(circle at 86% 18%, rgba(227, 179, 77, .22), transparent 15rem),
        radial-gradient(circle at 8% 8%, rgba(143, 211, 167, .22), transparent 17rem),
        linear-gradient(135deg, #0b3f2d, #176144 52%, #0d4e37);
    border-radius: 30px;
    box-shadow: 0 22px 60px rgba(8, 38, 26, .17);
    color: #fff;
    display: grid;
    gap: 18px;
    margin-bottom: 16px;
    overflow: hidden;
    padding: 24px;
    position: relative;
}

.dashboard-hero::after {
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 28px;
    content: "";
    inset: 8px;
    pointer-events: none;
    position: absolute;
}

.dashboard-hero .eyebrow,
.dashboard-hero p {
    color: rgba(255, 255, 255, .78);
}

.dashboard-hero h1 {
    font-size: clamp(2rem, 6vw, 3.35rem);
    font-weight: 900;
    letter-spacing: -.065em;
    line-height: .98;
    margin: .45rem 0 .8rem;
    max-width: 820px;
}

.dashboard-hero p {
    font-size: 1.02rem;
    margin: 0;
    max-width: 690px;
}

.dashboard-hero-content,
.stock-health-card {
    position: relative;
    z-index: 1;
}

.hero-actions {
    justify-content: flex-start;
    margin-top: 20px;
}

.hero-actions .btn-light {
    background: rgba(255, 255, 255, .92);
    border-color: rgba(255, 255, 255, .92);
}

.stock-health-card {
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 24px;
    display: grid;
    gap: 8px;
    min-width: 190px;
    padding: 18px;
}

.stock-health-card span,
.stock-health-card small {
    color: rgba(255, 255, 255, .78);
    font-size: .78rem;
    font-weight: 800;
}

.stock-health-card strong {
    font-size: 2.35rem;
    letter-spacing: -.055em;
    line-height: 1;
}

.health-ring {
    background:
        linear-gradient(#fff, #fff) padding-box,
        conic-gradient(#e3b34d var(--score), rgba(255, 255, 255, .18) 0) border-box;
    border: 8px solid transparent;
    border-radius: 999px;
    height: 58px;
    width: 58px;
}

.smart-action-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.smart-action-card {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow-sm);
    color: var(--ink);
    display: grid;
    gap: 4px 13px;
    grid-template-columns: auto 1fr;
    padding: 15px;
}

.smart-action-card:hover {
    color: var(--ink);
    transform: translateY(-1px);
}

.smart-action-card.primary {
    background: linear-gradient(135deg, #fff, #f2fbf6);
    border-color: #bfe2d2;
}

.smart-action-card strong,
.smart-action-card small {
    grid-column: 2;
}

.smart-action-card small {
    color: var(--muted);
    font-size: .78rem;
}

.smart-action-icon {
    align-items: center;
    background: var(--green-100);
    border-radius: 15px;
    color: var(--green-800);
    display: inline-flex;
    font-weight: 900;
    grid-row: span 2;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.smart-action-card.primary .smart-action-icon {
    background: var(--green-900);
    color: #e3b34d;
}

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

.guidance-item {
    align-items: center;
    background: #f7faf8;
    border: 1px solid #e2ebe6;
    border-radius: 18px;
    color: var(--ink);
    display: grid;
    gap: 2px 12px;
    grid-template-columns: auto 1fr;
    padding: 13px;
}

.guidance-item:hover {
    color: var(--ink);
}

.guidance-item.active {
    background: #fff7e7;
    border-color: #f1d79c;
}

.guidance-item > span {
    align-items: center;
    background: #fff;
    border-radius: 50%;
    color: var(--green-900);
    display: inline-flex;
    font-size: .8rem;
    font-weight: 900;
    grid-row: span 2;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.guidance-item small {
    color: var(--muted);
    font-size: .76rem;
}

.dashboard-actions,
.section-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.desktop-add {
    display: none;
}

.metric-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 16px;
}

.metric-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    color: var(--ink);
    display: grid;
    min-height: 128px;
    padding: 15px;
}

.metric-card:hover {
    color: var(--ink);
    transform: translateY(-1px);
}

.metric-card strong {
    font-size: 1.75rem;
    letter-spacing: -.04em;
    line-height: 1;
    margin-top: 10px;
}

.metric-card small {
    color: var(--muted);
    font-size: .76rem;
}

.metric-icon {
    align-items: center;
    background: var(--green-100);
    border-radius: 11px;
    color: var(--green-800);
    display: flex;
    font-size: 1.05rem;
    font-weight: 900;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.metric-warning .metric-icon {
    background: var(--warning-bg);
    color: var(--warning);
}

.metric-accent .metric-icon {
    background: #e7ecfa;
    color: var(--blue);
}

.metric-neutral .metric-icon {
    background: #ecefed;
    color: #66736e;
}

.dashboard-grid,
.content-two-columns {
    display: grid;
    gap: 16px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 18px;
}

.section-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
}

.section-heading > div {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.section-heading > div .eyebrow {
    flex-basis: 100%;
}

.section-heading h2 {
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: -.025em;
    margin: 0;
}

.section-heading > a {
    font-size: .78rem;
    font-weight: 800;
}

.section-heading > small {
    color: var(--muted);
}

.category-chart {
    display: grid;
    gap: 14px;
}

.category-label {
    display: flex;
    font-size: .82rem;
    justify-content: space-between;
    margin-bottom: 6px;
}

.bar-track {
    background: #edf1ef;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.bar-track span {
    border-radius: inherit;
    display: block;
    height: 100%;
}

.alert-list,
.movement-list {
    display: grid;
}

.alert-row,
.movement-row {
    align-items: center;
    border-bottom: 1px solid #edf1ef;
    color: var(--ink);
    display: grid;
    gap: 11px;
    grid-template-columns: auto 1fr auto;
    padding: 12px 0;
}

.alert-row:last-child,
.movement-row:last-child {
    border-bottom: 0;
}

.alert-row > span:nth-child(2),
.movement-row > span:nth-child(2) {
    display: flex;
    flex-direction: column;
}

.alert-row small,
.movement-row small {
    color: var(--muted);
    font-size: .72rem;
}

.alert-dot {
    background: var(--warning);
    border-radius: 50%;
    height: 9px;
    width: 9px;
}

.severity-critical .alert-dot {
    background: var(--danger);
}

.severity-info .alert-dot {
    background: var(--blue);
}

.movement-icon {
    align-items: center;
    background: var(--green-100);
    border-radius: 50%;
    color: var(--green-800);
    display: inline-flex;
    font-size: 1.1rem;
    font-weight: 900;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.movement-icon.exit {
    background: var(--danger-bg);
    color: var(--danger);
}

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

.empty-state.compact {
    min-height: 180px;
    padding: 24px 12px;
}

.empty-state p {
    color: var(--muted);
    max-width: 440px;
}

.empty-illustration,
.success-state > span {
    align-items: center;
    background: var(--green-100);
    border-radius: 50%;
    color: var(--green-800);
    display: inline-flex;
    font-size: 2rem;
    height: 72px;
    justify-content: center;
    margin-bottom: 14px;
    width: 72px;
}

.toolbar-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-form {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    display: flex;
    flex: 1;
    gap: 9px;
    padding: 0 14px;
}

.search-form input {
    background: transparent;
    border: 0;
    height: 48px;
    min-width: 0;
    outline: none;
    width: 100%;
}

.inventory-grid {
    display: grid;
    gap: 12px;
}

.inventory-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 14px;
    grid-template-columns: 74px 1fr;
    padding: 14px;
}

.product-photo {
    align-items: center;
    align-self: start;
    aspect-ratio: 1;
    background: var(--green-100);
    border-radius: 15px;
    color: var(--green-800);
    display: flex;
    font-size: 1.8rem;
    font-weight: 900;
    justify-content: center;
    overflow: hidden;
}

.product-photo img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.product-tags {
    align-items: center;
    display: flex;
    gap: 8px;
    margin-bottom: 5px;
}

.product-tags span {
    background: color-mix(in srgb, var(--tag-color), white 86%);
    border-radius: 999px;
    color: var(--tag-color);
    font-size: .64rem;
    font-weight: 800;
    padding: 4px 7px;
}

.product-tags small {
    color: var(--muted);
    font-size: .67rem;
}

.product-main h2 {
    font-size: 1rem;
    font-weight: 800;
    margin: 0 0 7px;
}

.product-balance {
    align-items: baseline;
    display: flex;
    gap: 5px;
}

.product-balance strong {
    font-size: 1.35rem;
    letter-spacing: -.04em;
}

.product-balance span {
    color: var(--muted);
    font-size: .72rem;
}

.product-balance.warning strong {
    color: var(--warning);
}

.product-balance.danger strong {
    color: var(--danger);
}

.product-meta {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: .68rem;
    gap: 4px 12px;
    margin-top: 4px;
}

.consume-form {
    border-top: 1px solid #edf1ef;
    grid-column: 1 / -1;
    padding-top: 12px;
}

.consume-form label {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
}

.consume-form > div {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-top: 5px;
}

.inventory-add-btn {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    min-height: 48px;
}

.stock-actions {
    border-top: 1px solid #edf1ef;
    display: grid;
    gap: 12px;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 12px;
}

.quantity-action {
    min-width: 0;
}

.quantity-action label {
    color: var(--muted);
    display: block;
    font-size: .72rem;
    font-weight: 700;
    min-height: 1.1rem;
}

.quantity-action > div {
    align-items: center;
    display: grid;
    gap: 6px;
    grid-template-columns: 54px minmax(115px, 1fr);
    margin-top: 5px;
}

.quantity-action .form-control {
    height: 46px;
    min-height: 46px;
    min-width: 54px;
    padding-left: 6px;
    padding-right: 6px;
    text-align: center;
}

.quantity-action .btn {
    font-size: .9rem;
    height: 46px;
    justify-content: center;
    min-height: 46px;
    min-width: 115px;
    padding-left: 8px;
    padding-right: 8px;
    white-space: nowrap;
    width: 100%;
}

.quantity-add {
    background: var(--green-50);
    border-radius: 12px;
    padding: 10px;
}

.quantity-consume {
    padding: 10px 0;
}

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

.location-row > form:first-child {
    min-width: 0;
}

.location-delete {
    min-height: 48px;
}

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

.user-card {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 15px;
    display: grid;
    gap: 10px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 12px;
}

.user-card > span:nth-child(2) {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-card > span:nth-child(2) small {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-admin-actions,
.user-delete-form {
    grid-column: 1 / -1;
}

.user-admin-actions {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 12px;
    padding-top: 12px;
}

.user-edit-form,
.user-password-form {
    align-items: end;
    display: grid;
    gap: 10px;
}

.user-edit-form .form-label,
.user-password-form .form-label {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.user-role {
    background: #edf1ef;
    border-radius: 999px;
    color: #51665e;
    font-size: .68rem;
    font-weight: 800;
    padding: 5px 8px;
}

.user-role.role-master {
    background: var(--green-100);
    color: var(--green-900);
}

.user-privacy-status {
    color: var(--muted);
    grid-column: 2 / -1;
}

.user-delete-form {
    grid-column: 2 / -1;
}

.user-delete-form .btn {
    min-height: 40px;
}

.privacy-note,
.license-note {
    background: var(--green-50);
    border: 1px solid #cfe3da;
    border-radius: 14px;
    margin-bottom: 18px;
    padding: 14px;
}

.privacy-note p {
    color: var(--muted);
    font-size: .82rem;
    margin: 4px 0 0;
}

.privacy-delete-note {
    background: #fff8e8;
    border: 1px solid #ead9a6;
    border-radius: 14px;
    margin-top: 18px;
    padding: 14px;
}

.privacy-delete-note p {
    color: var(--muted);
    font-size: .82rem;
    margin: 4px 0 0;
}

.product-form {
    display: grid;
    gap: 14px;
    margin: 0 auto;
    max-width: 940px;
}

.assistant-product-form {
    gap: 16px;
}

.assistant-hero {
    align-items: center;
    background:
        radial-gradient(circle at 10% 0, rgba(142, 203, 177, .34), transparent 18rem),
        linear-gradient(135deg, #ffffff, #f4faf7);
    display: grid;
    gap: 16px;
}

.assistant-hero h2 {
    font-size: clamp(1.45rem, 4.8vw, 2.2rem);
    font-weight: 900;
    letter-spacing: -.045em;
    margin: .25rem 0 .45rem;
}

.assistant-hero p {
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.5;
    margin: 0;
    max-width: 700px;
}

.assistant-summary {
    background: #123d30;
    border-radius: 18px;
    color: #fff;
    display: grid;
    gap: 3px;
    padding: 14px 16px;
}

.assistant-summary span {
    color: #a8d3c0;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.assistant-summary strong {
    font-size: .98rem;
}

.entry-assistant {
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 5px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 7px;
    position: sticky;
    top: 8px;
    z-index: 30;
}

.entry-assistant button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 15px;
    color: #6e7f78;
    display: flex;
    flex-direction: column;
    font-weight: 800;
    gap: 3px;
    min-height: 56px;
    padding: 7px 2px;
}

.entry-assistant button span {
    align-items: center;
    background: #eef4f1;
    border-radius: 50%;
    display: inline-flex;
    font-size: .72rem;
    height: 24px;
    justify-content: center;
    width: 24px;
}

.entry-assistant button small {
    font-size: .64rem;
}

.entry-assistant button.active {
    background: var(--green-50);
    color: var(--green-900);
}

.entry-assistant button.active span,
.entry-assistant button.complete span {
    background: var(--green-700);
    color: #fff;
}

.entry-assistant button.complete {
    color: var(--green-700);
}

.assistant-step[hidden] {
    display: none;
}

.form-section {
    padding: clamp(18px, 4vw, 28px);
}

.step-number {
    align-items: center;
    background: var(--green-700);
    border-radius: 50%;
    color: white;
    display: inline-flex;
    font-size: .78rem;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.photo-picker {
    align-items: center;
    background: var(--green-50);
    border: 1.5px dashed #91bca9;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 165px;
    overflow: hidden;
    padding: 22px;
    position: relative;
    text-align: center;
}

.photo-picker small {
    color: var(--muted);
    margin-top: 4px;
}

.camera-symbol {
    color: var(--green-700);
    font-size: 2.4rem;
    line-height: 1;
    margin-bottom: 8px;
}

.photo-picker img {
    height: 100%;
    inset: 0;
    object-fit: cover;
    position: absolute;
    width: 100%;
}

.recognition-explainer {
    align-items: flex-start;
    background: #f5f8ff;
    border: 1px solid #d9e2f4;
    border-radius: var(--radius-sm);
    display: flex;
    gap: 12px;
    margin-top: 14px;
    padding: 14px;
}

.recognition-icon {
    align-items: center;
    background: #e3ebfb;
    border-radius: 11px;
    color: var(--blue);
    display: inline-flex;
    flex: 0 0 36px;
    font-size: 1.35rem;
    font-weight: 900;
    height: 36px;
    justify-content: center;
}

.recognition-explainer strong {
    display: block;
    font-size: .88rem;
}

.recognition-explainer p,
.manual-confirmation-note p {
    color: var(--muted);
    font-size: .8rem;
    line-height: 1.45;
    margin: 3px 0 0;
}

.recognition-actions {
    display: grid;
    gap: 9px;
    grid-template-columns: 1fr;
    margin-top: 12px;
}

.recognition-actions .btn {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-height: 48px;
}

.barcode-entry {
    align-items: end;
    display: grid;
    gap: 9px;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-top: 15px;
}

.barcode-entry .btn {
    min-height: 48px;
}

.barcode-entry-wide {
    margin-top: 0;
}

.assistant-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
}

.assistant-actions .btn {
    min-height: 46px;
}

.assistant-tip {
    background: #f5f8ff;
    border: 1px solid #d9e2f4;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    padding: 14px;
}

.assistant-tip strong {
    display: block;
    font-size: .9rem;
}

.assistant-tip p {
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.45;
    margin: 4px 0 0;
}

.validity-grid {
    display: grid;
    gap: 15px;
}

.validity-main {
    background: var(--green-50);
    border: 1px solid #cfe3da;
    border-radius: var(--radius-sm);
    padding: 16px;
}

.quick-options {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 12px;
}

.quick-option {
    background: #fff;
    border: 1px solid #cbdcd4;
    border-radius: 999px;
    color: var(--green-700);
    font-size: .78rem;
    font-weight: 800;
    padding: 9px 12px;
}

.quick-option:hover,
.quick-option.selected {
    background: var(--green-700);
    border-color: var(--green-700);
    color: #fff;
}

.advanced-details {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px;
}

.advanced-details summary {
    color: var(--green-700);
    cursor: pointer;
    font-weight: 800;
}

.recognition-reader {
    height: 480px;
    left: -10000px;
    overflow: hidden;
    pointer-events: none;
    position: fixed;
    top: 0;
    width: 640px;
}

.live-barcode-reader,
.market-live-reader {
    background: #10291f;
    border: 1px solid #264d3d;
    border-radius: var(--radius-sm);
    margin-top: 14px;
    overflow: hidden;
    padding: 10px;
}

.live-barcode-reader[hidden],
.market-live-reader[hidden] {
    display: none;
}

.live-barcode-reader video,
.market-live-reader video {
    border-radius: 10px;
    display: block;
    max-height: 320px;
    object-fit: cover;
    width: 100%;
}

.live-barcode-reader-actions {
    align-items: center;
    color: #e5f7ed;
    display: flex;
    font-size: .85rem;
    gap: 12px;
    justify-content: space-between;
    padding: 10px 4px 2px;
}

.recognition-status,
.recognition-result {
    border-radius: var(--radius-sm);
    margin-top: 14px;
    padding: 14px;
}

.recognition-status {
    background: var(--green-50);
    border: 1px solid #cfe3da;
}

.recognition-status-line {
    align-items: center;
    display: grid;
    font-size: .8rem;
    gap: 8px;
    grid-template-columns: auto 1fr auto;
}

.recognition-spinner {
    animation: recognition-spin .8s linear infinite;
    border: 2px solid #b7d6c8;
    border-radius: 50%;
    border-top-color: var(--green-700);
    height: 18px;
    width: 18px;
}

.recognition-progress-track {
    background: #dcebe4;
    border-radius: 999px;
    height: 6px;
    margin-top: 10px;
    overflow: hidden;
}

.recognition-progress-track span {
    background: var(--green-700);
    border-radius: inherit;
    display: block;
    height: 100%;
    transition: width .2s ease;
    width: 0;
}

.recognition-result {
    background: #f7fbf8;
    border: 1px solid #bcd8ca;
}

.recognition-result.is-error {
    background: var(--danger-bg);
    border-color: #edc4c0;
}

.recognition-result-heading {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
}

.recognition-result-heading > div {
    display: grid;
    gap: 2px;
}

.recognition-result-heading .eyebrow {
    color: var(--green-700);
    font-size: .66rem;
}

.confirmation-badge {
    background: #fff3cd;
    border: 1px solid #ead28a;
    border-radius: 999px;
    color: #76580a;
    font-size: .66rem;
    font-weight: 800;
    padding: 5px 9px;
}

.recognition-suggestions {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.recognition-choice {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    display: grid;
    gap: 2px;
    padding: 11px 12px;
    text-align: left;
    width: 100%;
}

.recognition-choice:hover,
.recognition-choice:focus-visible,
.recognition-choice.selected {
    border-color: var(--green-700);
    box-shadow: 0 0 0 3px rgba(24, 79, 58, .09);
}

.recognition-choice.selected {
    background: var(--green-50);
}

.recognition-choice span {
    font-size: .86rem;
    font-weight: 800;
}

.recognition-choice small {
    color: var(--muted);
    font-size: .7rem;
}

.recognition-external-card {
    background: #fff;
    border: 1px solid var(--green-700);
    border-radius: 12px;
    box-shadow: 0 0 0 3px rgba(24, 79, 58, .07);
    display: grid;
    gap: 3px;
    padding: 12px;
}

.recognition-external-card strong {
    font-size: .9rem;
}

.recognition-external-card small {
    color: var(--muted);
    font-size: .72rem;
}

.recognition-result > .btn {
    margin-top: 11px;
}

.ocr-details {
    border-top: 1px solid #dbe8e1;
    margin-top: 13px;
    padding-top: 11px;
}

.ocr-details summary {
    color: var(--green-700);
    cursor: pointer;
    font-size: .78rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.manual-confirmation-note {
    background: #fff8e8;
    border: 1px solid #ead9a6;
    border-radius: 13px;
    margin-bottom: 16px;
    padding: 13px;
}

.manual-confirmation-note strong {
    font-size: .84rem;
}

@keyframes recognition-spin {
    to {
        transform: rotate(360deg);
    }
}

.new-product-toggle {
    background: transparent;
    border: 0;
    color: var(--green-700);
    font-size: .84rem;
    font-weight: 800;
    padding: 2px;
    text-align: left;
}

.new-product-fields {
    background: var(--green-50);
    border: 1px solid #cfe3da;
    border-radius: var(--radius-sm);
    display: grid;
    gap: 15px;
    padding: 16px;
}

.new-product-fields[hidden] {
    display: none;
}

.sticky-submit {
    background: rgba(245, 247, 245, .94);
    bottom: calc(73px + env(safe-area-inset-bottom));
    display: flex;
    padding: 8px 0;
    position: sticky;
    z-index: 20;
}

.sticky-submit .btn {
    flex: 1;
}

.shopping-list {
    display: grid;
}

.market-hero {
    align-items: center;
    background:
        radial-gradient(circle at 12% 0, rgba(227, 190, 124, .25), transparent 18rem),
        linear-gradient(135deg, #123d30, #1f6a4d);
    color: #fff;
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.market-hero .eyebrow,
.market-hero p {
    color: #bfe5d4;
}

.market-hero h2 {
    font-size: clamp(1.7rem, 7vw, 2.7rem);
    font-weight: 900;
    letter-spacing: -.05em;
    margin: .2rem 0 .4rem;
}

.market-hero p {
    margin: 0;
    max-width: 620px;
}

.market-layout {
    align-items: start;
}

.market-scanner-card,
.market-cart-card {
    overflow: hidden;
}

.market-search-grid {
    display: grid;
    gap: 14px;
}

.market-barcode-box {
    background: #f5f8ff;
    border: 1px solid #d9e2f4;
    border-radius: var(--radius-sm);
    display: grid;
    gap: 10px;
    margin-top: 16px;
    padding: 14px;
}

.market-help {
    color: var(--muted);
    font-size: .8rem;
    line-height: 1.45;
    margin: 10px 0 0;
}

.market-cart-empty {
    align-items: center;
    background: var(--green-50);
    border: 1px dashed #a9ccb9;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    min-height: 180px;
    justify-content: center;
    padding: 24px;
    text-align: center;
}

.market-cart-empty[hidden] {
    display: none;
}

.market-cart-empty span {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 8px;
}

.market-cart-empty p {
    color: var(--muted);
    font-size: .82rem;
    margin: 4px 0 0;
}

.market-cart-list {
    display: grid;
    gap: 9px;
}

.market-cart-item {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
}

.market-cart-item > span {
    display: grid;
    min-width: 0;
}

.market-cart-item strong {
    font-size: .92rem;
}

.market-cart-item small {
    color: var(--muted);
}

.market-cart-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.market-cart-actions button {
    background: #f7faf8;
    border: 1px solid #dce9e2;
    border-radius: 999px;
    color: var(--green-700);
    font-size: .78rem;
    font-weight: 800;
    min-height: 36px;
    padding: 6px 12px;
}

.market-finish-form {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
}

.market-finish-actions {
    display: grid;
    gap: 10px;
}

.shopping-item {
    align-items: center;
    border-bottom: 1px solid #edf1ef;
    display: grid;
    gap: 11px;
    grid-template-columns: auto 1fr auto;
    padding: 12px 0;
}

.shopping-item:last-child {
    border-bottom: 0;
}

.shopping-check {
    background: #fff;
    border: 2px solid #aac7ba;
    border-radius: 8px;
    color: #fff;
    font-weight: 900;
    height: 28px;
    width: 28px;
}

.shopping-item > span {
    display: flex;
    flex-direction: column;
}

.shopping-item small {
    color: var(--muted);
    font-size: .7rem;
}

.shopping-item > strong {
    font-size: .82rem;
}

.shopping-item.purchased {
    opacity: .58;
}

.shopping-item.purchased .shopping-check {
    background: var(--green-700);
    border-color: var(--green-700);
}

.shopping-item.purchased strong {
    text-decoration: line-through;
}

.alerts-page-list {
    display: grid;
    gap: 10px;
}

.alert-card {
    align-items: start;
    background: #fffaf1;
    border: 1px solid #f0dab6;
    border-radius: 15px;
    display: grid;
    gap: 12px;
    grid-template-columns: auto 1fr;
    padding: 15px;
}

.alert-card.severity-critical {
    background: #fff6f6;
    border-color: #efc5c5;
}

.alert-card.severity-info {
    background: #f4f8fd;
    border-color: #cad9eb;
}

.alert-symbol {
    align-items: center;
    background: var(--warning-bg);
    border-radius: 50%;
    color: var(--warning);
    display: flex;
    font-weight: 900;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.severity-critical .alert-symbol {
    background: var(--danger-bg);
    color: var(--danger);
}

.severity-info .alert-symbol {
    background: #e5eef9;
    color: var(--blue);
}

.alert-title-row {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.alert-title-row span {
    color: var(--muted);
    font-size: .68rem;
    text-transform: uppercase;
}

.alert-card p {
    color: #51665e;
    font-size: .86rem;
    margin: 4px 0;
}

.alert-card small {
    color: var(--muted);
}

@media (min-width: 760px) {
    .market-hero {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .market-search-grid {
        grid-template-columns: minmax(0, 1fr) 150px;
    }

    .market-search-grid > div:first-child,
    .market-search-grid > div:nth-child(2) {
        grid-column: 1 / -1;
    }

    .market-barcode-box {
        align-items: end;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .market-cart-item {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .market-finish-actions {
        grid-template-columns: auto 1fr;
    }

    .assistant-hero {
        grid-template-columns: minmax(0, 1fr) 240px;
    }

    .assistant-actions .btn {
        min-width: 170px;
    }

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

    .auth-body {
        align-items: center;
        display: flex;
    }

    .auth-shell {
        width: 100%;
    }

    .metric-grid {
        gap: 14px;
        grid-template-columns: repeat(4, 1fr);
    }

    .dashboard-hero {
        align-items: end;
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 34px;
    }

    .smart-action-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .panel-wide {
        grid-column: 1 / -1;
    }

    .content-two-columns {
        align-items: start;
        grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr);
    }

    .user-edit-form,
    .user-password-form {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    }

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

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

    .desktop-add {
        display: inline-flex;
    }
}

@media (min-width: 1060px) {
    .desktop-sidebar {
        background: var(--green-950);
        bottom: 0;
        color: #fff;
        display: flex;
        flex-direction: column;
        left: 0;
        padding: 28px 18px;
        position: fixed;
        top: 0;
        width: 244px;
        z-index: 80;
    }

    .sidebar-brand,
    .sidebar-brand:hover {
        color: #fff;
        padding: 0 8px;
    }

    .sidebar-brand small {
        color: #9bc2b1;
    }

    .sidebar-nav {
        display: grid;
        gap: 7px;
        margin-top: 42px;
    }

    .sidebar-nav a {
        align-items: center;
        border-radius: 12px;
        color: #b8d0c6;
        display: flex;
        font-size: .9rem;
        font-weight: 700;
        gap: 12px;
        min-height: 48px;
        padding: 0 13px;
    }

    .sidebar-nav a span {
        font-size: 1.2rem;
        width: 22px;
    }

    .sidebar-nav a:hover,
    .sidebar-nav a.active {
        background: rgba(255, 255, 255, .1);
        color: #fff;
    }

    .sidebar-user {
        align-items: center;
        border-top: 1px solid rgba(255, 255, 255, .12);
        display: flex;
        gap: 10px;
        margin-top: auto;
        padding: 18px 5px 8px;
    }

    .sidebar-user > span:last-child {
        display: flex;
        min-width: 0;
        flex-direction: column;
    }

    .sidebar-user strong,
    .sidebar-user small {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sidebar-user strong {
        font-size: .8rem;
    }

    .sidebar-user small {
        color: #9bc2b1;
        font-size: .65rem;
    }

    .sidebar-logout {
        color: #9bc2b1;
        font-size: .72rem;
        min-height: auto;
        padding: 7px 5px;
    }

    .app-shell {
        margin-left: 244px;
        padding-bottom: 0;
    }

    .mobile-header,
    .mobile-bottom-nav,
    .mobile-page-title {
        display: none;
    }

    .desktop-topbar {
        align-items: center;
        background: rgba(245, 247, 245, .92);
        display: flex;
        justify-content: space-between;
        margin: 0 auto;
        max-width: 1280px;
        padding: 26px 34px 0;
    }

    .desktop-topbar h1 {
        font-size: 1.7rem;
        font-weight: 800;
        letter-spacing: -.04em;
        margin: .2rem 0 0;
    }

    .location-button {
        border: 1px solid var(--line);
    }

    .page-content {
        padding: 24px 34px 44px;
    }

    .metric-card {
        min-height: 145px;
        padding: 19px;
    }

    .metric-card strong {
        font-size: 2.1rem;
    }

    .panel {
        padding: 22px;
    }

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

    .sticky-submit {
        bottom: 0;
        justify-content: end;
    }

    .sticky-submit .btn {
        flex: 0 0 260px;
    }
}

@media (min-width: 1060px) and (max-width: 1420px) {
    .inventory-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1421px) {
    .inventory-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px), (orientation: landscape) and (max-height: 620px) {
    .app-shell {
        padding-bottom: calc(118px + env(safe-area-inset-bottom));
    }

    .page-content {
        padding-bottom: 104px;
    }

    .mobile-bottom-nav .add-button {
        border-width: 3px;
        font-size: 1.55rem;
        height: 48px;
        margin-top: 0;
        width: 48px;
    }

    .stock-actions {
        grid-template-columns: 1fr;
    }

    .quantity-action > div {
        grid-template-columns: minmax(72px, 104px) minmax(130px, 1fr);
    }

    .quantity-consume {
        padding: 0;
    }
}

@media (orientation: landscape) and (max-height: 620px) {
    .app-shell {
        padding-bottom: 0;
    }

    .page-content {
        padding-bottom: 34px;
    }

    .mobile-bottom-nav {
        display: none;
    }
}

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