/* ============================================================================
 *  PAINEL ADMINISTRATIVO — ÁGUIA SIMULADOS
 *  Paleta e tipografia herdadas do site público (concursos/*.html)
 * ========================================================================== */

:root {
  --gold:        #f5b025;
  --gold-dark:   #b88214;
  --navy:        #001432;
  --blue:        #1e3a5f;
  --green:       #22c55e;
  --green-dark:  #16a34a;
  --red:         #dc2626;
  --orange:      #f59e0b;
  --bg-body:     #f4f6f9;
  --bg-card:     #ffffff;
  --border:      #e5e7eb;
  --text-main:   #111827;
  --text-muted:  #4b5563;
  --shadow:      0 2px 8px rgba(0, 20, 50, .07);
  --shadow-lg:   0 8px 28px rgba(0, 20, 50, .14);
}

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

body {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
}

h1, h2, h3 { font-family: 'Merriweather', Georgia, serif; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.sidebar {
  width: 248px;
  background: linear-gradient(180deg, var(--navy) 0%, var(--blue) 100%);
  color: #fff;
  padding: 1.4rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.brand { display: flex; align-items: center; gap: .6rem; padding: .2rem .4rem 1.1rem; }
.brand .logo {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--gold); color: var(--navy);
  display: grid; place-items: center; font-size: 1.3rem; font-weight: 800;
  font-family: 'Merriweather', serif;
}
.brand b { font-size: 1.05rem; line-height: 1.1; }
.brand small { color: #9fb4d4; font-size: .7rem; letter-spacing: .04em; }

.nav-btn {
  display: flex; align-items: center; gap: .7rem;
  padding: .65rem .8rem; border-radius: 10px;
  color: #d4ddec; font-size: .92rem; font-weight: 500;
  cursor: pointer; border: none; background: transparent; width: 100%;
  text-align: left; transition: background .15s, color .15s;
}
.nav-btn .ic { width: 20px; text-align: center; }
.nav-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-btn.active { background: var(--gold); color: var(--navy); font-weight: 700; }
.nav-spacer { flex: 1; }
.nav-foot { font-size: .68rem; color: #7f94b5; padding: .6rem .5rem; }

.main { flex: 1; padding: 1.6rem 2rem 3rem; max-width: 1280px; }

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.3rem; flex-wrap: wrap; gap: .8rem; }
.topbar h1 { font-size: 1.5rem; color: var(--navy); }
.topbar .sub { color: var(--text-muted); font-size: .85rem; }

.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  font-family: inherit; font-size: .85rem; font-weight: 600;
  padding: .5rem .9rem; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border); background: #fff; color: var(--text-main);
  display: inline-flex; align-items: center; gap: .45rem; transition: .15s;
}
.btn:hover { border-color: var(--gold); }
.btn-primary { background: var(--gold); border-color: var(--gold-dark); color: var(--navy); }
.btn-primary:hover { background: var(--gold-dark); color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--red); border-color: #f3c2c2; }
.btn-danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn-sm { padding: .3rem .6rem; font-size: .76rem; }

/* ---------- Cards / Stats ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.card {
  background: var(--bg-card); border-radius: 14px; padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow); border-top: 4px solid var(--gold);
}
.card .num { font-size: 2rem; font-weight: 800; font-family: 'Merriweather', serif; color: var(--navy); }
.card .lbl { color: var(--text-muted); font-size: .82rem; margin-top: .15rem; }
.card.green  { border-top-color: var(--green); }
.card.green  .num { color: var(--green-dark); }
.card.red    { border-top-color: var(--red); }
.card.red    .num { color: var(--red); }
.card.blue   { border-top-color: var(--blue); }
.card.blue   .num { color: var(--blue); }

.panel { background: var(--bg-card); border-radius: 14px; box-shadow: var(--shadow); padding: 1.3rem 1.4rem; margin-bottom: 1.4rem; }
.panel h2 { font-size: 1.1rem; color: var(--navy); margin-bottom: .9rem; display: flex; align-items: center; gap: .5rem; }

/* ---------- Badges / status ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700; padding: .18rem .55rem; border-radius: 100px; }
.badge.disp   { background: #dcfce7; color: var(--green-dark); }
.badge.hoje   { background: #fef3c7; color: var(--gold-dark); }
.badge.atras  { background: #fee2e2; color: var(--red); }
.badge.futuro { background: #dbeafe; color: var(--blue); }
.badge.vespera{ background: #fde68a; color: #92400e; }
.badge.obs    { background: #ede9fe; color: #6d28d9; }
.badge.gray   { background: #f1f5f9; color: #64748b; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .7rem; font-size: .86rem; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; }
tr:hover td { background: #fafbfd; }

/* ---------- Concurso accordion ---------- */
.concurso { background: var(--bg-card); border-radius: 12px; box-shadow: var(--shadow); margin-bottom: .9rem; overflow: hidden; }
.concurso-head { display: flex; align-items: center; gap: .8rem; padding: .9rem 1.1rem; cursor: pointer; }
.concurso-head:hover { background: #fafbfd; }
.concurso-head .chev { transition: transform .2s; color: var(--text-muted); }
.concurso.open .concurso-head .chev { transform: rotate(90deg); }
.concurso-title { flex: 1; }
.concurso-title b { font-size: .98rem; color: var(--navy); }
.concurso-title .meta { font-size: .76rem; color: var(--text-muted); margin-top: .15rem; }
.concurso-body { display: none; padding: 0 1.1rem 1rem; }
.concurso.open .concurso-body { display: block; }

.deliverables { display: flex; gap: .35rem; }
.toggle {
  border: 1px solid var(--border); background: #fff; border-radius: 7px;
  padding: .22rem .5rem; font-size: .72rem; font-weight: 600; cursor: pointer;
  color: #94a3b8; display: inline-flex; align-items: center; gap: .3rem; transition: .12s;
}
.toggle.on { background: #dcfce7; border-color: #86efac; color: var(--green-dark); }
.toggle:hover { border-color: var(--gold); }

.apostila-row { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; font-size: .85rem; }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.cal-head h2 { font-size: 1.25rem; color: var(--navy); text-transform: capitalize; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: .72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; padding: .3rem 0; }
.cal-cell { background: #fff; border: 1px solid var(--border); border-radius: 9px; min-height: 92px; padding: .35rem .4rem; display: flex; flex-direction: column; gap: .25rem; }
.cal-cell.empty { background: transparent; border: none; }
.cal-cell.today { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.cal-cell .daynum { font-size: .78rem; font-weight: 700; color: var(--text-muted); }
.cal-cell.today .daynum { color: var(--gold-dark); }
.cal-evt { font-size: .68rem; line-height: 1.25; padding: .12rem .35rem; border-radius: 5px; cursor: default; border-left: 3px solid; background: #f8fafc; }
.cal-evt.disp   { border-color: var(--green); background: #f0fdf4; }
.cal-evt.atras  { border-color: var(--red); background: #fef2f2; }
.cal-evt.futuro { border-color: var(--blue); background: #eff6ff; }
.cal-evt b { font-weight: 700; }
.cal-legend { display: flex; gap: 1.1rem; flex-wrap: wrap; margin-top: 1rem; font-size: .78rem; color: var(--text-muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* ---------- Upcoming list ---------- */
.up-day { font-weight: 700; color: var(--navy); margin: 1rem 0 .4rem; font-size: .92rem; display: flex; align-items: center; gap: .5rem; }
.up-item { display: flex; align-items: center; gap: .6rem; padding: .45rem .7rem; border-radius: 8px; background: #fff; box-shadow: var(--shadow); margin-bottom: .4rem; font-size: .86rem; }
.up-item .n { margin-left: auto; font-weight: 600; color: var(--gold-dark); }

/* ---------- Misc ---------- */
.empty-state { text-align: center; padding: 2.5rem; color: var(--text-muted); }
.flex { display: flex; align-items: center; gap: .6rem; }
.muted { color: var(--text-muted); }
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: #fff; padding: .7rem 1.2rem; border-radius: 10px;
  box-shadow: var(--shadow-lg); font-size: .85rem; opacity: 0; pointer-events: none;
  transition: .25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.hidden { display: none !important; }

@media (max-width: 820px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; gap: .25rem; }
  .brand { width: 100%; }
  .nav-spacer, .nav-foot { display: none; }
  .nav-btn { width: auto; }
  .main { padding: 1.1rem; }
  .calendar { gap: 3px; }
  .cal-cell { min-height: 64px; }
}
