/* RDG SO · estilos compartidos */
:root {
  --ink: #000;
  --paper: #fff;
  --line: #e5e5e5;
  --muted: #6e6e73;
  --accent: #fff0c2;
  --danger: #dc2626;
  --success: #16a34a;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
  background: #fafafa;
  line-height: 1.5;
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }

/* Layout */
.so-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.so-header {
  background: #000; color: #fff;
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
}
.so-header .logo { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.so-header .logo small { font-weight: 400; opacity: 0.55; margin-left: 8px; font-size: 12px; }
.so-nav { display: flex; gap: 4px; align-items: center; }
.so-nav a { padding: 8px 14px; border-radius: 6px; font-size: 13px; font-weight: 500; opacity: 0.7; transition: all 0.2s; }
.so-nav a:hover { opacity: 1; background: rgba(255,255,255,0.05); }
.so-nav a.active { opacity: 1; background: rgba(255,255,255,0.1); }
.so-user { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.so-user .name { color: rgba(255,255,255,0.8); }
.so-user .logout { background: transparent; border: 1px solid rgba(255,255,255,0.25); color: #fff; padding: 6px 12px; border-radius: 6px; font-size: 12px; cursor: pointer; }
.so-user .logout:hover { border-color: #fff; }

.so-main { max-width: 1380px; margin: 0 auto; padding: 28px 24px; width: 100%; }

/* Tipografía */
h1.page-title { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; margin: 0 0 4px; }
.page-sub { color: rgba(0,0,0,0.55); font-size: 13px; margin-bottom: 24px; }

/* Cards */
.card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 18px 20px;
}

/* KPI grid */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.kpi { background: #fff; border: 1px solid rgba(0,0,0,0.08); border-radius: 12px; padding: 14px 16px; }
.kpi .num { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.kpi .lbl { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(0,0,0,0.55); margin-top: 6px; font-weight: 600; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-weight: 500; font-size: 13px; cursor: pointer; border: 0; font-family: inherit; transition: all 0.2s; text-decoration: none; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: #000; color: #fff; }
.btn-primary:hover { background: #1a1a1a; }
.btn-secondary { background: transparent; color: #000; border: 1px solid rgba(0,0,0,0.18); }
.btn-secondary:hover { border-color: #000; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: rgba(0,0,0,0.7); margin-bottom: 5px; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="tel"], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 7px;
  font-family: inherit;
  font-size: 13px;
  background: #fff;
}
textarea { resize: vertical; min-height: 80px; font-family: 'SF Mono', 'Consolas', monospace; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #000; }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid rgba(0,0,0,0.08); border-radius: 10px; overflow: hidden; font-size: 13px; }
.tbl th { padding: 10px 12px; text-align: left; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(0,0,0,0.55); font-weight: 600; background: #fafafa; border-bottom: 1px solid rgba(0,0,0,0.08); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid rgba(0,0,0,0.05); vertical-align: middle; }
.tbl tr:hover { background: rgba(0,0,0,0.015); }
.tbl tr:last-child td { border-bottom: 0; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; }
.badge-nuevo { background: #e5e5e5; color: #000; }
.badge-contactado { background: #fef3c7; color: #92400e; }
.badge-respondido { background: #dcfce7; color: #14532d; }
.badge-cliente { background: #000; color: #fff; }
.badge-descartado { background: #f3f4f6; color: #6b7280; }

.badge-lista-blanca { background: #fff0c2; color: #92400e; }

/* Filters bar */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 16px; background: #fff; border: 1px solid rgba(0,0,0,0.08); border-radius: 10px; margin-bottom: 14px; }
.filters input, .filters select { width: auto; padding: 7px 11px; font-size: 12px; }

/* Login page */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f5f5f5; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 14px; padding: 36px 32px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.login-card h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 6px; }
.login-card .sub { color: rgba(0,0,0,0.55); font-size: 13px; margin-bottom: 24px; }
.login-error { background: #fee2e2; color: #991b1b; padding: 10px 14px; border-radius: 7px; font-size: 13px; margin-bottom: 14px; }

/* Empty state */
.empty { padding: 56px 24px; text-align: center; background: #fff; border: 1px solid rgba(0,0,0,0.08); border-radius: 12px; }
.empty h3 { font-size: 18px; margin: 0 0 6px; font-weight: 600; }
.empty p { color: rgba(0,0,0,0.55); margin: 0 0 16px; }

/* Modal simple */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: none; z-index: 50; align-items: center; justify-content: center; padding: 24px; }
.modal-bg.open { display: flex; }
.modal { background: #fff; border-radius: 12px; max-width: 720px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 24px; }
.modal h2 { margin: 0 0 16px; font-size: 18px; font-weight: 600; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(0,0,0,0.06); }

/* Utility */
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.muted { color: rgba(0,0,0,0.55); }
.mb-12 { margin-bottom: 12px; }
.mb-24 { margin-bottom: 24px; }
.mt-24 { margin-top: 24px; }
.text-right { text-align: right; }

/* Responsive */
@media (max-width: 700px) {
  .so-header { padding: 0 12px; }
  .so-nav a { padding: 6px 10px; font-size: 12px; }
  .so-main { padding: 16px 12px; }
}
