/* Cyprivi Panel — UI */
:root {
  --bg:         #060d1a;
  --bg-card:    #0e1b30;
  --bg-input:   #091325;
  --border:     rgba(59,139,255,0.15);
  --border-hi:  rgba(59,139,255,0.4);
  --c-bright:   #3B8BFF;
  --c-cyan:     #60C6FF;
  --c-text:     #d8e4f0;
  --c-dim:      #6b82a0;
  --c-white:    #ffffff;
  --c-green:    #3ecf8e;
  --c-yellow:   #f5a623;
  --c-red:      #ff6b6b;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 4px 24px rgba(0,0,0,0.4);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--c-text);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  min-height: 100vh;
  line-height: 1.6;
}
a { color: var(--c-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Auth pages ── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.auth-box {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: var(--shadow);
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  justify-content: center;
}
.auth-logo-mark {
  width: 36px; height: 36px;
  background: var(--c-bright);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; color: #fff;
}
.auth-logo-name { font-size: 1.2rem; font-weight: 700; color: var(--c-white); letter-spacing: 0.04em; }
.auth-title { font-size: 1.35rem; font-weight: 700; color: var(--c-white); margin-bottom: 6px; }
.auth-sub   { font-size: 0.88rem; color: var(--c-dim); margin-bottom: 28px; }

/* ── Forms ── */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.82rem; color: var(--c-dim); margin-bottom: 6px; font-weight: 500; }
.field input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--c-text);
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus { border-color: var(--c-bright); }
.field input::placeholder { color: var(--c-dim); }

.otp-input {
  letter-spacing: 0.3em;
  text-align: center;
  font-size: 1.6rem !important;
  font-weight: 700 !important;
  padding: 14px !important;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; border: none; text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--c-bright); color: #fff; width: 100%; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--c-text); }
.btn-danger { background: rgba(255,107,107,0.15); border: 1px solid rgba(255,107,107,0.3); color: var(--c-red); }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.msg { font-size: 0.85rem; padding: 10px 14px; border-radius: var(--radius-sm); margin-top: 14px; }
.msg-error   { background: rgba(255,107,107,0.1); border: 1px solid rgba(255,107,107,0.3); color: var(--c-red); }
.msg-success { background: rgba(62,207,142,0.1); border: 1px solid rgba(62,207,142,0.3); color: var(--c-green); }
.msg-info    { background: rgba(59,139,255,0.08); border: 1px solid var(--border); color: var(--c-cyan); }

.form-note { font-size: 0.78rem; color: var(--c-dim); text-align: center; margin-top: 12px; }

/* ── Layout ── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 28px 0;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 0 24px 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.sidebar-logo-mark {
  width: 32px; height: 32px;
  background: var(--c-bright);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; color: #fff;
}
.sidebar-logo-name { font-size: 1rem; font-weight: 700; color: var(--c-white); letter-spacing: 0.04em; }

nav { flex: 1; padding: 0 12px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--c-dim);
  font-size: 0.88rem; font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
}
.nav-item:hover { background: rgba(59,139,255,0.07); color: var(--c-text); text-decoration: none; }
.nav-item.active { background: rgba(59,139,255,0.12); color: var(--c-bright); font-weight: 600; }
.nav-item svg { flex-shrink: 0; }

.sidebar-footer { padding: 20px 24px 0; border-top: 1px solid var(--border); margin-top: auto; }
.sidebar-user-name { font-size: 0.85rem; font-weight: 600; color: var(--c-text); }
.sidebar-user-plan {
  display: inline-block; margin-top: 4px;
  font-size: 0.72rem; font-weight: 600; color: var(--c-bright);
  background: rgba(59,139,255,0.1); border: 1px solid rgba(59,139,255,0.25);
  border-radius: 100px; padding: 2px 9px;
}
.sidebar-logout {
  display: block; margin-top: 12px;
  font-size: 0.8rem; color: var(--c-dim);
  text-decoration: none;
}
.sidebar-logout:hover { color: var(--c-red); }

.main { flex: 1; padding: 40px 48px; overflow-y: auto; }
.page-title { font-size: 1.6rem; font-weight: 700; color: var(--c-white); margin-bottom: 4px; }
.page-sub   { font-size: 0.88rem; color: var(--c-dim); margin-bottom: 36px; }

/* ── Cards ── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin-bottom: 32px; }
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card-label { font-size: 0.75rem; font-weight: 600; color: var(--c-dim); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 8px; }
.card-value { font-size: 1.9rem; font-weight: 700; color: var(--c-white); line-height: 1.1; }
.card-value-sm { font-size: 1.1rem; }
.card-sub { font-size: 0.8rem; color: var(--c-dim); margin-top: 6px; }

/* Risk badge */
.risk-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px; border-radius: 100px;
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em;
}
.risk-bajo     { background: rgba(62,207,142,0.12); border: 1px solid rgba(62,207,142,0.3); color: var(--c-green); }
.risk-medio    { background: rgba(245,166,35,0.12); border: 1px solid rgba(245,166,35,0.3); color: var(--c-yellow); }
.risk-alto     { background: rgba(255,107,107,0.12); border: 1px solid rgba(255,107,107,0.3); color: var(--c-red); }
.risk-critico  { background: rgba(255,50,50,0.18); border: 1px solid rgba(255,50,50,0.5); color: #ff4444; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th { text-align: left; padding: 10px 14px; font-size: 0.75rem; font-weight: 600; color: var(--c-dim); text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--border); }
td { padding: 12px 14px; border-bottom: 1px solid rgba(59,139,255,0.07); color: var(--c-text); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(59,139,255,0.03); }

.status-pill {
  display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: 0.75rem; font-weight: 600;
}
.status-pendiente  { background: rgba(107,130,160,0.15); color: var(--c-dim); }
.status-en_curso   { background: rgba(245,166,35,0.12); color: var(--c-yellow); }
.status-completado { background: rgba(62,207,142,0.12); color: var(--c-green); }
.status-abierto    { background: rgba(255,107,107,0.12); color: var(--c-red); }
.status-en_progreso{ background: rgba(245,166,35,0.12); color: var(--c-yellow); }
.status-resuelto   { background: rgba(62,207,142,0.12); color: var(--c-green); }

/* ── Section header ── */
.section-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 1.05rem; font-weight: 700; color: var(--c-white); }

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--c-dim); font-size: 0.9rem;
  border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty-state svg { opacity: 0.3; margin-bottom: 12px; display: block; margin-inline: auto; }

/* ── Admin ── */
.page-actions { display: flex; gap: 10px; margin-bottom: 28px; flex-wrap: wrap; align-items: center; }
.page-actions .page-title { margin-bottom: 0; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { padding: 24px 20px; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr; }
  .auth-box { padding: 28px 20px; }
}
