:root {
    --app-bg: #f5f7f2;
    --app-dark: #20362a;
    --app-green: #2f7d4f;
    --app-green-soft: #e8f3ec;
    --app-border: #dfe6dc;
    --app-text: #1f2d24;
}

body {
    color: var(--app-text);
    background: var(--app-bg);
}

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.auth-shell {
    width: 100%;
    max-width: 440px;
}

.auth-panel,
.content-panel,
.metric-card {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: 0 12px 35px rgba(31, 45, 36, 0.07);
}

.auth-panel {
    padding: 2rem;
}

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

.app-body {
    min-height: 100vh;
}

.app-sidebar {
    width: 280px;
    background: #fff;
    border-right: 1px solid var(--app-border);
}

.sidebar-inner {
    min-height: 100vh;
    padding: 1rem;
}

.sidebar-brand {
    display: flex;
    gap: .75rem;
    align-items: center;
    color: var(--app-text);
    text-decoration: none;
    padding: .5rem .25rem 1.25rem;
}

.sidebar-brand small {
    display: block;
    color: #6c757d;
    line-height: 1.2;
}

.sidebar-nav {
    display: grid;
    gap: .25rem;
}

.sidebar-link {
    color: #496057;
    text-decoration: none;
    padding: .75rem .9rem;
    border-radius: 8px;
    font-weight: 600;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: var(--app-green);
    background: var(--app-green-soft);
}

.app-main {
    min-height: 100vh;
}

.app-topbar {
    min-height: 64px;
}

.metric-card {
    padding: 1.25rem;
}

.metric-card span {
    display: block;
    color: #6c757d;
    font-size: .9rem;
}

.metric-card strong {
    display: block;
    font-size: 2rem;
    line-height: 1.2;
    margin-top: .35rem;
}

.content-panel {
    padding: 1.5rem;
}

.empty-state {
    min-height: 220px;
    display: grid;
    place-content: center;
    text-align: center;
    border: 1px dashed #b9c8bd;
    border-radius: 8px;
    background: #fbfdfb;
    padding: 2rem;
}

.table-description {
    max-width: 360px;
}

.action-buttons form {
    margin: 0;
}

.product-thumb {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--app-border);
    background: #fff;
}

.product-thumb-empty {
    display: inline-grid;
    place-items: center;
    color: #6c757d;
    background: #f8f9fa;
    font-size: .72rem;
    line-height: 1.1;
    text-align: center;
}

.purchase-total-box {
    min-width: 220px;
    padding: 1rem 1.25rem;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #fbfdfb;
    text-align: right;
}

.purchase-total-box span {
    display: block;
    color: #6c757d;
    font-size: .9rem;
}

.purchase-total-box strong {
    display: block;
    font-size: 1.8rem;
    line-height: 1.2;
}

.metric-text {
    font-size: 1.15rem !important;
    overflow-wrap: anywhere;
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1.5rem;
    color: #fff;
    background: linear-gradient(135deg, #285f3f, #74a65f);
    border-radius: 8px;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: flex-end;
}

.dashboard-hero .btn-outline-success,
.dashboard-hero .btn-outline-secondary {
    color: #fff;
    border-color: rgba(255, 255, 255, .7);
}

.dashboard-hero .btn-outline-success:hover,
.dashboard-hero .btn-outline-secondary:hover {
    color: var(--app-green);
    background: #fff;
    border-color: #fff;
}

.dashboard-metric {
    min-height: 138px;
}

.dashboard-metric small {
    display: block;
    color: #6c757d;
    margin-top: .35rem;
}

.metric-warning {
    border-color: #f0c36d;
    background: #fffaf0;
}

.dashboard-empty {
    min-height: 130px;
}

.dashboard-feed {
    display: grid;
    gap: .75rem;
}

.dashboard-feed-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #fbfdfb;
}

.dashboard-feed-item span {
    display: block;
    color: #6c757d;
    font-size: .85rem;
}

.pos-results {
    display: grid;
    gap: .5rem;
}

.pos-result-item {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1rem;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #fff;
    text-align: left;
}

.pos-result-item:hover {
    border-color: var(--app-green);
    background: var(--app-green-soft);
}

.pos-result-item small {
    display: block;
    color: #6c757d;
}

.pos-summary {
    display: grid;
    gap: .85rem;
}

.pos-summary div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: .85rem;
    border-bottom: 1px solid var(--app-border);
}

.pos-summary-total {
    font-size: 1.25rem;
    border-bottom: 0 !important;
}

.report-link-card {
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    color: var(--app-text);
    background: #fff;
    text-decoration: none;
}

.report-section + .report-section {
    margin-top: 2rem;
}

.report-link-card:hover {
    color: var(--app-green);
    border-color: var(--app-green);
    background: var(--app-green-soft);
}

.report-link-card span {
    color: #6c757d;
    font-size: .9rem;
}

.report-table th,
.report-table td {
    white-space: nowrap;
}

.searchable-select {
    position: relative;
}

.searchable-options {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    display: none;
    max-height: 280px;
    overflow-y: auto;
    padding: .35rem;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 28px rgba(31, 45, 36, .12);
}

.searchable-options.show {
    display: grid;
    gap: .25rem;
}

.searchable-options.is-empty::after {
    content: "No matching products";
    display: block;
    padding: .75rem;
    color: #6c757d;
    text-align: center;
}

.searchable-option {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    padding: .7rem .75rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--app-text);
    text-align: left;
}

.searchable-option:hover,
.searchable-option:focus {
    background: var(--app-green-soft);
    outline: none;
}

.searchable-option small {
    display: block;
    color: #6c757d;
}

@media (min-width: 992px) {
    .app-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        transform: none !important;
        visibility: visible !important;
    }

    .app-main {
        margin-left: 280px;
    }
}

@media print {
    .app-sidebar,
    .app-topbar,
    .no-print {
        display: none !important;
    }

    .app-main {
        margin-left: 0 !important;
    }

    .content-panel,
    .metric-card {
        box-shadow: none;
    }

    body {
        background: #fff;
    }
}

@media (max-width: 767.98px) {
    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .dashboard-actions .btn {
        flex: 1 1 120px;
    }

    .action-buttons {
        min-width: 280px;
    }
}

@media (max-width: 575.98px) {
    .auth-panel,
    .content-panel {
        padding: 1.25rem;
    }
}
