/*
 * Grupo Hosting · Dark Design System
 * Versión: 1.0  (basado en envios.grupohosting.cl, 2026-04)
 *
 * Paleta: indigo (#6366f1) + teal (#14b8a6) sobre fondo casi-negro.
 * Tipografía: Inter (Google Fonts).
 * Uso: <link rel="stylesheet" href="grupohosting-dark.css">
 *      <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
 */

:root {
  /* Backgrounds */
  --bg: #0a0b14;
  --bg-2: #0f1020;
  --panel: #141829;
  --panel-2: #1d2238;
  --panel-3: #262c48;
  --border: #2a3050;
  --border-strong: #3a4268;

  /* Text */
  --text: #e5e7f0;
  --text-bright: #ffffff;
  --muted: #8b90a8;
  --muted-2: #6b7089;

  /* Brand */
  --primary: #6366f1;       /* indigo-500 */
  --primary-2: #818cf8;     /* indigo-400 */
  --primary-dark: #4f46e5;  /* indigo-600 */
  --accent: #14b8a6;        /* teal-500 */
  --accent-2: #5eead4;      /* teal-300 */

  /* States */
  --ok: #10b981;  --ok-bg: rgba(16,185,129,.12);
  --warn: #f59e0b; --warn-bg: rgba(245,158,11,.12);
  --err: #ef4444; --err-bg: rgba(239,68,68,.12);
  --info: #3b82f6; --info-bg: rgba(59,130,246,.12);

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 4px 16px rgba(0,0,0,.4);
  --shadow-lg: 0 24px 48px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.05);
  --glow: 0 0 32px rgba(99,102,241,.35);

  /* Shape */
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
}

/* Reset + base */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  background-image:
    radial-gradient(1200px 600px at 10% -20%, rgba(99,102,241,.08), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(20,184,166,.06), transparent 60%);
  min-height: 100vh;
}

a { color: var(--primary-2); text-decoration: none; }
button { cursor: pointer; font: inherit; }

/* Form controls */
input, textarea, select {
  font: inherit; color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.18);
}
textarea { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; resize: vertical; line-height: 1.5; }
label {
  display: block;
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); margin-bottom: 6px; font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white; border: none;
  border-radius: var(--radius);
  padding: 10px 18px;
  font-weight: 600; font-size: 13px;
  letter-spacing: .2px;
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 4px 12px rgba(99,102,241,.35);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.1); box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 6px 18px rgba(99,102,241,.45); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; }
.btn.ghost { background: var(--panel-2); color: var(--text); box-shadow: none; border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--panel-3); border-color: var(--border-strong); }
.btn.danger  { background: linear-gradient(180deg, var(--err) 0%, #c73440 100%); box-shadow: 0 4px 12px rgba(239,68,68,.35); }
.btn.success { background: linear-gradient(180deg, var(--ok)  0%, #059669 100%); box-shadow: 0 4px 12px rgba(16,185,129,.35); }
.btn.lg { padding: 14px 24px; font-size: 14px; }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn.block { width: 100%; justify-content: center; }

/* Cards */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 4px 0; font-size: 16px; font-weight: 600; }
.card .card-sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px;
  border: 1px solid transparent;
}
.badge.ok   { background: var(--ok-bg);   color: var(--ok);   border-color: rgba(16,185,129,.25); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: rgba(245,158,11,.25); }
.badge.err  { background: var(--err-bg);  color: var(--err);  border-color: rgba(239,68,68,.25); }
.badge.info { background: var(--info-bg); color: var(--info); border-color: rgba(59,130,246,.25); }
.badge.draft{ background: rgba(139,144,168,.12); color: var(--muted); border-color: rgba(139,144,168,.25); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Layout primitives */
.muted { color: var(--muted); }
.row { display: flex; gap: 14px; }
.col { flex: 1; min-width: 0; }
.between { justify-content: space-between; align-items: center; }
.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 14px; }
.hidden { display: none !important; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; padding: 12px 16px;
  color: var(--muted); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(99,102,241,.04); }
tbody tr:last-child td { border-bottom: none; }

/* Sidebar + layout */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 22px 16px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 10px 20px 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: grid; place-items: center;
  box-shadow: 0 4px 16px rgba(99,102,241,.4);
}
.brand-title { font-weight: 700; font-size: 15px; line-height: 1.2; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .4px; text-transform: uppercase; }
.sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sidebar nav button {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  background: transparent; border: none;
  color: var(--muted);
  padding: 11px 12px;
  border-radius: var(--radius);
  font-weight: 500; font-size: 13px;
  position: relative;
  transition: background .12s, color .12s;
}
.sidebar nav button:hover { background: rgba(255,255,255,.04); color: var(--text); }
.sidebar nav button.active { background: rgba(99,102,241,.1); color: var(--text-bright); }
.sidebar nav button.active::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 100%);
}
.sidebar nav svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar .user-area {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 10px; border-top: 1px solid var(--border); margin-top: 12px;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #5eead4, #6366f1);
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px; color: white;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 11px; color: var(--muted); }
.logout-btn {
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); padding: 8px; border-radius: 8px;
  display: grid; place-items: center;
}
.logout-btn:hover { color: var(--err); border-color: var(--err); }

.main { flex: 1; padding: 32px 40px; max-width: 1400px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.page-header h2 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.3px; }
.page-header .subtitle { color: var(--muted); margin-top: 4px; font-size: 13px; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; right: 0; width: 80px; height: 80px;
  background: radial-gradient(circle at top right, rgba(99,102,241,.12), transparent 70%);
  pointer-events: none;
}
.stat-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; margin-bottom: 14px;
  background: rgba(99,102,241,.12); color: var(--primary-2);
}
.stat-icon.teal  { background: rgba(20,184,166,.12); color: var(--accent-2); }
.stat-icon.green { background: var(--ok-bg);   color: var(--ok); }
.stat-icon.amber { background: var(--warn-bg); color: var(--warn); }
.stat-icon.red   { background: var(--err-bg);  color: var(--err); }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -.5px; line-height: 1; }
.stat-label { color: var(--muted); font-size: 12px; margin-top: 6px; font-weight: 500; text-transform: uppercase; letter-spacing: .4px; }

/* Stepper (wizard) */
.stepper { display: flex; align-items: center; margin-bottom: 28px; padding: 0 20px; }
.stepper .step { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.stepper .circle {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--panel-2); border: 2px solid var(--border);
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: var(--muted);
  transition: all .3s;
}
.stepper .step.active .circle {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-color: var(--primary); color: white;
  box-shadow: 0 0 0 4px rgba(99,102,241,.2);
}
.stepper .step.done .circle {
  background: linear-gradient(135deg, var(--accent) 0%, #0f766e 100%);
  border-color: var(--accent); color: white;
}
.stepper .step-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stepper .step.active .step-label, .stepper .step.done .step-label { color: var(--text); font-weight: 600; }
.stepper .line { flex: 1; height: 2px; background: var(--border); margin: 0 8px; margin-bottom: 28px; border-radius: 1px; }
.stepper .line.done { background: linear-gradient(90deg, var(--accent), var(--primary)); }

/* Progress bar */
.progress { height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .3s; border-radius: 4px; }

/* Modal */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(6,8,15,.75);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  animation: fadeIn .2s ease;
}
.modal {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 28px;
  min-width: 440px; max-width: 600px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .25s cubic-bezier(.2,.8,.3,1);
}
.modal h3 { margin: 0 0 6px 0; font-size: 18px; }
.modal p { margin-top: 0; }
.modal .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* Login shell */
.login-shell {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 20px;
  position: relative;
}
.login-shell::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(600px 400px at 20% 20%, rgba(99,102,241,.15), transparent 60%),
    radial-gradient(500px 350px at 80% 80%, rgba(20,184,166,.12), transparent 60%);
  pointer-events: none;
}
.login-card {
  position: relative;
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 34px;
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg);
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.login-brand .mark {
  width: 48px; height: 48px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(99,102,241,.45);
}
.login-brand h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.login-brand .sub { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.login-card h2 { margin: 0 0 6px 0; font-size: 22px; letter-spacing: -.3px; }
.login-card > p.muted { margin: 0 0 24px 0; }
.field { margin-bottom: 16px; }

/* Tabs (pill style, para login o toggles) */
.pill-tabs { display: flex; gap: 4px; background: var(--panel-2); padding: 4px; border-radius: 10px; }
.pill-tabs button {
  flex: 1; padding: 9px; background: transparent; border: none;
  color: var(--muted); border-radius: 7px; font-weight: 600; font-size: 13px;
  display: flex; align-items: center; gap: 6px; justify-content: center;
  transition: all .15s;
}
.pill-tabs button.active { background: var(--panel-3); color: var(--text-bright); box-shadow: var(--shadow-sm); }
.pill-tabs svg { width: 14px; height: 14px; }

/* Toast */
.toast {
  position: fixed; right: 24px; top: 24px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px; min-width: 280px; max-width: 420px;
  z-index: 200; box-shadow: var(--shadow-lg);
  animation: slideInRight .25s cubic-bezier(.2,.8,.3,1);
  display: flex; align-items: center; gap: 10px;
}
.toast.ok  { border-left: 3px solid var(--ok); }
.toast.err { border-left: 3px solid var(--err); }

/* Code inline */
code {
  background: var(--panel-2); padding: 2px 8px; border-radius: 4px;
  font-size: 12px; color: var(--accent-2);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* Empty state */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 14px; opacity: .4; }
.empty-state h4 { margin: 0 0 6px 0; color: var(--text); font-size: 15px; }

/* Animations */
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px) } to { opacity: 1; transform: translateY(0) } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(30px) } to { opacity: 1; transform: translateX(0) } }

/* Responsive */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 20px; }
}
