:root {
  /* Paleta Neson Graphite (claro) */
  --bg: #f6f7fb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;

  --primary: #111827;   /* grafito */
  --accent: #f59e0b;    /* ámbar */
  --accent-600: #d97706;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;

  --radius: 12px;
  --shadow: 0 10px 25px rgba(0,0,0,.08);

  --font: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
}

[data-theme="dark"] {
  /* Modo oscuro */
  --bg: #0f1115;
  --panel: #161a20;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #242a33;

  --primary: #0b0f14;   /* más profundo */
  --accent: #f59e0b;
  --accent-600: #b45309;

  --shadow: 0 6px 20px rgba(0,0,0,.35);
}

/* Reset pequeño */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); -webkit-font-smoothing: antialiased; line-height: 1.35;
}

/* Layout básico */
.header {
  background: var(--panel); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow); position: sticky; top: 0; z-index: 50;
}
.header .wrap {
  max-width: 1100px; margin: 0 auto; padding: 12px 18px;
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
}
.brand { font-weight: 800; letter-spacing:.2px; }
.brand .dot { color: var(--accent); }

.container {
  max-width: 1100px; margin: 20px auto; padding: 0 18px;
}

/* Cards / paneles */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px;
}

/* Formularios */
label { display:block; margin: 10px 0 6px; color: var(--muted); font-size: 14px; }
.input, input[type="text"], input[type="password"], input[type="number"], select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--panel); color: var(--text);
  outline: none;
}
.input:focus, input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245,158,11,.15); }

/* Botones */
.btn {
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px; padding: 10px 14px; border-radius: 10px; border:1px solid transparent;
  font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--accent); color: #1f2937; border-color: var(--accent-600); }
.btn-primary:hover { background: var(--accent-600); color: #111827; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); }

/* Tabla */
.table {
  width: 100%; border-collapse: collapse; overflow: hidden; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--border);
}
.table th, .table td { padding: 12px; border-bottom: 1px solid var(--border); text-align: left; }
.table th { font-size: 13px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.table tr:hover td { background: rgba(0,0,0,.02); }
[data-theme="dark"] .table tr:hover td { background: rgba(255,255,255,.03); }

/* Utilidades */
.row { display:flex; gap:12px; align-items:center; flex-wrap: wrap; }
.space { height: 16px; }
.badge { display:inline-block; padding: 4px 10px; font-size: 12px; border-radius: 999px; background: #e5e7eb; color:#111827; }
.badge.ok { background: rgba(16,185,129,.15); color: #10b981; }
.badge.warn { background: rgba(245,158,11,.15); color: #f59e0b; }
.badge.danger { background: rgba(239,68,68,.15); color: #ef4444; }

/* Login específico (reutiliza card) */
.login-wrap {
  min-height: 100dvh; display:grid; place-items:center; padding: 20px;
}
.login-card { width: 100%; max-width: 380px; }
.login-title { margin:0 0 6px; font-size: 22px; }
.login-sub { margin:0 0 16px; color: var(--muted); font-size: 14px; }
.error { color:#b91c1c; margin-top:10px; font-size: 14px; }

/* --- Header: agrupar acciones a la derecha --- */
.header .wrap { flex-wrap: wrap; }
.header .right { margin-left: auto; display:flex; gap:8px; align-items:center; }

/* Botón ícono redondo */
.btn-icon { width:38px; height:38px; border-radius:999px; padding:0; display:inline-flex; align-items:center; justify-content:center; }

/* Toolbar de tarjetas (buscador + botonera) */
.card-toolbar { display:flex; gap:12px; align-items:center; justify-content:space-between; flex-wrap:wrap; }
.card-toolbar form { flex:1; min-width: 220px; }

/* Tabla responsiva y alineaciones */
.table-wrap { overflow-x:auto; border-radius:12px; }
.nowrap { white-space: nowrap; }
.num { text-align: right; }

/* Ajustes pequeños en móvil */
@media (max-width: 640px){
  .brand { font-size: 16px; }
  .table th, .table td { padding: 10px; }
}