:root {
    --ink: #1d2523;
    --muted: #66706b;
    --line: #dde5df;
    --paper: #fbfcfa;
    --panel: #ffffff;
    --brand: #0f7a5f;
    --brand-dark: #095743;
    --accent: #c4862d;
    --danger-soft: #fff2f0;
}

* {
    letter-spacing: 0;
}

body {
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
}

body.pos-app {
    padding-top: 72px;
}

.login-page {
    display: grid;
    place-items: center;
    padding: 24px;
    background: #edf3ef;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(320px, 440px) minmax(320px, 520px);
    width: min(960px, 100%);
    min-height: 620px;
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: 0 24px 70px rgba(29, 37, 35, .12);
}

.login-panel {
    padding: clamp(28px, 5vw, 56px);
    align-self: center;
}

.login-panel h1,
.page-heading h1 {
    font-weight: 800;
    margin: 0;
}

.login-visual {
    display: flex;
    align-items: end;
    padding: 42px;
    color: #fff;
    background:
        linear-gradient(180deg, rgba(9, 87, 67, .08), rgba(9, 87, 67, .78)),
        url("../../landing/images/gallery.jpg") center/cover no-repeat;
}

.login-visual strong {
    display: block;
    max-width: 360px;
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1;
}

.visual-kicker,
.eyebrow {
    color: var(--accent);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    font-weight: 900;
}

.demo-logins {
    display: grid;
    gap: 6px;
    margin-top: 22px;
    color: var(--muted);
    font-size: .86rem;
}

.btn-dollar {
    border: 0;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
}

.btn-dollar:hover,
.btn-dollar:focus {
    background: var(--brand-dark);
    color: #fff;
}

.pos-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 2px 10px rgba(29, 37, 35, .06);
}

.pos-nav .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-weight: 700;
}

.shop-report-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    margin-bottom: 14px;
    border-bottom: 2px solid var(--brand);
}

.shop-report-header img {
    width: 64px;
    height: 42px;
    object-fit: contain;
}

.shop-report-header strong,
.shop-report-header span {
    display: block;
}

.shop-report-header strong {
    font-size: 1.1rem;
}

.shop-report-header span {
    color: var(--muted);
    font-size: .82rem;
}

@media print {
    body.pos-app { padding-top: 0; background: #fff; }
    .pos-nav, .d-print-none { display: none !important; }
    .panel { box-shadow: none !important; border: 1px solid #ddd; }
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.role-pill,
.stock-count {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e9f5ef;
    color: var(--brand-dark);
    font-size: .8rem;
    font-weight: 800;
}

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

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-card,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.metric-card {
    padding: 18px;
}

.metric-card span,
td small,
.stock-row span,
.staff-row span {
    display: block;
    color: var(--muted);
    font-size: .86rem;
}

.metric-card strong {
    display: block;
    margin-top: 8px;
    font-size: 1.65rem;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(280px, .8fr) minmax(420px, 1.4fr);
    gap: 18px;
    align-items: start;
}

.wide-panel {
    min-width: 0;
}

.panel {
    padding: 18px;
}

.panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.panel-title h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.stack-list,
.staff-list,
.cart-items {
    display: grid;
    gap: 10px;
}

.stock-row,
.staff-row,
.cart-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.empty-row {
    color: var(--muted);
    text-align: center;
}

.pos-grid {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(320px, 420px);
    gap: 18px;
    align-items: start;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
}

.product-tile {
    min-height: 250px;
    padding: 14px;
    text-align: left;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.product-tile:hover {
    border-color: var(--brand);
    box-shadow: 0 10px 24px rgba(15, 122, 95, .12);
}

.product-tile strong,
.product-tile span,
.product-tile em {
    display: block;
}

.product-photo {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    margin-bottom: 12px;
    overflow: hidden;
    border-radius: 8px;
    background: #eef4f0;
    color: var(--brand);
    font-size: 2rem;
}

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

.product-tile strong {
    margin: 8px 0 6px;
}

.product-tile em {
    margin-top: 12px;
    color: var(--brand-dark);
    font-style: normal;
    font-weight: 800;
}

.tile-category {
    color: var(--accent);
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.search-input {
    max-width: 300px;
}

.cart-panel {
    position: sticky;
    top: 86px;
}

.cart-row strong {
    display: block;
}

.qty-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.qty-controls button {
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.discount-control {
    display: grid;
    grid-template-columns: 82px 80px;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
    color: var(--muted);
    font-size: .82rem;
}

.discount-control input {
    min-width: 0;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 4px 8px;
}

.cart-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 18px 0;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.cart-total strong {
    font-size: 1.6rem;
}

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

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

.form-grid .btn {
    grid-column: 1 / -1;
}

.inline-form {
    display: grid;
    grid-template-columns: 86px minmax(120px, 1fr) 38px;
    gap: 8px;
}

.settings-form {
    display: grid;
    grid-template-columns: 86px minmax(150px, 1fr) 38px;
    gap: 8px;
    min-width: 280px;
}

.filter-bar {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-bar label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: .86rem;
    font-weight: 700;
}

.product-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.thumb {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    overflow: hidden;
    border-radius: 8px;
    background: #eef4f0;
    color: var(--brand);
}

.receipt-page {
    display: grid;
    place-items: start center;
    padding: 18px;
    background: #edf3ef;
}

.receipt-fallback {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(29, 37, 35, .14);
    font-weight: 800;
}

.receipt-paper {
    width: min(380px, 100%);
    padding: 22px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
}

.receipt-head {
    display: grid;
    gap: 4px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--line);
    text-align: center;
}

.receipt-head strong {
    font-size: 1.35rem;
}

.receipt-table {
    width: 100%;
    margin: 16px 0;
    border-collapse: collapse;
}

.receipt-table th,
.receipt-table td {
    padding: 8px 0;
    border-bottom: 1px solid #edf2ee;
    font-size: .92rem;
    text-align: left;
}

.receipt-table th:last-child,
.receipt-table td:last-child {
    text-align: right;
}

.receipt-totals {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.receipt-totals span {
    display: flex;
    justify-content: space-between;
}

.btn-print {
    width: 100%;
    margin-top: 18px;
    padding: 10px;
    border: 0;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
}

@media print {
    .receipt-page {
        display: block;
        padding: 0;
        background: #fff;
    }

    .receipt-paper {
        width: 100%;
        border: 0;
    }

    .btn-print {
        display: none;
    }
}

@media (max-width: 920px) {
    .login-shell,
    .content-grid,
    .pos-grid {
        grid-template-columns: 1fr;
    }

    .login-visual {
        min-height: 260px;
    }

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

    .cart-panel {
        position: static;
    }
}

@media (max-width: 560px) {
    .login-page {
        padding: 0;
    }

    .login-shell {
        min-height: 100vh;
        border: 0;
    }

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

    .metric-grid,
    .form-grid,
    .inline-form,
    .settings-form,
    .filter-bar {
        grid-template-columns: 1fr;
    }

    .nav-user {
        align-items: flex-start;
        flex-direction: column;
        margin-top: 12px;
    }
}
