* {
    box-sizing: border-box;
}

:root {
    --green: #0f8f4d;
    --green-dark: #086235;
    --bg: #f3f7f5;
    --card: #ffffff;
    --text: #15201a;
    --muted: #6b7a70;
    --line: #e2ebe6;
    --red: #dc2626;
    --shadow: 0 18px 60px rgba(15, 143, 77, .10);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, Arial, sans-serif;
}

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

code {
    background: #edf7f1;
    color: #075d35;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: 800;
}

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top left, rgba(15,143,77,.20), transparent 28%),
        linear-gradient(135deg, #f6fff9, #e5f4ed);
    padding: 20px;
}

.auth-box {
    width: 100%;
    max-width: 430px;
    background: white;
    padding: 34px;
    border-radius: 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
}

.brand-badge {
    display: inline-flex;
    background: #e8f8ef;
    color: var(--green-dark);
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
}

.auth-box h1 {
    margin: 18px 0 8px;
}

.auth-box p {
    color: var(--muted);
    margin-bottom: 24px;
}

.layout {
    display: grid;
    grid-template-columns: 270px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: #0d1f15;
    color: white;
    padding: 24px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.logo {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 36px;
}

.logo-mark {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: linear-gradient(135deg, #20c46b, #0f8f4d);
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 24px;
}

.logo span {
    display: block;
    color: #9bb9aa;
    font-size: 12px;
    margin-top: 3px;
}

.sidebar nav {
    display: grid;
    gap: 8px;
}

.sidebar nav a {
    color: #d7efe2;
    padding: 13px 14px;
    border-radius: 14px;
    font-weight: 700;
}

.sidebar nav a:hover {
    background: rgba(255,255,255,.08);
}

.sidebar nav a.logout {
    color: #ffb4b4;
    margin-top: 24px;
}

.content {
    padding: 34px;
}

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

.page-head h1 {
    margin: 0;
    font-size: 32px;
}

.page-head p {
    margin: 6px 0 0;
    color: var(--muted);
}

.head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

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

.stat-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 22px;
    box-shadow: var(--shadow);
}

.stat-card span {
    color: var(--muted);
    font-size: 13px;
}

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

.grid-2 {
    display: grid;
    grid-template-columns: 1.3fr .9fr;
    gap: 20px;
}

.panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: 26px;
    padding: 22px;
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}

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

.panel h2 {
    margin: 0 0 12px;
}

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

label {
    display: block;
    font-weight: 800;
    margin: 16px 0 7px;
}

input, textarea, select {
    width: 100%;
    border: 1px solid var(--line);
    background: #fbfefd;
    padding: 14px 15px;
    border-radius: 16px;
    outline: none;
    font-size: 16px;
}

input:focus, textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(15,143,77,.10);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: #eef6f2;
    color: var(--green-dark);
    padding: 13px 17px;
    border-radius: 15px;
    font-weight: 900;
    cursor: pointer;
    font-size: 15px;
}

.btn.primary {
    background: linear-gradient(135deg, #14a858, #0f8f4d);
    color: white;
    box-shadow: 0 12px 28px rgba(15,143,77,.22);
}

.btn.light {
    background: #f5f7f6;
    color: var(--text);
}

.btn.full {
    width: 100%;
    margin-top: 18px;
}

.btn.big {
    width: 100%;
    font-size: 18px;
    padding: 16px;
    margin-top: 18px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
}

td {
    padding: 14px 10px;
    border-bottom: 1px solid #f0f5f2;
    vertical-align: top;
}

td small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
}

.actions {
    white-space: nowrap;
}

.actions a {
    margin-right: 10px;
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 28px !important;
}

.error {
    background: #fff1f1;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 13px 15px;
    border-radius: 16px;
    margin-bottom: 16px;
}

.success {
    background: #ecfdf3;
    color: #065f36;
    border: 1px solid #bbf7d0;
    padding: 13px 15px;
    border-radius: 16px;
    margin-bottom: 16px;
}

.search-row {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.scan-row {
    display: flex;
    gap: 10px;
}

.scan-box small {
    display: block;
    margin-top: 9px;
    color: var(--muted);
}

.customer-found {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #ecfdf3, #ffffff);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 20px;
    margin-bottom: 18px;
}

.customer-found span {
    color: var(--green-dark);
    font-weight: 900;
    font-size: 12px;
    text-transform: uppercase;
}

.customer-found h2 {
    margin: 6px 0;
    font-size: 28px;
}

.customer-found p {
    color: var(--muted);
    margin: 0;
}

.discount-bubble {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: linear-gradient(135deg, #14a858, #0f8f4d);
    color: white;
    display: grid;
    place-items: center;
    font-size: 26px;
    font-weight: 900;
    box-shadow: 0 15px 35px rgba(15,143,77,.25);
}

.calc-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 14px 0;
}

.calc-preview div {
    background: #f5faf7;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
}

.calc-preview span {
    color: var(--muted);
    font-size: 13px;
}

.calc-preview strong {
    display: block;
    font-size: 25px;
    margin-top: 6px;
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

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

    .content {
        padding: 18px;
    }

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

    .stats-grid,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .search-row,
    .scan-row {
        flex-direction: column;
    }

    .customer-found {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .calc-preview {
        grid-template-columns: 1fr;
    }
}
