/* Netsurx Admin Web — Fase 36 */
:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #2563eb;
  --danger: #ef4444;
  --ok: #22c55e;
  --warn: #f59e0b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}
.sidebar h1 { font-size: 1.1rem; margin: 0 0 0.25rem; }
.sidebar .muted { color: var(--muted); font-size: 0.85rem; margin-bottom: 1rem; }
.sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 0.25rem; }
.sidebar nav button {
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
}
.sidebar nav button.active, .sidebar nav button:hover { background: #334155; }
.sidebar-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.8rem; }

main { flex: 1; padding: 1.25rem; overflow: auto; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.login-wrap {
  max-width: 400px;
  margin: 4rem auto;
}
h2 { margin-top: 0; }
input, select, textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  margin: 0.35rem 0 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0f172a;
  color: var(--text);
}
.btn {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #334155;
  color: var(--text);
  cursor: pointer;
}
.btn.primary { background: var(--primary); border-color: var(--primary); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.sm { padding: 0.25rem 0.5rem; font-size: 0.85rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.error { color: var(--danger); font-size: 0.9rem; }
.success { color: var(--ok); font-size: 0.9rem; }

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.kpi {
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
}
.kpi .label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; }
.kpi .value { font-size: 1.4rem; font-weight: 600; margin-top: 0.25rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.5rem; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--muted); font-weight: 500; }
tr:hover td { background: rgba(255,255,255,0.03); }

.toolbar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.hidden { display: none !important; }
.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  background: #334155;
}
.badge.activo { background: #166534; }
.badge.moroso { background: #92400e; }
.badge.suspendido { background: #991b1b; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal { background: var(--surface); border-radius: 10px; padding: 1.25rem; width: min(480px, 92vw); max-height: 90vh; overflow: auto; }
.modal-wide { width: min(720px, 96vw); }
.modal-body label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.75rem; }
.modal-foot { margin-top: 1rem; justify-content: flex-end; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.actions-cell { white-space: nowrap; }
.actions-cell .btn { margin-right: 0.25rem; margin-bottom: 0.25rem; }
.sidebar nav a.nav-link {
  color: var(--text);
  text-decoration: none;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  display: block;
}
.sidebar nav a.nav-link:hover { background: #334155; }

@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; }
}
