/* RASTERJOR WEB - Estilo Industrial */

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

:root {
  --bg:        #0b0f0d;
  --bg2:       #101a13;
  --bg3:       #162019;
  --border:    #1e3028;
  --text:      #ffffff;
  --text-dim:  #ffffff;
  --accent:    #2ecc71;
  --accent2:   #27ae60;
  --green:     #2eb87a;
  --red:       #e04040;
  --yellow:    #d4a820;
  --blue:      #3a8fd4;
  --white:     #eef0f5;
  --mono:      'IBM Plex Mono', monospace;
  --sans:      'IBM Plex Sans', sans-serif;
  --radius:    6px;
  --shadow:    0 2px 16px rgba(0,0,0,0.5);
}

/* ══════════════════════════════════════
   TEMA CLARO
   ══════════════════════════════════════ */
html[data-theme="light"] {
  --bg:        #f0f2f5;
  --bg2:       #ffffff;
  --bg3:       #f3f4f6;
  --border:    #d1d5db;
  --text:      #000000;
  --text-dim:  #374151;
  --accent:    #16a34a;
  --accent2:   #15803d;
  --green:     #16a34a;
  --red:       #dc2626;
  --yellow:    #ca8a04;
  --blue:      #2563eb;
  --white:     #111827;
  --shadow:    0 2px 16px rgba(0,0,0,0.10);
}

html[data-theme="light"] body {
  background: var(--bg);
  color: var(--text);
}

/* Main: offset correto para sidebar fixa */
html[data-theme="light"] .main   { margin-left: 220px !important; background: var(--bg); }
html[data-theme="light"] .sidebar.collapsed ~ .main { margin-left: 52px !important; }

/* Sidebar */
html[data-theme="light"] .sidebar       { background: var(--bg2); border-right: 1px solid var(--border); }
html[data-theme="light"] .sidebar-logo  { background: var(--bg2); border-bottom-color: var(--border); }
html[data-theme="light"] .sidebar-logo .brand { color: var(--accent); }
html[data-theme="light"] .sidebar-logo .sub   { color: var(--text-dim); }
html[data-theme="light"] .sidebar-nav   { background: var(--bg2); }
html[data-theme="light"] .sidebar-footer{ background: var(--bg3); border-top-color: var(--border); }
html[data-theme="light"] .nav-section   { color: var(--text-dim); }
html[data-theme="light"] .nav-item      { color: var(--text-dim); border-left-color: transparent; }
html[data-theme="light"] .nav-item:hover{ color: var(--white); background: var(--bg3); }
html[data-theme="light"] .nav-item.active { color: var(--accent); border-left-color: var(--accent); background: rgba(22,163,74,0.08); }
html[data-theme="light"] .sidebar-user strong { color: var(--white); }
html[data-theme="light"] .sidebar-user .perfil-tag { color: var(--accent); }
html[data-theme="light"] .sidebar-toggle { background: var(--bg3); border-color: var(--border); color: var(--text-dim); }
html[data-theme="light"] .sidebar-toggle:hover { background: var(--border); color: var(--white); }

/* Topbar */
html[data-theme="light"] .topbar        { background: var(--bg2); border-bottom-color: var(--border); }
html[data-theme="light"] .topbar-title  { color: var(--text-dim); }
html[data-theme="light"] .topbar-title span { color: var(--white); }
html[data-theme="light"] .topbar-time   { color: var(--text-dim); }

/* Content */
html[data-theme="light"] .content       { background: var(--bg); }

/* Cards */
html[data-theme="light"] .card          { background: var(--bg2); border-color: var(--border); }
html[data-theme="light"] .card-label    { color: var(--text-dim); }
html[data-theme="light"] .card-value    { color: var(--white); }
html[data-theme="light"] .card-sub      { color: var(--text-dim); }

/* Tabelas */
html[data-theme="light"] .table-wrap    { background: var(--bg2); border-color: var(--border); }
html[data-theme="light"] .table-header  { border-bottom-color: var(--border); }
html[data-theme="light"] .table-title   { color: var(--text); }
html[data-theme="light"] th             { background: var(--bg3); color: var(--text-dim); border-bottom-color: var(--border); }
html[data-theme="light"] td             { border-bottom-color: rgba(209,213,219,0.5); color: var(--text); }
html[data-theme="light"] tr:hover td    { background: rgba(0,0,0,0.02); }

/* Formulários */
html[data-theme="light"] .form-control  { background: var(--bg3); border-color: var(--border); color: var(--text); }
html[data-theme="light"] .form-control:focus { border-color: var(--accent); }
html[data-theme="light"] .form-label    { color: var(--text-dim); }
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea       { background: var(--bg2) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus { border-color: var(--accent) !important; }

/* Botões */
html[data-theme="light"] .btn-ghost     { background: var(--bg3); border-color: var(--border); color: var(--text); }
html[data-theme="light"] .btn-ghost:hover { border-color: var(--text-dim); color: var(--white); }

/* Outros */
html[data-theme="light"] .alerta-card   { background: var(--bg2); border-color: var(--border); }
html[data-theme="light"] .hist-body     { background: var(--bg3); border-color: var(--border); }
html[data-theme="light"] .status-tabs   { background: var(--bg2); border-color: var(--border); }
html[data-theme="light"] .status-tab.active { background: var(--bg3); color: var(--white); }
html[data-theme="light"] .section-title { color: var(--text-dim); }
html[data-theme="light"] .section-title::after { background: var(--border); }
html[data-theme="light"] .flash.success { background: rgba(22,163,74,0.1); }
html[data-theme="light"] .flash.error   { background: rgba(220,38,38,0.1); }

/* Scrollbar */
html[data-theme="light"] ::-webkit-scrollbar-track { background: var(--bg3); }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: var(--border); }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* Tooltip sidebar colapsada */
html[data-theme="light"] .sidebar.collapsed .nav-item::after { background: #1e293b !important; color: #fff !important; border-color: #334155 !important; }

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--white); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── LAYOUT ── */
.layout { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: 220px;
  min-height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .brand {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.sidebar-logo .sub {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }

.nav-section {
  padding: 8px 20px 4px;
  font-size: 9px;
  font-family: var(--mono);
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  border-left: 2px solid transparent;
  position: relative;
}
.nav-item:hover { color: var(--text); background: var(--bg3); }
.nav-item.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(245,130,10,0.07);
}
.nav-item .badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-family: var(--mono);
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.sidebar-user { font-size: 12px; color: var(--text-dim); }
.sidebar-user strong { display: block; color: var(--text); margin-bottom: 2px; }
.sidebar-user .perfil-tag {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── MAIN ── */
.main {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.22s ease;
}

/* Sidebar colapsada */
.sidebar.collapsed ~ .main {
  margin-left: 52px;
}

.topbar {
  height: 52px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}
.topbar-title span { color: var(--text); }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}

.content { padding: 28px; flex: 1; }

/* ── FLASH ── */
.flashes { margin-bottom: 20px; }
.flash {
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 8px;
  border-left: 3px solid;
}
.flash.success { background: rgba(46,184,122,0.1); border-color: var(--green); color: var(--green); }
.flash.error   { background: rgba(224,64,64,0.1);  border-color: var(--red);   color: var(--red);   }
.flash.info    { background: rgba(58,143,212,0.1); border-color: var(--blue);  color: var(--blue);  }

/* ── CARDS ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.card.orange::before { background: var(--accent); }
.card.green::before  { background: var(--green); }
.card.red::before    { background: var(--red); }
.card.blue::before   { background: var(--blue); }
.card.yellow::before { background: var(--yellow); }

.card-label {
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.card-value {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 600;
  color: var(--white);
  line-height: 1;
}
.card-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* ── TABELA ── */
.table-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.table-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
}

table { width: 100%; border-collapse: collapse; }
th {
  padding: 10px 16px;
  text-align: left;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(42,47,61,0.5);
  font-size: 13px;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ── BADGES ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge-orange  { background: rgba(245,130,10,0.15); color: var(--accent); }
.badge-red     { background: rgba(224,64,64,0.15);  color: var(--red); }
.badge-green   { background: rgba(46,184,122,0.15); color: var(--green); }
.badge-yellow  { background: rgba(212,168,32,0.15); color: var(--yellow); }
.badge-blue    { background: rgba(58,143,212,0.15); color: var(--blue); }
.badge-gray    { background: rgba(90,96,112,0.2);   color: var(--text-dim); }

/* ── STATUS ALERTA ── */
.status-Pendente    { @extend .badge-orange; }
.status-Em-Analise  { @extend .badge-yellow; }
.status-Justificado { @extend .badge-green; }
.status-Encerrado   { @extend .badge-gray; }

/* ── FORMULÁRIOS ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.15s;
}
.form-control:focus { border-color: var(--accent); }
textarea.form-control { min-height: 90px; resize: vertical; }
select.form-control { cursor: pointer; }

/* ── BOTÕES ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-primary   { background: var(--accent);  color: #000; }
.btn-primary:hover { background: var(--accent2); color: #000; }
.btn-danger    { background: var(--red);     color: #fff; }
.btn-danger:hover  { background: #c03030;   color: #fff; }
.btn-success   { background: var(--green);   color: #000; }
.btn-success:hover { background: #25a06a;   color: #000; }
.btn-ghost     { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--text-dim); color: var(--white); }
.btn-sm { padding: 4px 10px; font-size: 10px; }

/* ── FILTROS ── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  align-items: flex-end;
}
.filters .form-group { margin: 0; }
.filters .form-control { min-width: 140px; }

/* ── TABS STATUS ── */
.status-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  width: fit-content;
}
.status-tab {
  padding: 6px 16px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  color: var(--text-dim);
  transition: all 0.15s;
  text-decoration: none;
}
.status-tab:hover { color: var(--text); }
.status-tab.active { background: var(--bg3); color: var(--white); }

/* ── DETALHE ALERTA ── */
.alerta-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.alerta-tipo {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.alerta-titulo { font-size: 18px; color: var(--white); font-weight: 600; margin-bottom: 16px; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.info-item {}
.info-item .label {
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 3px;
}
.info-item .value { font-size: 14px; color: var(--white); }

/* ── HISTORICO ── */
.historico { margin-top: 24px; }
.hist-item {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.hist-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 6px;
  flex-shrink: 0;
}
.hist-body {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.hist-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
  display: flex;
  gap: 12px;
}
.hist-texto { font-size: 13px; color: var(--text); }

/* ── AUDITORIA ── */
.log-row td:first-child {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}

/* ── LOGIN ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 39px, var(--border) 39px, var(--border) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, var(--border) 39px, var(--border) 40px);
  background-size: 40px 40px;
}
.login-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 40px;
  width: 380px;
  box-shadow: var(--shadow);
  position: relative;
}
.login-box::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2px;
  background: var(--accent);
  border-radius: 0 0 4px 4px;
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo .brand {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.login-logo .sub {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  margin-top: 4px;
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 480px;
  max-width: 95vw;
  box-shadow: var(--shadow);
  transform: translateY(-16px);
  transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-title {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ── SECTION TITLE ── */
.section-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .content { padding: 16px; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
}
