:root {
  --bg: #121212;
  --surface: #1e1e1e;
  --surface-2: #262626;
  --line: #333;
  --text: #e8e8e8;
  --muted: #9aa0a6;
  --accent: #26a69a;
  --accent-2: #2bbbad;
  --danger: #e05656;
  --success: #4caf50;
  --warn: #e0a800;
  --radius: 12px;
}

* { box-sizing: border-box; }
/* El atributo [hidden] debe ganar a cualquier display de clase (.modal-backdrop, .login-wrap…) */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.muted { color: var(--muted); }
.error { color: var(--danger); font-size: 14px; }
.grow { flex: 1; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; }
.row.end { justify-content: flex-end; }
.wrap { flex-wrap: wrap; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.brand { display: flex; align-items: center; gap: 8px; }
.brand h1 { font-size: 22px; margin: 0; }
.brand-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px rgba(38,166,154,.18);
}
.brand-logo { height: 80px; width: auto; max-width: 260px; border-radius: 10px; object-fit: contain; }
.brand-logo.sm { height: 44px; width: auto; max-width: 160px; border-radius: 8px; object-fit: contain; }

.about {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  padding: 24px 0 0; font-size: 13px; border-top: 1px solid var(--line); margin-top: 8px;
}
.about a { color: var(--accent-2); text-decoration: none; }
.about a:hover { text-decoration: underline; }

/* Botones */
.btn {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 14px; font-size: 14px; cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04201c; font-weight: 600; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: #5a2a2a; }
.btn.small { padding: 5px 9px; font-size: 13px; }

input, select {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-size: 14px;
}
label { display: block; margin: 10px 0; font-size: 13px; color: var(--muted); }
label input, label select { margin-top: 4px; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 360px; }
.login-card .btn { width: 100%; margin-top: 8px; }

/* Topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 0; z-index: 5;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.container { max-width: 980px; margin: 0 auto; padding: 18px 20px 60px; display: grid; gap: 16px; }

/* Cliente */
.client { display: grid; gap: 10px; }
.client-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.client-head h3 { margin: 0; font-size: 17px; }
.tag {
  font-size: 12px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.tag.profesor { color: #8ab4f8; border-color: #2a3a5a; }
.tag.comercial { color: var(--accent-2); border-color: #234a45; }
.tag.trial { color: var(--warn); border-color: #5a4a1a; }
.tag.inactivo { background: rgba(224,168,0,.14); color: var(--warn); border-color: #5a4a1a; }
.tag.off { background: rgba(224,86,86,.16); color: var(--danger); border-color: #5a2a2a; }

/* Tabla de licencias */
.lic-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.lic-table th, .lic-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.lic-table th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.lic-table tr:last-child td { border-bottom: none; }
.lic-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.pill { font-size: 12px; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.pill.on { background: rgba(76,175,80,.16); color: var(--success); }
.pill.off { background: rgba(224,86,86,.16); color: var(--danger); }
.pill.exp { background: rgba(224,168,0,.16); color: var(--warn); }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: grid; place-items: center; padding: 20px; z-index: 20;
}
.modal { width: 100%; max-width: 440px; }
.modal h3 { margin: 0 0 12px; }
.empty { color: var(--muted); text-align: center; padding: 30px; }
