/* ═══════════════════════════════════════════════════
   DESTRAVA DESIGN SYSTEM — base compartilhada
   Usar em todos os painéis internos
   ═══════════════════════════════════════════════════ */

:root {
  --bg:        #0F172A;
  --bg2:       #1E293B;
  --bg3:       #253047;
  --border:    #334155;
  --accent:    #2DD4BF;
  --accent2:   #5EEAD4;
  --text:      #F8FAFC;
  --text2:     #CBD5E1;
  --muted:     #64748B;
  --danger:    #F87171;
  --success:   #4ADE80;
  --warning:   #FB923C;
  --radius:    10px;
  --radius-lg: 16px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Header ── */
.d-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.d-logo { font-size: 18px; font-weight: 800; color: var(--accent); text-decoration: none; }
.d-logo span { color: var(--text2); font-weight: 400; font-size: 14px; margin-left: 8px; }
.d-nav { display: flex; align-items: center; gap: 8px; }
.d-nav a {
  color: var(--muted); font-size: 13px; text-decoration: none;
  padding: 6px 12px; border-radius: 6px; transition: all .15s;
}
.d-nav a:hover, .d-nav a.ativo { background: var(--bg3); color: var(--text); }
.d-nav a.ativo { color: var(--accent); }

/* ── Layout ── */
.d-main { max-width: 1140px; margin: 0 auto; padding: 32px 24px; }
.d-page-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.d-page-sub   { color: var(--muted); font-size: 13px; margin-bottom: 32px; }

/* ── Cards ── */
.d-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.d-card-title { font-size: 13px; color: var(--muted); font-weight: 600;
                text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.d-card-value { font-size: 36px; font-weight: 800; color: var(--accent); }
.d-card-sub   { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── Grid ── */
.d-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.d-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.d-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 768px) {
  .d-grid-3, .d-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .d-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .d-grid-3, .d-grid-4, .d-grid-2 { grid-template-columns: 1fr; }
  .d-header { padding: 0 16px; }
  .d-main { padding: 20px 16px; }
}

/* ── Botões ── */
.d-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: none; text-decoration: none; transition: all .15s;
}
.d-btn-primary  { background: var(--accent);  color: #0F172A; }
.d-btn-primary:hover { background: var(--accent2); }
.d-btn-secondary { background: var(--bg3); color: var(--text2); border: 1px solid var(--border); }
.d-btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.d-btn-sm { padding: 5px 12px; font-size: 12px; }
.d-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Badges ── */
.d-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
}
.d-badge-green  { background: #14532D; color: var(--success); }
.d-badge-orange { background: #431407; color: var(--warning); }
.d-badge-blue   { background: #1E3A5F; color: #60A5FA; }
.d-badge-muted  { background: var(--bg3); color: var(--muted); }

/* ── Inputs ── */
.d-input, .d-select {
  width: 100%; padding: 10px 14px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: 14px;
}
.d-input:focus, .d-select:focus { outline: none; border-color: var(--accent); }

/* ── Table ── */
.d-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.d-table th { padding: 10px 16px; color: var(--muted); font-size: 11px;
              text-transform: uppercase; letter-spacing: .05em;
              border-bottom: 1px solid var(--border); text-align: left; }
.d-table td { padding: 12px 16px; border-bottom: 1px solid var(--bg3); }
.d-table tr:last-child td { border-bottom: none; }
.d-table tr:hover td { background: var(--bg3); }

/* ── Login ── */
.d-login-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg);
}
.d-login-card {
  background: var(--bg2); border-radius: var(--radius-lg);
  padding: 48px 40px; width: 360px; border: 1px solid var(--border);
}
.d-login-logo { font-size: 26px; font-weight: 800; color: var(--accent); margin-bottom: 4px; }
.d-login-sub  { color: var(--muted); font-size: 13px; margin-bottom: 32px; }
.d-login-erro { color: var(--danger); font-size: 13px; margin-bottom: 12px; }

/* ── Toast ── */
.d-toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--accent); color: #0F172A;
  padding: 12px 20px; border-radius: var(--radius);
  font-weight: 700; font-size: 14px;
  opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 999;
}
.d-toast.show { opacity: 1; }

/* ── Utilitários ── */
.d-oculto { display: none !important; }
.d-mt-8  { margin-top: 8px; }
.d-mt-16 { margin-top: 16px; }
.d-mt-24 { margin-top: 24px; }
.d-mt-32 { margin-top: 32px; }
.d-mb-8  { margin-bottom: 8px; }
.d-mb-16 { margin-bottom: 16px; }
.d-mb-24 { margin-bottom: 24px; }
.d-mb-32 { margin-bottom: 32px; }
.d-flex  { display: flex; }
.d-flex-between { display: flex; justify-content: space-between; align-items: center; }
.d-gap-8  { gap: 8px; }
.d-gap-16 { gap: 16px; }
.text-muted   { color: var(--muted); }
.text-accent  { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.font-bold { font-weight: 700; }
