*{box-sizing:border-box}
html,body{height:100%}

:root{
  --bg0:#f5f6fb;
  --bg1:#eef1f7;
  --ink:#0b1220;
  --muted:rgba(11,18,32,.72);
  --border:rgba(15,23,42,.12);
  --border2:rgba(15,23,42,.08);
  --card:rgba(255,255,255,.82);
  --cardSolid:#ffffff;
  --shadow:0 30px 80px rgba(2,6,23,.12);
  --shadow2:0 18px 50px rgba(2,6,23,.12);
  --radius:26px;
}

body{
  margin:0;
  color:var(--ink);
  font-family:-apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, system-ui, Segoe UI, Roboto, sans-serif;
  background:
    radial-gradient(900px 420px at 15% 10%, rgba(99,102,241,.10), transparent 60%),
    radial-gradient(900px 420px at 85% 20%, rgba(34,197,94,.08), transparent 55%),
    radial-gradient(1200px 600px at 50% 100%, rgba(2,132,199,.08), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

/* Home centrado */
body.home{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:56px 28px;
}

/* Páginas longas (dashboard, listas) */
body.page{
  min-height:100vh;
  padding:42px 28px;
}

/* Containers */
.wrap{width:100%; max-width:980px; margin:0 auto}
.wrap.wide{max-width:1220px}

.shell{
  width:100%;
  max-width:980px;
  margin:0 auto;
}

/* Cartões */
.card, .panel{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  backdrop-filter:blur(14px);
  box-shadow:var(--shadow);
}

.card{
  padding:46px;
}

.panel{
  padding:34px;
}

/* Header (form pages) */
.top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
}

.h1{
  font-size:30px;
  font-weight:900;
  letter-spacing:-0.02em;
  margin:0;
}

.sub{
  margin-top:8px;
  font-size:15px;
  color:var(--muted);
}

/* Header (index) */
.hero{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:22px;
}

.title{
  margin:0;
  font-size:34px;
  font-weight:900;
  letter-spacing:-0.02em;
}

.subtitle{
  margin:10px 0 0;
  color:var(--muted);
  font-size:16px;
  line-height:1.35;
}

.toplink{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius:999px;
  background:rgba(255,255,255,.75);
  border:1px solid var(--border);
  color:var(--ink);
  text-decoration:none;
  font-weight:800;
  box-shadow:0 10px 22px rgba(2,6,23,.08);
  transition:box-shadow 180ms ease, background 180ms ease, filter 180ms ease;
}

.toplink:hover{
  background:rgba(255,255,255,.90);
  box-shadow:0 14px 28px rgba(2,6,23,.10);
  filter:saturate(1.02);
}

a.link{
  font-weight:900;
  color:var(--ink);
  text-decoration:none;
}

a.link:hover{opacity:.85}

/* Botões grandes (index) */
.actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
  margin-top:4px;
}

.action_btn{
  height:86px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:22px;
  text-decoration:none;
  font-weight:900;
  font-size:20px;
  letter-spacing:-0.01em;
  transform:none;
  transition:box-shadow 180ms ease, filter 180ms ease, background 180ms ease, border-color 180ms ease;
}

.action_btn.primary{
  color:#fff;
  background:linear-gradient(135deg, #0b1220, #111a2e);
  box-shadow:0 18px 45px rgba(2,6,23,.20);
}

.action_btn.primary:hover{
  box-shadow:0 24px 60px rgba(2,6,23,.24);
  filter:saturate(1.03);
}

.action_btn.secondary{
  color:var(--ink);
  background:rgba(255,255,255,.92);
  border:1px solid var(--border);
  box-shadow:0 14px 32px rgba(2,6,23,.10);
}

.action_btn.secondary:hover{
  border-color:var(--border);
  box-shadow:0 18px 44px rgba(2,6,23,.12);
  filter:saturate(1.02);
}

.grid{
  display:flex;
  flex-direction:column;
  gap:14px;
}

/* Mensagens */
.msg{
  padding:12px 14px;
  border-radius:14px;
  background:rgba(15,23,42,.06);
  margin:12px 0;
  border:1px solid rgba(15,23,42,.06);
}

/* Formulários */
.field{display:flex;flex-direction:column;gap:6px;margin:12px 0}
label{font-weight:800}

input{
  padding:14px 14px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.14);
  font-size:16px;
  background:rgba(255,255,255,.95);
}

input:focus{
  outline:none;
  border-color:rgba(15,23,42,.22);
  box-shadow:0 0 0 4px rgba(2,6,23,.08);
}

button{
  padding:14px 16px;
  border-radius:14px;
  border:0;
  background:linear-gradient(135deg, #0b1220, #111a2e);
  color:#fff;
  font-weight:900;
  font-size:16px;
  cursor:pointer;
  box-shadow:0 16px 34px rgba(2,6,23,.20);
  transition:box-shadow 180ms ease, filter 180ms ease;
}

button:hover{
  box-shadow:0 22px 52px rgba(2,6,23,.24);
  filter:saturate(1.03);
}

/* Dashboard */
.dash_grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:14px;
  margin:10px 0 14px;
}

.stat{
  background:rgba(255,255,255,.92);
  border:1px solid var(--border2);
  border-radius:18px;
  padding:14px 16px;
  box-shadow:0 10px 26px rgba(2,6,23,.08);
}

.stat a{
  color:var(--ink);
  text-decoration:none;
  font-weight:900;
}

.stat_label{font-size:13px; color:var(--muted); margin:0 0 6px}
.stat_num{font-size:22px; font-weight:900; margin:0}

.chart_card{
  background:rgba(255,255,255,.92);
  border:1px solid var(--border2);
  border-radius:18px;
  padding:14px 16px;
  box-shadow:0 10px 26px rgba(2,6,23,.08);
  margin:10px 0 16px;
}

.table_wrap{overflow:auto; border-radius:18px}

table{width:100%; border-collapse:separate; border-spacing:0}
th,td{padding:14px 12px; text-align:left; vertical-align:middle}
thead th{font-weight:900; font-size:13px; color:rgba(11,18,32,.78)}

tbody tr{
  background:rgba(255,255,255,.92);
  border:1px solid var(--border2);
}

tbody tr:nth-child(even){
  background:rgba(15,23,42,.03);
}

tbody td:first-child{border-top-left-radius:14px;border-bottom-left-radius:14px}
tbody td:last-child{border-top-right-radius:14px;border-bottom-right-radius:14px}

/* Botão de imprimir na lista com fundo claro */
table .modal_btn,
table .btn,
table a.action_print{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 12px;
  border-radius:999px;
  text-decoration:none;
  font-weight:900;
  color:var(--ink);
  background:rgba(255,255,255,.92);
  border:1px solid var(--border);
  box-shadow:0 10px 22px rgba(2,6,23,.08);
  transition:box-shadow 180ms ease, background 180ms ease, filter 180ms ease;
}

table .modal_btn:hover,
table .btn:hover,
table a.action_print:hover{
  background:rgba(255,255,255,.98);
  box-shadow:0 14px 30px rgba(2,6,23,.10);
  filter:saturate(1.02);
}

/* Segmented (tabs) */
.segmented{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin:14px 0 10px;
}

.pill{
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.75);
  text-decoration:none;
  color:var(--ink);
  font-weight:900;
}

.pill.is_active{
  background:linear-gradient(135deg, #0b1220, #111a2e);
  color:#fff;
  border-color:rgba(2,6,23,.35);
}

/* Modal */
.modal_backdrop{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:22px;
  background:rgba(2,6,23,.45);
  backdrop-filter:blur(3px);
  opacity:0;
  pointer-events:none;
  transition:opacity 160ms ease;
  z-index:9999;
}

.modal_panel{
  width:min(760px, 100%);
  border-radius:22px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.86);
  box-shadow:0 30px 90px rgba(2,6,23,.30);
  padding:20px;
  transform:translateY(10px) scale(.98);
  transition:transform 160ms ease;
}

.modal_title{
  font-size:20px;
  font-weight:900;
  letter-spacing:-0.01em;
  margin:0 0 6px;
}

.modal_text{
  margin:0;
  opacity:.82;
  font-size:15px;
  line-height:1.35;
}

.modal_actions{
  display:flex;
  justify-content:flex-end;
  gap:12px;
  margin-top:16px;
  flex-wrap:wrap;
}

.modal_btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:12px 16px;
  border-radius:16px;
  border:0;
  background:linear-gradient(135deg, #0b1220, #111a2e);
  color:#fff;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 16px 34px rgba(2,6,23,.20);
  text-decoration:none;
  transition:box-shadow 180ms ease, filter 180ms ease;
}

.modal_btn:hover{
  box-shadow:0 22px 52px rgba(2,6,23,.24);
  filter:saturate(1.03);
}

.modal_backdrop.is_open{opacity:1;pointer-events:auto}
.modal_backdrop.is_open .modal_panel{transform:translateY(0) scale(1)}

/* Responsivo */
@media(max-width:900px){
  body.home{padding:42px 18px}
  body.page{padding:26px 18px}
  .card{padding:30px}
  .panel{padding:22px}
  .actions{grid-template-columns:1fr; gap:14px}
  .action_btn{height:74px}
  .dash_grid{grid-template-columns:1fr}
  .hero{flex-direction:column; align-items:flex-start}
}

/* Botões grandes do index */
a.big{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px 18px;
  border-radius:18px;
  font-weight:900;
  text-decoration:none;
  border:1px solid rgba(15,23,42,0.12);
  background:rgba(255,255,255,0.85);
  color:#0b1220;
  box-shadow:0 16px 40px rgba(2,6,23,0.10);
}

a.big.primary{
  color:#fff;
  background:linear-gradient(135deg, #0b1220, #111a2e);
  box-shadow:0 18px 45px rgba(2,6,23,.20);
  border-color:transparent;
}

a.big.primary:hover{
  box-shadow:0 24px 60px rgba(2,6,23,.24);
  filter:saturate(1.03);
}

a.big.secondary{
  background:rgba(255,255,255,0.92);
}

a.big.secondary:hover{
  box-shadow:0 24px 60px rgba(2,6,23,.14);
}

/* Botão pequeno "Dashboard" */
a.chip_btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 12px;
  border-radius:999px;
  font-weight:900;
  text-decoration:none;
  color:#0b1220;
  background:rgba(255,255,255,0.92);
  border:1px solid rgba(15,23,42,0.12);
  box-shadow:0 10px 22px rgba(2,6,23,0.08);
}
a.chip_btn:hover{
  box-shadow:0 16px 40px rgba(2,6,23,0.12);
}
