:root {
  --aif-ink: #140c40;
  --aif-muted: #656273;
  --aif-blue: #800020;
  --aif-blue-dark: #650019;
  --aif-surface: #f9f9ff;
  --aif-line: #e6dde1;
  --aif-success: #17845c;
}

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  color: var(--aif-ink);
  background:
    radial-gradient(circle at 5% 0%, rgba(128, 0, 32, .07), transparent 30rem),
    var(--aif-surface);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}
main { width: 100%; flex: 1; }

.app-navbar {
  background: rgba(255, 255, 255, .9);
  border-bottom: 1px solid var(--aif-line);
  backdrop-filter: blur(12px);
}

.navbar-brand { color: var(--aif-ink); }

.eyebrow {
  display: block;
  margin-bottom: .55rem;
  color: var(--aif-blue);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 10rem);
}
.login-shell-centered { width: 100%; }

.login-card,
.welcome-panel {
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--aif-line);
  border-radius: 1.1rem;
  box-shadow: 0 1.25rem 3rem rgba(23, 36, 58, .08);
}
.login-card { width: min(100%, 27rem); padding: clamp(1.5rem, 4vw, 2.5rem); }
.login-card h2 { margin-bottom: 1.5rem; }

.form-control {
  min-height: 3rem;
  border-color: #c9d4e3;
  border-radius: .65rem;
}
.form-control:focus {
  border-color: var(--aif-blue);
  box-shadow: 0 0 0 .22rem rgba(128, 0, 32, .16);
}

.btn-primary {
  background: var(--aif-blue);
  border-color: var(--aif-blue);
}
.btn-primary:hover {
  background: var(--aif-blue-dark);
  border-color: var(--aif-blue-dark);
}

.welcome-panel {
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1.5rem, 4vw, 3rem);
}
.welcome-panel h1 {
  margin-bottom: .5rem;
  font-size: clamp(2rem, 5vw, 3.6rem);
  letter-spacing: -.045em;
}
.welcome-panel .lead { color: var(--aif-muted); }

.section-heading {
  display: flex;
  gap: 2rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.section-heading h2 { margin: 0; }
.section-heading p {
  max-width: 32rem;
  margin: 0;
  color: var(--aif-muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.metric-card {
  display: flex;
  min-height: 8.5rem;
  padding: 1.25rem;
  flex-direction: column;
  justify-content: space-between;
  color: inherit;
  background: white;
  border: 1px solid var(--aif-line);
  border-radius: .9rem;
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.metric-card:hover {
  color: inherit;
  border-color: #aebee0;
  box-shadow: 0 .75rem 2rem rgba(23, 36, 58, .07);
  transform: translateY(-2px);
}
.metric-card strong {
  font-size: 2.2rem;
  line-height: 1;
}
.metric-card span { color: var(--aif-muted); }

.bulk-grid-shell { overflow: hidden; }
.bulk-grid { min-width: 1650px; }
.bulk-grid th {
  position: sticky;
  top: 0;
  min-width: 10rem;
  padding: .75rem;
  color: white;
  background: var(--aif-ink);
  white-space: nowrap;
}
.bulk-grid th:nth-child(1), .bulk-grid th:nth-child(3) { min-width: 15rem; }
.bulk-grid th:nth-child(5) { min-width: 18rem; }
.bulk-grid td { min-width: 10rem; padding: .45rem; vertical-align: top; }
.bulk-grid .form-control, .bulk-grid .form-select { min-height: 2.4rem; font-size: .85rem; }

.dashboard-metrics { grid-template-columns: repeat(3, 1fr); }
.chart-card { height: 100%; }
.chart-frame { position: relative; min-height: 18rem; }

.attachment-selection { display: grid; gap: .75rem; }
.attachment-selection-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: .85rem;
  background: #fff;
  border: 1px solid var(--aif-line);
  border-radius: .75rem;
}
.attachment-thumb {
  width: 5rem;
  height: 5rem;
  flex: 0 0 5rem;
  object-fit: cover;
  background: #f3f0f2;
  border: 1px solid var(--aif-line);
  border-radius: .6rem;
}

@media (max-width: 991.98px) {
  .dashboard-metrics { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767.98px) {
  .login-shell { min-height: calc(100vh - 12rem); }
  .welcome-panel,
  .section-heading { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 420px) {
  .metric-grid { grid-template-columns: 1fr; }
  .navbar-brand { font-size: .95rem; }
}

/* Presentación de la versión de demostración. */
.app-navbar { box-shadow: 0 .4rem 1.5rem rgba(23, 36, 58, .04); }
.navbar-brand { display: flex; align-items: center; color: var(--aif-ink); }
.brand-copy { display: flex; flex-direction: column; line-height: 1.05; }
.brand-copy strong { font-size: .96rem; }
.brand-copy small { margin-top: .2rem; color: var(--aif-muted); font-size: .68rem; font-weight: 500; }
.app-navbar .nav-link { padding: .55rem .7rem !important; color: var(--aif-muted); border-radius: .55rem; font-size: .88rem; font-weight: 600; }
.app-navbar .nav-link:hover { color: var(--aif-blue); background: rgba(128, 0, 32, .06); }
.app-navbar .nav-link-featured { color: white; background: var(--aif-blue); }
.app-navbar .nav-link-featured:hover { color: white; background: var(--aif-blue-dark); }
.nav-user { display: flex; align-items: center; gap: .65rem; padding-left: .7rem; border-left: 1px solid var(--aif-line); }
.nav-user span { max-width: 12rem; overflow: hidden; color: var(--aif-muted); font-size: .83rem; text-overflow: ellipsis; white-space: nowrap; }
.nav-user form { display: inline-flex; }
.nav-user button { padding: 0; color: var(--aif-blue); background: none; border: 0; font-size: .8rem; font-weight: 700; }
.btn-outline-primary { color: var(--aif-blue); border-color: var(--aif-blue); }
.btn-outline-primary:hover,
.btn-outline-primary:focus { color: white; background: var(--aif-blue); border-color: var(--aif-blue); }
.form-select:focus { border-color: var(--aif-blue); box-shadow: 0 0 0 .22rem rgba(128, 0, 32, .16); }
.password-reminder { display: flex; gap: 2rem; align-items: center; justify-content: space-between; padding: 1.1rem 1.25rem; background: #fffaf1; border: 1px solid #f1d8aa; border-left: .3rem solid #f2a541; border-radius: .85rem; }
.password-reminder .eyebrow { margin-bottom: .25rem; color: #99600b; }
.password-reminder p { margin: .2rem 0 0; color: var(--aif-muted); font-size: .9rem; }
.action-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.action-card { display: flex; min-height: 13rem; padding: 1.35rem; flex-direction: column; color: var(--aif-ink); background: white; border: 1px solid var(--aif-line); border-radius: 1rem; text-decoration: none; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.action-card:hover { color: var(--aif-ink); border-color: #aebee0; box-shadow: 0 1rem 2.4rem rgba(23, 36, 58, .08); transform: translateY(-3px); }
.action-card-primary { color: white; background: linear-gradient(145deg, var(--aif-blue), var(--aif-blue-dark)); border-color: transparent; }
.action-card-primary:hover { color: white; }
.action-index { margin-bottom: auto; color: var(--aif-blue); font-size: .75rem; font-weight: 800; letter-spacing: .08em; }
.action-card-primary .action-index { color: rgba(255,255,255,.7); }
.action-card strong { margin-top: 1.25rem; font-size: 1.1rem; }
.action-card p { margin: .4rem 0 1rem; color: var(--aif-muted); font-size: .88rem; }
.action-card-primary p { color: rgba(255,255,255,.76); }
.action-link { color: var(--aif-blue); font-size: .82rem; font-weight: 700; }
.action-card-primary .action-link { color: white; }
.action-card-disabled { color: #77717a; background: #f3f0f2; border-style: dashed; cursor: not-allowed; }
.action-card-disabled:hover { color: #77717a; border-color: var(--aif-line); box-shadow: none; transform: none; }
.action-card-disabled .action-index { color: #938b91; }
.action-card-disabled p { color: #817a80; }
.action-status { color: #716a70; font-size: .78rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.narrow-shell { max-width: 42rem; margin: 1rem auto; }
.form-card { padding: clamp(1.5rem, 5vw, 3rem); background: white; border: 1px solid var(--aif-line); border-radius: 1.1rem; box-shadow: 0 1.25rem 3rem rgba(23, 36, 58, .08); }
.form-card h1 { margin-bottom: .75rem; font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -.04em; }
.success-mark { display: grid; width: 3.5rem; height: 3.5rem; margin: 0 auto 1.25rem; place-items: center; color: white; background: var(--aif-success); border-radius: 50%; font-size: 1.6rem; }
.app-footer { display: flex; justify-content: space-between; padding-top: 1.2rem; padding-bottom: 2rem; color: var(--aif-muted); border-top: 1px solid var(--aif-line); font-size: .78rem; }
@media (max-width: 1199.98px) { .action-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 991.98px) { .nav-user { margin-top: .5rem; padding: .75rem 0 0; justify-content: space-between; border-top: 1px solid var(--aif-line); border-left: 0; } }
@media (max-width: 767.98px) { .password-reminder { align-items: flex-start; flex-direction: column; } .action-grid { grid-template-columns: 1fr; } .action-card { min-height: 11rem; } }
@media (max-width: 420px) { .brand-copy small { display: none; } .app-footer { flex-direction: column; gap: .25rem; } }
