/* ============================================================
   APP SHELL
============================================================ */
.app-wrap { min-height: 100vh; display: flex; flex-direction: column; }

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

/* ============================================================
   LOGIN PAGE
============================================================ */
.login-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-height: 100vh;
  background: var(--bg);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 48px 40px 40px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 36px;
  gap: 12px;
}
.login-logo img { height: 52px; width: auto; }
.login-tagline {
  font-size: 0.85rem;
  color: var(--text3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}
.login-tagline.admin-accent { color: var(--accent); font-weight: 700; }
.login-heading {
  font-family: 'DM Serif Display', serif;
  font-size: 1.7rem;
  color: var(--text);
  margin-bottom: 4px;
  text-align: center;
}
.login-sub {
  font-size: 0.9rem;
  color: var(--text3);
  text-align: center;
  margin-bottom: 32px;
}
.login-error {
  background: rgba(220,38,38,0.10);
  border: 1px solid rgba(220,38,38,0.3);
  color: var(--status-failed);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  margin-bottom: 18px;
}
.login-success {
  background: rgba(22,163,74,0.10);
  border: 1px solid rgba(22,163,74,0.3);
  color: var(--status-sent, #16a34a);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  margin-bottom: 18px;
}
.login-link {
  color: var(--text3);
  font-size: 0.85rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.login-link:hover { color: var(--text); border-bottom-color: var(--text3); }

/* ============================================================
   TOP NAV
============================================================ */
.topnav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-brand img { height: 32px; width: auto; }

/* Theme-aware brand logos: black for light, white for dark */
.brand-logo--dark { display: none; }
body.theme-dark .brand-logo--light { display: none; }
body.theme-dark .brand-logo--dark { display: inline-block; }
.nav-brand-badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 4px;
}
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-user { font-size: 0.85rem; color: var(--text2); margin-right: 4px; }
.hamburger {
  display: none;
  background: transparent;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 4px;
}

/* ============================================================
   BODY + SIDEBAR
============================================================ */
.dashboard-body { display: flex; flex: 1; }
.sidebar {
  width: 230px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar-section {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 0 12px;
  margin-bottom: 8px;
  margin-top: 20px;
}
.sidebar-section:first-child { margin-top: 0; }
.menu-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text2);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 2px;
}
.menu-btn .icon { width: 18px; height: 18px; opacity: 0.6; flex-shrink: 0; }
.menu-btn:hover { background: var(--bg2); color: var(--text); }
.menu-btn.active { background: var(--bg2); color: var(--text); font-weight: 600; }
.menu-btn.active .icon { opacity: 1; }
.sidebar-identity {
  margin-top: auto;
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}
.sidebar-identity .s-name { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.sidebar-identity .s-dept { font-size: 0.8rem; color: var(--text3); margin-top: 2px; }

/* ============================================================
   MAIN CONTENT
============================================================ */
.main-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  background: var(--bg);
}
.content-narrow { max-width: 920px; }

/* ============================================================
   403 SCREEN
============================================================ */
.error-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.error-screen .err-code {
  font-family: 'DM Serif Display', serif;
  font-size: 4rem;
  color: var(--accent);
}
.error-screen .err-msg { font-size: 1.1rem; color: var(--text); margin: 8px 0 6px; }
.error-screen .err-sub { font-size: 0.9rem; color: var(--text3); margin-bottom: 24px; }

/* ============================================================
   DASHBOARD GRID
============================================================ */
.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 980px) {
  .panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .main-content { padding: 20px; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .sidebar {
    position: fixed;
    top: 60px;
    bottom: 0;
    left: 0;
    z-index: 99;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: inline-flex; }
  .topnav { padding: 0 16px; }
  .main-content { padding: 16px; }
  .meta-grid { grid-template-columns: 1fr; }
  .report-type-grid { grid-template-columns: 1fr; }
  .nav-user { display: none; }
}
