:root {
    --bg: #050505;
    --bg-soft: #101010;
    --panel: rgba(17, 17, 19, 0.92);
    --panel-strong: rgba(25, 25, 28, 0.96);
    --text: #f6f2f2;
    --muted: #aaa1a1;
    --primary: #c1121f;
    --primary-dark: #780000;
    --accent: #ff4d5a;
    --danger: #ff6b6b;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    --radius: 24px;
    --glass: rgba(255, 255, 255, 0.03);
    --auth-image: none;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(193, 18, 31, 0.28), transparent 22%),
        radial-gradient(circle at top right, rgba(120, 0, 0, 0.38), transparent 28%),
        linear-gradient(135deg, #080808 0%, #130608 48%, #1a090d 100%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
}

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

img {
    max-width: 100%;
    display: block;
}

input,
select,
button {
    font: inherit;
}

input,
select {
    width: 100%;
    margin-top: 8px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus,
select:focus {
    border-color: rgba(255, 77, 90, 0.55);
    box-shadow: 0 0 0 4px rgba(193, 18, 31, 0.18);
    background: rgba(255, 255, 255, 0.06);
}

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 16px;
    padding: 13px 20px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    font-weight: 600;
}

button:hover,
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--primary-dark));
    color: #fff;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-danger {
    background: rgba(255, 107, 107, 0.12);
    color: #ffd0d0;
}

.flash {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 20;
    padding: 14px 18px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    backdrop-filter: blur(18px);
}

.flash-success {
    background: rgba(18, 112, 52, 0.18);
    color: #8df0b0;
}

.flash-error {
    background: rgba(193, 18, 31, 0.16);
    color: #ffb5ba;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    padding: 24px;
    align-items: stretch;
}

.auth-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 42px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.auth-brand {
    background:
        linear-gradient(155deg, rgba(193, 18, 31, 0.82), rgba(120, 0, 0, 0.86)),
        linear-gradient(45deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
        var(--auth-image);
    background-size: cover;
    background-position: center;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.14), transparent 28%),
        radial-gradient(circle at 80% 80%, rgba(0, 0, 0, 0.22), transparent 28%);
    pointer-events: none;
}

.auth-panel > * {
    position: relative;
    z-index: 1;
}

.auth-panel h1,
.auth-panel h2 {
    margin-top: 0;
}

.auth-panel h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.05;
    margin-bottom: 16px;
}

.auth-panel h2 {
    font-size: 1.8rem;
    margin-bottom: 24px;
}

.eyebrow {
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ff9ca5;
    font-size: 0.78rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.feature-list,
.helper-links,
.auth-panel p {
    color: var(--muted);
}

.feature-list {
    padding-left: 20px;
    line-height: 1.8;
}

.auth-brand p,
.auth-brand .feature-list {
    color: rgba(255, 240, 240, 0.88);
}

label {
    display: block;
    color: #f8dede;
    font-size: 0.96rem;
}

.stack-md,
.stack-lg {
    display: grid;
    gap: 16px;
}

.stack-lg {
    gap: 20px;
}

.coupon-status {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    min-height: 20px;
}

.dashboard-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 290px 1fr;
}

.sidebar {
    background:
        radial-gradient(circle at top, rgba(255, 77, 90, 0.18), transparent 28%),
        linear-gradient(180deg, rgba(22, 10, 12, 0.98), rgba(10, 10, 12, 0.98));
    color: #fff;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    height: 100vh;
}

.nav-links {
    display: grid;
    gap: 10px;
}

.nav-links a {
    padding: 14px 16px;
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.84);
    border: 1px solid transparent;
    background: transparent;
}

.nav-links a.active,
.nav-links a:hover {
    background: linear-gradient(135deg, rgba(193, 18, 31, 0.22), rgba(120, 0, 0, 0.22));
    border-color: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.dashboard-main {
    padding: 28px;
}

.toolbar,
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.toolbar h1 {
    margin: 0 0 8px;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
}

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

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

.stat-card,
.panel {
    background: linear-gradient(180deg, rgba(26, 26, 30, 0.96), rgba(15, 15, 18, 0.96));
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    border: 1px solid var(--border);
}

.stat-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 12px;
}

.stat-card strong {
    font-size: 1.6rem;
    color: #fff;
}

.panel h3,
.panel-head h3 {
    margin-top: 0;
    color: #fff;
}

.table-wrap {
    overflow: auto;
    border-radius: 18px;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
    background: rgba(255, 255, 255, 0.01);
}

th,
td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
}

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

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.sales-filters {
    margin-bottom: 22px;
}

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

.filter-actions {
    grid-column: 1 / -1;
}

.pagination-bar {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.disabled-link {
    pointer-events: none;
    opacity: 0.5;
}

.chat-panel {
    max-width: 720px;
}

small {
    color: var(--muted);
}

::placeholder {
    color: #847979;
}

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

@media (max-width: 960px) {
    .auth-shell {
        grid-template-columns: 1fr;
        padding: 18px;
    }

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

    .sidebar {
        position: static;
        height: auto;
        gap: 24px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

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

    .dashboard-main {
        padding: 20px;
    }

    .toolbar,
    .panel-head,
    .form-grid,
    .card-grid {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .pagination-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 720px) {
    .auth-panel {
        padding: 28px 20px;
        border-radius: 24px;
    }

    .auth-brand {
        min-height: 280px;
    }

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

    .dashboard-main {
        padding: 16px;
    }

    .stat-card,
    .panel {
        padding: 18px;
        border-radius: 20px;
    }

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

    table {
        min-width: 640px;
    }
}

@media (max-width: 520px) {
    .auth-shell {
        padding: 12px;
    }

    .nav-links {
        grid-template-columns: 1fr;
    }

    .toolbar {
        gap: 12px;
    }
}
