/* ==========================================================================
   ACADEMIA PRO — Sophisticated Academic Organizer & Workspace
   Modern, Clean, Responsive CSS Architecture with Light/Dark Themes
   Optimized for Standalone Use and Google Sites Iframe Embeds
   ========================================================================== */

:root {
  /* Safe Area Insets (iPhone Dynamic Island, Home Bar, Notch) */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* Theme Tokens — Light Mode (Executive Clean) */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f1f5f9;
  --bg-surface-active: #e2e8f0;
  --bg-surface-elevated: #ffffff;
  --bg-surface-subtle: #f8fafc;
  --bg-sidebar: #ffffff;
  
  --border-subtle: rgba(15, 23, 42, 0.05);
  --border-default: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.16);
  --border-focus: rgba(79, 70, 229, 0.4);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  /* Primary Brand Accent (Electric Indigo / Sapphire) */
  --accent: #4f46e5;
  --accent-light: #eef2ff;
  --accent-hover: #4338ca;
  --accent-focus: rgba(79, 70, 229, 0.2);
  --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);

  /* Semantic Feedback */
  --success: #10b981;
  --success-light: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #047857;
  
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #b45309;

  --danger: #ef4444;
  --danger-light: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #b91c1c;

  --info: #0ea5e9;
  --info-light: #f0f9ff;
  --info-border: #bae6fd;
  --info-text: #0369a1;

  --purple: #8b5cf6;
  --purple-light: #f5f3ff;

  /* Elevation & Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);

  /* Border Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Sizing Layout */
  --sidebar-width: 250px;
  --header-height: 60px;
  --bottom-nav-height: 60px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Variables (Deep Slate / Zinc) */
[data-theme="dark"] {
  --bg-app: #0a0e17;
  --bg-surface: #111827;
  --bg-surface-hover: #1e293b;
  --bg-surface-active: #334155;
  --bg-surface-elevated: #1e293b;
  --bg-surface-subtle: #0f172a;
  --bg-sidebar: #0e1422;
  
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-default: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-focus: rgba(99, 102, 241, 0.4);
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-inverse: #0a0e17;

  --accent: #6366f1;
  --accent-light: rgba(99, 102, 241, 0.15);
  --accent-hover: #818cf8;
  --accent-focus: rgba(99, 102, 241, 0.3);
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #38bdf8 100%);

  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.25);
  --success-text: #34d399;
  
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.12);
  --warning-border: rgba(245, 158, 11, 0.25);
  --warning-text: #fbbf24;

  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.12);
  --danger-border: rgba(239, 68, 68, 0.25);
  --danger-text: #f87171;

  --info: #0284c7;
  --info-light: rgba(14, 165, 233, 0.12);
  --info-border: rgba(14, 165, 233, 0.25);
  --info-text: #38bdf8;

  --purple-light: rgba(139, 92, 246, 0.15);

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.6);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.7);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.8);
}

/* ==========================================================================
   Base Reset & Typography
   ========================================================================== */

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

html {
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
  user-select: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==========================================================================
   Layout Shell: App Container, Sidebar, Header, Mobile Nav
   ========================================================================== */

#app-container {
  display: flex;
  width: 100vw;
  min-height: 100vh;
  position: relative;
}

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 40;
  transition: transform var(--transition-normal);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.semester-selector-wrapper {
  padding: 0.625rem 1.125rem;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-subtle);
}

.term-picker-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.semester-select {
  width: 100%;
  padding: 0.4375rem 0.625rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.semester-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-focus);
}

.sidebar-nav {
  flex: 1;
  padding: 0.875rem 0.625rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.1875rem;
}

.nav-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.75rem 0.625rem 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5625rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
}

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

.nav-item.active {
  background-color: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

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

.nav-badge {
  margin-left: auto;
  font-size: 0.6875rem;
  padding: 0.125rem 0.4375rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  background-color: var(--bg-surface-hover);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.nav-badge.danger {
  background-color: var(--danger-light);
  color: var(--danger-text);
}

.sidebar-footer {
  padding: 0.875rem 1.125rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-surface-subtle);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex: 1;
  min-width: 0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8125rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

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

.user-status {
  font-size: 0.6875rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Main Content Area */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: calc(100vw - var(--sidebar-width));
  overflow-x: hidden;
}

/* Top App Header with Glassmorphism */
.app-header {
  height: calc(var(--header-height) + var(--sat));
  padding-top: var(--sat);
  padding-left: calc(1.5rem + var(--sal));
  padding-right: calc(1.5rem + var(--sar));
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex: 1;
  max-width: 440px;
}

.mobile-menu-toggle {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.mobile-menu-toggle:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-primary);
}

.global-search-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.global-search-input {
  width: 100%;
  padding: 0.4375rem 0.75rem 0.4375rem 2.125rem;
  background-color: var(--bg-surface-hover);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}

.global-search-input:focus {
  background-color: var(--bg-surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-focus);
}

.search-shortcut-badge {
  position: absolute;
  right: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.625rem;
  font-family: var(--font-mono);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  padding: 0.0625rem 0.3125rem;
  border-radius: 3px;
  color: var(--text-muted);
  pointer-events: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  transition: all var(--transition-fast);
  position: relative;
}

.icon-btn:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.notification-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background-color: var(--danger);
  border: 2px solid var(--bg-surface);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  padding: 0.5rem 1rem;
  background: var(--accent-gradient);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.8125rem;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.2);
  transition: all var(--transition-fast);
  border: none;
}

.btn-primary:hover {
  opacity: 0.95;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  padding: 0.5rem 0.875rem;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.8125rem;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.btn-ghost:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* Main Viewport */
.app-viewport {
  flex: 1;
  padding: 1.5rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-nav-height) + var(--sab));
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-default);
  z-index: 40;
  justify-content: space-around;
  align-items: center;
  padding: 0 calc(0.25rem + var(--sal)) var(--sab) calc(0.25rem + var(--sar));
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1875rem;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  flex: 1;
  padding: 0.375rem 0;
  transition: color var(--transition-fast);
}

.mobile-nav-btn.active {
  color: var(--accent);
}

/* ==========================================================================
   Component System: Cards, Grids, Badges, Headers, Onboarding
   ========================================================================== */

.view-section {
  display: none;
  animation: fadeIn 200ms ease;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.875rem;
}

.section-title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.section-subtitle {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.1875rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
}

/* Stat Cards Grid */
.stat-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.875rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 1.125rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.stat-icon-wrapper {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.stat-icon-wrapper.blue { background: rgba(79, 70, 229, 0.1); color: var(--accent); }
.stat-icon-wrapper.emerald { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.stat-icon-wrapper.amber { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.stat-icon-wrapper.purple { background: rgba(139, 92, 246, 0.1); color: var(--purple); }
.stat-icon-wrapper.rose { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

.stat-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stat-value {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-top: 0.125rem;
  letter-spacing: -0.02em;
}

.stat-subtext {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  margin-top: 0.1875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dashboard Two-Column Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.25rem;
}

.card-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
  margin-bottom: 1.25rem;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-action-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
}
.panel-action-link:hover {
  text-decoration: underline;
}

/* Onboarding Setup Guide Card (Shown to New Users with 0 items) */
.onboarding-guide-card {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.04) 0%, rgba(59, 130, 246, 0.06) 100%);
  border: 1.5px dashed var(--accent);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.onboarding-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.onboarding-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.onboarding-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.875rem;
  margin-top: 1rem;
}

.onboarding-step-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.onboarding-step-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.step-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-light);
  padding: 0.1875rem 0.5rem;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.step-title {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.step-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Empty State Styling */
.empty-state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background-color: var(--bg-surface-subtle);
  margin: 0.5rem 0;
}

.empty-state-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-xs);
  color: var(--text-muted);
}

.empty-state-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.empty-state-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  max-width: 380px;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

/* Badges & Tag Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  padding: 0.2rem 0.5625rem;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.2;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
}

.badge.primary { background: var(--accent-light); color: var(--accent); }
.badge.success { background: var(--success-light); color: var(--success-text); }
.badge.warning { background: var(--warning-light); color: var(--warning-text); }
.badge.danger { background: var(--danger-light); color: var(--danger-text); }
.badge.info { background: var(--info-light); color: var(--info-text); }
.badge.neutral { background: var(--bg-surface-hover); color: var(--text-secondary); }

/* Task / Assignment Item Row */
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  border-radius: var(--radius-md);
  margin-bottom: 0.625rem;
  transition: all var(--transition-fast);
  position: relative;
}

.task-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.task-item.completed {
  opacity: 0.6;
  background-color: var(--bg-surface-hover);
}

.task-item.completed .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-item.overdue {
  border-left: 3.5px solid var(--danger);
}

/* Custom Checkbox */
.task-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-radius: 5px;
  margin-top: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  background-color: var(--bg-surface);
}

.task-checkbox:checked {
  background-color: var(--success);
  border-color: var(--success);
}

.task-checkbox:checked::after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.task-content {
  flex: 1;
  min-width: 0;
}

.task-header-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.task-course-pill {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm);
  color: white;
  display: inline-flex;
  align-items: center;
}

.task-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 1.35;
}

.task-meta-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
  flex-wrap: wrap;
}

.task-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.task-item:hover .task-actions {
  opacity: 1;
}

/* Kanban Board View */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.kanban-column {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.875rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.kanban-col-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.kanban-col-count {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.kanban-cards-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  flex: 1;
}

/* Exam Cards */
.exam-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.exam-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.exam-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--exam-color, var(--accent));
}

.exam-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.exam-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}

.exam-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.exam-countdown-pill {
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.exam-countdown-pill.urgent { background: var(--danger-light); color: var(--danger-text); }
.exam-countdown-pill.soon { background: var(--warning-light); color: var(--warning-text); }
.exam-countdown-pill.future { background: var(--info-light); color: var(--info-text); }

.exam-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.75rem 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.exam-detail-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* Classes Directory Cards */
.classes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.class-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.class-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.class-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.class-card-name {
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--text-primary);
}

.class-card-code {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-top: 0.125rem;
}

/* Calendar Grid */
.calendar-container {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.calendar-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  text-transform: uppercase;
}

.calendar-days-matrix {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background-color: var(--border-default);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 0.5rem;
}

.calendar-day-cell {
  background-color: var(--bg-surface);
  min-height: 85px;
  padding: 0.375rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: background-color var(--transition-fast);
  cursor: pointer;
}

.calendar-day-cell:hover {
  background-color: var(--bg-surface-hover);
}

.calendar-day-cell.other-month {
  opacity: 0.35;
  background-color: var(--bg-surface-subtle);
}

.calendar-day-cell.today {
  background-color: var(--accent-light);
}

.calendar-day-number {
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-primary);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
}

.calendar-day-cell.today .calendar-day-number {
  background-color: var(--accent);
  color: white;
}

.cal-event-pill {
  font-size: 0.6875rem;
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-xs);
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

/* Timetable Matrix Grid */
.timetable-grid {
  display: grid;
  grid-template-columns: 70px repeat(5, 1fr);
  gap: 1px;
  background-color: var(--border-default);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.timetable-header-cell {
  background-color: var(--bg-surface-subtle);
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.timetable-time-slot {
  background-color: var(--bg-surface-subtle);
  padding: 0.5rem;
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-align: center;
}

.timetable-cell {
  background-color: var(--bg-surface);
  min-height: 54px;
  padding: 0.25rem;
  position: relative;
}

.timetable-class-block {
  padding: 0.375rem 0.5rem;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.6875rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  height: 100%;
}

/* Form Controls & Modals */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 0.875rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background-color: var(--bg-surface-hover);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}

.form-control:focus {
  background-color: var(--bg-surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-focus);
}

textarea.form-control {
  min-height: 70px;
  resize: vertical;
}

/* Modal Overlay & Dialog */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
  animation: modalFadeIn 180ms ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: modalPop 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { transform: scale(0.96) translateY(8px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  padding: 1.125rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
}
.modal-close-btn:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.25rem;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.625rem;
  background-color: var(--bg-surface-subtle);
}

/* Toast Tray */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
  animation: toastSlideIn 200ms ease;
  min-width: 240px;
}

@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-left: 4px solid var(--success); }
.toast.info { border-left: 4px solid var(--accent); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.danger { border-left: 4px solid var(--danger); }

/* Status Dot Styles */
.cloud-status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  margin-right: 4px;
  vertical-align: middle;
}

.cloud-status-dot.synced {
  background-color: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.cloud-status-dot.syncing {
  background-color: var(--accent);
  animation: pulseSync 1s infinite alternate;
}

.cloud-status-dot.offline {
  background-color: var(--text-muted);
}

.cloud-status-dot.saved {
  background-color: var(--success);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

@keyframes pulseSync {
  from { opacity: 0.4; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.15); }
}

/* ==========================================================================
   Welcome / Registration Overlay Screen
   ========================================================================== */

.welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: var(--bg-app);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
  animation: welcomeFadeIn 300ms ease;
}

@keyframes welcomeFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.welcome-container {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.welcome-brand {
  text-align: center;
}

.welcome-brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.875rem;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25);
}

.welcome-title {
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.welcome-tagline {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.welcome-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  animation: welcomeSlideUp 300ms ease;
}

.welcome-section.hidden {
  display: none;
}

@keyframes welcomeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.welcome-section-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.welcome-section-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 1.125rem;
}

.welcome-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.welcome-account-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all 150ms ease;
  width: 100%;
  text-align: left;
}

.welcome-account-card:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-focus);
  transform: translateY(-1px);
}

.welcome-account-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.welcome-account-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

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

.welcome-account-school {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.0625rem;
}

.welcome-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  padding: 0.375rem 0;
  transition: color 150ms;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  justify-content: center;
}

.welcome-link-btn:hover {
  color: var(--accent-hover);
}

.welcome-form {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.welcome-avatar-preview-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.welcome-avatar-preview {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  flex-shrink: 0;
  transition: background 200ms ease;
  box-shadow: var(--shadow-sm);
}

.avatar-color-picker {
  flex: 1;
}

.avatar-color-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}

.avatar-color-options {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.avatar-color-option {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 150ms ease;
}

.avatar-color-option:hover {
  transform: scale(1.15);
}

.avatar-color-option.selected {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--text-primary);
}

.welcome-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.welcome-form-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.welcome-form-input {
  width: 100%;
  padding: 0.5625rem 0.75rem;
  background-color: var(--bg-surface-hover);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-primary);
  outline: none;
  transition: all 150ms ease;
}

.welcome-form-input:focus {
  background-color: var(--bg-surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-focus);
}

.welcome-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6875rem 1.125rem;
  background: var(--accent-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  transition: all 150ms ease;
}

.welcome-submit-btn:hover {
  opacity: 0.95;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
  transform: translateY(-1px);
}

.welcome-footer-note {
  text-align: center;
  font-size: 0.6875rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   Responsive Breakpoints & Iframe Embedding Optimizations
   ========================================================================== */

@media (max-width: 900px) {
  .app-sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    z-index: 100;
    box-shadow: var(--shadow-xl);
    padding-top: var(--sat);
    padding-bottom: var(--sab);
  }

  .app-sidebar.mobile-open {
    transform: translateX(260px);
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .app-main {
    max-width: 100vw;
    padding-bottom: calc(var(--bottom-nav-height) + var(--sab) + 1.5rem);
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .kanban-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .app-viewport {
    padding: 1rem 0.75rem calc(var(--bottom-nav-height) + var(--sab) + 1.5rem);
  }

  .app-header {
    padding-top: var(--sat);
    padding-left: calc(0.75rem + var(--sal));
    padding-right: calc(0.75rem + var(--sar));
    gap: 0.5rem;
  }

  .header-left {
    gap: 0.375rem;
    flex: 1;
    min-width: 0;
  }

  .global-search-wrapper {
    flex: 1;
    min-width: 0;
  }

  .global-search-input {
    padding-right: 0.5rem;
    font-size: 0.75rem;
  }

  .header-right {
    gap: 0.375rem;
    flex-shrink: 0;
  }

  #header-auth-btn {
    display: none;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
  }

  .header-add-btn span {
    display: none;
  }

  .header-add-btn {
    padding: 0;
    width: 34px;
    height: 34px;
    justify-content: center;
    border-radius: var(--radius-md);
  }

  .search-shortcut-badge {
    display: none;
  }

  .stat-cards-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .calendar-days-matrix {
    min-height: 350px;
  }

  .calendar-day-cell {
    min-height: 60px;
    padding: 0.2rem;
  }

  .cal-event-pill span {
    display: none;
  }
}

/* ==========================================================================
   Firebase Auth & Cloud Sync Modal System
   ========================================================================== */

.auth-tabs {
  display: flex;
  gap: 0.375rem;
  background: var(--bg-surface-subtle);
  padding: 0.3125rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-default);
}

.auth-tab-btn {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 150ms ease;
  text-align: center;
}

.auth-tab-btn:hover {
  color: var(--text-primary);
}

.auth-tab-btn.active {
  background: var(--bg-surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.auth-pane {
  display: none;
  animation: authFadeIn 200ms ease;
}

.auth-pane.active {
  display: block;
}

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.cloud-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.cloud-status-badge.connected {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.cloud-status-badge.syncing {
  background: rgba(79, 70, 229, 0.12);
  color: var(--accent);
  border: 1px solid rgba(79, 70, 229, 0.3);
}

.cloud-status-badge.offline {
  background: rgba(100, 116, 139, 0.12);
  color: var(--text-muted);
  border: 1px solid rgba(100, 116, 139, 0.25);
}

.cloud-status-badge.error {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.cloud-info-box {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.cloud-info-box.alert-box {
  background: rgba(79, 70, 229, 0.05);
  border-color: rgba(79, 70, 229, 0.2);
}

.firebase-config-guide {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.firebase-config-guide ol {
  margin-left: 1.25rem;
  margin-top: 0.375rem;
}

.firebase-config-guide li {
  margin-bottom: 0.25rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1rem 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-default);
}

.auth-divider:not(:empty)::before {
  margin-right: 0.5em;
}

.auth-divider:not(:empty)::after {
  margin-left: 0.5em;
}


/* Pomodoro Styles */
.pomodoro-timer-ring {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.5s linear;
}

.pomodoro-timer-inner {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.pomodoro-time {
  font-size: 4rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1;
  margin: 0.5rem 0;
}

.pomodoro-phase {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.pomodoro-counter {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Heatmap Styles */
.heatmap-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--bg-surface-active);
}
.heatmap-cell.intensity-1 { background: #9be9a8; }
.heatmap-cell.intensity-2 { background: #40c463; }
.heatmap-cell.intensity-3 { background: #30a14e; }
.heatmap-cell.intensity-4 { background: #216e39; }

[data-theme="dark"] .heatmap-cell.intensity-1 { background: #0e4429; }
[data-theme="dark"] .heatmap-cell.intensity-2 { background: #006d32; }
[data-theme="dark"] .heatmap-cell.intensity-3 { background: #26a641; }
[data-theme="dark"] .heatmap-cell.intensity-4 { background: #39d353; }
