/* ============================================
   OS Dashboard — Design System & Global Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
  /* Color palette — deep space theme */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(30, 41, 59, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-input: rgba(255, 255, 255, 0.06);

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);
  --border-focus: rgba(99, 102, 241, 0.5);

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #818cf8;

  /* Accents */
  --accent-indigo: #818cf8;
  --accent-indigo-glow: rgba(129, 140, 248, 0.2);
  --accent-purple: #a78bfa;
  --accent-cyan: #22d3ee;
  --accent-emerald: #34d399;
  --accent-amber: #fbbf24;
  --accent-rose: #fb7185;
  --accent-blue: #60a5fa;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-card: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.05) 100%);
  --gradient-sidebar: linear-gradient(180deg, #0f1629 0%, #0a0e1a 100%);
  --gradient-glow: radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 60%);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
}

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

html {
  font-size: 14px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background glow effect */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(168, 85, 247, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--accent-indigo);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--accent-purple);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ---- Layout ---- */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--gradient-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: width var(--transition-base);
  overflow: hidden;
}

.sidebar-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow);
}

.sidebar-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #f1f5f9, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md) var(--space-sm);
  overflow-y: auto;
}

.nav-section {
  margin-bottom: var(--space-lg);
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: var(--space-xs) var(--space-md);
  margin-bottom: var(--space-xs);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
  user-select: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-indigo-glow);
  color: var(--accent-indigo);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent-indigo);
  border-radius: var(--radius-full);
}

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

.nav-badge {
  margin-left: auto;
  background: var(--accent-rose);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

/* Sidebar user profile (bottom) */
.sidebar-profile {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--border-light);
}

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

.profile-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-email {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  font-size: 1.1rem;
}

.profile-logout:hover {
  color: var(--accent-rose);
  background: rgba(251, 113, 133, 0.1);
}

/* ---- Main Content ---- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: var(--space-xl);
  min-height: 100vh;
}

/* ---- Dashboard Header ---- */
.dashboard-header {
  margin-bottom: var(--space-xl);
}

.greeting {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xs);
}

.greeting-highlight {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.date-display {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 400;
}

/* ---- Widget Grid ---- */
.widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-lg);
}

/* ---- Widget Card ---- */
.widget-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.widget-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.widget-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.widget-card.span-2 {
  grid-column: span 2;
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.widget-title-group {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

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

.widget-icon.gmail { background: rgba(234, 67, 53, 0.15); }
.widget-icon.calendar { background: rgba(66, 133, 244, 0.15); }
.widget-icon.tasks { background: rgba(52, 211, 153, 0.15); }
.widget-icon.health { background: rgba(251, 113, 133, 0.15); }
.widget-icon.drive { background: rgba(251, 188, 4, 0.15); }
.widget-icon.contacts { background: rgba(99, 102, 241, 0.15); }
.widget-icon.weather { background: rgba(34, 211, 238, 0.15); }
.widget-icon.finance { background: rgba(52, 211, 153, 0.15); }
.widget-icon.youtube { background: rgba(255, 0, 0, 0.15); }
.widget-icon.ai { background: rgba(168, 85, 247, 0.15); }
.widget-icon.todo { background: rgba(52, 211, 153, 0.15); }
.widget-icon.agentfeed { background: rgba(251, 188, 4, 0.15); }

.widget-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.widget-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.widget-action {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
}

.widget-action:hover {
  background: var(--accent-indigo-glow);
  border-color: var(--accent-indigo);
  color: var(--accent-indigo);
}

.widget-body {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ---- Widget Content Styles ---- */

/* Email list */
.email-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.email-item:last-child { border-bottom: none; }
.email-item:hover { padding-left: var(--space-sm); }

.email-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  color: white;
}

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

.email-sender {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-subject {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Calendar events */
.event-item {
  display: flex;
  gap: var(--space-md);
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.event-item:last-child { border-bottom: none; }

.event-time-block {
  text-align: center;
  min-width: 50px;
  flex-shrink: 0;
}

.event-time {
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--accent-indigo);
}

.event-period {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.event-details {
  flex: 1;
  min-width: 0;
}

.event-name {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.event-location {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.event-dot {
  width: 3px;
  border-radius: var(--radius-full);
  background: var(--accent-indigo);
  flex-shrink: 0;
}

/* Task items */
.task-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 8px 0;
}

.task-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-light);
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  background: transparent;
  color: transparent;
  font-size: 0.7rem;
}

.task-checkbox:hover {
  border-color: var(--accent-emerald);
}

.task-checkbox.checked {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: white;
}

.task-text {
  font-size: 0.85rem;
  flex: 1;
}

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

.task-due {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Health metrics */
.health-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.health-metric {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  transition: all var(--transition-fast);
}

.health-metric:hover {
  border-color: var(--border-light);
  background: var(--bg-input);
}

.metric-icon {
  font-size: 1.5rem;
  margin-bottom: var(--space-xs);
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

.metric-value.steps { color: var(--accent-emerald); }
.metric-value.heart { color: var(--accent-rose); }
.metric-value.sleep { color: var(--accent-purple); }
.metric-value.calories { color: var(--accent-amber); }
.metric-value.active { color: var(--accent-cyan); }

.metric-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* Drive files */
.file-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.file-item:last-child { border-bottom: none; }

.file-icon-img {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.file-name {
  font-size: 0.85rem;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-name a {
  color: var(--text-primary);
}
.file-name a:hover {
  color: var(--accent-indigo);
}

.file-modified {
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Storage bar */
.storage-bar {
  margin-top: var(--space-md);
  background: var(--bg-input);
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
}

.storage-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  transition: width var(--transition-slow);
}

.storage-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
  text-align: right;
}

/* Weather */
.weather-display {
  text-align: center;
  padding: var(--space-md) 0;
}

.weather-temp {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.weather-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: capitalize;
  margin-top: var(--space-xs);
}

.weather-details {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin-top: var(--space-md);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.weather-icon-img {
  width: 64px;
  height: 64px;
}

/* Finance */
.balance-display {
  text-align: center;
  padding: var(--space-md) 0;
  margin-bottom: var(--space-md);
}

.balance-amount {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-emerald);
}

.balance-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.transaction-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.transaction-item:last-child { border-bottom: none; }

.transaction-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.transaction-details {
  flex: 1;
  min-width: 0;
}

.transaction-name {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transaction-category {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.transaction-amount {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}

.transaction-amount.debit { color: var(--accent-rose); }
.transaction-amount.credit { color: var(--accent-emerald); }

/* YouTube */
.video-item {
  display: flex;
  gap: var(--space-md);
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.video-item:last-child { border-bottom: none; }
.video-item:hover { padding-left: var(--space-sm); }

.video-thumb {
  width: 100px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-input);
}

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

.video-title {
  font-size: 0.85rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-channel {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* AI Briefing */
.ai-briefing-content {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.ai-briefing-content strong,
.ai-briefing-content b {
  color: var(--text-primary);
}

.ai-input-container {
  margin-top: var(--space-lg);
  display: flex;
  gap: var(--space-sm);
}

.ai-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 10px 18px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition-fast);
}

.ai-input:focus {
  border-color: var(--border-focus);
}

.ai-input::placeholder {
  color: var(--text-muted);
}

.ai-send {
  background: var(--gradient-primary);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.ai-send:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-glow);
}

/* Contacts */
.contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.contact-item:last-child { border-bottom: none; }

.contact-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.contact-name {
  font-size: 0.85rem;
  font-weight: 500;
  flex: 1;
}

.contact-email {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ---- Loading States ---- */
.loading-skeleton {
  background: linear-gradient(90deg, var(--bg-input) 25%, rgba(255,255,255,0.08) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
  height: 14px;
  margin-bottom: var(--space-sm);
}

.loading-skeleton.wide { width: 80%; }
.loading-skeleton.medium { width: 60%; }
.loading-skeleton.narrow { width: 40%; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ---- Empty / Error States ---- */
.empty-state {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state-text {
  font-size: 0.85rem;
}

.connect-btn {
  margin-top: var(--space-md);
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.connect-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

/* ---- Login Page ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.login-container {
  text-align: center;
  max-width: 440px;
  padding: var(--space-2xl);
}

.login-logo {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-xl);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  margin: 0 auto var(--space-xl);
  box-shadow: var(--shadow-glow);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.login-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-sm);
  line-height: 1.2;
}

.login-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-2xl);
  line-height: 1.6;
}

.google-login-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
  background: white;
  color: #1f2937;
  border: none;
  padding: 14px 32px;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
}

.google-login-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.google-login-btn img {
  width: 20px;
  height: 20px;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .widget-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
  .widget-card.span-2 {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: var(--sidebar-collapsed);
  }
  .sidebar-title,
  .nav-section-title,
  .nav-item span:not(.nav-icon),
  .nav-badge,
  .profile-info {
    display: none;
  }
  .nav-item {
    justify-content: center;
    padding: 12px;
  }
  .main-content {
    margin-left: var(--sidebar-collapsed);
    padding: var(--space-md);
  }
  .widget-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Utility animations ---- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

.widget-card {
  animation: fadeIn 0.5s ease forwards;
  opacity: 0;
}

.widget-card:nth-child(1) { animation-delay: 0.05s; }
.widget-card:nth-child(2) { animation-delay: 0.10s; }
.widget-card:nth-child(3) { animation-delay: 0.15s; }
.widget-card:nth-child(4) { animation-delay: 0.20s; }
.widget-card:nth-child(5) { animation-delay: 0.25s; }
.widget-card:nth-child(6) { animation-delay: 0.30s; }
.widget-card:nth-child(7) { animation-delay: 0.35s; }
.widget-card:nth-child(8) { animation-delay: 0.40s; }
.widget-card:nth-child(9) { animation-delay: 0.45s; }
.widget-card:nth-child(10) { animation-delay: 0.50s; }
.widget-card:nth-child(11) { animation-delay: 0.55s; }
.widget-card:nth-child(12) { animation-delay: 0.60s; }

/* Task add input */
.task-add-form {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.task-add-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition-fast);
}

.task-add-input:focus {
  border-color: var(--border-focus);
}

.task-add-input::placeholder {
  color: var(--text-muted);
}

.task-add-btn {
  background: var(--accent-emerald);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.task-add-btn:hover {
  transform: scale(1.1);
}

/* Calendar quick add */
.cal-add-form {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.cal-add-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition-fast);
}

.cal-add-input:focus { border-color: var(--border-focus); }
.cal-add-input::placeholder { color: var(--text-muted); }

.cal-add-btn {
  background: var(--accent-blue);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.cal-add-btn:hover { transform: scale(1.1); }

/* Contacts search */
.contacts-search {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: var(--font-sans);
  outline: none;
  width: 100%;
  margin-bottom: var(--space-md);
  transition: border-color var(--transition-fast);
}

.contacts-search:focus { border-color: var(--border-focus); }
.contacts-search::placeholder { color: var(--text-muted); }

/* ============================================
   Todo Widget
   ============================================ */

#todo-widget-body {
  width: 100%;
  display: block;
}

.todo-filters {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
  padding: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  width: fit-content;
}

.todo-filter-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  font-family: var(--font-sans);
}

.todo-filter-btn.active {
  background: var(--accent-indigo);
  color: white;
  box-shadow: 0 4px 12px var(--accent-indigo-glow);
}

.todo-filter-btn:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.todo-list-wrapper {
  display: block;
  width: 100%;
  margin: 0;
  flex: 1;
  overflow-y: auto;
  padding-right: 4px; /* Space for scrollbar */
}

.todo-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-md);
  padding: 10px var(--space-sm);
  border-bottom: 1px solid var(--border-subtle);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  transition: all var(--transition-fast);
  border-radius: var(--radius-md);
}

.todo-item:hover {
  background: var(--bg-glass);
  border-color: var(--border-light);
  transform: translateX(2px);
}

.todo-item:last-child {
  border-bottom: none;
}

.todo-item.todo-completed {
  opacity: 0.5;
}

.todo-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-light);
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  background: transparent;
  color: transparent;
  font-size: 0.8rem;
  font-weight: 800;
}

.todo-checkbox:hover {
  border-color: var(--accent-emerald);
  background: rgba(52, 211, 153, 0.1);
}

.todo-checkbox.checked {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: white;
}

.todo-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.todo-title {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-primary);
  word-break: break-word;
  white-space: normal;
}

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

.todo-notes {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.todo-source {
  font-size: 0.9rem;
  flex-shrink: 0;
  opacity: 0.6;
  margin-left: var(--space-sm);
}

.todo-sync-badge {
  font-size: 0.75rem;
  flex-shrink: 0;
  opacity: 0.4;
  transition: all var(--transition-fast);
  margin: 0 4px;
}

.todo-item:hover .todo-sync-badge {
  opacity: 1;
}

.todo-priority {
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  min-width: 22px;
  text-align: center;
}

.todo-priority.priority-high {
  background: rgba(251, 113, 133, 0.2);
  color: var(--accent-rose);
}

.todo-priority.priority-medium {
  background: rgba(251, 188, 4, 0.2);
  color: var(--accent-amber);
}

.todo-priority.priority-low {
  background: rgba(100, 116, 139, 0.2);
  color: var(--text-muted);
}

.todo-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  flex-shrink: 0;
  opacity: 0;
  line-height: 1;
}

.todo-item:hover .todo-delete {
  opacity: 1;
}

.todo-delete:hover {
  color: var(--accent-rose);
  background: rgba(251, 113, 133, 0.1);
}

.todo-add-form {
  display: flex;
  gap: var(--space-sm);
  margin-top: auto;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}

.todo-add-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition-fast);
}

.todo-add-input:focus { border-color: var(--border-focus); }
.todo-add-input::placeholder { color: var(--text-muted); }

.todo-add-btn {
  background: var(--accent-emerald);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.todo-add-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.3);
}

/* ============================================
   Agent Feed Widget
   ============================================ */

.agent-feed-filters {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.agent-filter-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
  white-space: nowrap;
}

.agent-filter-btn.active {
  background: var(--accent-indigo-glow);
  border-color: var(--accent-indigo);
  color: var(--accent-indigo);
}

.agent-filter-btn:hover:not(.active) {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.agent-feed-list {
  max-height: 400px;
  overflow-y: auto;
  padding-right: var(--space-xs);
}

.agent-event-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
  animation: fadeIn 0.3s ease forwards;
}

.agent-event-item:last-child {
  border-bottom: none;
}

.agent-event-item:hover {
  background: var(--bg-glass);
  padding-left: var(--space-sm);
  border-radius: var(--radius-sm);
}

.agent-event-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 2px;
}

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

.agent-event-summary {
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-primary);
}

.agent-event-action {
  font-size: 0.7rem;
  color: var(--accent-emerald);
  margin-top: 3px;
  font-weight: 500;
}

.agent-event-meta {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.agent-event-importance {
  font-size: 0.6rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

.agent-event-importance.importance-high {
  background: rgba(251, 113, 133, 0.2);
  color: var(--accent-rose);
}

.agent-event-importance.importance-medium {
  background: rgba(251, 188, 4, 0.2);
  color: var(--accent-amber);
}

.agent-event-importance.importance-low {
  background: rgba(100, 116, 139, 0.2);
  color: var(--text-muted);
}

.agent-event-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.agent-event-todo-badge {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* ---- News Widget ---- */

#news-widget-body {
  max-height: 550px;
  overflow-y: auto;
  padding-right: var(--space-xs);
}

.news-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
  animation: fadeIn 0.4s ease backwards;
}

.news-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-indigo);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm), var(--accent-indigo-glow);
}

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xs);
}

.news-source-tag {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
}

.source-bbc { background: #bb1919; color: white; }
.source-nyt { background: #333; color: white; }
.source-rte { background: #0088cc; color: white; }
.source-default { background: var(--bg-input); color: var(--text-secondary); }

.news-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

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

.news-summary {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: var(--space-xs);
  opacity: 0.8;
}

.news-footer {
  margin-top: var(--space-lg);
  display: flex;
  justify-content: center;
}

.news-view-all {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 20px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.news-view-all:hover {
  border-color: var(--accent-indigo);
  color: var(--accent-indigo);
  background: var(--accent-indigo-glow);
}
