/* =========================================
   CORE STYLES & VARIABLES
   ========================================= */
:root {
  --bg: #f5f7fa; 
  --card: #ffffff; 
  --text: #1a1a1a; 
  --text-muted: #666666;
  --border: #e1e4e8; 
  --accent: #4a4a4a; 
  --accent-light: #f3f4f6;
  --live-red: #ff3b30;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04); 
  --shadow-hover: 0 12px 24px rgba(0, 0, 0, 0.08);
  
  /* Sidebar Dimensions */
  --sidebar-collapsed: 80px;
  --sidebar-expanded: 260px;
  --header-height: 64px;
  --transition: 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

* { box-sizing: border-box; font-family: 'Inter', system-ui, -apple-system, sans-serif; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); overflow-x: hidden; }

/* =========================================
   LAYOUT ARCHITECTURE
   ========================================= */
.app-container { display: flex; min-height: 100vh; }

/* =========================================
   MOBILE HEADER
   ========================================= */
.mobile-header {
  display: none; position: fixed; top: 0; left: 0; right: 0; height: var(--header-height);
  background: var(--card); border-bottom: 1px solid var(--border); z-index: 90;
  align-items: center; padding: 0 20px; justify-content: space-between;
}
.menu-toggle {
  background: none; border: none; cursor: pointer; color: var(--text);
  display: flex; align-items: center; justify-content: center; padding: 8px; margin-left: -8px; border-radius: 8px;
}
.menu-toggle:hover { background: var(--accent-light); }
.menu-toggle svg { width: 24px; height: 24px; }
.mobile-logo { font-weight: 800; font-size: 18px; letter-spacing: -0.5px; }

/* =========================================
   SIDEBAR (Desktop Expand-on-Hover)
   ========================================= */
.sidebar {
  background: var(--card); border-right: 1px solid var(--border); position: fixed;
  top: 0; bottom: 0; left: 0; display: flex; flex-direction: column; z-index: 100;
  transition: width var(--transition), transform var(--transition); overflow: hidden; white-space: nowrap;
}

/* Sidebar Top (For mobile close button) */
.sidebar-top {
  display: none; padding: 16px; justify-content: flex-end;
}
.close-sidebar { background: none; border: none; cursor: pointer; color: var(--text-muted); }

/* Sidebar Navigation */
.sidebar-nav { padding: 24px 0; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.nav-link {
  display: flex; align-items: center; padding: 12px 0; margin: 0 12px;
  border-radius: var(--radius-md); text-decoration: none; color: var(--text-muted);
  font-weight: 600; font-size: 15px; transition: all 0.2s ease;
}
.nav-icon-wrapper { width: 56px; min-width: 56px; display: flex; align-items: center; justify-content: center; }
.nav-link svg { width: 22px; height: 22px; stroke-width: 2px; }
.nav-text { opacity: 0; transition: opacity 0.2s; }
.nav-link:hover { background: var(--accent-light); color: var(--text); }
.nav-link.active { background: var(--text); color: var(--card); }
.nav-link.active svg { color: var(--card); }

/* Live Indicator in Menu */
.live-badge {
  margin-left: auto; background: rgba(255, 59, 48, 0.1); color: var(--live-red);
  font-size: 11px; padding: 4px 8px; border-radius: 20px; font-weight: 800;
  display: flex; align-items: center; gap: 6px; margin-right: 12px;
}
.live-dot-small { width: 6px; height: 6px; background: var(--live-red); border-radius: 50%; animation: pulse 2s infinite; }

/* Sidebar Footer */
.sidebar-footer {
  height: 80px; display: flex; align-items: center; padding: 0 22px; border-top: 1px solid var(--border);
  margin-top: auto; 
}
.brand-avatar {
  width: 36px; height: 36px; min-width: 36px; background: linear-gradient(135deg, var(--accent), #888888);
  border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.brand-avatar img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.5px; margin-left: 12px; opacity: 0; transition: opacity 0.2s; }

/* Hover Rules for Desktop Sidebar */
@media (min-width: 769px) {
  .sidebar { width: var(--sidebar-collapsed); }
  .sidebar:hover { width: var(--sidebar-expanded); box-shadow: var(--shadow-hover); }
  .sidebar:hover .brand-name, .sidebar:hover .nav-text { opacity: 1; transition-delay: 0.1s; }
  .main-content { margin-left: var(--sidebar-collapsed); transition: margin-left var(--transition); }
}

.sidebar-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5);
  z-index: 95; opacity: 0; pointer-events: none; transition: opacity var(--transition);
}

/* =========================================
   MAIN CONTENT AREA
   ========================================= */
.main-content { flex: 1; padding: 40px; max-width: 1200px; }
.welcome-banner {
  background: linear-gradient(135deg, var(--text), var(--accent)); border-radius: var(--radius-lg);
  padding: 40px; color: white; margin-bottom: 32px; box-shadow: var(--shadow-hover);
}
.welcome-banner h1 { font-size: 32px; font-weight: 800; margin-bottom: 8px; }
.welcome-banner p { font-size: 16px; opacity: 0.9; max-width: 600px; line-height: 1.6; }

.section-title { font-size: 20px; font-weight: 800; margin-bottom: 20px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }

/* Action Cards */
.action-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 32px; text-decoration: none; color: var(--text); display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm); transition: transform var(--transition), box-shadow var(--transition); position: relative;
}
.action-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: #d1d5db; }
.card-icon-wrapper {
  width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; margin-bottom: 24px;
}
.card-icon-wrapper.live-bg { background: rgba(255, 59, 48, 0.1); color: var(--live-red); }
.card-icon-wrapper.standard-bg { background: var(--accent-light); color: var(--text); }
.card-icon-wrapper svg { width: 28px; height: 28px; }
.action-card h3 { font-size: 20px; font-weight: 800; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.action-card p { font-size: 14px; color: var(--text-muted); line-height: 1.5; flex: 1; }

/* LOCKED STATE STYLES */
.action-card.locked { background: #fafafa; color: #999; border-color: #eaeaea; cursor: not-allowed; pointer-events: none; }
.action-card.locked:hover { transform: none; box-shadow: var(--shadow-sm); }
.action-card.locked .card-icon-wrapper { background: #eee; color: #aaa; }
.lock-badge {
  position: absolute; top: 24px; right: 24px; background: #f0f0f0; color: #666;
  padding: 6px 12px; border-radius: 20px; font-size: 11px; font-weight: 800; letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 6px;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(255, 59, 48, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

@media (max-width: 1024px) { .main-content { padding: 32px; } }
@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .sidebar-top { display: flex; } 
  .sidebar { width: var(--sidebar-expanded); transform: translateX(-100%); }
  .sidebar.active { transform: translateX(0); }
  .sidebar .brand-name, .sidebar .nav-text { opacity: 1; }
  .sidebar-overlay.active { opacity: 1; pointer-events: auto; }
  .main-content { margin-left: 0; padding: calc(var(--header-height) + 24px) 20px 40px 20px; }
  .welcome-banner { padding: 32px 24px; }
  .welcome-banner h1 { font-size: 26px; }
}
