/* ============================================================================
   ACEF - layout.css : sidebar, topbar, contenido, login.
   Paleta corporativa CEF / Udima.
   ========================================================================== */

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

/* --- Sidebar -------------------------------------------------------------- */
.sidebar {
  width: 244px; flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: none;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: .6rem;
  padding: 1.2rem 1.1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-logo { width: 34px; height: 34px; border-radius: 8px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1rem; color: #ffffff; letter-spacing: .04em; }
.brand-text span { font-size: .68rem; color: rgba(255,255,255,.45); }

.nav { padding: .8rem .6rem; display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: .65rem; padding: .55rem .7rem; border-radius: var(--radius-sm);
  color: rgba(255,255,255,.65); font-weight: 500; font-size: .9rem;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: rgba(255,255,255,.08); text-decoration: none; color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; font-weight: 700; }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .8; }
.nav-item.active .nav-icon { opacity: 1; }

.sidebar-foot {
  padding: .9rem 1.1rem;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .75rem;
  color: rgba(255,255,255,.4);
}
.sidebar-foot strong { color: rgba(255,255,255,.7); display: block; margin-bottom: .1rem; }

/* --- Main ----------------------------------------------------------------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; background: rgba(255,255,255,.95); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 1rem;
  padding: 0 1.4rem; position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 1.02rem; font-weight: 650; color: var(--primary-dark); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .7rem; }
.user-chip {
  background: var(--primary-soft); border: 1px solid var(--border);
  border-radius: 999px; padding: .25rem .7rem; font-size: .78rem;
  color: var(--primary-dark); text-transform: capitalize; font-weight: 600;
}
.hamburger { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text-soft); }

.content { padding: 1.4rem; max-width: 1180px; width: 100%; margin: 0 auto; }

/* --- Login ---------------------------------------------------------------- */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, #1a4d2e 45%, #f4f6f4 100%);
}
.login-card {
  background: #fff; border: none; border-radius: 16px;
  box-shadow: 0 20px 60px rgba(13,33,23,.35);
  padding: 2.4rem 2.2rem; width: 100%; max-width: 390px; text-align: center;
}
.login-logo { width: 52px; height: 52px; border-radius: 12px; margin-bottom: .8rem; }
.login-card h1 { font-size: 1.5rem; letter-spacing: .04em; color: var(--primary-dark); margin-bottom: .1rem; }
.login-sub { color: var(--muted); font-size: .85rem; margin: 0 0 1.6rem; }
.login-form { text-align: left; display: flex; flex-direction: column; gap: .9rem; }
.login-form label { font-size: .82rem; font-weight: 600; color: var(--text-soft); display: flex; flex-direction: column; gap: .3rem; }
.login-error { background: var(--danger-soft); color: var(--danger); padding: .5rem .7rem; border-radius: var(--radius-sm); font-size: .82rem; }
.login-hint { font-size: .75rem; color: var(--muted); margin: 1rem 0 .3rem; }
.login-config { font-size: .75rem; }

/* Franja de color decorativa en el login */
.login-card::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--sidebar-bg), var(--accent));
  border-radius: 4px 4px 0 0;
  margin: -2.4rem -2.2rem 1.6rem;
}

/* --- Detalle (top bar de vistas detalle) --------------------------------- */
.detail-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 820px) {
  .sidebar {
    position: fixed; z-index: 200; height: 100vh; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: block; }
  .content { padding: 1rem; }
}
