:root{
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface2: rgba(255,255,255,.78);

  --text: #0b1220;
  --muted: #667085;

  --line: rgba(15,23,42,.10);
  --line2: rgba(15,23,42,.07);

  --shadow: 0 18px 60px rgba(2,6,23,.10);
  --shadow2: 0 10px 26px rgba(2,6,23,.08);

  --radius: 18px;
  --radius2: 14px;

  --primary: #0b1220;
  --primary2: #121b30;

  --ok: #16a34a;
  --warn: #f59e0b;
  --bad: #ef4444;

  --okbg: rgba(22,163,74,.10);
  --warnbg: rgba(245,158,11,.12);
  --badbg: rgba(239,68,68,.10);
}

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

body{
  margin:0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 30% -10%, rgba(17,24,39,.06), transparent 60%),
    radial-gradient(900px 420px at 90% 0%, rgba(2,132,199,.06), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}

.wrap{
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px;
}

.page{ padding-top: 16px; }

/* =========================
   TOPBAR (luxo, clean)
========================= */
.topbar{
  position: sticky;
  top:0;
  z-index: 50;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}

.topbar__left{
  display:flex;
  align-items:center;
  gap:14px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
}

/* ? logo ajustada (tava enorme com 86px) */
.brand__logo{
  height: 46px;
  width:auto;
  object-fit:contain;
  filter: drop-shadow(0 10px 20px rgba(2,6,23,.10));
}

/* chip “Sistema interno” */
.chip{
  display:inline-flex;
  align-items:center;
  padding:8px 12px;
  border-radius:999px;
  font-weight: 950;
  font-size: 12px;
  border: 1px solid rgba(59,130,246,.22);
  background: rgba(59,130,246,.08);
  color: #1d4ed8;
}

/* nav premium */
.nav{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.nav a{
  padding:10px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: rgba(15,23,42,.60);
  font-weight: 950;
  font-size: 14px;
  transition: .16s ease;
}

.nav a:hover{
  background: rgba(15,23,42,.04);
  border-color: rgba(15,23,42,.08);
  color: var(--text);
}

.nav a.active{
  background: rgba(11,18,32,.95);
  color:#fff;
  border-color: rgba(11,18,32,.95);
  box-shadow: 0 14px 30px rgba(2,6,23,.16);
}

/* usuário / logout */
.user{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  border-radius: 999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.72);
  box-shadow: 0 12px 26px rgba(2,6,23,.06);
}

.user__avatar{
  width:34px;
  height:34px;
  border-radius:999px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.55), transparent 55%),
    linear-gradient(135deg, #0b1220, #334155);
  box-shadow: 0 12px 30px rgba(2,6,23,.18);
}

.user__name{
  font-weight: 950;
  font-size: 14px;
  color: var(--text);
  padding: 0 4px;
}

/* =========================
   ALERTS
========================= */
.alert{
  border-radius: var(--radius2);
  border: 1px solid var(--line);
  padding: 12px 14px;
  font-weight: 950;
  font-size: 14px;
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow2);
  margin-bottom: 12px;
}

.alert--ok{
  border-color: rgba(22,163,74,.22);
  background: rgba(22,163,74,.08);
  color: #14532d;
}

.alert--bad{
  border-color: rgba(239,68,68,.22);
  background: rgba(239,68,68,.08);
  color:#7f1d1d;
}

/* =========================
   BUTTONS
========================= */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.92);
  color: var(--text);
  font-weight: 950;
  font-size: 14px;
  cursor:pointer;
  transition: .15s ease;
  box-shadow: 0 10px 25px rgba(2,6,23,.06);
}

.btn:hover{
  transform: translateY(-1px);
  background: #fff;
  box-shadow: 0 14px 32px rgba(2,6,23,.08);
}

.btn--primary{
  background: linear-gradient(180deg, rgba(11,18,32,.98), rgba(11,18,32,.90));
  border-color: rgba(11,18,32,.95);
  color:#fff;
}
.btn--primary:hover{ filter:brightness(.98); }

.btn--danger{
  background: rgba(239,68,68,.08);
  border-color: rgba(239,68,68,.22);
  color: #dc2626;
}

.btn--ghost-danger{
  background: rgba(239,68,68,.08);
  border-color: rgba(239,68,68,.22);
  color: #dc2626;
  border-radius: 999px;
  padding:10px 14px;
  box-shadow:none;
}
.btn--ghost-danger:hover{
  transform: translateY(-1px);
  background: rgba(239,68,68,.12);
}

/* =========================
   PANEL / HEADERS
========================= */
.panel{
  border-radius: var(--radius);
  border:1px solid var(--line);
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.panel-head{
  padding: 22px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(900px 240px at 10% 0%, rgba(17,24,39,.06), transparent 60%),
    radial-gradient(900px 240px at 90% 0%, rgba(2,132,199,.05), transparent 60%),
    rgba(255,255,255,.92);
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.h1{
  margin:0;
  font-size: 28px;
  font-weight: 980;
  letter-spacing: -.03em;
  line-height: 1.1;
}

.sub{
  margin: 8px 0 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.panel-body{ padding: 18px; }

.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
}

/* =========================
   GRID / CARDS
========================= */
.grid{ display:grid; gap:14px; }
.cols-4{ grid-template-columns: repeat(4, minmax(0,1fr)); }
.cols-3{ grid-template-columns: repeat(3, minmax(0,1fr)); }
.cols-2{ grid-template-columns: repeat(2, minmax(0,1fr)); }

@media(max-width:1100px){ .cols-4{grid-template-columns: repeat(2, minmax(0,1fr));} }
@media(max-width:740px){ .cols-4,.cols-3,.cols-2{grid-template-columns: 1fr;} }

.card{
  background: rgba(255,255,255,.88);
  border: 1px solid var(--line2);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 14px 35px rgba(2,6,23,.07);
}

.card-title{
  font-weight: 950;
  color: rgba(15,23,42,.86);
  font-size: 14px;
}

.kpi{
  margin-top: 8px;
  font-size: 34px;
  font-weight: 990;
  letter-spacing: -.03em;
}

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

/* pills */
.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.85);
  font-weight: 950;
  font-size: 12px;
  color: rgba(15,23,42,.86);
}

.pill--ok{ background: var(--okbg); border-color: rgba(22,163,74,.22); color:#166534; }
.pill--warn{ background: var(--warnbg); border-color: rgba(245,158,11,.22); color:#92400e; }
.pill--bad{ background: var(--badbg); border-color: rgba(239,68,68,.22); color:#991b1b; }
.pill--info{ background: rgba(59,130,246,.08); border-color: rgba(59,130,246,.22); color:#1d4ed8; }

/* =========================
   FORMS
========================= */
.field{ display:flex; flex-direction:column; gap:6px; }

label{
  font-size: 12px;
  font-weight: 950;
  color: var(--muted);
}

input,select,textarea{
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.95);
  padding: 10px 12px;
  outline:none;
  font-size: 14px;
}

input:focus,select:focus,textarea:focus{
  border-color: rgba(11,18,32,.22);
  box-shadow: 0 0 0 4px rgba(11,18,32,.08);
}

/* =========================
   TABLES
========================= */
.table-wrap{
  overflow:auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.95);
}

table{
  width:100%;
  border-collapse: collapse;
  min-width: 860px;
}

thead th{
  text-align:left;
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 980;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(15,23,42,.70);
  border-bottom: 1px solid var(--line);
  background: rgba(248,250,252,.95);
}

tbody td{
  padding: 14px;
  border-bottom: 1px solid rgba(15,23,42,.06);
  font-size: 14px;
  vertical-align: top;
}

tbody tr:hover{ background: rgba(15,23,42,.02); }
.right{text-align:right}

/* =========================
   LOGIN PREMIUM (sem topbar)
========================= */
.login-shell{
  min-height: 100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 22px 14px;
}

.login-card{
  width: 100%;
  max-width: 440px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(2,6,23,.16);
  padding: 22px;
}

.login-brand{
  display:flex;
  justify-content:center;
  margin-bottom: 12px;
}

.login-logo{
  width: 210px;
  max-width: 75%;
  height: auto;
  background: transparent !important;
  filter: drop-shadow(0 16px 30px rgba(2,6,23,.14));
}

.login-h1{
  margin: 6px 0 0 0;
  text-align:center;
  font-size: 22px;
  font-weight: 980;
  letter-spacing: -.02em;
}

.login-sub{
  margin: 6px 0 0 0;
  text-align:center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.login-form{ margin-top: 14px; }

.login-btn{
  width: 100%;
  margin-top: 14px;
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 980;
}

.login-foot{
  margin-top: 14px;
  text-align:center;
  padding-top: 12px;
  border-top: 1px solid rgba(15,23,42,.08);
}

@media(max-width: 420px){
  .login-card{ padding: 18px; border-radius: 20px; }
  .login-logo{ width: 190px; max-width: 80%; }
}

/* =========================
   PAGINAÇÃO (FIX DO SETÃO)
========================= */

.pagination{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
  padding: 12px 0;
}

.pagination svg{
  width:18px;
  height:18px;
}

.pagination a,
.pagination span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  border: 1px solid rgba(15,23,42,.12);
  background:#fff;
  color:#0b1220;
}

.pagination a:hover{
  background: rgba(15,23,42,.06);
}

.pagination .active span{
  background:#0b1220;
  color:#fff;
  border-color:#0b1220;
}

.pagination .disabled span{
  opacity:.45;
}
/* FIX HARD: paginação gigante (reset local) */
nav[role="navigation"]{
  display:block;
}

nav[role="navigation"] .pagination,
nav[role="navigation"] .pagination *{
  max-width: unset !important;
  max-height: unset !important;
  line-height: 1 !important;
}

nav[role="navigation"] svg{
  width: 14px !important;
  height: 14px !important;
  flex: 0 0 auto !important;
}

nav[role="navigation"] a,
nav[role="navigation"] span{
  font-size: 13px !important;
}

nav[role="navigation"] a,
nav[role="navigation"] span[aria-current="page"],
nav[role="navigation"] span[aria-disabled="true"]{
  min-width: 30px !important;
  height: 30px !important;
  padding: 0 8px !important;
  border-radius: 9px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
}
