/* ============================================================
   LAYOUT.CSS  —  Auth pages layout, Sidebar, Topbar, Dashboard
   Donor-Student Management Portal
   ============================================================ */

/* ── AUTH LAYOUT ───────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* Left panel — branding */
.auth-brand {
  background: var(--primary);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-10) var(--space-12);
  overflow: hidden;
}
.auth-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(232,146,58,0.18) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(46,109,164,0.3) 0%, transparent 60%);
}
.auth-brand-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.06) 1px, transparent 0);
  background-size: 32px 32px;
}
.auth-brand-content { position: relative; z-index: 1; }
.auth-brand-bottom  { position: relative; z-index: 1; }

.brand-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}
.brand-logo-mark {
  width: 44px; height: 44px;
  background: var(--accent);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.brand-logo-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--white);
  line-height: 1.2;
}
.brand-logo-text span {
  display: block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.brand-headline {
  margin-top: var(--space-16);
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--white);
  line-height: 1.2;
}
.brand-headline em {
  font-style: italic;
  color: var(--accent);
}
.brand-subline {
  margin-top: var(--space-5);
  font-size: 1rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.7;
  max-width: 340px;
}

.brand-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.brand-stat {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  backdrop-filter: blur(8px);
}
.brand-stat-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--accent);
  line-height: 1;
}
.brand-stat-label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.65);
  margin-top: 4px;
}

/* Right panel — the form */
.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-10) var(--space-12);
  background: var(--white);
  overflow-y: auto;
}
.auth-form-wrap {
  width: 100%;
  max-width: 440px;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}
.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: var(--space-8);
}

.auth-footer-link {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: var(--space-6);
}
.auth-footer-link a {
  color: var(--primary-mid);
  font-weight: 500;
}
.auth-footer-link a:hover { color: var(--accent); }

/* Centered auth (forgot / reset password — single card) */
.auth-centered {
  min-height: 100vh;
  background: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}
.auth-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-10) var(--space-10);
  width: 100%;
  max-width: 460px;
}
.auth-card-icon {
  width: 60px; height: 60px;
  border-radius: var(--radius-lg);
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  margin-bottom: var(--space-6);
}

/* ── DASHBOARD SHELL ───────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg-page);
}

/* ── SIDEBAR ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--primary);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition-md);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  text-decoration: none;
}
.sidebar-logo-mark {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.sidebar-logo-text {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--white);
  line-height: 1.25;
}
.sidebar-logo-text small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.65rem;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Shared logo image for auth/admin/donor nav marks */
.brand-logo-mark,
.sidebar-logo-mark,
.dn-mark {
  color: transparent !important;
  font-size: 0 !important;
  text-indent: -9999px;
  overflow: hidden;
  border-radius: 50% !important;
  background-color: transparent !important;
  background-image: url('../img/RVS_Logo.png') !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: cover !important;
}

/* Nav sections */
.sidebar-nav {
  flex: 1;
  padding: var(--space-4) 0;
  overflow-y: auto;
}

.nav-section-label {
  padding: var(--space-4) var(--space-6) var(--space-2);
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-6);
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
  font-weight: 400;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  position: relative;
}
.nav-item:hover {
  color: var(--white);
  background: rgba(255,255,255,0.07);
}
.nav-item.active {
  color: var(--white);
  background: rgba(255,255,255,0.12);
  border-left-color: var(--accent);
  font-weight: 500;
}
.nav-item .nav-icon {
  font-size: 1rem;
  width: 20px;
  flex-shrink: 0;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-item .nav-icon svg {
  width: 16px;
  height: 16px;
}
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

/* Sidebar footer */
.sidebar-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}
.sidebar-user-info { flex: 1; overflow: hidden; }
.sidebar-user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
}

/* ── MAIN CONTENT ──────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOPBAR ────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-8);
  position: sticky;
  top: 0;
  z-index: 50;
  gap: var(--space-4);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.topbar-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text-primary);
}
.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.topbar-breadcrumb a { color: var(--text-muted); }
.topbar-breadcrumb a:hover { color: var(--primary); }
.topbar-breadcrumb span { color: var(--text-light); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.topbar-icon-btn {
  width: 36px; height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.topbar-icon-btn:hover { background: var(--gray-100); color: var(--text-primary); }
.topbar-icon-btn svg { width: 18px; height: 18px; }
.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--white);
}

/* Topbar user dropdown */
.topbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
}
.topbar-user:hover { background: var(--gray-100); }
.topbar-user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}
.topbar-user-role {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── PAGE BODY ─────────────────────────────────────────────── */
.page-body {
  flex: 1;
  padding: var(--space-8);
}

.page-header {
  margin-bottom: var(--space-8);
}
.page-header h1 {
  font-size: 1.6rem;
}
.page-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: var(--space-1);
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}

/* Two-column content grid */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}
.content-grid.thirds {
  grid-template-columns: 2fr 1fr;
}

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-form-panel { padding: var(--space-8) var(--space-6); }

  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }

  .content-grid,
  .content-grid.thirds { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { padding: var(--space-8) var(--space-6); }
  .page-body { padding: var(--space-5); }
  .topbar { padding: 0 var(--space-5); }
}
