/* assets/css/minimalist.css
   Sistema de design do painel Minimalist — segue a identidade visual do
   site (ext.baiakminimalist.com): fundo escuro profundo + dourado como
   destaque, tipografia Cinzel para títulos. Mesma família visual de
   checkout.html/download.html, adaptada para uma tela de dados densa
   (o dourado é usado com moderação aqui — reservado a título, marca,
   ações primárias e badges — para não cansar a leitura de tabelas).
*/

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --bg-base:        #050402;
  --bg-surface:      #0e0c08;
  --bg-surface-2:    #161209;
  --border:          #211c10;
  --border-strong:   #342912;

  --text-primary:    #e8d8a8;
  --text-secondary:  #8a7d5a;
  --text-tertiary:   #4a4030;

  --gold:            #c8a840;
  --gold-bright:     #f0d060;
  --accent:          #c8a840;
  --accent-text:     #0a0800;

  --success:         #4ADE80;
  --success-bg:      rgba(74, 222, 128, 0.08);
  --danger:          #F87171;
  --danger-bg:       rgba(248, 113, 113, 0.08);
  --warning:         #f0d060;
  --warning-bg:      rgba(240, 208, 96, 0.10);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Cinzel', serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: -180px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 500px;
  background: radial-gradient(ellipse, rgba(200,168,64,0.08) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }

/* ---------- Layout geral ---------- */

.page {
  min-height: 100vh;
  display: flex;
  position: relative;
  z-index: 1;
}

.sidebar {
  width: 220px;
  background: var(--bg-surface);
  border-right: 0.5px solid var(--border);
  padding: 24px 16px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 24px;
  margin-bottom: 8px;
  border-bottom: 0.5px solid var(--border);
}

.sidebar-logo .mark {
  width: 26px; height: 26px;
  background: #000;
  border-radius: 7px;
  flex-shrink: 0;
  position: relative;
}
.sidebar-logo .mark::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 8px;
  background: linear-gradient(135deg, #c8a840 0%, #2a1a00 50%, #c8a840 100%);
  z-index: -1;
  opacity: 0.85;
}

.sidebar-logo span {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, #c8a840, #f5e8a0, #c8a840);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}

.nav-item .icon { font-size: 14px; width: 16px; text-align: center; opacity: 0.85; }

.nav-item:hover { background: var(--bg-surface-2); color: var(--text-primary); }
.nav-item.active { background: var(--bg-surface-2); color: var(--gold-bright); }
.nav-item.active .icon { opacity: 1; }

.nav-item .badge-count {
  margin-left: auto;
  background: var(--gold);
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 100px;
  min-width: 16px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 0.5px solid var(--border);
}

.sidebar-admin-name {
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 0 10px 8px;
}

.main {
  flex: 1;
  padding: 32px 40px;
  min-width: 0;
}

.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.main-header h1 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--text-primary);
}

.main-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 4px 0 0;
}

/* ---------- Componentes ---------- */

.card {
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-surface-2);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: border-color 0.15s;
}
.metric-card:hover { border-color: var(--border-strong); }

.metric-card .label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metric-card .value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
}

.metric-card.highlight {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(200,168,64,0.08), var(--bg-surface-2));
}

/* ---------- Banner de aviso (ação pendente) ---------- */

.action-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--warning-bg);
  border: 0.5px solid rgba(240, 208, 96, 0.25);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  margin-bottom: 20px;
}
.action-banner .text { font-size: 13px; color: var(--text-primary); }
.action-banner .text strong { color: var(--gold-bright); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--text-secondary); font-weight: 500; padding: 10px 12px; border-bottom: 0.5px solid var(--border); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
td { padding: 12px; border-bottom: 0.5px solid var(--border); }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.1s; }
tbody tr:hover { background: var(--bg-surface-2); }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
}
.badge.active  { background: var(--success-bg); color: var(--success); }
.badge.expired { background: var(--danger-bg);  color: var(--danger); }
.badge.revoked { background: rgba(138,125,90,0.12); color: var(--text-secondary); }
.badge.pending { background: var(--warning-bg); color: var(--gold-bright); }
.badge.paused  { background: rgba(140,138,133,0.12); color: var(--text-secondary); }

/* ---------- Formulários ---------- */

label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

input, select {
  width: 100%;
  background: var(--bg-surface-2);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--gold);
}

input::placeholder { color: var(--text-tertiary); }

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 0.5px solid var(--border-strong);
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font);
  transition: background 0.12s, transform 0.08s, border-color 0.12s;
}

button:hover { background: var(--bg-surface-2); border-color: var(--text-secondary); }
button:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, #c8a840, #8b6914);
  color: var(--accent-text);
  border: none;
  font-weight: 600;
}
.btn-primary:hover { opacity: 0.9; background: linear-gradient(135deg, #c8a840, #8b6914); }

.btn-danger {
  border-color: rgba(248, 113, 113, 0.3);
  color: var(--danger);
}
.btn-danger:hover { background: var(--danger-bg); }

button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Tela de login (sem sidebar) ---------- */

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  position: relative;
  z-index: 1;
}

.auth-box {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-box .mark {
  width: 44px; height: 44px;
  background: #000;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  position: relative;
}
.auth-box .mark::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 9px;
  background: linear-gradient(135deg, #c8a840 0%, #2a1a00 50%, #c8a840 100%);
  z-index: -1;
  opacity: 0.85;
}

.auth-box h1 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 0 0 4px;
  background: linear-gradient(90deg, #8b6914, #f5d97a, #c8a840, #f5e8a0, #8b6914);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}

@keyframes shimmer { 0% { background-position: 0% center; } 100% { background-position: 300% center; } }

.auth-box .subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 28px;
}

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-error {
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  margin-top: 4px;
  display: none;
}
.auth-error.show { display: block; }

/* ---------- Toolbar de busca/filtro ---------- */

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.toolbar input[type="text"] {
  max-width: 320px;
}

.toolbar select {
  max-width: 160px;
}

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-box {
  background: var(--bg-surface);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 380px;
  position: relative;
  overflow: hidden;
}
.modal-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.modal-box h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--gold-bright);
  margin: 0 0 4px;
}

.modal-box .modal-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 20px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.modal-actions button { flex: 1; }

/* ---------- Chave copiável ---------- */

.key-chip {
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 12px;
  background: var(--bg-surface-2);
  border: 0.5px solid var(--border);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-block;
  transition: border-color 0.12s;
}
.key-chip:hover { border-color: var(--gold); color: var(--gold-bright); }

/* ---------- Toast de feedback rápido ---------- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--bg-surface-2);
  border: 0.5px solid var(--gold);
  color: var(--text-primary);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 200;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.text-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
}
.text-btn:hover { color: var(--gold-bright); background: var(--bg-surface-2); }

/* ---------- Estado vazio / carregando ---------- */

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
  font-size: 13px;
}
