@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg:           #F4F6FA;
  --panel:        #FFFFFF;
  --panel-hi:     #F8FAFC;
  --line:         rgba(15,23,42,0.08);
  --line-strong:  rgba(15,23,42,0.16);
  --ink:          #0F172A;
  --ink-dim:      #475569;
  --ink-muted:    #94A3B8;
  --primary:      #0F172A;
  --primary-hi:   #1E293B;
  --accent:       #2563EB;
  --accent-dim:   #1D4ED8;
  --accent-bg:    rgba(37,99,235,0.08);
  --accent-ink:   #1D4ED8;
  --pos:          #16A34A;
  --pos-bg:       rgba(22,163,74,0.10);
  --neg:          #DC2626;
  --neg-bg:       rgba(220,38,38,0.09);
  --warn:         #B45309;
  --warn-bg:      rgba(217,119,6,0.10);
  --mark:         #FBBF24;
  --radius:       18px;
  --radius-sm:    12px;
  --shadow-card:  0 1px 2px rgba(15,23,42,0.04), 0 12px 32px -16px rgba(15,23,42,0.10);
  --shadow-pop:   0 16px 48px -12px rgba(15,23,42,0.22);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(15,23,42,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 20%, #000 25%, transparent 75%);
          mask-image: radial-gradient(ellipse at 50% 20%, #000 25%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-muted); }
::-webkit-scrollbar-track { background: transparent; }

@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* ── Topbar ────────────────────────────────────────────────────── */
.topbar {
  background: var(--primary);
  color: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}
.topbar .brand {
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  gap: 9px;
}
.topbar .brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--mark);
  box-shadow: 0 0 0 4px rgba(251,191,36,0.18);
}
.topbar .user-info {
  font-size: 13px;
  color: #CBD5E1;
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar button {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: #E2E8F0;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.topbar button:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.24); }

/* ── Shell / layout ────────────────────────────────────────────── */
.shell {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px 20px 70px;
  position: relative;
  z-index: 1;
}

.nav-tabs-custom {
  display: flex;
  gap: 4px;
  margin-bottom: 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 5px;
  box-shadow: var(--shadow-card);
}
.nav-tabs-custom a {
  flex: 1;
  text-align: center;
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-dim);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}
.nav-tabs-custom a.active {
  color: #fff;
  background: var(--primary);
}
.nav-tabs-custom a:not(.active):hover { background: var(--panel-hi); color: var(--ink); }

h1 {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 5px;
  color: var(--ink);
}
h2.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 30px 0 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
h2.section-title::before {
  content: '';
  width: 3px; height: 15px;
  background: var(--mark);
  border-radius: 3px;
}
.subtitle {
  font-size: 14px;
  color: var(--ink-dim);
  margin: 0 0 24px;
}

/* ── Panel / card ──────────────────────────────────────────────── */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  animation: fade-up 0.4s cubic-bezier(0.23,1,0.32,1) both;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 560px) {
  .field-grid { grid-template-columns: 1fr; }
}

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-dim);
  margin-bottom: 6px;
  letter-spacing: 0.005em;
}
label .req { color: var(--neg); }

input[type="text"],
input[type="date"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 10px 13px;
  font-size: 14.5px;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-hi);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder, textarea::placeholder { color: var(--ink-muted); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--panel);
  box-shadow: 0 0 0 4px var(--accent-bg);
}
textarea { resize: vertical; min-height: 76px; }

.field { margin-bottom: 0; }

/* ── Botões ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .12s, border-color .12s, opacity .12s;
  font-family: inherit;
}
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hi);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px rgba(15,23,42,0.4);
}
.btn-secondary {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: var(--accent-bg);
}
.btn-block { width: 100%; justify-content: center; }

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

/* ── Alertas ───────────────────────────────────────────────────── */
.alert {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 18px;
  font-weight: 500;
  animation: fade-up 0.3s cubic-bezier(0.23,1,0.32,1) both;
}
.alert-danger { background: var(--neg-bg); color: var(--neg); }
.alert-ok { background: var(--pos-bg); color: var(--pos); }

/* ── Badges de status ──────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.badge-PENDENTE { background: var(--warn-bg); color: var(--warn); }
.badge-APROVADO, .badge-RESPONDIDO { background: var(--pos-bg); color: var(--pos); }
.badge-QUESTIONADO { background: var(--neg-bg); color: var(--neg); }

/* ── Lista de itens ────────────────────────────────────────────── */
.list-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 17px 19px;
  margin-bottom: 12px;
  background: var(--panel);
  box-shadow: var(--shadow-card);
  transition: border-color .15s, transform .15s;
}
.list-item:hover { border-color: var(--line-strong); }
.list-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.list-item-plate {
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.list-item-meta {
  font-size: 12.5px;
  color: var(--ink-dim);
}
.list-item-body {
  font-size: 13.5px;
  color: var(--ink-dim);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 7px 18px;
}
.list-item-body b { color: var(--ink); font-weight: 600; }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--ink-muted);
  font-size: 14px;
  background: var(--panel);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

/* ── Login ─────────────────────────────────────────────────────── */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  background-image:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(37,99,235,0.28), transparent),
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 22px;
  padding: 40px 34px;
  width: 100%;
  max-width: 390px;
  box-shadow: var(--shadow-pop);
  animation: fade-up 0.5s cubic-bezier(0.23,1,0.32,1) both;
}
.login-card .badge-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent-bg);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.login-card .badge-brand .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mark); }
.login-card h1 { font-size: 21px; margin-bottom: 6px; }
.login-card .subtitle { margin-bottom: 26px; }
.login-card .field { margin-bottom: 15px; }

/* ── Upload de arquivo ─────────────────────────────────────────── */
.file-drop {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--ink-dim);
  transition: border-color .15s, background .15s;
}
.file-drop:hover { border-color: var(--accent); background: var(--accent-bg); }
.file-drop.has-file { border-color: var(--pos); background: var(--pos-bg); color: var(--pos); }
.file-drop input { display: none; }

.hidden { display: none !important; }
