:root{ --red:#CC0000; --black:#000; --white:#FFF; --gold:#B87A24; }
/* Box model consistente */
*, *::before, *::after{ box-sizing: border-box; }
body{ background:#000; color:#FFF; font-family:system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif; line-height:1.45; }
.topbar{ display:flex; justify-content:space-between; align-items:center; padding:14px 22px; background:linear-gradient(180deg, rgba(0,0,0,.95), rgba(0,0,0,.85)); border-bottom:2px solid var(--red); position:sticky; top:0; z-index:10; }
.brand{ font-weight:900; letter-spacing:1px; font-size:20px; text-transform:uppercase; }
.brand span{ color:var(--red); text-shadow:0 0 8px rgba(204,0,0,.3); }
nav a{ color:#DDD; margin-right:14px; text-decoration:none; padding:6px 8px; border-radius:6px; transition:all .15s ease; }
nav a:hover{ color:#FFF; background:#151515; }
.container{ padding:24px; max-width:1100px; margin:0 auto; }

/* Cards e grid */
.grid{ display:grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap:18px; margin-top:18px; }
.card{ background:#0f0f0f; padding:18px; border:1px solid #1c1c1c; border-radius:12px; color:#EEE; text-decoration:none; box-shadow: 0 2px 0 0 #111 inset, 0 0 0 1px rgba(255,255,255,0.03); overflow:hidden; }
.card:hover{ border-color: var(--gold); transform: translateY(-1px); }
.card h3{ margin:0 0 8px; font-size:16px; font-weight:700; color:#FFF; }

/* Tabelas */
.table{ width:100%; border-collapse: collapse; margin-top:16px; background:#0b0b0b; border:1px solid #1f1f1f; border-radius:10px; overflow:hidden; }
.table thead th{ background:#121212; color:#ddd; text-align:left; font-weight:700; padding:10px; border-bottom:1px solid #1f1f1f; }
.table tbody td{ border-top:1px solid #161616; padding:10px; }
.table tbody tr:nth-child(even){ background:#0e0e0e; }
.table tbody tr:hover{ background:#141414; }
.table.has-actions thead th:last-child, .table.has-actions tbody td:last-child{ text-align:right; }
.actions-cell{ text-align:right; }
.action-buttons{ display:inline-flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.action-buttons .btn{ padding:6px 10px; font-size:12px; border-radius:8px; }

/* Formulários */
form .form-row{ display:grid; grid-template-columns: repeat(2, 1fr); gap:14px; }
form .form-row-3{ grid-template-columns: repeat(3, 1fr); }
label{ display:block; font-size:12px; color:#bbb; margin-bottom:6px; }
input[type="text"], input[type="number"], input[type="date"], input[type="password"], select, textarea{
  width:100%; max-width:100%; background:#0f0f10; color:#f1f1f1; border:1px solid #2a2a2a; border-radius:10px; padding:10px 12px; outline:none; transition: all .15s ease; display:block;
}
select:focus, textarea:focus{ border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184,122,36,0.15); }
input:focus{ border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184,122,36,0.15); }
input::placeholder{ color:#888 }

/* Evitar que os inputs "estourem" para fora do card em telas estreitas */
.card form, .card .table{ max-width:100%; overflow:hidden; }
.card .table td > *{ max-width:100%; }

/* Botões */
.btn{ background:var(--red); color:#FFF; border:none; padding:10px 14px; border-radius:10px; cursor:pointer; font-weight:700; letter-spacing:.3px; box-shadow: 0 2px 0 0 #7a0000 inset; display:inline-flex; align-items:center; gap:6px; }
.btn.secondary{ background:#1b1b1b; color:#fff; border:1px solid #2a2a2a; box-shadow:none; }
.btn:hover{ background:#e00000; }
.btn:focus{ outline:none; box-shadow: 0 0 0 3px rgba(204,0,0,0.2); }

/* Boxes e indicadores */
.profit-box{ margin:16px 0; padding:10px 14px; background:#0f0f0f; border:1px solid #2a2a2a; border-radius:10px; display:flex; gap:12px; align-items:center; }
.indicador.verde{ color:#00d084 }
.indicador.vermelho{ color:#ff4757 }
.indicador.neutro{ color:#AAA }

/* Badges de status */
.status{ padding:4px 8px; border-radius:999px; font-weight:700; text-transform:capitalize; border:1px solid transparent; }
.status.verde{ color:#00d084; border-color:#0a3; background:rgba(0,208,132,0.08) }
.status.amarelo{ color:#f1c40f; border-color:#946c00; background:rgba(241,196,15,0.08) }
.status.vermelho{ color:#ff4757; border-color:#a30012; background:rgba(255,71,87,0.08) }

/* Seções */
h1,h2,h3{ margin:0 0 10px; }
.section{ margin:14px 0 22px; }
.section .card{ margin-top:10px; }
.section-lg{ margin-top:20px; }
.table-lg{ margin-top:24px; margin-bottom:24px; }

/* Barra de progresso */
.bar{ width:100%; height:10px; background:#121212; border:1px solid #1f1f1f; border-radius:999px; overflow:hidden; }
.bar-fill{ height:100%; width:0; transition: width .25s ease; }
.bar-fill.verde{ background: linear-gradient(90deg, #0a3, #00d084); }
.bar-fill.amarelo{ background: linear-gradient(90deg, #946c00, #f1c40f); }
.bar-fill.vermelho{ background: linear-gradient(90deg, #a30012, #ff4757); }

/* Utilitários */
.hidden{ display:none; }

/* Centralização vertical da página (abaixo da topbar) */
.center-page{ min-height: calc(100vh - 64px); display:flex; justify-content:center; align-items:center; }
.auth-card{ width:100%; max-width:360px; }

/* Ícone e popover de informação */
.info-icon{ display:inline-block; width:18px; height:18px; border-radius:50%; background:#1b1b1b; color:#ddd; font-weight:700; text-align:center; line-height:18px; margin-left:6px; cursor:help; position:relative; border:1px solid #2a2a2a; }
.info-icon:hover{ background:#222; }
.info-icon[data-tip]:hover::after{
  content: attr(data-tip);
  position:absolute; left:24px; top:50%; transform: translateY(-50%);
  background:#0f0f0f; color:#eee; border:1px solid #2a2a2a; padding:8px 10px; border-radius:8px; white-space:normal; width:260px; z-index:20; box-shadow:0 8px 20px rgba(0,0,0,0.35);
}
.info-icon[data-tip]:hover::before{
  content:""; position:absolute; left:16px; top:50%; transform:translateY(-50%);
  border:6px solid transparent; border-right-color:#2a2a2a;
}

/* Modal simples para confirmar exclusão */
.modal-backdrop{ position:fixed; inset:0; background:rgba(0,0,0,.6); display:flex; align-items:center; justify-content:center; z-index:100; }
.modal{ background:#0f0f0f; border:1px solid #2a2a2a; border-radius:12px; width:90%; max-width:420px; padding:18px; color:#eee; }
.modal .actions{ display:flex; gap:10px; justify-content:flex-end; margin-top:12px; }

/* Tema claro */
body.light{ background:#f7f7f7; color:#111; }
body.light .topbar{ background:linear-gradient(180deg, #fff, #f3f3f3); border-bottom-color:#e33; }
body.light nav a{ color:#333; }
body.light nav a:hover{ background:#eee; }
body.light .card{ background:#fff; color:#222; border-color:#e5e5e5; box-shadow: 0 2px 0 0 #f1f1f1 inset, 0 0 0 1px rgba(0,0,0,0.03); }
body.light .table{ background:#fff; border-color:#e8e8e8; }
body.light .table thead th{ background:#f7f7f7; color:#333; border-bottom-color:#e8e8e8; }
body.light .table tbody td{ border-top-color:#eee; }
body.light .table tbody tr:nth-child(even){ background:#fafafa; }
body.light input[type="text"], body.light input[type="number"], body.light input[type="date"], body.light input[type="password"], body.light select, body.light textarea{ background:#fff; color:#111; border-color:#ddd; }
body.light .btn.secondary{ background:#fff; color:#111; border-color:#ddd; }
body.light .status.verde{ background:rgba(0,208,132,0.12); }
body.light .status.amarelo{ background:rgba(241,196,15,0.12); }
body.light .status.vermelho{ background:rgba(255,71,87,0.12); }
body.light .bar{ background:#f1f1f1; border-color:#e7e7e7; }
body.light .info-icon{ background:#f4f4f4; color:#444; border-color:#ddd; }
body.light .info-icon[data-tip]:hover::after{ background:#fff; color:#222; border-color:#ddd; }
