:root {
    --forest-950: #0d251d;
    --forest-900: #173d30;
    --forest-800: #20523f;
    --forest-700: #2d6650;
    --gold-600: #aa7721;
    --gold-500: #c59232;
    --gold-100: #fbf0d7;
    --canvas: #f5f4ef;
    --surface: #ffffff;
    --surface-soft: #faf9f5;
    --ink: #1d2b26;
    --ink-soft: #53615c;
    --muted: #8a9691;
    --line: #e6e9e4;
    --line-strong: #d9dfd9;
    --success: #238456;
    --success-soft: #e7f5ec;
    --danger: #bd4b4b;
    --danger-soft: #fbeceb;
    --warning: #a87013;
    --warning-soft: #fff4dc;
    --blue: #357b91;
    --blue-soft: #e7f3f7;
    --shadow: 0 16px 34px rgba(18, 46, 36, 0.07);
    --shadow-lg: 0 24px 70px rgba(9, 36, 27, 0.18);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

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

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

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

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

button {
    border: 0;
}

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

h1,
h2,
h3,
strong {
    letter-spacing: -0.02em;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    position: fixed;
    z-index: 20;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: 260px;
    padding: 24px 16px 18px;
    color: rgba(255, 255, 255, 0.78);
    background:
        radial-gradient(circle at 0% 0%, rgba(222, 180, 88, 0.19), transparent 28%),
        linear-gradient(160deg, var(--forest-900), var(--forest-950));
}

.sidebar::after {
    position: absolute;
    right: -54px;
    bottom: -58px;
    width: 180px;
    height: 180px;
    border: 1px solid rgba(221, 187, 104, 0.2);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: #fff;
}

.brand > span:last-child {
    display: grid;
    gap: 1px;
}

.brand strong {
    font-size: 15px;
    font-weight: 750;
    line-height: 1.1;
}

.brand small {
    color: #d6ad5f;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.brand-mark {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(235, 209, 148, 0.55);
    border-radius: 12px;
    color: #f3d58e;
    font-family: Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

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

.side-nav {
    margin-top: 52px;
}

.nav-label {
    margin: 0 11px 12px;
    color: rgba(255, 255, 255, 0.43);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 48px;
    margin: 3px 0;
    padding: 0 12px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 14px;
    font-weight: 600;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
    color: #fff;
    background: rgba(222, 181, 91, 0.17);
    box-shadow: inset 2px 0 0 #e0b55e;
}

.nav-icon {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
}

.sidebar-bottom {
    z-index: 1;
    margin-top: auto;
    padding: 16px 8px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-brief,
.employee-cell,
.sale-owner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-name {
    display: grid;
    min-width: 0;
    gap: 1px;
}

.profile-name strong {
    overflow: hidden;
    color: #fff;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-name small {
    color: rgba(255, 255, 255, 0.54);
    font-size: 11px;
}

.avatar {
    display: inline-grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    overflow: hidden;
    border: 1px solid #e6c477;
    border-radius: 50%;
    background: #f6e7bd;
    color: var(--forest-900);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
}

.avatar-small {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    border-color: #d7e1da;
    background: #eef3ef;
    color: var(--forest-800);
    font-size: 11px;
}

.logout-button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 16px;
    padding: 8px 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.57);
    cursor: pointer;
    font-size: 12px;
    font-weight: 650;
    text-align: left;
}

.logout-button:hover {
    color: #fff;
}

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

.main-content {
    width: calc(100% - 260px);
    min-height: 100vh;
    margin-left: 260px;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 128px;
    padding: 33px clamp(24px, 4vw, 64px) 22px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.68);
}

.topbar h1 {
    margin: 2px 0 2px;
    color: var(--ink);
    font-size: clamp(24px, 2.4vw, 32px);
    font-weight: 760;
    line-height: 1.18;
}

.eyebrow {
    margin: 0;
    color: var(--gold-600);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.page-subtitle {
    margin: 0;
    color: var(--ink-soft);
    font-size: 13px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    padding-top: 11px;
}

.desktop-greeting {
    color: var(--ink-soft);
    font-size: 13px;
    white-space: nowrap;
}

.page-content {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 32px clamp(24px, 4vw, 64px) 50px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 43px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 750;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

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

.button:focus-visible,
.icon-button:focus-visible,
.table-action:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(197, 146, 50, 0.28);
    outline-offset: 2px;
}

.button-primary {
    background: var(--forest-900);
    box-shadow: 0 7px 16px rgba(23, 61, 48, 0.2);
    color: #fff;
}

.button-primary:hover {
    background: var(--forest-800);
    box-shadow: 0 9px 18px rgba(23, 61, 48, 0.28);
}

.button-secondary {
    border-color: var(--line-strong);
    background: var(--surface);
    color: var(--forest-900);
}

.button-secondary:hover {
    border-color: #bfcabf;
    background: #f8faf8;
}

.button-compact {
    min-height: 38px;
    padding: 0 13px;
    font-size: 12px;
}

.button-full {
    width: 100%;
}

.icon-button {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.alert {
    display: flex;
    align-items: center;
    min-height: 48px;
    margin: 0 0 21px;
    padding: 12px 15px;
    border: 1px solid;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.alert-success {
    border-color: #b8e1c7;
    background: var(--success-soft);
    color: #176642;
}

.alert-error {
    border-color: #f0c4c1;
    background: var(--danger-soft);
    color: #973838;
}

.info-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 13px 16px;
    border: 1px solid #d5e8dc;
    border-radius: 13px;
    background: #f3faf5;
    color: #356150;
    font-size: 13px;
}

.info-banner strong {
    color: var(--forest-800);
}

.info-banner-icon {
    display: inline-grid;
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    place-items: center;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

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

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

.stat-grid-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 0;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    min-height: 122px;
    padding: 19px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: 0 4px 12px rgba(18, 46, 36, 0.025);
}

.stat-card p,
.stat-card small {
    display: block;
    margin: 0;
    color: var(--ink-soft);
    font-size: 11px;
}

.stat-card p {
    margin-bottom: 2px;
    font-weight: 650;
}

.stat-card strong {
    display: block;
    overflow: hidden;
    margin: 1px 0;
    color: var(--ink);
    font-size: clamp(18px, 1.8vw, 24px);
    font-weight: 780;
    letter-spacing: -0.04em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-card-forest {
    border-color: var(--forest-900);
    background: linear-gradient(135deg, var(--forest-900), #1d4c3b);
}

.stat-card-forest p,
.stat-card-forest small {
    color: rgba(255, 255, 255, 0.62);
}

.stat-card-forest strong {
    color: #fff;
}

.stat-icon {
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 13px;
    background: #eaf2ed;
    color: var(--forest-800);
    font-size: 14px;
    font-weight: 800;
}

.stat-card-forest .stat-icon {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.12);
    color: #efcc7d;
}

.stat-icon-gold {
    background: var(--gold-100);
    color: var(--gold-600);
}

.stat-icon-blue {
    background: var(--blue-soft);
    color: var(--blue);
}

.stat-icon-red {
    background: var(--danger-soft);
    color: var(--danger);
}

.stat-icon-green {
    background: var(--success-soft);
    color: var(--success);
}

.content-grid {
    display: grid;
    gap: 20px;
}

.dashboard-grid {
    grid-template-columns: minmax(0, 2.05fr) minmax(265px, 0.95fr);
    align-items: start;
}

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

.recent-sales-panel,
.low-stock-panel {
    padding: 23px;
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 19px;
}

.section-header h2 {
    margin: 3px 0 0;
    color: var(--ink);
    font-size: 17px;
    font-weight: 760;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding-top: 7px;
    color: var(--forest-800);
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.text-link:hover {
    color: var(--gold-600);
}

.text-link span {
    font-size: 16px;
    line-height: 0;
}

.sale-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.sale-card {
    display: flex;
    min-width: 0;
    min-height: 202px;
    flex-direction: column;
    padding: 14px;
    border: 1px solid #e4e9e5;
    border-radius: 13px;
    background: linear-gradient(180deg, #fff, #fcfdfb);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.sale-card:hover {
    border-color: #cbd8ce;
    box-shadow: 0 9px 20px rgba(20, 61, 45, 0.08);
    transform: translateY(-2px);
}

.sale-card-top,
.sale-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sale-card-top {
    margin-bottom: 12px;
}

.sale-code {
    color: var(--forest-800);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.payment-pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 3px 7px;
    border-radius: 999px;
    background: #edf2ee;
    color: #426154;
    font-size: 10px;
    font-weight: 750;
    white-space: nowrap;
}

.sale-card-person {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 9px 0;
    border-top: 1px solid #eff2ef;
    border-bottom: 1px solid #eff2ef;
}

.sale-card-person div {
    display: grid;
    min-width: 0;
}

.sale-card small,
.sale-card-product small {
    color: var(--muted);
    font-size: 10px;
}

.sale-card-person strong,
.sale-card-product strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 12px;
    font-weight: 730;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sale-card-product {
    display: grid;
    min-width: 0;
    gap: 1px;
    padding: 12px 0;
}

.sale-card-bottom {
    margin-top: auto;
    color: var(--muted);
    font-size: 10px;
}

.sale-card-bottom strong {
    color: var(--forest-800);
    font-size: 13px;
    font-weight: 780;
}

.stock-alert-list {
    display: grid;
}

.stock-alert-item {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 13px 0;
    border-bottom: 1px solid #edf0ed;
}

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

.stock-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 0 0 4px var(--danger-soft);
}

.stock-alert-item div {
    display: grid;
    min-width: 0;
}

.stock-alert-item strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 12px;
    font-weight: 720;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stock-alert-item small {
    color: var(--muted);
    font-size: 10px;
}

.stock-alert-item > span:last-child {
    color: var(--ink-soft);
    font-size: 11px;
    white-space: nowrap;
}

.stock-alert-item b {
    color: var(--danger);
    font-size: 13px;
}

.quiet-state {
    display: grid;
    min-height: 170px;
    place-content: center;
    justify-items: center;
    gap: 10px;
    color: var(--ink-soft);
    text-align: center;
}

.quiet-state span {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    background: var(--success-soft);
    color: var(--success);
    font-weight: 800;
}

.quiet-state p {
    max-width: 180px;
    margin: 0;
    font-size: 12px;
}

.empty-state {
    display: grid;
    min-height: 255px;
    place-content: center;
    justify-items: center;
    padding: 25px;
    color: var(--ink-soft);
    text-align: center;
}

.empty-state.compact {
    min-height: 200px;
}

.empty-icon {
    display: grid;
    width: 45px;
    height: 45px;
    place-items: center;
    margin-bottom: 11px;
    border-radius: 50%;
    background: #edf3ee;
    color: var(--forest-700);
    font-size: 18px;
    font-weight: 750;
}

.empty-state h3 {
    margin: 0 0 5px;
    color: var(--ink);
    font-size: 15px;
}

.empty-state p {
    max-width: 360px;
    margin: 0 0 17px;
    font-size: 12px;
}

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

.mini-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    color: var(--ink-soft);
    font-size: 12px;
}

.mini-stats b {
    color: var(--forest-800);
    font-weight: 780;
}

.table-panel {
    overflow: hidden;
    padding: 0;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 17px 19px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
}

.search-field {
    display: flex;
    min-width: 240px;
    flex: 1;
    align-items: center;
    gap: 7px;
    padding: 0 11px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: var(--surface);
    color: var(--muted);
}

.search-field:focus-within {
    border-color: #9eb4a5;
}

.search-field input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
}

.filter-bar select {
    max-width: 175px;
}

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

table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
    font-size: 12px;
}

thead {
    background: #fbfcfa;
}

th {
    padding: 13px 18px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-align: left;
    text-transform: uppercase;
}

td {
    padding: 14px 18px;
    border-bottom: 1px solid #edf0ed;
    color: var(--ink-soft);
    vertical-align: middle;
}

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

tbody tr:hover {
    background: #fcfdfb;
}

.align-right {
    text-align: right;
}

.table-primary {
    display: grid;
    gap: 2px;
}

.table-primary strong {
    color: var(--ink);
    font-size: 12px;
    font-weight: 730;
}

.table-primary small,
.products-cell small {
    color: var(--muted);
    font-size: 10px;
}

.muted {
    color: var(--muted);
    font-size: 11px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 780;
    white-space: nowrap;
}

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

.badge-warning {
    background: var(--warning-soft);
    color: var(--warning);
}

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

.badge-neutral {
    background: #edf0ed;
    color: #66736d;
}

.badge-admin {
    background: #e5eef1;
    color: #276079;
}

.badge-manager {
    background: var(--gold-100);
    color: #8a5a0b;
}

.badge-employee {
    background: #edf3ee;
    color: var(--forest-700);
}

.action-cell {
    white-space: nowrap;
}

.table-action {
    display: inline-block;
    margin-left: 13px;
    border: 0;
    background: transparent;
    color: var(--forest-800);
    cursor: pointer;
    font-size: 11px;
    font-weight: 760;
}

.table-action:first-child {
    margin-left: 0;
}

.table-action:hover {
    color: var(--gold-600);
}

.danger-link {
    color: var(--danger);
}

.inline-form {
    display: inline;
}

.form-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 21px;
}

.back-link {
    display: inline-block;
    margin-bottom: 11px;
    color: var(--forest-800);
    font-size: 12px;
    font-weight: 720;
}

.back-link:hover {
    color: var(--gold-600);
}

.form-page-head h2 {
    margin: 0 0 4px;
    color: var(--ink);
    font-size: 23px;
    font-weight: 770;
}

.form-page-head p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 13px;
}

.stock-display {
    display: grid;
    gap: 2px;
    min-width: 132px;
    padding: 10px 14px;
    border: 1px solid #dbe5dc;
    border-radius: 11px;
    background: #f5faf6;
    color: var(--ink-soft);
    font-size: 11px;
}

.stock-display strong {
    color: var(--forest-800);
    font-size: 16px;
}

.form-panel {
    padding: 25px;
}

.narrow-form {
    max-width: 760px;
}

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

.field {
    display: grid;
    gap: 7px;
    min-width: 0;
    color: var(--ink);
    font-size: 12px;
    font-weight: 690;
}

.field > span {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.field em {
    color: var(--muted);
    font-size: 10px;
    font-style: normal;
    font-weight: 500;
}

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

.field input,
.field select,
.field textarea,
.filter-bar select {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    outline: 0;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
    font-weight: 500;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

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

.field input::placeholder,
.field textarea::placeholder {
    color: #a3ada8;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.filter-bar select:focus {
    border-color: #87a893;
    box-shadow: 0 0 0 3px rgba(45, 102, 80, 0.1);
}

.field small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.35;
}

.hint-field {
    align-content: start;
}

.hint-field p {
    margin: 0;
    padding: 10px 11px;
    border: 1px dashed #d5ded6;
    border-radius: 9px;
    background: #fafcf9;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 500;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
    padding-top: 19px;
    border-top: 1px solid var(--line);
}

.access-guide {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 13px;
    margin-top: 20px;
}

.access-guide > div {
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface-soft);
}

.access-guide p {
    margin: 8px 0 0;
    color: var(--ink-soft);
    font-size: 11px;
}

.products-cell {
    display: grid;
    gap: 2px;
    max-width: 320px;
    color: var(--ink);
    font-weight: 620;
}

.positive-value {
    color: var(--success);
}

.negative-value {
    color: var(--danger);
}

.sale-owner {
    padding: 9px 12px;
    border: 1px solid #dce7de;
    border-radius: 12px;
    background: #f7faf7;
}

.sale-owner div {
    display: grid;
}

.sale-owner small {
    color: var(--muted);
    font-size: 10px;
}

.sale-owner strong {
    color: var(--forest-800);
    font-size: 12px;
}

.sale-form {
    display: grid;
    gap: 19px;
}

.sale-items-panel {
    padding: 23px;
}

.sale-lines {
    display: grid;
    gap: 10px;
}

.sale-line {
    display: grid;
    grid-template-columns: minmax(220px, 1.55fr) 115px minmax(105px, 0.7fr) 30px;
    align-items: end;
    gap: 12px;
    padding: 13px;
    border: 1px solid #e5eae6;
    border-radius: 12px;
    background: #fcfdfb;
}

.sale-line .field {
    gap: 5px;
}

.sale-line .field input,
.sale-line .field select {
    min-height: 39px;
}

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

.line-subtotal {
    display: grid;
    min-height: 39px;
    align-content: center;
    gap: 2px;
}

.line-subtotal small {
    color: var(--muted);
    font-size: 10px;
}

.line-subtotal strong {
    color: var(--forest-800);
    font-size: 14px;
    font-weight: 780;
}

.remove-sale-line {
    width: 28px;
    height: 39px;
    border-radius: 8px;
    background: transparent;
    color: #acb6af;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.remove-sale-line:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.sale-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 17px;
    padding: 16px 3px 0;
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 680;
}

.sale-total strong {
    color: var(--forest-800);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.sale-details-panel .section-header {
    margin-bottom: 20px;
}

.quick-panel {
    margin: 0 0 20px;
    padding: 21px;
}

.quick-panel .section-header {
    margin-bottom: 14px;
}

.inline-fields {
    display: flex;
    align-items: end;
    gap: 12px;
}

.inline-field-grow {
    flex: 1;
}

.is-hidden {
    display: none !important;
}

/* Login */
.auth-body {
    background: #edf0ea;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(360px, 46%) 1fr;
}

.auth-brand {
    position: relative;
    display: flex;
    overflow: hidden;
    flex-direction: column;
    justify-content: center;
    min-height: 420px;
    padding: clamp(45px, 8vw, 110px);
    background:
        radial-gradient(circle at 76% 22%, rgba(220, 179, 83, 0.28), transparent 11%),
        radial-gradient(circle at 7% 87%, rgba(197, 146, 50, 0.14), transparent 28%),
        linear-gradient(145deg, #112e24, #204d3c);
    color: #fff;
}

.auth-brand > *:not(.auth-orbit) {
    position: relative;
    z-index: 1;
}

.brand-mark-large {
    width: 54px;
    height: 54px;
    margin-bottom: 42px;
    border-radius: 16px;
    font-size: 31px;
}

.auth-brand .eyebrow {
    color: #e1bc6a;
}

.auth-brand h1 {
    margin: 6px 0 16px;
    font-family: Georgia, serif;
    font-size: clamp(42px, 5vw, 68px);
    font-weight: 500;
    letter-spacing: -0.055em;
    line-height: 0.96;
}

.auth-brand h1 em {
    color: #e5bd67;
    font-size: 0.48em;
    font-style: normal;
    letter-spacing: 0.02em;
    vertical-align: super;
}

.auth-brand > p:last-of-type {
    max-width: 360px;
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    line-height: 1.7;
}

.auth-orbit {
    position: absolute;
    border: 1px solid rgba(224, 181, 93, 0.18);
    border-radius: 50%;
}

.orbit-one {
    right: -180px;
    bottom: -210px;
    width: 500px;
    height: 500px;
}

.orbit-two {
    right: -75px;
    bottom: -100px;
    width: 280px;
    height: 280px;
}

.auth-panel {
    display: grid;
    place-items: center;
    padding: 35px;
    background: #fbfcf9;
}

.auth-form-wrap {
    width: min(100%, 390px);
}

.auth-copy {
    margin-bottom: 30px;
}

.auth-copy h2 {
    margin: 5px 0 7px;
    color: var(--ink);
    font-size: 28px;
    font-weight: 760;
}

.auth-copy p:last-child {
    margin: 0;
    color: var(--ink-soft);
    font-size: 13px;
}

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

.password-field {
    position: relative;
    display: block;
}

.password-field input {
    padding-right: 70px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    padding: 5px 7px;
    transform: translateY(-50%);
    border-radius: 6px;
    background: transparent;
    color: var(--forest-800);
    cursor: pointer;
    font-size: 10px;
    font-weight: 750;
}

.password-toggle:hover {
    background: #edf3ee;
}

.auth-footer-note {
    margin: 28px 0 0;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.mobile-auth-logo {
    display: none;
}

@media (max-width: 1220px) {
    .sale-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat-card {
        padding: 16px;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 230px;
    }

    .main-content {
        width: calc(100% - 230px);
        margin-left: 230px;
    }

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

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

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

    .low-stock-panel {
        min-height: 0;
    }
}

@media (max-width: 800px) {
    .sidebar {
        left: 0;
        width: min(280px, 84vw);
        transform: translateX(-105%);
        transition: transform 180ms ease;
    }

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

    .sidebar-close,
    .menu-button {
        display: inline-grid;
        place-items: center;
    }

    .sidebar-close {
        color: rgba(255, 255, 255, 0.72);
        font-size: 25px;
    }

    .mobile-overlay {
        position: fixed;
        z-index: 15;
        inset: 0;
        display: none;
        background: rgba(10, 25, 19, 0.35);
        backdrop-filter: blur(1px);
    }

    body.menu-open .mobile-overlay {
        display: block;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
    }

    .topbar {
        min-height: 108px;
        padding: 22px 24px 17px;
    }

    .menu-button {
        margin: 3px 12px 0 0;
        border: 1px solid var(--line);
        background: #fff;
        color: var(--forest-900);
    }

    .topbar > div:first-of-type {
        flex: 1;
    }

    .topbar-actions {
        padding-top: 1px;
    }

    .desktop-greeting {
        display: none;
    }

    .page-content {
        padding: 25px 24px 42px;
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        display: none;
    }

    .auth-panel {
        padding: 32px 25px;
    }

    .mobile-auth-logo {
        display: grid;
        width: 45px;
        height: 45px;
        place-items: center;
        margin-bottom: 42px;
        border-radius: 14px;
        background: var(--forest-900);
        color: #ebc972;
        font-family: Georgia, serif;
        font-size: 27px;
        font-weight: 700;
    }
}

@media (max-width: 640px) {
    .topbar {
        align-items: center;
        min-height: 89px;
        padding: 18px 17px;
    }

    .topbar .eyebrow,
    .page-subtitle {
        display: none;
    }

    .topbar h1 {
        margin: 0;
        font-size: 22px;
    }

    .topbar-actions .button {
        min-height: 36px;
        padding: 0 10px;
        font-size: 11px;
    }

    .menu-button {
        width: 34px;
        height: 34px;
        margin-right: 8px;
    }

    .page-content {
        padding: 18px 15px 36px;
    }

    .page-actions,
    .form-page-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .page-actions .button {
        width: 100%;
    }

    .mini-stats {
        gap: 5px 12px;
    }

    .stat-grid,
    .stat-grid-three,
    .stat-grid-four {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 16px;
    }

    .stat-card {
        min-height: 105px;
        flex-direction: column;
        align-items: flex-start;
        gap: 7px;
        padding: 13px;
    }

    .stat-icon {
        width: 31px;
        height: 31px;
        flex-basis: 31px;
        border-radius: 10px;
        font-size: 11px;
    }

    .stat-card strong {
        max-width: 125px;
        font-size: 18px;
    }

    .stat-card small {
        display: none;
    }

    .recent-sales-panel,
    .low-stock-panel,
    .sale-items-panel,
    .form-panel,
    .quick-panel {
        padding: 16px;
    }

    .section-header h2 {
        font-size: 16px;
    }

    .sale-card-grid {
        grid-template-columns: 1fr;
    }

    .sale-card {
        min-height: 184px;
    }

    .filter-bar {
        flex-wrap: wrap;
        padding: 13px;
    }

    .search-field {
        min-width: 100%;
    }

    .filter-bar select {
        max-width: none;
        flex: 1;
    }

    .form-grid,
    .access-guide {
        grid-template-columns: 1fr;
    }

    .field-wide {
        grid-column: auto;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .button {
        width: 100%;
    }

    .stock-display {
        width: 100%;
    }

    .sale-owner {
        width: 100%;
    }

    .sale-line {
        grid-template-columns: 1fr 92px 28px;
        gap: 9px;
        padding: 10px;
    }

    .sale-line .field:first-child {
        grid-column: 1 / -1;
    }

    .line-subtotal {
        display: none;
    }

    .remove-sale-line {
        align-self: end;
    }

    .inline-fields {
        align-items: stretch;
        flex-direction: column;
    }

    .inline-fields .button {
        width: 100%;
    }

    .info-banner {
        align-items: flex-start;
        font-size: 11px;
    }
}

@media (max-width: 390px) {
    .topbar-actions .button {
        max-width: 124px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .stat-card strong {
        max-width: 110px;
        font-size: 16px;
    }
}
