/* ============================================================
   Ipil District Jail — Inmate Recording System
   layout.css — app shells
   ============================================================ */

/* ============================================================
   1. AUTH LAYOUT
   ============================================================ */

.auth-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
}

.auth-brand-panel {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem clamp(2rem, 5vw, 5rem);
  overflow: hidden;
  color: #fff;
  text-align: center;
  background:
    linear-gradient(160deg, rgba(18, 58, 109, 0.86) 0%, rgba(6, 20, 40, 0.96) 100%),
    url('../images/bg-login.jpg') center / cover no-repeat;
  min-height: 100vh;
}

.auth-brand-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 50% 42%, rgba(255,255,255,0.08), transparent 42%);
  pointer-events: none;
}

.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(to bottom right, var(--page-bg-1), var(--page-bg-2), var(--page-bg-3));
  overflow-y: auto;
}

.auth-panel-inner {
  width: 100%;
  max-width: 420px;
}

/* ---------- Tablet (below 900px) ---------- */
@media (max-width: 900px) {
  .auth-wrapper {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .auth-brand-panel {
    min-height: 40vh;
    padding: 2.5rem 1.5rem 2rem;
  }

  .auth-form-panel {
    min-height: 60vh;
    padding: 2rem 1.5rem;
  }
}

/* ---------- Mobile (below 640px) ---------- */
@media (max-width: 640px) {
  .auth-brand-panel {
    min-height: 32vh;
    padding: 2rem 1.25rem 1.5rem;
  }

  .auth-form-panel {
    padding: 1.5rem 1rem;
  }
}

/* ============================================================
   2. DASHBOARD SHELL
   ============================================================ */

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

.dashboard-sidebar {
  width: 16rem;
  flex: 0 0 16rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sidebar-from) 0%, var(--sidebar-to) 100%);
  color: #e8eef6;
  z-index: 50;
}

.dashboard-main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 1.25rem 1.5rem;
  overflow-x: hidden;
}

.dashboard-section { display: none; }
.dashboard-section.is-visible { display: block; }

/* ============================================================
   3. SIDEBAR PARTS
   ============================================================ */

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand__logo {
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
}

.sidebar-brand__copy { min-width: 0; display: flex; flex-direction: column; }
.sidebar-brand__copy strong { color: #fff; font-size: 0.7rem; letter-spacing: 0.06em; line-height: 1.2; }
.sidebar-brand__copy span { color: rgba(255, 255, 255, 0.55); font-size: 0.65rem; }

.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem 0.5rem;
}

.sidebar-nav__label {
  margin: 1rem 0.65rem 0.35rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

.sidebar-nav__item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.1rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.82rem;
  font-weight: 500;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-nav__item i { width: 1.1rem; font-size: 1rem; text-align: center; }
.sidebar-nav__item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.sidebar-nav__item.is-active { background: rgba(255, 255, 255, 0.12); color: #fff; }

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-user { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem; }

.sidebar-user__avatar {
  width: 2rem; height: 2rem;
  flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.72rem; font-weight: 700;
}

.sidebar-user__info { min-width: 0; display: flex; flex-direction: column; }
.sidebar-user__info strong { color: #fff; font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user__info span { color: rgba(255, 255, 255, 0.55); font-size: 0.65rem; }

.sidebar-logout {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 0.75rem; font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.sidebar-logout:hover,
.sidebar-logout:focus-visible {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

/* ============================================================
   4. MOBILE HEADER + RESPONSIVE
   ============================================================ */

.mobile-header { display: none; }

@media (max-width: 991.98px) {
  .dashboard-sidebar {
    position: fixed; left: 0; top: 0;
    width: min(16rem, 85vw);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    z-index: 1040;
  }

  .dashboard-sidebar.is-open { transform: translateX(0); }
  .dashboard-main { padding: 1rem; }

  .mobile-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
  }

  .mobile-header__menu {
    width: 2.25rem; height: 2.25rem;
    display: grid; place-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--primary);
    font-size: 1.1rem;
  }

  .mobile-header__title { flex: 1; display: flex; flex-direction: column; }
  .mobile-header__title strong { color: var(--text); font-size: 0.82rem; }
  .mobile-header__title span { color: var(--text-soft); font-size: 0.68rem; }
  .mobile-header__date { color: var(--text-soft); font-size: 0.7rem; }
}