/* ============================================================
   DESKTOP LAYOUT — min-width: 768px ONLY
   Mobile styles are completely untouched.
   ============================================================ */

/* ── Desktop Sidebar ────────────────────────── */
.desktop-sidebar {
  display: none;
}

@media (min-width: 768px) {

  /* ── Hide mobile bottom nav ─────────────── */
  .bottom-nav {
    display: none !important;
  }

  /* ── Show desktop sidebar ───────────────── */
  .desktop-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background: #13131A;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    z-index: 300;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* Sidebar logo area */
  .sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
  }

  .sidebar-logo-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--text-primary), var(--red-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .sidebar-logo-sub {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 4px;
  }

  /* Sidebar navigation */
  .sidebar-nav {
    flex: 1;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .sidebar-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 16px 20px 8px;
  }

  .sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    position: relative;
    border-left: 3px solid transparent;
  }

  .sidebar-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
  }

  .sidebar-link.active {
    color: var(--red-accent);
    background: rgba(240, 192, 0, 0.08);
    border-left-color: var(--red-accent);
    font-weight: 600;
  }

  .sidebar-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
  }

  .sidebar-link.active svg {
    opacity: 1;
  }

  /* Sidebar user area */
  .sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
    margin-top: auto;
  }

  .sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red-primary), var(--red-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.8rem;
    color: #131312;
    flex-shrink: 0;
  }

  .sidebar-user-info {
    flex: 1;
    min-width: 0;
  }

  .sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sidebar-user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: capitalize;
  }

  .sidebar-logout {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
  }

  .sidebar-logout:hover {
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
  }

  /* ── Desktop header bar ─────────────────── */
  .app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  /* Hide the mobile header logo on desktop — page title shown instead */
  .header-logo {
    display: none;
  }

  .desktop-page-title {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
  }

  .desktop-header-user {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .desktop-header-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
  }

  /* ── Main content area shift ────────────── */
  #app {
    margin-left: 240px;
    width: calc(100% - 240px);
    padding-bottom: 0;
    min-height: 100vh;
  }

  .view-container {
    min-height: calc(100vh - 64px);
  }

  .view {
    max-width: none !important;
    margin: 0 !important;
    padding: 32px 40px !important;
    min-height: auto;
  }

  /* ── Desktop Home ───────────────────────── */
  .hero-welcome {
    margin-bottom: 32px;
  }

  .hero-name {
    font-size: 2rem;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px;
    margin-bottom: 32px;
  }

  .stat-card .stat-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 12px;
  }

  .stat-card .stat-value {
    font-family: var(--font-heading);
    font-size: 48px !important;
    font-weight: 800;
    line-height: 1;
  }

  .stat-card .stat-label {
    font-size: 0.85rem;
    margin-top: 8px;
  }

  /* ── Desktop Admin ──────────────────────── */
  .admin-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }

  .metric-card .metric-value {
    font-family: var(--font-heading);
    font-size: clamp(32px, 3vw, 48px);
    font-weight: 800;
    line-height: 1;
  }

  .metric-card .metric-label {
    font-size: 0.85rem;
    margin-top: 8px;
  }

  .quick-actions {
    grid-template-columns: repeat(4, 1fr);
  }

  /* ── Desktop Events ─────────────────────── */
  #events-list-content .events-grid,
  #events-list-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  #events-list-content .event-card-img,
  .event-card-img {
    height: 220px;
  }

  /* ── Desktop Modals ─────────────────────── */
  .modal-center {
    max-width: 520px;
  }

  .modal-sheet {
    left: 240px;
  }

  /* ── Desktop Toast ──────────────────────── */
  #toast-container {
    left: 260px;
  }

  /* ── Desktop FAB ────────────────────────── */
  .fab {
    right: 40px;
    bottom: 40px;
  }

  /* ── Section titles typography ──────────── */
  .section-title {
    font-size: 1.25rem;
    font-weight: 700;
  }

  .page-title {
    font-size: 2rem;
    font-weight: 800;
  }

  .page-subtitle {
    font-size: 1rem;
  }

}

/* ── Hide sidebar & desktop layout before login ── */
body:not(.authenticated) .desktop-sidebar {
  display: none !important;
}

body:not(.authenticated) #app {
  margin-left: 0 !important;
  width: 100% !important;
}

/* ── Login screen is always full-screen centered, no sidebar ── */
#login-screen {
  margin-left: 0 !important;
  width: 100% !important;
}

/* ── Mobile-only helpers (below 768px) ────── */
.desktop-page-title {
  display: none;
}

.desktop-header-user {
  display: none;
}
