@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Playfair+Display:wght@600;700&display=swap');

:root {
    --dark: #211c26;
    --dark-2: #2b2432;
    --dark-3: #362c40;
    --gold: #c9a15a;
    --gold-light: #e6cd9d;
    --rose: #b8657a;
    --rose-light: #f3dde2;
    --cream: #faf6f0;
    --white: #ffffff;
    --text: #2d2a32;
    --muted: #8a8391;
    --border: #ece6dd;
    --success: #3f9d70;
    --success-bg: #e7f5ee;
    --danger: #c1504a;
    --danger-bg: #fbeceb;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px rgba(33, 28, 38, 0.08);
    --shadow-lg: 0 20px 45px rgba(33, 28, 38, 0.14);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: var(--cream);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }

h1, h2, h3, .brand-font {
    font-family: 'Playfair Display', serif;
}

/* ---------- Layout de autenticação ---------- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 15% 20%, rgba(201, 161, 90, 0.18), transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(184, 101, 122, 0.18), transparent 45%),
        var(--dark);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 44px 36px;
    text-align: center;
}

.auth-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--rose));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 700;
}

.auth-card h1 {
    margin: 0 0 4px;
    font-size: 24px;
    color: var(--dark);
}

.auth-card p.subtitle {
    margin: 0 0 28px;
    color: var(--muted);
    font-size: 14px;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.field {
    text-align: left;
    margin-bottom: 18px;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 6px;
}

.field input,
.field select {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    font-family: inherit;
    font-size: 14px;
    background: var(--cream);
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 161, 90, 0.18);
    background: var(--white);
}

.field .hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    transition: transform .12s ease, box-shadow .12s ease, background .15s;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--gold), var(--rose));
    color: var(--white);
    box-shadow: 0 8px 20px rgba(184, 101, 122, 0.28);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(184, 101, 122, 0.35); }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.btn-ghost {
    background: var(--dark-3);
    color: var(--gold-light);
}

.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }

.auth-foot {
    margin-top: 22px;
    font-size: 12.5px;
    color: var(--muted);
}

/* ---------- Layout do painel ---------- */
.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--dark), var(--dark-2));
    color: var(--white);
    display: flex;
    flex-direction: column;
    padding: 28px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 26px;
    margin-bottom: 22px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand .logo-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--rose));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-brand .name { font-size: 15px; font-weight: 700; line-height: 1.25; }
.sidebar-brand .sub { font-size: 11px; color: var(--gold-light); letter-spacing: .5px; text-transform: uppercase; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    color: rgba(255,255,255,0.72);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    transition: background .15s, color .15s;
}

.nav-item .ic {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-item:hover { background: rgba(255,255,255,0.06); color: var(--white); }

.nav-item.active {
    background: linear-gradient(135deg, rgba(201,161,90,0.9), rgba(184,101,122,0.9));
    color: var(--white);
    box-shadow: 0 8px 18px rgba(0,0,0,0.25);
}

.nav-badge {
    margin-left: auto;
    background: var(--rose);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}

.sidebar-foot {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.sidebar-user .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--gold-light);
}

.sidebar-user .uname { font-size: 13px; font-weight: 600; }
.sidebar-user .uemail { font-size: 11px; color: rgba(255,255,255,0.5); }

.main {
    flex: 1;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 26px 40px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 5;
}

.topbar h1 {
    margin: 0;
    font-size: 22px;
    color: var(--dark);
}

.topbar .today {
    font-size: 13px;
    color: var(--muted);
}

.content {
    padding: 32px 40px 60px;
}

/* ---------- Cards e grids ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

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

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 22px 22px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-light), transparent);
    opacity: .5;
}

.stat-card .label {
    font-size: 12.5px;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.stat-card .value {
    font-size: 28px;
    font-weight: 800;
    color: var(--dark);
    margin-top: 8px;
    font-family: 'Playfair Display', serif;
}

.stat-card .icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 18px;
}

.icon-gold { background: rgba(201,161,90,0.15); color: var(--gold); }
.icon-rose { background: rgba(184,101,122,0.15); color: var(--rose); }
.icon-success { background: var(--success-bg); color: var(--success); }
.icon-dark { background: rgba(43,36,50,0.08); color: var(--dark); }

.grid-2 {
    display: grid;
    grid-template-columns: 1.1fr 1.6fr;
    gap: 24px;
    align-items: start;
}

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

.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px 28px;
}

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

.card-head h2 {
    margin: 0;
    font-size: 18px;
    color: var(--dark);
}

.card-head p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; }

table.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

table.tbl th {
    text-align: left;
    padding: 12px 14px;
    color: var(--muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .3px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

table.tbl td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

table.tbl tbody tr:hover { background: var(--cream); }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.pill-success { background: var(--success-bg); color: var(--success); }
.pill-warning { background: #fdf1de; color: #b8842b; }
.pill-muted { background: var(--border); color: var(--muted); }

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--muted);
}

.empty-state .big { font-size: 40px; margin-bottom: 10px; }

/* ---------- Alertas / flash ---------- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(63,157,112,.25); }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(193,80,74,.25); }
.alert-info { background: rgba(201,161,90,.12); color: #8a6c2f; border: 1px solid rgba(201,161,90,.3); }

/* ---------- Paginação ---------- */
.pagination { display: flex; gap: 6px; margin-top: 20px; flex-wrap: wrap; }
.pagination a, .pagination span {
    padding: 8px 13px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--text);
}
.pagination a:hover { border-color: var(--gold); color: var(--gold); }
.pagination .active { background: var(--dark); color: var(--white); border-color: var(--dark); }

/* ---------- Badges de cupom pendente ---------- */
.progress-wrap { margin-top: 6px; background: var(--border); border-radius: 999px; height: 8px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--gold), var(--rose)); border-radius: 999px; }

.footer-note {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    margin-top: 30px;
}
