/* Soporte Geztion — mismo lenguaje visual que el RAT/GRC y GestorPM */
:root {
  --navy: #0f1830;
  --navy-2: #0f1a3d;
  --bg: #eef1f6;
  --card: #ffffff;
  --border: #dde3ee;
  --fg: #15203a;
  --muted: #5a6786;
  --accent: #3b6fd1;
  --alert: #d97706;
  --ok: #15803d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
}

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

.layout { min-height: 100vh; display: flex; flex-wrap: wrap; }

/* --- Sidebar --- */
.sidebar {
  width: 272px;
  box-sizing: border-box;
  align-self: stretch;
  background: var(--navy);
  padding: 26px 18px 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  color: #c7d2ea;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.sidebar .brand-logo {
  display: block; max-width: 100%; max-height: 42px; width: auto; height: auto;
  object-fit: contain; object-position: left center;
}
.sidebar .brand-mark {
  width: 34px; height: 34px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, #2f5fd6, #7aa6ff);
  display: flex; align-items: center; justify-content: center;
}
.sidebar .brand-mark span { color: #fff; font-weight: 800; font-size: 16px; }
.sidebar .brand-name { color: #fff; font-weight: 700; font-size: 14px; }
.sidebar .brand-sub { color: #6b7aa3; font-size: 9.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; }

.sidebar .company-box { padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar .company-box .label { color: #6b7aa3; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }
.sidebar .company-box .name { color: #fff; font-size: 14.5px; font-weight: 700; margin-bottom: 3px; }
.sidebar .company-box .role { color: #7c89b3; font-size: 12px; }

.sidebar nav { display: flex; flex-direction: column; gap: 20px; }
.sidebar .nav-group-label { color: #6b7aa3; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 0 12px; margin-bottom: 8px; }
.sidebar .nav-item {
  display: block; padding: 8px 12px; border-radius: 7px; font-size: 13.5px; font-weight: 600;
  color: #c7d2ea; border-left: 3px solid transparent;
}
.sidebar .nav-item:hover { color: #fff; text-decoration: none; }
.sidebar .nav-item.active { background: rgba(79,125,240,0.16); border-left-color: #4f7df0; color: #fff; }
.sidebar .nav-item.disabled { color: #4a567c; cursor: default; }
.sidebar .nav-item.disabled:hover { color: #4a567c; }

/* --- Contenido --- */
.content { flex: 999 1 560px; min-width: 0; padding: 40px 48px 64px; }
.page-head { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.page-head h1 { margin: 0 0 8px; font-size: 28px; font-weight: 800; color: #10172e; }
.page-head p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); max-width: 640px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  padding: 10px 16px; border-radius: 8px; border: 1px solid #c7d0e0; background: #fff; color: var(--fg);
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-primary { border: none; background: var(--accent); color: #fff; }
.btn:hover { opacity: 0.92; }

.cards { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
@media (max-width: 900px) { .cards { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.card.alert { border-top: 3px solid var(--alert); }
.card .k-label { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.card .k-stat { font-size: 30px; font-weight: 800; color: var(--fg); line-height: 1; }
.card.alert .k-stat { color: var(--alert); }
.card .k-sub { margin: 8px 0 0; font-size: 12px; color: var(--muted); }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: 10px; margin-top: 24px; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--bg); }
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 700; }

.charts-row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin-top: 14px; }
@media (max-width: 900px) { .charts-row { grid-template-columns: 1fr; } }
.chart-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; min-width: 0; }
.chart-card h3 { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--fg); }
.chart-wrap { position: relative; height: 230px; width: 100%; }
.chart-wrap.chart-wrap-wide { height: 150px; }

.table-row { display: flex; gap: 14px; padding: 16px 20px; border-bottom: 1px solid #f2f4f9; }
.table-row:last-child { border-bottom: none; }
.table-row .code { flex: 0 0 72px; font-size: 13px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.table-row a.row-link { display: block; text-decoration: none; }
.table-row a.row-link:hover { text-decoration: none; }
.table-row a.row-link .title { color: var(--fg); }
.table-row a.row-link:hover .title { color: var(--accent); text-decoration: underline; }
.table-row .title { font-size: 14px; font-weight: 700; color: var(--fg); margin-bottom: 4px; }
.table-row .desc { font-size: 13px; color: #92400e; line-height: 1.5; }

table.grid-table { width: 100%; border-collapse: collapse; }
table.grid-table th { text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; padding: 12px 20px; background: #f7f9fc; border-bottom: 1px solid var(--bg); }
table.grid-table td { padding: 14px 20px; border-bottom: 1px solid #f2f4f9; font-size: 13.5px; vertical-align: middle; }
table.grid-table tr:last-child td { border-bottom: none; }

.pill { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; }
.filters label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.03em; margin-bottom: 4px; }
.filters input, .filters select { padding: 8px 10px; border-radius: 7px; border: 1px solid #c7d0e0; font-size: 13px; font-family: inherit; }

.form-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 22px; max-width: 640px; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 9px 11px; border-radius: 7px; border: 1px solid #c7d0e0; font-size: 13.5px; font-family: inherit;
}
.form-row textarea { min-height: 120px; resize: vertical; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy); }
.login-card { background: #fff; border-radius: 12px; padding: 36px 32px; width: 100%; max-width: 360px; }
.login-card h1 { font-size: 18px; margin: 0 0 4px; }
.login-card p.sub { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.login-error { background: #fde2e1; color: #b91c1c; padding: 10px 12px; border-radius: 7px; font-size: 13px; margin-bottom: 16px; }
