/* ============================================================
   Crown Heritage Bank — Layout (Public Navbar + Auth App Shell)
   ============================================================ */

/* ──────────────────────────────────────────────────────────
   PUBLIC NAVBAR
   ────────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-topbar);
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  padding: 0;
}

.navbar.scrolled {
  background: rgba(11, 31, 75, 0.97);
  box-shadow: 0 2px 20px rgba(11, 31, 75, 0.3);
  backdrop-filter: blur(10px);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 var(--space-xl);
  max-width: 1400px;
  margin: 0 auto;
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  flex-shrink: 0;
}

.navbar__logo-img {
  height: 44px;
  width: auto;
}

.navbar__logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.navbar__logo-text .logo-name {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.03em;
}

.navbar__logo-text .logo-sub {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-light);
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.navbar__link {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: var(--transition);
  position: relative;
}

.navbar__link::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 100%;
  height: 2px;
  background: var(--gold);
  transition: right 0.25s ease;
  border-radius: var(--radius-full);
}

.navbar__link:hover { color: var(--white); }
.navbar__link:hover::after { right: 0; }

.navbar__cta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Hamburger */
.navbar__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.navbar__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: var(--radius-full);
  transition: var(--transition);
}

/* Mobile Nav Drawer */
.mobile-nav {
  position: fixed;
  top: 72px; left: 0; right: 0;
  background: var(--navy-dark);
  z-index: calc(var(--z-topbar) - 1);
  padding: var(--space-lg);
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.mobile-nav.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

.mobile-nav__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.mobile-nav__link {
  font-size: 1rem;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-weight: 500;
}

.mobile-nav__cta {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* ──────────────────────────────────────────────────────────
   AUTH APP SHELL
   ────────────────────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

/* ── Sidebar ── */
.app-sidebar {
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s ease;
}

.sidebar__header {
  padding: var(--space-xl) var(--space-lg);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.sidebar__logo-img {
  height: 36px;
  width: auto;
}

.sidebar__logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.sidebar__logo-text .logo-name {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--white);
}

.sidebar__logo-text .logo-sub {
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-light);
}

.sidebar__nav {
  flex: 1;
  padding: var(--space-lg) 0;
  overflow-y: auto;
}

.sidebar__section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: var(--space-md) var(--space-lg) var(--space-xs);
}

.sidebar__nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 11px var(--space-lg);
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  border-left: 3px solid transparent;
  position: relative;
}

.sidebar__nav-item:hover {
  color: var(--white);
  background: rgba(255,255,255,0.05);
}

.sidebar__nav-item.active {
  color: var(--white);
  background: rgba(201, 168, 76, 0.12);
  border-left-color: var(--gold);
}

.sidebar__nav-item.active .sidebar__nav-icon {
  color: var(--gold);
}

.sidebar__nav-icon {
  font-size: 1.125rem;
  width: 22px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.sidebar__footer {
  padding: var(--space-lg);
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.sidebar__user-info { overflow: hidden; }

.sidebar__user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__user-email {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__logout {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 10px var(--space-sm);
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
}

.sidebar__logout:hover {
  background: rgba(220, 38, 38, 0.2);
  color: #FCA5A5;
}

/* Sidebar toggle button (mobile) */
.sidebar__toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: calc(var(--z-sidebar) + 1);
  width: 44px;
  height: 44px;
  background: var(--navy);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.25rem;
  box-shadow: var(--shadow);
}

/* ── Main Content Area ── */
.app-main {
  grid-column: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.app-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-xl);
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  flex-shrink: 0;
}

.app-topbar__left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.app-topbar__title {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  color: var(--navy);
  font-weight: 700;
}

.app-topbar__right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.app-topbar__greeting {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.app-content {
  flex: 1;
  padding: var(--space-xl);
  max-width: 1200px;
  width: 100%;
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}
.breadcrumb__sep { color: var(--border-dark); }
.breadcrumb__current { color: var(--navy); font-weight: 600; }

/* ──────────────────────────────────────────────────────────
   RESPONSIVE — layout.css
   ────────────────────────────────────────────────────────── */

/* Tablets */
@media (max-width: 1024px) {
  .navbar__links { display: none; }
  .navbar__cta   { display: none; }
  .navbar__hamburger { display: flex; }
}

/* Mobile */
@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    transform: translateX(-100%);
  }

  .app-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

  .sidebar__toggle { display: flex; }

  .app-main {
    grid-column: 1;
  }

  .app-topbar {
    padding: 0 var(--space-md);
    padding-left: 72px;
  }

  .app-content {
    padding: var(--space-md);
  }
}

@media (max-width: 480px) {
  .app-topbar__greeting { display: none; }
}
