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

#login-screen {
  align-items: center; justify-content: center;
  background: var(--white);
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 110%, rgba(31,43,77,.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% -20%, rgba(184,137,47,.06) 0%, transparent 60%);
  width: 100%;
}
.login-wrap {
  display: grid; grid-template-columns: 1fr 1fr;
  width: 100%; max-width: 960px; min-height: 520px;
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin: 24px;
}
.login-left {
  background: linear-gradient(160deg, var(--navy-dark) 0%, #0a0e1c 100%);
  padding: 56px 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(0deg,transparent,transparent 39px,rgba(255,255,255,.025) 39px,rgba(255,255,255,.025) 40px),repeating-linear-gradient(90deg,transparent,transparent 39px,rgba(255,255,255,.025) 39px,rgba(255,255,255,.025) 40px);
}
.login-left-content { position: relative; z-index: 1; }
.login-logo { width: 52px; height: 52px; object-fit: contain; margin-bottom: 28px; }
.login-brand { font-family: 'Fraunces', serif; color: var(--white); font-size: 1.8rem; font-weight: 700; line-height: 1.15; margin-bottom: 12px; }
.login-tagline { color: rgba(255,255,255,.55); font-size: .84rem; line-height: 1.6; }
.login-left-footer { position: relative; z-index: 1; }
.login-left-footer p { color: rgba(255,255,255,.35); font-size: .72rem; font-family: 'DM Mono', monospace; letter-spacing: .08em; }

.login-right {
  background: var(--white);
  padding: 56px 48px;
  display: flex; flex-direction: column; justify-content: center;
}
.login-right h2 { font-family: 'Fraunces', serif; font-size: 1.5rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.login-right p { color: var(--text-3); font-size: .88rem; margin-bottom: 36px; }
.login-note { margin-top: 20px; font-size: .76rem; color: var(--text-3); line-height: 1.7; text-align: center; }

#pending-screen, #blocked-screen { align-items: center; justify-content: center; background: var(--bg); width: 100%; }
.pending-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 48px; max-width: 440px; text-align: center;
  box-shadow: var(--shadow); margin: 24px;
}
.pending-icon { margin-bottom: 20px; color: var(--amber); display: flex; justify-content: center; }
.pending-card h2 { font-family: 'Fraunces', serif; font-size: 1.4rem; color: var(--text); margin-bottom: 10px; }
.pending-card p { font-size: .875rem; color: var(--text-2); line-height: 1.65; margin-bottom: 8px; }

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

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 50;
  transition: transform .22s cubic-bezier(0.4,0,0.2,1);
}
.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo { width: 32px; height: 32px; object-fit: contain; }
.sidebar-brand { font-family: 'Fraunces', serif; font-size: 1rem; font-weight: 700; color: var(--text); }
.sidebar-brand span { display: block; font-family: 'DM Mono', monospace; font-size: .6rem; color: var(--text-3); font-weight: 400; letter-spacing: .08em; text-transform: uppercase; margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-section-label {
  font-family: 'DM Mono', monospace; font-size: .6rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-3);
  padding: 8px 10px 4px; margin-top: 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 6px;
  color: var(--text-2); font-size: .875rem; font-weight: 500;
  cursor: pointer; border: none; background: none;
  width: 100%; text-align: left;
  transition: var(--transition); margin-bottom: 2px;
  text-decoration: none;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--navy-pale); color: var(--navy); }
.nav-item.active .nav-icon { color: var(--navy); }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .7; }
.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px;
  cursor: pointer; transition: var(--transition);
}
.user-card:hover { background: var(--bg); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--navy); color: var(--white);
  font-size: .75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: .82rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-family: 'DM Mono', monospace; font-size: .6rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }

.topbar {
  position: fixed; top: 0; right: 0;
  left: var(--sidebar-w);
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 28px; gap: 16px;
  z-index: 40;
}
.topbar-title { font-family: 'Fraunces', serif; font-size: 1.1rem; font-weight: 600; color: var(--text); flex: 1; }
.topbar-title small { font-family: 'DM Sans', sans-serif; font-size: .72rem; color: var(--text-3); font-weight: 400; display: block; line-height: 1; margin-top: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-2); transition: var(--transition);
}
.icon-btn:hover { background: var(--bg); border-color: var(--border-dark); color: var(--text); }

.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 32px 28px;
  min-height: calc(100vh - var(--topbar-h));
  max-width: 1200px;
}

.page-hdr { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.page-hdr h1 { font-family: 'Fraunces', serif; font-size: 1.6rem; font-weight: 700; color: var(--text); line-height: 1.15; }
.page-hdr p { font-size: .84rem; color: var(--text-3); margin-top: 4px; }

.hamburger-btn {
  display: none;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 36px; height: 36px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  flex-shrink: 0; transition: var(--transition);
  margin-right: 4px;
}
.hamburger-btn:hover { background: var(--bg); }
.hamburger-btn span {
  display: block; width: 16px; height: 2px;
  background: var(--text-2); border-radius: 2px;
  transition: var(--transition);
}

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(20,27,51,.5); backdrop-filter: blur(2px);
  z-index: 49;
}
.sidebar-overlay.open { display: block; }

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-240px); width: 240px; }
  .sidebar.open { transform: translateX(0); }
  .topbar { left: 0; padding: 0 16px; gap: 10px; }
  .main-content { margin-left: 0; padding: 20px 16px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .hamburger-btn { display: flex; }
  .modal { max-width: 100% !important; margin: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .table-wrap { font-size: .8rem; }
  td, th { padding: 10px 10px !important; }
  .topbar-title { font-size: .95rem; }
  .field input, .field select, .field textarea, .search-input, .filter-select { font-size: 16px; }
}
