/* ── I.S.A. — Estilos compartidos (tema Aubergine / estilo Slack) ──── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  /* Superficies y neutros */
  --bg:        #fefbff;   /* lienzo (soft-white, tinte lila) */
  --surface:   #ffffff;   /* tarjetas */
  --surface2:  #f9f0ff;   /* wash lila (cabeceras, zonas apagadas) */
  --border:    #edeaed;   /* hairline (fog) */
  --border-lav:#eac8fe;   /* borde lavanda de tarjetas */

  /* Marca */
  --accent:    #611f69;   /* aubergine — CTAs, títulos, marca */
  --accent-l:  #730394;   /* iris — hover */
  --accent-d:  #481a54;   /* deep plum — énfasis oscuro */
  --accent-bg: #f9f0ff;   /* wash para hover/fondos suaves */
  --gold:      #b8892a;

  /* Texto */
  --text:      #1d1c1d;   /* carbon */
  --text2:     #454245;   /* charcoal */
  --muted:     #696969;   /* mid-gray */

  /* Semánticos */
  --urgent:    #b91c1c;
  --warning:   #b45309;
  --ok:        #1d6a40;

  /* Métricas */
  --nav-h:     64px;
  --r:         8px;        /* inputs / general */
  --r-btn:     4px;        /* botones / tags (rectangular Slack) */
  --r-card:    16px;       /* tarjetas */
  --shadow:    0 0 32px rgba(0,0,0,.10);            /* ambiente flotante (xl) */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);           /* nav / sutil */
  --shadow-lg: 0 5px 20px rgba(0,0,0,.10);

  /* Tipografía */
  --font-head: 'DM Sans', system-ui, sans-serif;    /* geométrica (display/heading) */
  --font-body: 'Inter', system-ui, sans-serif;      /* humanista (cuerpo/UI) */
  --font-mono: 'IBM Plex Mono', monospace;          /* datos/fechas/IDs */
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar (barra flotante) ── */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 40px;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.navbar-brand {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.navbar-brand:hover { text-decoration: none; color: var(--accent-l); }

.navbar-sep { width: 1px; height: 28px; background: var(--border); }

.navbar-subtitle {
  font-size: 12px;
  letter-spacing: 0.057em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 700;
}

.navbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }

.navbar-user { font-size: 14px; color: var(--text2); display: flex; align-items: center; gap: 8px; }

.navbar-user-avatar {
  width: 32px; height: 32px;
  background: var(--surface2);
  border: 1px solid var(--border-lav);
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--accent);
}

/* ── Botones (rectangulares, 4px) ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-size: 15px; font-weight: 600;
  padding: 10px 20px; border-radius: var(--r-btn);
  cursor: pointer; border: 1px solid transparent;
  text-decoration: none; transition: all 0.2s cubic-bezier(0.165,0.84,0.44,1); white-space: nowrap;
}

.btn-primary   { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-d); border-color: var(--accent-d); text-decoration: none; color: #fff; }

.btn-secondary { background: var(--surface); color: var(--accent-d); border-color: var(--border-lav); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); text-decoration: none; }

.btn-danger    { background: #fef2f2; color: var(--urgent); border-color: #fca5a5; }
.btn-danger:hover { background: #fee2e2; text-decoration: none; }

.btn-ghost     { background: transparent; color: var(--accent-d); border-color: transparent; padding: 10px 14px; }
.btn-ghost:hover { color: var(--accent); background: var(--accent-bg); text-decoration: none; }

.btn-sm { font-size: 13px; padding: 6px 14px; }

/* ── Formularios ── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.form-label .req { color: var(--urgent); margin-left: 2px; }

.form-control {
  width: 100%; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border-lav);
  border-radius: var(--r); color: var(--text);
  font-family: var(--font-body); font-size: 15px;
  outline: none; transition: border-color 0.18s, box-shadow 0.18s;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(97,31,105,.12); }

.form-hint { font-size: 13px; color: var(--muted); margin-top: 5px; }

/* ── Alertas ── */
.alert {
  padding: 12px 16px; border-radius: var(--r);
  font-size: 15px; margin-bottom: 20px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-error   { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #14532d; }
.alert-info    { background: var(--surface2); border: 1px solid var(--border-lav); color: var(--accent-d); }
.alert-warn    { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* ── Cards (16px, borde lavanda) ── */
.card {
  background: var(--surface); border: 1px solid var(--border-lav);
  border-radius: var(--r-card); box-shadow: none;
  overflow: hidden;
}
.card-header {
  padding: 20px 28px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.card-header h2 {
  font-family: var(--font-head); font-size: 20px; font-weight: 700;
  color: var(--accent); display: flex; align-items: center; gap: 10px; letter-spacing: -0.01em;
}
.card-header p { font-size: 14px; color: var(--text2); margin-top: 4px; }
.card-body { padding: 24px 28px; }

/* ── Tabla admin ── */
.table-wrap { overflow-x: auto; }
table.isa-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.isa-table thead tr { background: var(--surface2); border-bottom: 2px solid var(--accent); }
.isa-table th {
  padding: 11px 14px; text-align: left;
  font-size: 12px; font-weight: 700; letter-spacing: 0.057em;
  text-transform: uppercase; color: var(--muted);
}
.isa-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.isa-table tr:last-child td { border-bottom: none; }
.isa-table tr:hover td { background: var(--accent-bg); }

/* ── Badges ── */
.badge { display: inline-block; padding: 2px 10px; border-radius: 90px; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
.badge-admin   { background: var(--surface2); color: var(--accent-d); border: 1px solid var(--border-lav); }
.badge-user    { background: #eff6ff; color: #1e40af; border: 1px solid #93c5fd; }
.badge-active  { background: #f0fdf4; color: #14532d; border: 1px solid #86efac; }
.badge-inactive{ background: #f9fafb; color: #6b7280; border: 1px solid #d1d5db; }

/* ── Página de login ── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 40px 20px;
  background: linear-gradient(135deg, #fefbff 0%, #f9f0ff 100%);
}
.login-box {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--border-lav);
  border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden;
}
.login-head {
  background: var(--accent-d); padding: 32px 36px 28px; text-align: center;
}
.login-head h1 { font-family: var(--font-head); font-size: 30px; color: #fff; font-weight: 700; letter-spacing: -0.02em; }
.login-head p  { font-size: 12px; color: rgba(255,255,255,.75); margin-top: 4px; letter-spacing: 0.1em; text-transform: uppercase; }
.login-body    { padding: 32px 36px; }
.login-footer  { padding: 0 36px 28px; text-align: center; font-size: 13px; color: var(--muted); }

/* ── Layout principal ── */
.page-wrap { max-width: 1200px; margin: 0 auto; padding: 40px 24px; }
.page-header { margin-bottom: 36px; }
.page-header h1 { font-family: var(--font-head); font-size: 32px; color: var(--accent); font-weight: 700; letter-spacing: -0.02em; }
.page-header p  { color: var(--text2); font-size: 16px; margin-top: 6px; }

/* ── Grid de cards ── */
.card-grid { display: grid; gap: 24px; }
.card-grid-2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.card-grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ── Link card (secciones home) ── */
.link-card {
  background: var(--surface); border: 1px solid var(--border-lav);
  border-radius: var(--r-card); box-shadow: none;
  padding: 24px 28px; display: flex; flex-direction: column; gap: 10px;
  text-decoration: none; color: inherit;
  transition: box-shadow 0.25s cubic-bezier(0.165,0.84,0.44,1), border-color 0.2s, transform 0.2s;
  position: relative; overflow: hidden;
}
.link-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 4px; height: 100%; background: var(--accent);
  opacity: 0; transition: opacity 0.2s;
}
.link-card:hover { box-shadow: var(--shadow); border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.link-card:hover::before { opacity: 1; }

.link-card-icon { font-size: 28px; margin-bottom: 2px; }
.link-card-title { font-family: var(--font-head); font-size: 18px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.link-card-desc  { font-size: 15px; color: var(--text2); line-height: 1.5; }
.link-card-arrow { margin-top: auto; font-size: 14px; color: var(--accent); font-weight: 600; }

/* ── Sección home ── */
.section-head {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.section-head h2 { font-family: var(--font-head); font-size: 24px; color: var(--text); font-weight: 700; letter-spacing: -0.015em; }
.section-icon { font-size: 28px; }

/* ── Log viewer ── */
.log-line {
  font-family: var(--font-mono); font-size: 12px; line-height: 1.8;
  padding: 3px 0; border-bottom: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.log-ok   { color: var(--ok); }
.log-fail { color: var(--urgent); }
.log-info { color: var(--text2); }

/* ── Utilidades ── */
.text-muted  { color: var(--muted); }
.text-small  { font-size: 13px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-16{ margin-top: 16px; }
.mt-24{ margin-top: 24px; } .mt-32{ margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-16{ margin-bottom: 16px; } .mb-24{ margin-bottom: 24px; }
.flex  { display: flex; } .items-center { align-items: center; }
.gap-8 { gap: 8px; } .gap-12{ gap: 12px; } .ml-auto { margin-left: auto; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .navbar {
    padding: 0 16px; height: auto; min-height: var(--nav-h);
    flex-wrap: wrap; gap: 8px; padding-top: 10px; padding-bottom: 10px;
  }
  .navbar-brand { font-size: 18px; }
  .navbar-subtitle { display: none; }
  .navbar-sep { display: none; }
  .navbar-right { gap: 8px; flex-wrap: wrap; }
  .navbar-user span:not(.badge) { display: none; }
  .btn-ghost.btn-sm { padding: 6px 10px; font-size: 12px; }
  .btn-secondary.btn-sm { padding: 6px 10px; font-size: 12px; }
  .page-wrap { padding: 20px 16px; }
  .card-grid-2, .card-grid-3 { grid-template-columns: 1fr; }
  .login-head, .login-body, .login-footer { padding-left: 24px; padding-right: 24px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .section-head h2 { font-size: 20px; }
  .isa-table { font-size: 13px; }
  .isa-table th, .isa-table td { padding: 8px 10px; }
  .tabs { overflow-x: auto; gap: 0; }
  .tab-btn { font-size: 12px; padding: 8px 14px; white-space: nowrap; }
  .form-control { font-size: 14px; }
}

@media (max-width: 480px) {
  .navbar-brand { font-size: 16px; }
  .page-wrap { padding: 16px 12px; }
  .page-header h1 { font-size: 24px; }
  .isa-table .btn-sm { padding: 4px 8px; }
}
