/* =========================================================
   INSPIRE v2 — app.css (MONOCHROME PRO)
   Estilo: Minimalista, Blanco y Negro, Compacto.
========================================================= */

:root {
  /* Paleta Monochrome */
  --bg: #fafafa;           /* Fondo casi blanco */
  --card-bg: #ffffff;      /* Blanco puro */
  --text: #171717;         /* Negro suave */
  --text-muted: #737373;   /* Gris medio */
  --border: #e5e5e5;       /* Borde sutil */
  --border-hover: #a3a3a3; /* Borde al pasar mouse */
  
  --primary: #171717;      /* Negro principal */
  --primary-fg: #ffffff;   /* Texto sobre negro */
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  
  --radius: 6px;           /* Bordes más cerrados y serios */
}

/* --- BASE --- */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  font-size: 13px; /* Fuente más compacta */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; cursor: pointer; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
.hidden { display: none !important; }

/* --- TOPBAR (Negra Sólida) --- */
.topbar {
  background: #000000;
  color: #ffffff;
  height: 50px; /* Más delgada */
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #333;
}
.topbar-inner {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand span { opacity: 0.5; font-weight: 400; }

.nav { display: flex; gap: 4px; }
.user-info {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  color: #e5e5e5;
  font-size: 11px;
  white-space: nowrap;
}
.user-name,
.user-email {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-name { color: #f5f5f5; font-weight: 600; }
.user-email { color: #a1a1aa; }
.user-dot { color: #52525b; }
.nav-btn {
  background: transparent;
  border: none;
  color: #a1a1aa;
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 12px;
  transition: all 0.2s;
}
.nav-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.nav-btn.active { color: #fff; background: rgba(255,255,255,0.15); font-weight: 600; }

/* --- LAYOUT --- */
.shell {
  max-width: 1440px;
  margin: 20px auto;
  padding: 0 20px;
  padding-bottom: 60px;
}

/* --- LOGIN SIUBENpro --- */
.login-page {
  min-height: 100vh;
  width: 100%;
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  background:
    linear-gradient(rgba(15, 118, 110, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, .03) 1px, transparent 1px),
    linear-gradient(135deg, #f8fafc 0%, #edf7f4 52%, #f4f7fb 100%);
  background-size: 32px 32px, 32px 32px, auto;
}

.login-shell {
  width: min(1180px, 100%);
  min-height: 680px;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, .95);
  border-radius: 28px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .14);
}

.login-brand-panel {
  position: relative;
  display: flex;
  padding: 52px;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, .16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .14) 1px, transparent 1px),
    linear-gradient(145deg, #e6f4f2 0%, #dbeafe 100%);
  background-size: 40px 40px, 40px 40px, auto;
}

.login-brand-panel::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 8px;
  background: linear-gradient(90deg, #0f766e 0 42%, #2563eb 42% 76%, #dc2626 76% 100%);
}

.login-brand-content {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.login-logo,
.login-brand-panel img,
.login-brand img.login-logo {
  display: block;
  width: auto;
  max-width: 230px;
  height: auto;
  max-height: 120px;
  object-fit: contain;
}

.login-brand span {
  display: inline-flex;
  padding: 6px 9px;
  border: 1px solid rgba(15, 118, 110, .2);
  border-radius: 6px;
  background: rgba(255, 255, 255, .62);
  color: #0b665f;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.login-brand-copy h1 {
  margin: 0;
  color: #0f172a;
  font-size: 56px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
}

.login-brand-copy h2 {
  max-width: 560px;
  margin: 14px 0 0;
  color: #1e3a5f;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
}

.login-brand-copy p {
  max-width: 570px;
  margin: 16px 0 0;
  color: #475569;
  font-size: 15px;
  line-height: 1.65;
}

.login-modules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.login-module {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(148, 163, 184, .3);
  border-radius: 7px;
  background: rgba(255, 255, 255, .66);
  color: #334155;
  font-size: 12px;
}

.login-module span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  flex: 0 0 25px;
  border-radius: 6px;
  background: #0f766e;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.login-module strong {
  min-width: 0;
  line-height: 1.2;
}

.login-quote {
  margin: 0;
  padding: 15px 17px;
  border-left: 4px solid #0f766e;
  border-radius: 0 7px 7px 0;
  background: rgba(255, 255, 255, .68);
  color: #0f172a;
}

.login-quote span {
  display: block;
  margin-bottom: 5px;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-quote strong {
  font-size: 14px;
  line-height: 1.4;
}

.login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 52px 48px;
  background: rgba(255, 255, 255, .96);
}

.login-form-wrap {
  width: min(380px, 100%);
}

.login-form-head {
  margin-bottom: 28px;
}

.login-form-head > span {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 5px 8px;
  border: 1px solid #d1fae5;
  border-radius: 6px;
  background: #ecfdf5;
  color: #047857;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-form-head h2 {
  margin: 0;
  color: #0f172a;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
}

.login-form-head p {
  margin: 9px 0 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
}

.login-error {
  display: grid;
  gap: 3px;
  margin-bottom: 18px;
  padding: 12px 13px;
  border: 1px solid #fecaca;
  border-radius: 7px;
  background: #fef2f2;
  color: #991b1b;
}

.login-error strong {
  font-size: 13px;
}

.login-error span {
  font-size: 12px;
}

.login-form {
  display: grid;
  gap: 17px;
}

.login-field,
.login-form label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.login-form input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #101828;
  font-size: 15px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.login-form input:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.login-password-control {
  position: relative;
  display: block;
}

.login-password-control input {
  padding-right: 80px;
}

.login-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.login-password-toggle:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.login-submit {
  width: 100%;
  min-height: 54px;
  margin-top: 3px;
  border: 0;
  border-radius: 7px;
  background: #0f766e;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.22);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.login-submit:hover {
  transform: translateY(-1px);
  background: #0b635c;
  box-shadow: 0 18px 34px rgba(15, 118, 110, 0.28);
}

.login-security {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: start;
  margin-top: 22px;
  padding: 12px;
  border: 1px solid #d1fae5;
  border-radius: 7px;
  background: #f0fdf4;
  color: #166534;
}

.login-security-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #dcfce7;
  font-size: 14px;
}

.login-security strong {
  display: block;
  font-size: 12px;
}

.login-security p {
  margin: 3px 0 0;
  color: #3f7153;
  font-size: 11px;
  line-height: 1.45;
}

.login-footnote {
  display: grid;
  gap: 4px;
  margin-top: 24px;
  color: #667085;
  text-align: left;
  font-size: 12px;
}

.login-footnote strong {
  color: #334155;
}

/* --- COMPONENTES UI --- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
.h1 { font-size: 20px; margin-bottom: 4px; }
.sub { color: var(--text-muted); font-size: 13px; margin-bottom: 16px; }

/* Grid Configuración */
.settings-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}
.settings-menu { display: flex; flex-direction: column; gap: 2px; }
.settings-link {
  text-align: left;
  background: transparent;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 500;
  transition: 0.1s;
}
.settings-link:hover { background: #f4f4f5; color: var(--text); }
.settings-link.active { background: #f4f4f5; color: #000; font-weight: 600; }

/* Botones & Inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; border-radius: var(--radius); border: 1px solid var(--border);
  font-weight: 500; background: #fff; color: var(--text);
  cursor: pointer; transition: 0.1s; font-size: 12px;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: #fafafa; border-color: var(--border-hover); }
.btn.solid {
  background: #000; color: #fff; border-color: #000;
}
.btn.solid:hover { background: #333; border-color: #333; }

.input, .select, .textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 8px;
  transition: 0.1s;
}
.input:focus {
  outline: none;
  border-color: #000;
  box-shadow: 0 0 0 1px #000;
}

/* Badges / Chips */
.badge {
  display: inline-block;
  background: #f4f4f5;
  color: #171717;
  border: 1px solid #e5e5e5;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}
.chip {
  cursor: pointer;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: #fff;
  font-size: 11px;
  user-select: none;
  transition: 0.1s;
}
.chip:hover { border-color: #000; }
.chip.is-on { background: #000; color: #fff; border-color: #000; }

/* --- DRAG & DROP CARDS (ESTÉTICA MEJORADA) --- */

/* Contenedor Macro */
.macro-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px; /* Más pegados */
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.macro-card:hover { box-shadow: var(--shadow-md); border-color: #d4d4d4; }

.macro-head {
  padding: 10px 16px;
  background: #fff; /* Cabecera blanca limpia */
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.macro-title {
  font-weight: 600;
  font-size: 14px;
  color: #000;
  display: flex; align-items: center; gap: 8px;
}
.macro-meta { font-size: 11px; color: #737373; margin-top: 2px; }

.macro-body {
  padding: 12px;
  background: #fafafa; /* Fondo gris muy tenue para diferenciar contenido */
}

/* Tareas */
.task-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.02);
  position: relative;
}
.task-row { display: flex; justify-content: space-between; align-items: flex-start; }
.task-title { font-weight: 600; font-size: 13px; color: #171717; }
.task-meta { font-size: 11px; color: #737373; margin-top: 2px; }

/* Subtareas */
.sublist {
  margin-top: 8px;
  padding-left: 12px;
  border-left: 1px solid #e5e5e5; /* Línea fina */
}
.subtask-card {
  background: #fff;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-top: 6px;
  font-size: 12px;
  color: #52525b;
}

/* Drag State */
.dragging { opacity: 0.4; border: 1px dashed #000 !important; transform: scale(0.99); }
.drag-over { background: #f4f4f5; border: 1px dashed #000; }

/* --- MODAL (Sharp & Clean) --- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 999;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-backdrop.is-open { opacity: 1; pointer-events: auto; }

.modal {
  background: #fff; width: 95%; max-width: 550px;
  border-radius: 8px; box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  display: flex; flex-direction: column; max-height: 85vh;
}
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-title { font-size: 16px; font-weight: 600; color: #000; }
.modal-close { background: none; border: none; cursor: pointer; color: #999; font-size: 18px; }
.modal-close:hover { color: #000; }

.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer {
  padding: 16px 20px; border-top: 1px solid var(--border); background: #fafafa;
  display: flex; justify-content: flex-end; gap: 8px;
}

/* Helpers */
.icon-btn {
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent; background: transparent; border-radius: 4px;
  color: #737373; cursor: pointer; transition: 0.1s;
}
.icon-btn:hover { color: #000; background: #e5e5e5; }
.mini-btn {
  font-size: 10px; padding: 2px 6px; border: 1px solid #e5e5e5;
  background: #fff; border-radius: 3px; cursor: pointer; color: #52525b;
}
.mini-btn:hover { border-color: #a3a3a3; color: #000; }

/* -----------------------
   UI/UX Improvements
   - Form grid, controls, buttons, tables
 ------------------------*/
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-control, .form-grid input, .form-grid select, .form-grid textarea {
  height: 40px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 13px;
  background: #fff;
}
.form-actions { display: flex; gap: 8px; align-items: end; }

@media (max-width: 900px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* Standard button types */
.btn-primary { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); height: 40px; padding: 0 14px; }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); height: 40px; padding: 0 12px; }
.btn-success { background: #047857; color: #fff; border-color: #047857; height: 40px; }
.btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; height: 40px; }
.btn-warning { background: #b45309; color: #fff; border-color: #b45309; height: 40px; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); height: 40px; }

/* Tables compactas */
.table-compact { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-compact th, .table-compact td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-compact thead th { background: transparent; text-align: left; font-weight: 600; color: var(--text-muted); }
.table-compact tr { height: 44px; }
.table-compact tbody tr:hover { background: #fafafa; }

/* Action column first */
.table-actions-first td, .table-actions-first th { text-align: left; }
.table-actions-first td.action-col { width: 1%; white-space: nowrap; }

/* Compact cards and sections */
.card.compact { padding: 12px; margin-bottom: 12px; }

/* Toast notifications */
.app-toast { position: fixed; right: 20px; top: 80px; z-index: 1200; display: flex; flex-direction: column; gap: 8px; }
.app-toast .toast { background: #fff; border: 1px solid var(--border); padding: 10px 12px; border-radius: 8px; box-shadow: var(--shadow-sm); min-width: 220px; }
.toast.success { border-left: 4px solid #16a34a; }
.toast.error { border-left: 4px solid #dc2626; }
.toast.info { border-left: 4px solid #0ea5e9; }
.toast.warn { border-left: 4px solid #f59e0b; }

/* Focus visible accessibility */
:focus { outline: 2px solid rgba(59,130,246,0.25); outline-offset: 2px; }

/* =========================================================
   SIUBENpro Institutional Portal
========================================================= */
.portal-home {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(520px, 1.35fr);
  gap: 20px;
  align-items: start;
}

.portal-left,
.portal-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.portal-user-card,
.portal-panel,
.portal-quote,
.portal-system-info,
.portal-hero,
.portal-module-card {
  background: #fff;
  border: 1px solid #e6e8ef;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.portal-user-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
}

.portal-user-avatar {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f766e;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
}

.portal-user-card h1,
.portal-hero h1,
.portal-modules-head h2,
.portal-section-head h2 {
  margin: 0;
  color: #101828;
  letter-spacing: 0;
}

.portal-user-card h1 {
  font-size: 22px;
  line-height: 1.15;
}

.portal-user-card p {
  margin: 6px 0 0;
  color: #667085;
}

.portal-user-meta {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.portal-user-meta span,
.portal-system-info span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  color: #667085;
  font-size: 11px;
  line-height: 1.3;
}

.portal-user-meta strong,
.portal-system-info strong {
  color: #101828;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.portal-eyebrow {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 7px;
  color: #0f766e;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.portal-quote {
  padding: 16px 18px;
  border-left: 4px solid #0f766e;
}

.portal-quote span {
  display: block;
  color: #667085;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.portal-quote strong {
  display: block;
  color: #101828;
  font-size: 15px;
  line-height: 1.35;
}

.portal-panel {
  padding: 16px;
}

.portal-section-head,
.portal-modules-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.portal-section-head h2,
.portal-modules-head h2 {
  font-size: 16px;
}

.portal-section-head span,
.portal-modules-head p {
  margin: 2px 0 0;
  color: #667085;
  font-size: 12px;
}

.portal-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.portal-mini-kpi {
  min-height: 78px;
  padding: 12px;
  border: 1px solid #eef0f5;
  border-radius: 12px;
  background: #fbfcfe;
}

.portal-mini-kpi strong {
  display: block;
  color: #101828;
  font-size: 22px;
  line-height: 1;
}

.portal-mini-kpi span {
  display: block;
  margin-top: 8px;
  color: #667085;
  font-size: 12px;
  line-height: 1.25;
}

.portal-activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.portal-activity {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
  padding: 10px;
  border: 1px solid #eef0f5;
  border-radius: 12px;
  background: #fbfcfe;
}

.portal-activity > span {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: #ecfdf3;
  color: #047857;
  font-size: 12px;
  font-weight: 900;
}

.portal-activity strong,
.portal-activity small {
  display: block;
}

.portal-activity strong {
  color: #101828;
  font-size: 13px;
}

.portal-activity small {
  margin-top: 2px;
  color: #667085;
  font-size: 11px;
}

.portal-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.portal-config-card {
  min-height: 92px;
  padding: 12px;
  text-align: left;
  border: 1px solid #eef0f5;
  border-radius: 12px;
  background: #fff;
  color: #101828;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.portal-config-card:hover {
  transform: translateY(-2px);
  border-color: #cfd6e4;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.portal-config-card strong,
.portal-config-card span {
  display: block;
}

.portal-config-card span {
  margin-top: 5px;
  color: #667085;
  font-size: 11px;
  line-height: 1.35;
}

.portal-system-info {
  padding: 14px 16px;
  display: grid;
  gap: 4px;
}

.portal-hero {
  padding: 26px;
  min-height: 178px;
  border-color: #d8eee8;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(37, 99, 235, 0.05)),
    #fff;
}

.portal-hero h1 {
  max-width: 820px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.02;
  font-weight: 850;
}

.portal-hero p {
  max-width: 820px;
  margin: 14px 0 0;
  color: #475467;
  font-size: 16px;
  line-height: 1.5;
}

.portal-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.portal-module-card {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  min-height: 156px;
  padding: 18px;
  color: #101828;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.portal-module-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #0f766e;
}

/* =========================================================
   Avances module: wrapper for the existing historical dashboard
========================================================= */
.advances-dashboard {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.advances-hero,
.advances-section {
  background: #fff;
  border: 1px solid #e6e8ef;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.advances-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(37, 99, 235, 0.04)),
    #fff;
}

.advances-hero h1,
.advances-section-head h2 {
  margin: 0;
  color: #101828;
  letter-spacing: 0;
}

.advances-hero h1 {
  font-size: 34px;
  line-height: 1.05;
}

.advances-hero p,
.advances-section-head p {
  margin: 8px 0 0;
  color: #667085;
}

.advances-note {
  width: fit-content;
  margin-top: 12px;
  padding: 7px 10px;
  border: 1px solid #d8eee8;
  border-radius: 999px;
  background: #ecfdf3;
  color: #047857;
  font-size: 12px;
  font-weight: 800;
}

.advances-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.advances-section {
  padding: 16px;
}

.advances-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.advances-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.advances-week-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.portal-module-card:hover {
  transform: translateY(-3px);
  border-color: #cfd6e4;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.09);
}

.portal-module-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #101828;
  background: #f2f4f7;
  font-size: 22px;
  font-weight: 900;
}

.portal-module-copy strong {
  display: block;
  color: #101828;
  font-size: 18px;
}

.portal-module-copy span {
  display: block;
  margin-top: 7px;
  color: #667085;
  font-size: 13px;
  line-height: 1.4;
}

.portal-module-action {
  grid-column: 2;
  align-self: end;
  justify-self: start;
  margin-top: 12px;
  min-height: 34px;
  padding: 7px 13px;
  border-radius: 8px;
  background: #101828;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.portal-accent-green::before { background: #0f766e; }
.portal-accent-red::before { background: #dc2626; }
.portal-accent-blue::before { background: #2563eb; }
.portal-accent-teal::before { background: #0891b2; }
.portal-accent-amber::before { background: #d97706; }
.portal-accent-violet::before { background: #7c3aed; }
.portal-accent-gray::before { background: #667085; }
.portal-accent-dark::before { background: #101828; }

@media (max-width: 1100px) {
  .portal-home {
    grid-template-columns: 1fr;
  }

  .advances-hero {
    flex-direction: column;
  }

  .advances-actions {
    justify-content: flex-start;
  }

  .portal-module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .topbar {
    height: auto;
  }

  .topbar-inner,
  .nav {
    flex-wrap: wrap;
  }

  .nav {
    justify-content: flex-start;
    row-gap: 6px;
  }

  .user-info {
    order: 3;
    width: 100%;
    padding: 4px 0;
  }

  .portal-module-grid,
  .portal-kpi-grid,
  .portal-config-grid,
  .portal-user-meta {
    grid-template-columns: 1fr;
  }

  .portal-hero h1 {
    font-size: 30px;
  }

  .portal-module-card {
    min-height: 140px;
  }
}

@media (max-width: 900px) {
  .login-page {
    align-items: flex-start;
    padding: 20px;
  }

  .login-shell {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    padding: 34px;
    text-align: center;
  }

  .login-brand-content {
    gap: 24px;
  }

  .login-brand {
    align-items: center;
  }

  .login-brand-copy h2,
  .login-brand-copy p {
    margin-left: auto;
    margin-right: auto;
  }

  .login-modules {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .login-form-panel {
    padding: 40px 30px;
  }
}

@media (max-width: 520px) {
  .login-page {
    align-items: flex-start;
    padding: 12px;
  }

  .login-shell {
    width: 100%;
  }

  .login-brand-panel {
    padding: 26px 18px 30px;
  }

  .login-logo,
  .login-brand-panel img {
    max-width: 190px;
  }

  .login-brand-copy h1 {
    font-size: 38px;
  }

  .login-brand-copy h2 {
    font-size: 19px;
  }

  .login-brand-copy p {
    font-size: 13px;
  }

  .login-modules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-module {
    min-height: 44px;
    padding: 8px;
    font-size: 11px;
  }

  .login-quote {
    text-align: left;
  }

  .login-form-panel {
    padding: 30px 18px;
  }

  .login-form-head h2 {
    font-size: 24px;
  }

  .shell {
    margin-top: 12px;
    padding: 0 12px 40px;
  }

  .portal-user-card {
    grid-template-columns: 1fr;
  }

  .portal-user-avatar {
    width: 52px;
    height: 52px;
  }

  .portal-hero,
  .portal-panel,
  .portal-user-card {
    padding: 14px;
  }

  .portal-module-card {
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 14px;
  }
}
