/* ========================================
   OKUN ACADEMIA - Layout
   ======================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 16px;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
}

#app {
  height: 100vh;
  display: flex;
  overflow: hidden;
  background: var(--bg-primary);
  transition: background var(--ease-normal);
}

/* ---- Auth Layout ---- */
.auth-page {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  padding: 20px;
}

.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}

.auth-card-header {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
  padding: 32px 32px 24px;
  text-align: center;
}

.auth-card-header .logo {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.auth-card-header .logo span {
  font-weight: 300;
}

.auth-card-header .subtitle {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.85);
  font-weight: 300;
}

.auth-card-body {
  padding: 32px;
}

/* ---- Dashboard Layout ---- */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  transition: width var(--ease-smooth);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar-header {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  min-height: 65px;
}

.sidebar-header .logo-text {
  font-size: var(--text-lg);
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-header .logo-text span {
  color: var(--accent-gold);
}

.sidebar.collapsed .sidebar-header .logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .sidebar-footer-info {
  display: none;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav-section-title {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 16px 20px 6px;
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-sidebar);
  cursor: pointer;
  transition: all var(--ease-fast);
  font-size: var(--text-sm);
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-sidebar-active);
}

.nav-item.active {
  background: var(--bg-sidebar-active);
  color: var(--text-sidebar-active);
  border-left-color: var(--accent-gold);
}

.nav-item .nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-item .nav-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-collapse-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--ease-fast);
  font-size: var(--text-xs);
}

.sidebar-collapse-btn:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
}

.sidebar-collapse-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform var(--ease-normal);
}

.sidebar.collapsed .sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

/* ---- Main Content Area ---- */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  height: var(--topbar-height);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
  transition: background var(--ease-normal), border var(--ease-normal);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.topbar-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.hamburger-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ---- Mobile Overlay ---- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    z-index: 200;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar.collapsed {
    width: var(--sidebar-width);
  }
  .hamburger-btn {
    display: flex;
  }
  .sidebar-overlay.active {
    display: block;
    z-index: 199;
  }
}

@media (max-width: 768px) {
  .page-content {
    padding: 16px;
  }
  .topbar {
    padding: 0 16px;
  }
}

@media (max-width: 480px) {
  .page-content {
    padding: 12px;
  }
}
