* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background: #0f1115;
    color: #e5e7eb;
}

/* ---- LOGIN ---- */
.login-page { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-box { background: #1a1d24; padding: 40px; border-radius: 16px; width: 340px; box-shadow: 0 10px 40px rgba(0,0,0,0.4); }
.login-box h1 { font-size: 22px; margin-bottom: 4px; }
.subtitle { color: #9ca3af; font-size: 13px; margin-bottom: 24px; }
.login-box label { display: block; font-size: 12px; color: #9ca3af; margin: 12px 0 4px; }
.login-box input {
    width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #2d313b;
    background: #12141a; color: #e5e7eb; font-size: 14px;
}
.login-box button {
    width: 100%; margin-top: 20px; padding: 12px; border: none; border-radius: 8px;
    background: #3b82f6; color: white; font-weight: 600; cursor: pointer; font-size: 14px;
}
.login-box button:hover { background: #2563eb; }
.hint { margin-top: 16px; font-size: 12px; color: #6b7280; text-align: center; }
.alert-error { background: #3f1d1d; color: #fca5a5; padding: 10px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.alert-ok { background: #1d3f24; color: #86efac; padding: 10px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }

/* ---- LAYOUT GERAL ---- */
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 24px; background: #1a1d24; border-bottom: 1px solid #2d313b;
}
.brand { font-weight: 700; font-size: 16px; }
.user-info { font-size: 13px; color: #9ca3af; }
.user-info a { color: #60a5fa; text-decoration: none; }
.container { max-width: 1300px; margin: 24px auto; padding: 0 20px; }

/* ---- PLACAR ---- */
.placar-card {
    background: #14161c; border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px; padding: 22px; margin-bottom: 22px;
}
.placar-card h2 { font-size: 15px; margin-bottom: 14px; font-weight: 700; letter-spacing: -0.01em; }
.placar-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.placar-table th { text-align: left; color: #9ca3af; padding: 8px; border-bottom: 1px solid #2d313b; font-weight: 500; }
.placar-table td { padding: 8px; border-bottom: 1px solid #22252c; }
.placar-table tr.me td { color: #60a5fa; font-weight: 600; }

/* ---- NAV SEMANA ---- */
.metas-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.btn-nav { color: #9ca3af; text-decoration: none; font-size: 13px; }
.btn-nav:hover { color: #e5e7eb; }
.semana-label { font-weight: 600; }

/* ---- BOARD DE METAS ---- */
.board { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.day-col { background: #14161c; border-radius: 10px; padding: 8px; min-height: 200px; }
.day-header { text-align: center; font-size: 12px; font-weight: 700; padding: 8px 0; color: #d1d5db; }
.day-header small { font-weight: 400; color: #6b7280; }

.meta-card {
    background: #1a1d24; border-radius: 8px; padding: 10px; margin-bottom: 8px;
    border-left: 4px solid #3b82f6; font-size: 12px;
}
.meta-card.card-done { opacity: 0.55; }
.meta-card.card-revisao { background: #26210f; }
.meta-materia { font-weight: 700; margin-bottom: 2px; }
.meta-assunto { color: #9ca3af; font-size: 11px; margin-bottom: 8px; }
.meta-footer { display: flex; justify-content: space-between; align-items: center; }
.meta-dur { color: #6b7280; font-size: 11px; }
.btn-toggle {
    background: #2d313b; border: none; color: #d1d5db; font-size: 10px;
    padding: 4px 8px; border-radius: 6px; cursor: pointer;
}
.btn-toggle:hover { background: #3b82f6; color: white; }

/* ---- ADMIN ---- */
.admin-form { background: #1a1d24; padding: 20px; border-radius: 12px; max-width: 400px; margin-bottom: 30px; }
.admin-form label { display: block; font-size: 12px; color: #9ca3af; margin: 10px 0 4px; }
.admin-form input {
    width: 100%; padding: 10px; border-radius: 8px; border: 1px solid #2d313b;
    background: #12141a; color: #e5e7eb;
}
.admin-form button {
    margin-top: 16px; padding: 10px 20px; border: none; border-radius: 8px;
    background: #22c55e; color: white; font-weight: 600; cursor: pointer;
}

/* ---- LAYOUT COM SIDEBAR ---- */
* { box-sizing: border-box; }
body { font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif; }

.app-layout { display: flex; min-height: 100vh; background: #0b0d11; }

.sidebar {
    width: 260px; flex-shrink: 0; background: #14161c;
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 24px 22px 20px;
}
.brand-icon {
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: flex; align-items: center; justify-content: center;
    color: white; flex-shrink: 0;
}
.brand-icon svg { width: 20px; height: 20px; }
.brand-text { font-weight: 800; font-size: 17px; line-height: 1.1; color: #f9fafb; }
.brand-text span { display: block; font-weight: 400; font-size: 12px; color: #6b7280; margin-top: 1px; }

.sidebar-profile {
    display: flex; align-items: center; gap: 12px;
    margin: 4px 16px 18px; padding: 14px; border-radius: 12px;
    background: rgba(255,255,255,0.03);
}
.avatar {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 13px;
}
.profile-info { min-width: 0; }
.profile-nome { font-size: 13px; font-weight: 600; color: #e5e7eb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-tag { font-size: 11px; color: #6b7280; margin-top: 1px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; padding: 4px 12px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    color: #9ca3af; text-decoration: none; padding: 11px 14px; font-size: 14px; font-weight: 500;
    border-radius: 10px; transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 2; }
.sidebar-nav a:hover { background: rgba(255,255,255,0.05); color: #e5e7eb; }
.sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(59,130,246,0.18), rgba(59,130,246,0.03));
    color: #60a5fa; font-weight: 700;
    box-shadow: inset 3px 0 0 #3b82f6;
}

.sidebar-footer { padding: 14px 12px 20px; }
.sidebar-logout {
    display: flex; align-items: center; gap: 10px;
    color: #f87171; text-decoration: none; font-size: 13px; font-weight: 500;
    padding: 10px 14px; border-radius: 10px; transition: background 0.15s ease;
}
.sidebar-logout svg { width: 16px; height: 16px; }
.sidebar-logout:hover { background: rgba(248,113,113,0.1); }

.content-area { flex: 1; padding: 28px 32px; overflow-x: auto; }

@media (max-width: 900px) {
    .app-layout { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; }
    .sidebar-brand { padding: 16px; }
    .sidebar-profile { margin: 0 16px 12px; }
    .sidebar-nav { flex-direction: row; overflow-x: auto; padding: 4px 16px 12px; }
    .sidebar-nav a { white-space: nowrap; }
    .sidebar-footer { padding: 0 16px 16px; }
}

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

/* ---- REGISTRO RÁPIDO ---- */
.quick-row { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.quick-row select, .quick-row input {
    padding: 10px 12px; border-radius: 8px; border: 1px solid #2d313b;
    background: #12141a; color: #e5e7eb; font-size: 14px; flex: 1; min-width: 140px;
}
.quick-buttons { display: flex; gap: 12px; margin: 16px 0; }
.btn-quick {
    flex: 1; padding: 18px; border: none; border-radius: 10px; font-size: 16px;
    font-weight: 700; cursor: pointer; color: white;
}
.btn-acertei { background: #16a34a; }
.btn-acertei:hover { background: #15803d; }
.btn-errei { background: #dc2626; }
.btn-errei:hover { background: #b91c1c; }
.quick-contador { text-align: center; font-size: 14px; color: #9ca3af; margin-top: 8px; }
.divisor { border: none; border-top: 1px solid #2d313b; margin: 24px 0; }

.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.radio-group { display: flex; gap: 16px; margin-top: 6px; }
.radio-opt { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #d1d5db; }
.nav-link { color: #60a5fa; text-decoration: none; font-size: 13px; margin-right: 12px; }
@media (max-width: 900px) {
    .grid-2col { grid-template-columns: 1fr; }
}

/* ---- FAIXAS / PATENTES ---- */
.patente-destaque {
    display: flex; align-items: center; gap: 20px;
    background: rgba(255,255,255,0.03); border-radius: 14px; padding: 20px;
    margin-bottom: 18px;
}
.patente-nome-grande { font-size: 20px; font-weight: 800; color: #f9fafb; }
.patente-sub { font-size: 13px; color: #9ca3af; margin-top: 4px; }

.faixa-status { font-size: 13px; color: #d1d5db; margin-bottom: 24px; }
.faixa-barra { background: #2d313b; border-radius: 6px; height: 8px; margin-top: 8px; overflow: hidden; }
.faixa-barra-fill { background: linear-gradient(90deg, #3b82f6, #22c55e); height: 100%; border-radius: 6px; }

.patentes-linha { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 12px; }
.patente-item {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 12px 6px; border-radius: 10px; background: rgba(255,255,255,0.02);
    opacity: 0.4; transition: opacity 0.2s ease;
}
.patente-item span { font-size: 10px; text-align: center; color: #9ca3af; line-height: 1.2; }
.patente-item.patente-ativa { opacity: 1; background: rgba(59,130,246,0.12); box-shadow: 0 0 0 1px rgba(59,130,246,0.4); }
.patente-item.patente-ativa span { color: #60a5fa; font-weight: 700; }
.patente-item.patente-bloqueada { opacity: 0.25; }
.patente-item:not(.patente-bloqueada):not(.patente-ativa) { opacity: 0.75; }
/* ---- AGENDA POR HORÁRIO ---- */
.schedule-title { display:flex; justify-content:space-between; align-items:center; gap:16px; margin:8px 0 18px; }
.schedule-title h2 { margin-bottom:4px; }
.schedule-title p { color:#6b7280; font-size:12px; }
.btn-edit-schedule,.btn-save-schedule,.btn-add { display:inline-flex; align-items:center; justify-content:center; border:0; border-radius:9px; padding:9px 13px; background:#2563eb; color:white; text-decoration:none; font-size:12px; font-weight:700; cursor:pointer; }
.btn-edit-schedule:hover,.btn-save-schedule:hover,.btn-add:hover { background:#1d4ed8; }
.week-schedule { display:grid; grid-template-columns:repeat(7,minmax(180px,1fr)); gap:10px; overflow-x:auto; }
.schedule-day { background:#0f1115; border:1px solid #22252c; border-radius:12px; padding:10px; min-width:180px; }
.schedule-day.today { border-color:rgba(59,130,246,.55); box-shadow:0 0 0 1px rgba(59,130,246,.12); }
.schedule-day-head { display:flex; justify-content:space-between; align-items:center; padding:4px 3px 10px; border-bottom:1px solid #22252c; margin-bottom:8px; }
.schedule-day-head strong { display:block; font-size:13px; }
.schedule-day-head span { display:block; color:#6b7280; font-size:11px; margin-top:2px; }
.schedule-day-head em { font-style:normal; font-size:9px; font-weight:800; color:#60a5fa; }
.schedule-slot { display:grid; grid-template-columns:52px 1fr auto; gap:8px; align-items:center; padding:9px 7px; margin-bottom:6px; border-radius:9px; background:#171a21; border-left:3px solid #4b5563; }
.slot-time { font-size:10px; color:#9ca3af; line-height:1.2; }
.slot-main { min-width:0; }
.slot-type { display:block; font-size:8px; font-weight:800; letter-spacing:.06em; color:#6b7280; margin-bottom:2px; }
.slot-main strong { display:block; font-size:11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.slot-main small { display:block; color:#9ca3af; font-size:9px; margin-top:2px; line-height:1.25; }
.type-estudo { border-left-color:#3b82f6; background:rgba(59,130,246,.08); }
.type-revisao { border-left-color:#22c55e; background:rgba(34,197,94,.07); }
.type-compromisso { border-left-color:#f59e0b; background:rgba(245,158,11,.07); }
.type-refeicao { border-left-color:#a78bfa; }
.type-pausa { border-left-color:#6b7280; }
.type-livre { border-left-color:#374151; }
.agenda-check { width:25px; height:25px; border:1px solid #374151; background:#111318; color:#9ca3af; border-radius:50%; cursor:pointer; font-weight:800; }
.agenda-check:hover { border-color:#3b82f6; color:#60a5fa; }
.schedule-done { opacity:.5; }
.schedule-done .agenda-check { background:#166534; border-color:#22c55e; color:#fff; }
.schedule-warning { color:#fbbf24; font-size:11px; padding:8px; background:rgba(245,158,11,.08); border-radius:8px; }
.schedule-warning a { color:#fbbf24; }
/* ---- EDITOR DE HORÁRIOS ---- */
.schedule-editor { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.day-editor { margin-bottom:0; }
.day-editor-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.day-editor-head h3 { font-size:14px; }
.editor-rows { display:flex; flex-direction:column; gap:8px; }
.editor-row { display:grid; grid-template-columns:85px 22px 85px 115px minmax(100px,1fr) 28px; gap:6px; align-items:center; }
.editor-row input,.editor-row select,.materia-select { width:100%; padding:8px; border-radius:7px; border:1px solid #2d313b; background:#12141a; color:#e5e7eb; font-size:11px; }
.editor-row span { text-align:center; color:#6b7280; font-size:10px; }
.btn-remove { border:0; background:transparent; color:#f87171; font-size:20px; cursor:pointer; }
.btn-save-schedule { margin-top:18px; padding:12px 18px; }
.batch-fields { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; margin:14px 0; }
.batch-fields label { display:block; font-size:11px; color:#9ca3af; margin-bottom:5px; }
.batch-fields input { width:100%; padding:10px 12px; border-radius:8px; border:1px solid #2d313b; background:#12141a; color:#e5e7eb; font-size:14px; }
.batch-result { display:flex; flex-direction:column; justify-content:center; padding:10px 12px; background:#12141a; border:1px solid #2d313b; border-radius:8px; }
.batch-result span { color:#9ca3af; font-size:11px; }
.batch-result strong { font-size:20px; margin-top:3px; }
.btn-batch { border:0; border-radius:9px; padding:11px 16px; background:#3b82f6; color:#fff; font-weight:700; cursor:pointer; }
.subject-competition { margin-top:16px; padding-top:14px; border-top:1px solid #22252c; }
.subject-competition h3 { font-size:13px; margin-bottom:8px; }
.subject-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:7px; }
@media (max-width:1100px) { .week-schedule { grid-template-columns:repeat(4,minmax(180px,1fr)); } }
@media (max-width:900px) { .schedule-title { align-items:flex-start; flex-direction:column; } .week-schedule { grid-template-columns:1fr; overflow-x:visible; } .schedule-day { min-width:0; } .schedule-editor { grid-template-columns:1fr; } .editor-row { grid-template-columns:72px 18px 72px 105px minmax(80px,1fr) 25px; } .batch-fields { grid-template-columns:1fr; } }


/* ===== CRONOGRAMA VISUAL — LAYOUT DIÁRIO ===== */
.cronograma-page{max-width:1180px;margin:0 auto;padding:4px 0 36px}
.cronograma-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin-bottom:22px}
.cronograma-heading .eyebrow{font-size:10px;font-weight:800;letter-spacing:.14em;color:#60a5fa;margin-bottom:6px}
.cronograma-heading h1{font-size:28px;line-height:1.1;letter-spacing:-.03em;color:#f8fafc;margin:0}
.cronograma-heading p{font-size:13px;color:#7f8a9b;margin-top:7px}
.period-badge{padding:10px 14px;border:1px solid rgba(255,255,255,.07);background:#11151d;border-radius:11px;color:#cbd5e1;font-size:12px;white-space:nowrap}
.cronograma-toolbar{display:grid;grid-template-columns:42px 1fr 42px;gap:10px;align-items:stretch;margin-bottom:18px}
.week-arrow{display:flex;align-items:center;justify-content:center;text-decoration:none;color:#cbd5e1;background:#111722;border:1px solid rgba(255,255,255,.07);border-radius:11px;font-size:30px;line-height:1;transition:.15s}
.week-arrow:hover{background:#182234;color:#fff;border-color:rgba(59,130,246,.5)}
.day-tabs{display:grid;grid-template-columns:repeat(7,1fr);gap:8px}
.day-tab{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:62px;text-decoration:none;color:#aab4c4;background:#11151d;border:1px solid rgba(255,255,255,.055);border-radius:11px;transition:.15s}
.day-tab strong{font-size:12px;color:#dbe4ef}.day-tab span{font-size:11px;color:#687589;margin-top:4px}
.day-tab:hover{background:#182131;color:#fff}.day-tab.active{background:linear-gradient(180deg,#1769e8,#1355c4);border-color:#3b8cff;box-shadow:0 8px 22px rgba(24,105,232,.18)}
.day-tab.active strong,.day-tab.active span{color:#fff}.day-tab.today:not(.active){box-shadow:inset 0 -2px 0 #60a5fa}
.day-agenda-card{background:linear-gradient(180deg,#11161f,#0e131a);border:1px solid rgba(255,255,255,.07);border-radius:18px;padding:22px;box-shadow:0 16px 50px rgba(0,0,0,.22)}
.day-agenda-head{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:2px 2px 20px}
.day-kicker{font-size:11px;font-weight:800;letter-spacing:.12em;color:#60a5fa;margin-bottom:5px}.day-agenda-head h2{font-size:22px;color:#f8fafc;letter-spacing:-.02em}
.phase-box{display:flex;flex-direction:column;align-items:flex-end;gap:5px}.phase-box span{background:rgba(34,197,94,.14);border:1px solid rgba(34,197,94,.25);color:#4ade80;padding:7px 10px;border-radius:999px;font-size:11px;font-weight:700}.phase-box strong{font-size:11px;color:#6f7d90;font-weight:500}
.agenda-table-head,.agenda-row{display:grid;grid-template-columns:170px minmax(250px,1.05fr) minmax(220px,1fr) 42px;align-items:center}
.agenda-table-head{padding:0 16px 9px;color:#69778b;font-size:10px;font-weight:800;letter-spacing:.09em}
.agenda-list{display:flex;flex-direction:column;gap:5px}.agenda-row{min-height:56px;padding:7px 10px 7px 16px;border:1px solid rgba(255,255,255,.035);border-radius:10px;background:#151b25;position:relative;overflow:hidden}.agenda-row:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:#334155}
.agenda-time{font-size:13px;font-weight:700;color:#dbe5f1;font-variant-numeric:tabular-nums}.agenda-time span{color:#586579;margin:0 3px}
.agenda-activity{display:flex;align-items:center;gap:11px}.agenda-icon{width:34px;height:34px;display:flex;align-items:center;justify-content:center;border-radius:9px;background:rgba(255,255,255,.045);font-size:16px}.agenda-activity strong{display:block;font-size:13px;color:#edf2f7}.agenda-activity small{display:block;font-size:9px;color:#718096;margin-top:2px;font-weight:700;letter-spacing:.06em}
.agenda-detail{font-size:12px;color:#9aa8ba;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agenda-action{display:flex;justify-content:flex-end}.dots{font-size:22px;color:#738196;line-height:1}
.agenda-row.agenda-estudo{background:rgba(37,99,235,.13)}.agenda-row.agenda-estudo:before{background:#3b82f6}.agenda-row.agenda-revisao{background:rgba(124,58,237,.16)}.agenda-row.agenda-revisao:before{background:#a855f7}.agenda-row.agenda-compromisso{background:rgba(239,68,68,.12)}.agenda-row.agenda-compromisso:before{background:#ef4444}.agenda-row.agenda-refeicao{background:rgba(245,158,11,.10)}.agenda-row.agenda-refeicao:before{background:#f59e0b}.agenda-row.agenda-pausa{background:rgba(34,197,94,.08)}.agenda-row.agenda-pausa:before{background:#22c55e}.agenda-row.agenda-livre{background:rgba(71,85,105,.17)}.agenda-row.agenda-livre:before{background:#64748b}
.agenda-row.is-done{opacity:.52}.agenda-check{width:27px;height:27px;border-radius:50%;border:1px solid #3b4a5e;background:#0d1219;color:#9fb0c3;font-weight:800;cursor:pointer}.agenda-check:hover{border-color:#60a5fa;color:#fff}.is-done .agenda-check{background:#166534;border-color:#22c55e;color:#fff}
.empty-day{min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:#8b98aa}.empty-day div{font-size:34px;margin-bottom:10px}.empty-day strong{color:#dbe4ef;font-size:15px}.empty-day span{font-size:12px;margin-top:5px}
@media(max-width:900px){.cronograma-heading{align-items:flex-start;flex-direction:column}.period-badge{align-self:stretch;text-align:center}.cronograma-toolbar{grid-template-columns:36px 1fr 36px}.day-tabs{overflow-x:auto;grid-template-columns:repeat(7,minmax(82px,1fr));padding-bottom:2px}.agenda-table-head{display:none}.agenda-row{grid-template-columns:105px 1fr 34px;gap:8px}.agenda-detail{grid-column:2}.agenda-action{grid-column:3;grid-row:1 / span 2}.agenda-time{font-size:11px}.agenda-activity strong{font-size:12px}.day-agenda-card{padding:14px}.day-agenda-head{align-items:flex-start}.phase-box{display:none}}
@media(max-width:560px){.cronograma-page{padding-top:0}.cronograma-heading h1{font-size:23px}.cronograma-toolbar{grid-template-columns:30px 1fr 30px}.day-tab{min-height:56px}.day-tab strong{font-size:11px}.day-agenda-head h2{font-size:18px}.agenda-row{grid-template-columns:88px 1fr 30px;padding-left:12px}.agenda-time{font-size:10px}.agenda-icon{width:29px;height:29px;font-size:14px}.agenda-activity{gap:7px}.agenda-detail{font-size:10px}}
