
:root {
  --herto-navy-900: #123E70;
  --herto-navy-800: #0f3054;
  --herto-blue-700: #0A4E9B;
  --herto-blue-500: #2F80ED;
  --herto-blue-100: #EAF3FF;
  --herto-blue-050: #F4F6F9;

  --ink-900: #2B2B2B;
  --ink-600: #6B7280;
  --ink-400: #8a93a0;
  --line: #E5E7EB;
  --white: #ffffff;

  --error: #d93025;
  --error-bg: #fff5f5;

  --tag-manual-bg: #e3eef9;   --tag-manual-fg: var(--herto-blue-700);
  --tag-diagrama-bg: #efeaf7; --tag-diagrama-fg: #6b4fa0;
  --tag-formato-bg: #fbf0e1;  --tag-formato-fg: #b4670c;
  --tag-vinculado-bg: #e6f4ec; --tag-vinculado-fg: #1e7a4c;

  --radius: 16px;
  --shadow-card: 0 12px 30px rgba(10, 78, 155, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--herto-blue-050);
  color: var(--ink-900);
  font-family: "Poppins", Arial, sans-serif;
  font-size: 15px;
}

a { color: var(--herto-blue-700); text-decoration: none; }
a:hover { color: var(--herto-navy-900); text-decoration: underline; }

h1, h2, h3, h4 { color: var(--herto-navy-900); font-weight: 600; margin: 0; }

/* ---------- Layout general: sidebar + contenido ---------- */

.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--herto-navy-900);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
}

.app-sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 10px;
}

.brand-logo { height: 28px; width: auto; display: block; }

.app-sidebar .brand-name {
  font-weight: 700;
  letter-spacing: 0.03em;
  font-size: 15px;
}

.app-sidebar .brand-tag {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: #aebedb;
}

.nav-section-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #90a5c7;
  font-weight: 600;
  padding: 0 12px;
  margin: 18px 0 6px;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  color: #c7d5ea;
  font-size: 14px;
  font-weight: 500;
}

.nav-link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--herto-blue-500); color: #fff; }

.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.app-topbar {
  height: 68px;
  flex-shrink: 0;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
}

.app-content { flex: 1; padding: 26px 28px 34px; }

/* ---------- Menú móvil (hamburguesa) ---------- */

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--herto-navy-900);
  flex-shrink: 0;
}

.sidebar-overlay { display: none; }

/* ---------- Componentes reutilizables ---------- */

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.btn-herto {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--herto-blue-700);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-herto:hover { background: var(--herto-navy-900); color: #fff; text-decoration: none; }

.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-900); margin-bottom: 6px; }
.form-field input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 14.5px;
}
.form-field input:focus { outline: 2px solid var(--herto-blue-500); outline-offset: 1px; }

.validation-summary { color: var(--error); font-size: 13.5px; margin-bottom: 14px; }

/* ---------- Login ---------- */

.login-shell { display: flex; min-height: 100vh; }
.login-brand-panel {
  width: 45%;
  background: var(--herto-navy-900);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
}
.login-brand-top { display: flex; align-items: center; gap: 10px; }
.login-logo { height: 34px; width: auto; }
.login-brand-name { font-weight: 700; font-size: 18px; letter-spacing: .03em; }
.login-headline { font-size: 32px; font-weight: 600; line-height: 1.3; max-width: 380px; }
.login-subtext { color: #c7d5ea; font-size: 15px; margin-top: 14px; max-width: 360px; }
.login-footnote { color: #8ea3c4; font-size: 12.5px; }

.login-form-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-form-panel .inner { width: 100%; max-width: 380px; }

/* ---------- Tarjetas de departamento / documento ---------- */

.doc-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}
.doc-row:last-child { border-bottom: none; }

/* ============================================================
   Responsive — celular y tablet
   ============================================================ */

@media (max-width: 860px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.15);
  }

  .app-sidebar.open { transform: translateX(0); }

  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }

  .sidebar-overlay.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 44, 82, 0.35);
    z-index: 30;
  }

  .app-topbar { padding: 0 16px; }
  .app-content { padding: 18px 16px 26px; }

  .doc-row { flex-wrap: wrap; padding: 14px 16px; }
}

@media (max-width: 600px) {
  .login-shell { flex-direction: column; min-height: auto; }
  .login-brand-panel { width: 100%; padding: 32px 24px; min-height: auto; }
  .login-headline { font-size: 24px; max-width: none; }
  .login-subtext { max-width: none; }
  .login-form-panel { padding: 28px 20px 40px; }
}

/* ---------- Botón grande + iconos de documento + arrastrar y soltar ---------- */

.btn-herto-lg {
  height: 52px;
  padding: 0 30px;
  font-size: 15.5px;
  gap: 10px;
}

.doc-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.doc-icon-btn:hover { background: var(--herto-blue-050); text-decoration: none; }

.dropzone {
  border: 2px dashed var(--line);
  border-radius: 14px;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--herto-blue-050);
  transition: border-color .15s, background .15s;
}
.dropzone.dragover { border-color: var(--herto-blue-500); background: var(--herto-blue-100); }
.dropzone-text { color: var(--ink-600); font-size: 13.5px; margin-top: 8px; }
.dropzone-link { color: var(--herto-blue-700); font-weight: 600; text-decoration: underline; }
.dropzone-filename { color: var(--herto-navy-900); font-size: 13.5px; font-weight: 600; margin-top: 8px; }
.dropzone-input-hidden { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

/* ---------- Tarjeta de login (usada por account/*.php) ---------- */

.pagina-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.tarjeta-login {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
}

.tarjeta-login h1 { font-size: 1.4rem; margin-bottom: 1.5rem; }

.tarjeta-login label { display: block; margin-top: 1rem; font-weight: 600; font-size: 0.9rem; color: var(--ink-900); }

.tarjeta-login input[type="email"],
.tarjeta-login input[type="password"],
.tarjeta-login input[type="text"] {
  width: 100%;
  padding: 0.6rem;
  margin-top: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-sizing: border-box;
  font-family: inherit;
}

.tarjeta-login .checkbox { display: flex; align-items: center; gap: 0.5rem; font-weight: normal; }
.tarjeta-login .checkbox input { width: auto; }

.tarjeta-login button {
  margin-top: 1.5rem;
  width: 100%;
  background: var(--herto-blue-700);
  color: #fff;
  border: none;
  padding: 0.7rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}
.tarjeta-login button:hover { background: var(--herto-navy-900); }

.enlace-secundario { text-align: center; margin-top: 1rem; font-size: 0.9rem; }
.ayuda { font-size: 0.8rem; color: var(--ink-600); margin-top: 0.3rem; }

.alerta { padding: 0.7rem 1rem; border-radius: 8px; font-size: 0.9rem; margin-bottom: 1rem; }
.alerta-error { background: var(--error-bg); color: #9C2A21; }
.alerta-info { background: var(--herto-blue-100); color: var(--herto-navy-900); }
