:root {
    --bg: #07030f;
    --card: #12081f;
    --card2: #1b0d2d;
    --purple: #8b5cf6;
    --purple2: #c026d3;
    --purple3: #a855f7;
    --text: #f8f7ff;
    --muted: #a9a0bd;
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #facc15;
    --border: rgba(139, 92, 246, .28);
    --shadow: rgba(139, 92, 246, .18);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 40% 0%, rgba(139, 92, 246, .32), transparent 30%),
        radial-gradient(circle at 80% 20%, rgba(192, 38, 211, .15), transparent 22%),
        linear-gradient(145deg, #07030f, #12051f 55%, #06030b);
    color: var(--text);
    font-family: Inter, Arial, sans-serif;
}

/* LOGIN */
.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(430px, 92vw);
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(18, 8, 31, .9);
    box-shadow:
        0 0 70px rgba(139, 92, 246, .28),
        inset 0 1px 0 rgba(255,255,255,.05);
    backdrop-filter: blur(12px);
}

.logo {
    font-size: 30px;
    font-weight: 900;
    letter-spacing: 1px;
}

.logo span {
    color: var(--purple);
}

.logo img {
    display: block;
    object-fit: contain;
}

label {
    display: block;
    margin-top: 18px;
    color: var(--muted);
}

input {
    width: 100%;
    margin-top: 8px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.1);
    background: #0b0614;
    color: white;
    outline: none;
}

input:focus {
    border-color: rgba(168,85,247,.8);
    box-shadow: 0 0 0 3px rgba(168,85,247,.16);
}

button,
.btn {
    display: inline-block;
    border: 0;
    cursor: pointer;
    padding: 13px 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--purple), var(--purple2));
    color: white;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(168,85,247,.22);
    transition: .2s ease;
}

button:hover,
.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.12);
}

.login-card button {
    width: 100%;
    margin-top: 22px;
}

.erro {
    padding: 12px;
    margin-top: 16px;
    background: rgba(239,68,68,.15);
    border: 1px solid rgba(239,68,68,.35);
    border-radius: 12px;
}

/* LAYOUT */
.layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.sidebar {
    padding: 24px;
    border-right: 1px solid rgba(255,255,255,.08);
    background:
        radial-gradient(circle at top, rgba(139,92,246,.18), transparent 38%),
        rgba(8,4,15,.78);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar .subtitle {
    text-align: left;
    margin-top: 24px;
}

.sidebar nav {
    display: grid;
    gap: 10px;
    margin-top: 32px;
}

.sidebar a {
    padding: 12px 14px;
    color: var(--muted);
    text-decoration: none;
    border-radius: 12px;
    transition: .18s ease;
}

.sidebar a:hover,
.sidebar a.active {
    color: white;
    background: rgba(139,92,246,.18);
}

.main {
    padding: 28px;
}

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

h1 {
    margin: 0;
    font-size: 28px;
}

h2 {
    margin-top: 0;
}

.subtitle {
    color: var(--muted);
    margin-top: 6px;
}

/* CARDS */
.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin: 28px 0;
}

.card,
.panel {
    padding: 20px;
    border-radius: 20px;
    background:
        linear-gradient(160deg, rgba(27,13,45,.96), rgba(12,6,20,.96));
    border: 1px solid var(--border);
    box-shadow:
        0 0 35px rgba(139,92,246,.12),
        inset 0 1px 0 rgba(255,255,255,.04);
}

.card {
    min-height: 105px;
}

.card .value {
    font-size: 30px;
    font-weight: 900;
    margin-top: 10px;
}

.card .label {
    color: var(--muted);
}

.grid2 {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 18px;
}

/* TABELAS */
table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 10px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    text-align: left;
}

th {
    color: var(--muted);
    font-size: 13px;
}

td {
    color: #f5f3ff;
}

.badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    display: inline-block;
}

.pago,
.ativa,
.aberto {
    background: rgba(34,197,94,.18);
    color: #86efac;
}

.pendente {
    background: rgba(250,204,21,.16);
    color: #fde68a;
}

.cancelada,
.fechado {
    background: rgba(239,68,68,.16);
    color: #fca5a5;
}

/* GRÁFICO PROFISSIONAL DE VENDAS */
.chart-panel {
    margin-bottom: 18px;
    overflow: hidden;
    position: relative;
}

.chart-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 0%, rgba(168,85,247,.18), transparent 30%),
        radial-gradient(circle at 85% 20%, rgba(192,38,211,.11), transparent 26%);
    pointer-events: none;
}

.chart-header {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}

.chart-header h2 {
    margin: 0;
}

.chart-badge {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(139, 92, 246, .18);
    border: 1px solid rgba(139, 92, 246, .35);
    color: #ddd6fe;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.sales-chart {
    position: relative;
    z-index: 1;
    height: 300px;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 18px;
    align-items: end;
    padding: 18px 12px 0;
    border-radius: 18px;
    background:
        linear-gradient(to top, rgba(255,255,255,.08) 1px, transparent 1px),
        radial-gradient(circle at top, rgba(139,92,246,.18), transparent 42%);
    background-size: 100% 25%, 100% 100%;
    border: 1px solid rgba(255,255,255,.06);
}

.chart-day {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: end;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.bar-wrap {
    height: 230px;
    width: 100%;
    display: flex;
    justify-content: end;
    align-items: center;
    flex-direction: column;
    position: relative;
}

.bar-value {
    margin-bottom: 8px;
    font-size: 12px;
    color: #f5f3ff;
    opacity: .95;
    font-weight: 800;
    white-space: nowrap;
    text-shadow: 0 0 12px rgba(168,85,247,.45);
}

.bar {
    width: 72%;
    min-height: 8px;
    border-radius: 14px 14px 6px 6px;
    background:
        linear-gradient(180deg, #f0abfc 0%, #d946ef 18%, #8b5cf6 58%, #5b21b6 100%);
    box-shadow:
        0 0 22px rgba(168,85,247,.45),
        0 16px 30px rgba(91,33,182,.22),
        inset 0 1px 0 rgba(255,255,255,.45);
    transition: .25s ease;
}

.bar-wrap:hover .bar {
    filter: brightness(1.25);
    transform: translateY(-4px);
}

.bar-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

/* RESPONSIVO */
@media (max-width: 1100px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

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

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

    .sales-chart {
        gap: 8px;
        padding-inline: 6px;
    }

    .bar {
        width: 85%;
    }

    .bar-value {
        font-size: 10px;
        transform: rotate(-8deg);
    }
}

@media (max-width: 600px) {
    .main {
        padding: 18px;
    }

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

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

    .chart-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .sales-chart {
        overflow-x: auto;
        grid-template-columns: repeat(7, minmax(70px, 1fr));
    }
}
