:root {
    --tech-green: #6ad03f;
    --tech-dark: #242b34;
    --tech-charcoal: #161b21;
    --line: #e6e9ed;
    --soft: #f5f7f9;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--soft);
    color: #20252b;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.btn-tech {
    --bs-btn-bg: var(--tech-green);
    --bs-btn-border-color: var(--tech-green);
    --bs-btn-color: #101510;
    --bs-btn-hover-bg: #58bd31;
    --bs-btn-hover-border-color: #58bd31;
    font-weight: 700;
}

.app-logo {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
}

.login-logo {
    max-width: 260px;
    margin-bottom: 12px;
}

.sidebar-logo {
    max-width: 196px;
    max-height: 78px;
    padding: 6px;
}

.topbar-logo {
    display: none;
    width: 112px;
    padding: 4px;
}

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(140deg, rgba(36, 43, 52, 0.95), rgba(22, 27, 33, 0.98)),
        url("https://images.unsplash.com/photo-1511707171634-5f897ff02aa9?auto=format&fit=crop&w=1600&q=80") center/cover;
}

.login-panel {
    width: min(100%, 430px);
    padding: 32px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

.login-panel h1 {
    margin: 18px 0 6px;
    font-size: 1.75rem;
    color: var(--tech-dark);
}

.login-panel p {
    color: #626d78;
    margin-bottom: 24px;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 250px;
    padding: 20px 14px;
    background: var(--tech-dark);
    color: #fff;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px 22px;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ced5dd;
    border-radius: 8px;
    padding: 11px 12px;
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover {
    color: #111;
    background: var(--tech-green);
}

.content {
    min-height: 100vh;
    margin-left: 250px;
    padding: 24px;
}

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

.topbar-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar h1 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 800;
}

.muted-label {
    display: block;
    color: #7b8793;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

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

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 8px 12px;
    font-weight: 700;
}

.user-chip small {
    color: #74808c;
    font-weight: 600;
}

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

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

.stat {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.stat span {
    color: #6f7b87;
    font-size: 0.85rem;
}

.stat strong {
    display: block;
    margin-top: 8px;
    font-size: 1.45rem;
}

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

.toolbar .form-control,
.toolbar .form-select {
    max-width: 320px;
}

.table {
    vertical-align: middle;
}

.badge-soft {
    background: #edf8e8;
    color: #2f7a15;
    border: 1px solid #d7efcd;
}

.toast-area {
    position: fixed;
    right: 18px;
    top: 18px;
    z-index: 30;
}

.mobile-nav {
    display: none;
}

.scan-box {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.scanner-overlay {
    position: fixed;
    z-index: 50;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 20, 25, 0.72);
}

.scanner-panel {
    width: min(100%, 420px);
    border-radius: 8px;
    background: #fff;
    padding: 16px;
    box-shadow: 0 22px 80px rgba(0, 0, 0, 0.3);
}

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

.scanner-panel h2 {
    margin: 0;
    font-size: 1rem;
}

#qrReader {
    overflow: hidden;
    border-radius: 8px;
}

.receipt-body {
    background: #fff;
}

.receipt {
    width: min(760px, 100%);
    margin: 24px auto;
    padding: 28px;
    border: 1px solid #d7dce2;
}

.receipt-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.receipt-logo {
    display: block;
    max-width: 260px;
    width: 60%;
    height: auto;
    object-fit: contain;
}

.receipt header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 2px solid #101510;
    padding-bottom: 14px;
}

.receipt header span {
    display: block;
    color: #616c78;
}

.receipt dl {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 8px 18px;
}

.receipt dt {
    color: #626d78;
}

.receipt dd {
    margin: 0;
    font-weight: 700;
}

.receipt-note {
    margin-top: 28px;
    text-align: center;
}

@media (max-width: 992px) {
    .sidebar {
        display: none;
    }

    .content {
        margin-left: 0;
        padding: 18px 14px 86px;
    }

    .topbar-logo {
        display: block;
        flex: 0 0 auto;
    }

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

    .mobile-nav {
        position: fixed;
        z-index: 20;
        inset: auto 0 0 0;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        border-top: 1px solid var(--line);
        background: #fff;
    }

    .mobile-nav a {
        display: grid;
        place-items: center;
        gap: 2px;
        min-height: 62px;
        color: #5f6a75;
        text-decoration: none;
        font-size: 0.72rem;
        font-weight: 700;
    }

    .mobile-nav a.active {
        color: #1f7610;
    }

    .mobile-nav i {
        font-size: 1.15rem;
    }
}

@media (max-width: 620px) {
    .topbar {
        align-items: flex-start;
    }

    .user-chip {
        display: none;
    }

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

    .panel {
        padding: 14px;
    }

    .toolbar .form-control,
    .toolbar .form-select {
        max-width: none;
        width: 100%;
    }

    .table-responsive {
        font-size: 0.88rem;
    }

    .receipt {
        margin: 0;
        border: 0;
    }

    .receipt dl {
        grid-template-columns: 1fr;
    }
}

@media print {
    .receipt button {
        display: none;
    }

    .receipt {
        border: 0;
        margin: 0;
        width: 100%;
    }
}
