
[hidden] { display: none !important; }


:root{
  --bg:#0b0f14;
  --panel:#111822;
  --panel2:#0f1620;
  --border:#1f2a3a;
  --text:#e8eef7;
  --muted:#9bb0c9;
  --accent:#7dd3fc;
  --good:#34d399;
  --warn:#fbbf24;
  --bad:#fb7185;
  --shadow: 0 12px 30px rgba(0,0,0,.35);
  --radius: 16px;
  --radius2: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background: radial-gradient(1200px 800px at 20% 0%, rgba(125,211,252,.10), transparent 60%),
              radial-gradient(1200px 800px at 80% 0%, rgba(52,211,153,.08), transparent 55%),
              var(--bg);
  color:var(--text);
  font-family: var(--sans);
}

.topbar{
  position: sticky;
  top:0;
  z-index:10;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 16px;
  background: rgba(11,15,20,.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(31,42,58,.65);
}

.brand{ display:flex; gap:12px; align-items:center; }
.logo{
  width:40px;height:40px;
  display:grid;place-items:center;
  background: linear-gradient(135deg, rgba(125,211,252,.18), rgba(52,211,153,.12));
  border: 1px solid rgba(125,211,252,.25);
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size:20px;
}
.title{ font-weight:800; letter-spacing:.3px; }
.subtitle{ font-size:12px; color:var(--muted); margin-top:2px; }

.topbar-actions{ display:flex; gap:10px; }

.layout{
  display:grid;
  grid-template-columns: 270px 1fr;
  min-height: calc(100% - 64px);
}

.sidebar{
  border-right: 1px solid rgba(31,42,58,.65);
  padding:16px;
}

.nav{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.nav-btn{
  width:100%;
  text-align:left;
  padding:12px 12px;
  border-radius: 14px;
  border:1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor:pointer;
  font-weight:700;
  transition: .15s ease;
}
.nav-btn:hover{
  background: rgba(255,255,255,.03);
  border-color: rgba(31,42,58,.9);
}
.nav-btn.active{
  background: linear-gradient(135deg, rgba(125,211,252,.16), rgba(52,211,153,.10));
  border-color: rgba(125,211,252,.25);
}

.sidebar-footer{ margin-top:18px; }
.hint{
  border:1px solid rgba(31,42,58,.85);
  background: rgba(17,24,34,.55);
  border-radius: var(--radius);
  padding:14px;
}
.hint-title{ font-weight:800; margin-bottom:6px; }
.hint-text{ color:var(--muted); font-size:13px; line-height:1.35; }

.content{
  padding: 16px;
}

.grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:16px;
}

.card{
  background: rgba(17,24,34,.62);
  border:1px solid rgba(31,42,58,.85);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.card-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 14px;
  border-bottom:1px solid rgba(31,42,58,.75);
  background: rgba(15,22,32,.55);
}

.card-title{ font-weight:900; font-size:16px; }
.card-subtitle{ color:var(--muted); font-size:12px; margin-top:2px; }
.card-body{ padding:14px; }

.row{ display:flex; align-items:center; }
.gap{ gap:10px; }
.wrap{ flex-wrap:wrap; }

.input{
  background: rgba(17,24,34,.75);
  color: var(--text);
  border: 1px solid rgba(31,42,58,.95);
  border-radius: 12px;
  padding:10px 12px;
  outline:none;
  min-height: 40px;
}
.input:focus{ border-color: rgba(125,211,252,.55); box-shadow: 0 0 0 4px rgba(125,211,252,.10); }

.btn{
  background: linear-gradient(135deg, rgba(125,211,252,.25), rgba(52,211,153,.18));
  border:1px solid rgba(125,211,252,.30);
  color: var(--text);
  padding:10px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-weight:800;
  min-height: 40px;
  transition: .15s ease;
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0); }
.btn:disabled{
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost{
  background: rgba(255,255,255,.03);
  border:1px solid rgba(31,42,58,.95);
}
.btn-danger{
  background: rgba(251,113,133,.12);
  border: 1px solid rgba(251,113,133,.35);
}

.icon-btn{
  background: transparent;
  border:1px solid rgba(31,42,58,.95);
  color: var(--text);
  width: 38px; height: 38px;
  border-radius: 12px;
  cursor:pointer;
}

.toolbar{ margin-bottom:10px; }

.table-wrap{ overflow:auto; border-radius: 12px; }
.table{
  width:100%;
  border-collapse: collapse;
  min-width: 700px;
}
.table th, .table td{
  padding:10px 10px;
  border-bottom: 1px solid rgba(31,42,58,.6);
  white-space: nowrap;
}
.table th{
  text-align:left;
  color: var(--muted);
  font-size:12px;
  font-weight:800;
  background: rgba(15,22,32,.35);
}
.table tbody tr:hover{
  background: rgba(255,255,255,.03);
}
.right{ text-align:right; }

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius: 999px;
  border:1px solid rgba(31,42,58,.9);
  background: rgba(255,255,255,.03);
  font-weight:800;
  font-size:12px;
}
.b-green{ border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.08); }
.b-yellow{ border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.08); }
.b-blue{ border-color: rgba(125,211,252,.35); background: rgba(125,211,252,.08); }
.b-red{ border-color: rgba(251,113,133,.35); background: rgba(251,113,133,.08); }

.muted{ color: var(--muted); font-size:13px; margin-top:10px; }
.warning{
  border:1px solid rgba(251,191,36,.35);
  background: rgba(251,191,36,.08);
  padding:12px;
  border-radius: 12px;
  color: #ffe7aa;
  font-weight:700;
}

.kpis{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  margin-bottom: 12px;
}
.kpi{
  border:1px solid rgba(31,42,58,.85);
  background: rgba(17,24,34,.35);
  border-radius: 14px;
  padding:12px;
}
.kpi-label{ color:var(--muted); font-size:12px; font-weight:800; }
.kpi-value{ font-size:20px; font-weight:900; margin-top:4px; }

.section-title{
  font-weight:900;
  margin: 8px 0 8px;
}

.footer{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:flex-end;
  margin-top: 14px;
  padding: 8px 2px;
}

.pill{
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border:1px solid rgba(31,42,58,.9);
  background: rgba(255,255,255,.03);
}

/* MODAL */
.modal{
  position: fixed;
  inset:0;
  z-index: 50;
  display:grid;
  place-items:center;
}
.modal-backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
}
.modal-card{
  position:relative;
  width: min(720px, calc(100% - 24px));
  background: rgba(17,24,34,.92);
  border:1px solid rgba(31,42,58,.95);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 14px;
  border-bottom: 1px solid rgba(31,42,58,.75);
  background: rgba(15,22,32,.7);
}
.modal-title{ font-weight:900; }
.modal-subtitle{ color:var(--muted); font-size:12px; margin-top:2px; }
.modal-body{ padding:14px; }
.modal-footer{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  padding:14px;
  border-top: 1px solid rgba(31,42,58,.75);
}

/* Form grid */
.form{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
.form .full{ grid-column: 1 / -1; }

.label{ font-size:12px; color:var(--muted); font-weight:800; margin-bottom:6px; }
.field{ display:flex; flex-direction:column; }

.textarea{
  min-height: 90px;
  resize: vertical;
}

/* Toast */
.toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 60;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(17,24,34,.95);
  border: 1px solid rgba(31,42,58,.95);
  box-shadow: var(--shadow);
  color: var(--text);
  font-weight:800;
}

/* Responsive */
@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
  .sidebar{ border-right:none; border-bottom:1px solid rgba(31,42,58,.65); }
  .grid-2{ grid-template-columns: 1fr; }
  .table{ min-width: 620px; }
}

/* ===== MOBILE BOOST (cards no lugar de tabela) ===== */
@media (max-width: 640px) {
  .content { padding: 12px; }
  .card { border-radius: 14px; }
  .card-header { padding: 12px; gap: 10px; flex-direction: column; align-items: flex-start; }
  .card-header .row { width: 100%; }
  .card-header .row .input,
  .card-header .row .btn { width: 100%; }

  /* Sidebar vira menu horizontal */
  .sidebar { padding: 10px 12px; }
  .nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 6px;
  }
  .nav-btn {
    white-space: nowrap;
    min-width: max-content;
    padding: 10px 12px;
    border-radius: 999px;
  }
  .sidebar-footer { display: none; }

  /* Tables: modo card */
  .table-wrap { overflow: visible; }
  .rtable { min-width: 0 !important; width: 100%; }
  .rtable thead { display: none; }

  .rtable,
  .rtable tbody,
  .rtable tr,
  .rtable td {
    display: block;
    width: 100%;
  }

  .rtable tr {
    border: 1px solid rgba(31,42,58,.85);
    background: rgba(17,24,34,.35);
    border-radius: 14px;
    margin-bottom: 10px;
    overflow: hidden;
  }

  .rtable td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(31,42,58,.55);
    white-space: normal;
  }
  .rtable td:last-child { border-bottom: none; }

  .rtable td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 900;
    font-size: 12px;
    margin-right: 12px;
  }

  .rtable .right { text-align: left; }

  /* Botões na célula de ações */
  .rtable td[data-label="Ações"] {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
  .rtable td[data-label="Ações"]::before { align-self: center; }

  /* Inputs e botões mais “tocáveis” */
  .btn, .input { min-height: 44px; }
}

