/* =============================================
   ARITMÉTICA MÁGICA — Reservas v3
   Ambiente: mocho roxo/azul LearnWorlds
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
    --navy:    #1a1040;
    --purple:  #6B21E8;
    --violet:  #9333EA;
    --cyan:    #22D3EE;
    --pink:    #E040FB;
    --gold:    #F5C542;
    --bg:      #0D0B1A;
    --bg2:     #13102A;
    --bg3:     #1C1840;
    --border:  rgba(107,33,232,0.3);
    --text:    #E8E4FF;
    --muted:   #8B83B8;
    --success: #22C55E;
    --danger:  #EF4444;
    --warning: #F59E0B;
    --radius:  12px;
    --shadow:  0 4px 32px rgba(107,33,232,0.2);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Space Grotesk', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
}

/* ── BACKGROUND mocho ── */
body.has-bg {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(107,33,232,0.25) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(34,211,238,0.08) 0%, transparent 50%),
        #0D0B1A;
    background-attachment: fixed;
}

/* ── NAVBAR ── */
.navbar {
    background: rgba(13,11,26,0.92);
    border-bottom: 1px solid var(--border);
    padding: 12px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar-brand img { height: 120px; width: auto; }

@media (max-width: 640px) {
    .navbar-brand img { height: 80px; }
}
.navbar-nav { display: flex; gap: 20px; align-items: center; }
.navbar-nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color .2s;
}
.navbar-nav a:hover, .navbar-nav a.active { color: var(--cyan); }
.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
}
.badge-patente {
    background: linear-gradient(135deg, var(--purple), var(--violet));
    border: 1px solid rgba(147,51,234,0.5);
    color: #fff;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
}

/* ── CONTAINER ── */
.container { max-width: 1100px; margin: 0 auto; padding: 32px 20px; }

/* ── CARDS ── */
.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
}
.card-header { border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-bottom: 24px; }
.card-title   { font-size: 18px; font-weight: 700; }
.card-subtitle { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ── FORMULÁRIOS ── */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 14px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}
.form-control:focus {
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(147,51,234,0.2);
}
select.form-control option { background: var(--bg2); }

/* ── BOTÕES ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all .2s;
}
.btn-primary {
    background: linear-gradient(135deg, var(--purple), var(--violet));
    color: #fff;
    box-shadow: 0 2px 16px rgba(107,33,232,0.4);
}
.btn-primary:hover { filter: brightness(1.15); transform: translateY(-1px); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-warning { background: var(--warning); color: #000; font-weight: 700; }
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
}
.btn-ghost:hover { border-color: var(--violet); color: var(--violet); }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* ── ALERTAS ── */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 18px;
    border-left: 3px solid;
}
.alert-success { background: rgba(34,197,94,.12);  border-color: var(--success); color: #86efac; }
.alert-danger  { background: rgba(239,68,68,.12);  border-color: var(--danger);  color: #fca5a5; }
.alert-info    { background: rgba(107,33,232,.12); border-color: var(--violet);  color: #c4b5fd; }
.alert-warning { background: rgba(245,158,11,.12); border-color: var(--warning); color: #fcd34d; }

/* ── TABELA ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
    background: var(--bg3);
    color: var(--muted);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: .5px;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
tbody td { padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.04); vertical-align: middle; }
tbody tr:hover { background: rgba(107,33,232,.05); }

/* ── LOGIN ── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(107,33,232,0.35) 0%, transparent 65%),
        radial-gradient(ellipse at 80% 70%, rgba(34,211,238,0.1) 0%, transparent 50%),
        #0D0B1A;
}
.login-card {
    width: 100%;
    max-width: 440px;
    background: rgba(19,16,42,0.95);
    border: 1px solid rgba(147,51,234,0.4);
    border-radius: 20px;
    padding: 44px 40px;
    box-shadow: 0 8px 64px rgba(107,33,232,0.3);
    backdrop-filter: blur(20px);
}
.login-logo { text-align: center; margin-bottom: 8px; }
.login-logo img { height: 80px; }
.login-titulo { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 4px; }
.login-sub { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 28px; }

/* ── CALENDÁRIO ── */
.cal-dia {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-height: 100px;
    padding: 8px;
    transition: border-color .2s;
}
.cal-dia.hoje { border-color: var(--cyan); box-shadow: 0 0 12px rgba(34,211,238,0.2); }
.cal-dia-header { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.cal-dia-num { font-size: 16px; font-weight: 700; margin-bottom: 6px; }

.cal-slot-mini {
    padding: 4px 7px;
    border-radius: 5px;
    margin-bottom: 4px;
    font-size: 10px;
    cursor: pointer;
    transition: filter .15s;
    border: 1px solid transparent;
    line-height: 1.3;
}
.cal-slot-mini:hover { filter: brightness(1.25); }
.cal-slot-mini.presencial {
    background: rgba(245,197,66,.12);
    border-color: rgba(245,197,66,.3);
    color: var(--gold);
}
.cal-slot-mini.teams {
    background: rgba(34,211,238,.1);
    border-color: rgba(34,211,238,.25);
    color: var(--cyan);
}
.cal-slot-mini.reservado {
    background: rgba(34,197,94,.12);
    border-color: rgba(34,197,94,.3);
    color: #86efac;
}
.cal-slot-mini.encerrado {
    background: rgba(239,68,68,.08);
    border-color: rgba(239,68,68,.2);
    color: #fca5a5;
    cursor: default;
}
.cal-slot-mini.lotado { opacity: .4; cursor: default; }
.cal-slot-mini.evento {
    background: linear-gradient(135deg, rgba(245,197,66,.28), rgba(245,130,0,.12));
    border: 2px solid rgba(245,197,66,.7) !important;
    color: #F5C542;
    box-shadow: 0 0 12px rgba(245,197,66,.3), inset 0 1px 0 rgba(255,255,255,.1);
    font-weight: 600;
    position: relative;
}
.cal-slot-mini.evento::before {
    content: "⭐";
    font-size: 8px;
    position: absolute;
    top: 2px;
    right: 3px;
    line-height: 1;
}
.cal-slot-mini.evento:hover { box-shadow: 0 0 18px rgba(245,197,66,.5); filter: brightness(1.1); }
.cal-slot-mini.evento-conv {
    background: linear-gradient(135deg, rgba(147,51,234,.35), rgba(107,33,232,.15));
    border: 2px solid rgba(147,51,234,.8) !important;
    color: #e0cfff;
    box-shadow: 0 0 12px rgba(147,51,234,.3), inset 0 1px 0 rgba(255,255,255,.1);
    font-weight: 600;
    position: relative;
}
.cal-slot-mini.evento-conv::before {
    content: "🎟";
    font-size: 8px;
    position: absolute;
    top: 2px;
    right: 3px;
    line-height: 1;
}
.cal-slot-mini.evento-conv:hover { box-shadow: 0 0 18px rgba(147,51,234,.5); filter: brightness(1.1); }

/* ── TIPO BADGE ── */
.slot-tipo {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 3px 10px;
    border-radius: 20px;
}
.slot-tipo.presencial { background: rgba(245,197,66,.15); color: var(--gold); border: 1px solid rgba(245,197,66,.3); }
.slot-tipo.teams      { background: rgba(34,211,238,.12); color: var(--cyan); border: 1px solid rgba(34,211,238,.3); }

/* ── MODAL ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    z-index: 500;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: var(--bg2);
    border: 1px solid rgba(147,51,234,0.5);
    border-radius: 16px;
    padding: 32px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 8px 64px rgba(107,33,232,0.4);
    animation: modalIn .2s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(-20px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ── FILTROS ── */
.filtros { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filtro-btn {
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
    text-decoration: none;
}
.filtro-btn:hover {
    border-color: rgba(107,33,232,.5);
    color: var(--text);
    background: rgba(107,33,232,.08);
}
.filtro-btn.ativo {
    border-color: var(--violet);
    border-width: 2px;
    color: var(--cyan);
    background: rgba(107,33,232,.2);
    box-shadow: 0 0 10px rgba(107,33,232,.3);
}

/* ── SECTION ── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.section-title { font-size: 22px; font-weight: 700; }
.section-title span { color: var(--cyan); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

.slot-data {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--cyan);
}

.periodo-nav { display: flex; align-items: center; gap: 10px; }
.periodo-label { font-size: 15px; font-weight: 700; min-width: 180px; text-align: center; }

.patente-rec {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    padding: 10px 12px;
    background: var(--bg3);
    border-radius: 8px;
    font-size: 12px;
    color: var(--muted);
    border: 1px solid var(--border);
}

/* ── CAL MES ── */
.cal-mes {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}
.cal-mes-titulo { font-size: 14px; font-weight: 700; color: var(--cyan); margin-bottom: 12px; }

@media (max-width: 640px) {
    .navbar { padding: 10px 14px; }
    .container { padding: 16px 12px; }
    .login-card { padding: 28px 20px; }
    .section-header { flex-direction: column; align-items: flex-start; }
}
