:root{
  --bg:#f6f7fb;
  --surface:#ffffff;
  --text:#0b1220;
  --muted:#667085;

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

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

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

  --primary:#0b1220;
  --primary2:#111a2e;

  --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 20% -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}

.container{
  max-width:1280px;
  margin:0 auto;
  padding:18px;
}

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

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

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

.brand-logo{
  height:42px;
  width:auto;
  display:block;
  object-fit:contain;
  filter: drop-shadow(0 10px 18px rgba(2,6,23,.12));
}

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

/* Nav */
.nav{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.nav a{
  padding:10px 14px;
  border-radius:999px;
  border:1px solid transparent;
  font-weight:900;
  font-size:14px;
  color:rgba(15,23,42,.62);
  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: linear-gradient(180deg, rgba(11,18,32,.98), rgba(11,18,32,.90));
  border-color: rgba(11,18,32,.95);
  color:#fff;
  box-shadow: 0 18px 40px rgba(2,6,23,.16);
}

/* User */
.userbox{
  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: var(--shadow2);
}

.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);
}

.username{
  font-weight:950;
  font-size:14px;
}

.btn-logout{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius:999px;
  font-weight:950;
  font-size:14px;
  border:1px solid rgba(239,68,68,.25);
  background:rgba(239,68,68,.08);
  color:#dc2626;
  cursor:pointer;
  transition:.15s ease;
}
.btn-logout:hover{
  background:rgba(239,68,68,.12);
  transform: translateY(-1px);
}

/* Alerts */
.alert{
  margin: 12px 0;
  border-radius: var(--radius2);
  border:1px solid var(--line);
  padding:12px 14px;
  font-weight:900;
  font-size:14px;
  background:rgba(255,255,255,.92);
  box-shadow: var(--shadow2);
}
.alert.ok{border-color:rgba(22,163,74,.22); background:var(--okbg); color:#14532d;}
.alert.bad{border-color:rgba(239,68,68,.22); background:var(--badbg); color:#7f1d1d;}

/* ===== COMPONENTES PARA TODAS AS TELAS ===== */
.panel{
  background:rgba(255,255,255,.92);
  border:1px solid var(--line);
  border-radius: var(--radius);
  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:30px;
  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;
}

.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,.95);
  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);
  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.danger{
  background:rgba(239,68,68,.08);
  border-color:rgba(239,68,68,.22);
  color:#dc2626;
}

/* Grid + cards */
.grid{display:grid; gap:14px;}
.grid.cols-4{grid-template-columns:repeat(4,minmax(0,1fr));}
@media(max-width:1100px){.grid.cols-4{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:740px){.grid.cols-4{grid-template-columns:1fr;}}

.card{
  background:rgba(255,255,255,.92);
  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;}

/* Tables */
.table-wrap{
  overflow:auto;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:rgba(255,255,255,.96);
}
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,.96);
}
tbody td{
  padding:14px;
  border-bottom:1px solid rgba(15,23,42,.06);
  font-size:14px;
}
tbody tr:hover{background:rgba(15,23,42,.02);}

/* Forms */
input,select,textarea{
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.96);
  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);
}

/* Login (logo menor) */
.login-logo{
  width:190px;
  max-width:70%;
  height:auto;
  display:block;
  margin:0 auto;
  object-fit:contain;
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
}
