/* Global theme tokens - Professional Academic Design */
:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --secondary: #0891b2;
  --secondary-light: #06b6d4;
  --success: #16a34a;
  --warning: #ea580c;
  --error: #dc2626;
  
  --bg: #ffffff;
  --bg-subtle: #f8fafc;
  --text: #0f172a;
  --text-secondary: #475569;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --radius: 8px;
  --transition: 150ms ease;
}

[data-theme="dark"] {
  --primary: #3b82f6;
  --primary-light: #60a5fa;
  --secondary: #06b6d4;
  --secondary-light: #22d3ee;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  
  --bg: #0f172a;
  --bg-subtle: #1e293b;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

* { 
  box-sizing: border-box; 
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 0;
  line-height: 1.6;
  letter-spacing: 0;
  transition: background var(--transition), color var(--transition);
  position: relative;
}

/* Weather page - Modern mobile-first design */
body[data-page="weather"] {
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(226, 232, 240, 0.95) 100%), url('https://images.unsplash.com/photo-1534274988757-a28bf1a4c817?auto=format&fit=crop&w=1200&q=80') center / cover;
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
}

body[data-page="weather"]::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.82);
  pointer-events: none;
  z-index: -1;
}

[data-theme="dark"] body[data-page="weather"]::before {
  background: rgba(15, 23, 42, 0.88);
}

.shell {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 700;
  letter-spacing: 0;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 16px;
  color: var(--text);
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  padding: 0;
  border-radius: 0;
  border: none;
  font-size: 14px;
  font-weight: 500;
  transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--primary);
  outline: none;
}

.theme-toggle {
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  font-size: 13px;
  font-weight: 500;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--bg);
  border-color: var(--primary);
  outline: none;
}

.hero {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
  align-items: start;
  margin: 40px 0;
  padding: 48px 20px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.hero .sublede { 
  color: var(--text-secondary); 
  max-width: 620px; 
  margin: 0; 
  font-size: 16px;
  line-height: 1.6;
}

.hero-inline {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
}

h1 {
  font-size: 44px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
  font-weight: 700;
  color: var(--text);
}

.lede {
  max-width: 880px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.btn {
  text-decoration: none;
  color: #ffffff;
  background: var(--primary);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow);
  transition: background var(--transition), box-shadow var(--transition);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover,
.btn:focus-visible {
  background: var(--primary-light);
  box-shadow: var(--shadow-lg);
  outline: none;
}

.btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  box-shadow: var(--shadow);
}

.btn.secondary {
  background: var(--secondary);
}

.btn.secondary:hover {
  background: var(--secondary-light);
}

.ghost-btn {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  box-shadow: none;
  transition: background var(--transition), border-color var(--transition);
}

.ghost-btn:hover,
.ghost-btn:focus-visible {
  background: rgba(30, 64, 175, 0.05);
  border-color: var(--primary-light);
  outline: none;
}

.section {
  margin-top: 48px;
  padding: 0 20px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

body[data-page="weather"] .section { margin-top: 32px; }

.section h2 {
  margin: 0 0 12px;
  font-size: 28px;
  letter-spacing: -0.01em;
  color: var(--text);
  font-weight: 700;
}

.section .lede { margin: 0 0 20px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.card {
  position: relative;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), background var(--transition);
  text-decoration: none;
  color: inherit;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  outline: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.card h3 { 
  margin: 0 0 10px; 
  font-size: 18px;
  color: var(--text);
  font-weight: 700;
}

.card p { 
  margin: 0 0 16px; 
  color: var(--text-secondary); 
  line-height: 1.5;
  font-size: 14px;
}

.meta { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  color: var(--text-secondary); 
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.dashboard-card {
  padding: 20px;
  min-height: 200px;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.08), transparent);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.dashboard-card:hover,
.dashboard-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  outline: none;
}

.dashboard-card h3,
.dashboard-card p,
.dashboard-card .metric,
.dashboard-card .meta,
.dashboard-card .tag,
.dashboard-card .label {
  text-decoration: none;
  color: inherit;
}

.dash-weather {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), transparent);
}

.dash-finance {
  background: linear-gradient(135deg, rgba(202, 138, 4, 0.08), transparent);
}

.dash-students {
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.08), transparent);
}

/* Feature carousel */
.carousel-shell {
  margin-top: 20px;
  overflow: hidden;
  padding: 0 20px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 1fr);
  gap: 16px;
  overflow-x: auto;
  padding: 0;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.carousel-track::-webkit-scrollbar { 
  height: 6px; 
}

.carousel-track::-webkit-scrollbar-thumb { 
  background: var(--border); 
  border-radius: 3px;
}

.carousel-item {
  scroll-snap-align: start;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.carousel-track a.carousel-item {
  color: inherit;
  text-decoration: none;
}

.carousel-item:hover,
.carousel-item:focus-visible {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  outline: none;
}

.carousel-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 64, 175, 0.1);
  font-size: 20px;
}

.carousel-item strong { 
  font-size: 16px;
  color: var(--text);
  font-weight: 700;
}

.carousel-item span { 
  color: var(--text-secondary); 
  font-size: 14px; 
  line-height: 1.5;
}

.metrics { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); 
  gap: 12px; 
  margin-top: 12px;
}

.metric {
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
}

.metric .label { 
  background: none; 
  border: none; 
  padding: 0; 
  margin: 0 0 6px; 
  text-transform: none; 
  letter-spacing: 0; 
  color: var(--text-secondary); 
  font-size: 12px;
  font-weight: 500;
}

.metric .value { 
  font-weight: 700; 
  font-size: 16px;
  color: var(--text);
}

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }

/* Weather layout - compact dashboard */
.compact-hero {
  margin-bottom: 32px;
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.05), rgba(34, 197, 94, 0.05));
  border-left: 4px solid #1E3A8A;
}

.compact-hero h1 {
  color: #1E3A8A;
}

.weather-compact { 
  margin-top: 24px;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .summary-grid { 
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.summary-card {
  padding: 28px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  position: relative;
  z-index: 1;
}

[data-theme="dark"] .summary-card {
  background: #1E293B;
  border-color: #334155;
}

.summary-top { 
  display: grid; 
  grid-template-columns: 1fr; 
  gap: 12px;
}

.summary-temp { 
  font-size: clamp(48px, 10vw, 64px); 
  font-weight: 800; 
  letter-spacing: -0.02em;
  color: #22C55E;
  line-height: 1.1;
}

.summary-condition { 
  color: #475569; 
  font-weight: 600; 
  font-size: 18px;
}

[data-theme="dark"] .summary-condition {
  color: #CBD5E1;
}

.summary-meta { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 10px;
  margin-top: 16px;
}

.summary-bottom { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); 
  gap: 12px; 
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #E2E8F0;
}

[data-theme="dark"] .summary-bottom {
  border-top-color: #334155;
}

.mini-stat { 
  display: flex; 
  align-items: flex-start; 
  gap: 12px; 
  padding: 12px;
  border-radius: 12px; 
  background: #F8FAFC;
  border: none;
}

[data-theme="dark"] .mini-stat {
  background: #0F172A;
}

.mini-stat .icon {
  color: #1E3A8A;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.mini-label { 
  color: #475569; 
  font-size: 12px;
  font-weight: 500;
}

[data-theme="dark"] .mini-label {
  color: #CBD5E1;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  padding: 0;
}

.stat-tile {
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  display: grid;
  gap: 10px;
  justify-items: start;
  min-height: 140px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 150ms ease;
}

[data-theme="dark"] .stat-tile {
  background: #1E293B;
  border-color: #334155;
}

.stat-tile:hover {
  border-color: #1E3A8A;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.1);
}

.stat-tile .icon {
  color: #1E3A8A;
  width: 28px;
  height: 28px;
}

.stat-value { 
  font-weight: 700; 
  font-size: 20px;
  color: #22C55E;
}

.stat-label { 
  color: #475569; 
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

[data-theme="dark"] .stat-label {
  color: #CBD5E1;
}

.compact-card { 
  padding: 20px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .compact-card {
  background: #1E293B;
  border-color: #334155;
}
.align-center { align-items: center; }

.mini-forecast-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
}

.mini-forecast-card {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 100px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 150ms ease;
}

[data-theme="dark"] .mini-forecast-card {
  background: #1E293B;
  border-color: #334155;
}

.mini-forecast-card:hover {
  border-color: #22C55E;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.1);
}

.mini-forecast-day { 
  font-weight: 700;
  color: #1E3A8A;
  font-size: 14px;
}

.mini-forecast-temps { 
  font-size: 14px; 
  font-weight: 600;
  color: #22C55E;
}

.mini-forecast-meta { 
  color: #475569; 
  font-size: 11px;
  font-weight: 500;
}

[data-theme="dark"] .mini-forecast-meta {
  color: #CBD5E1;
}

/* Icon system (flat, minimal) */
.icon { 
  width: 18px; 
  height: 18px; 
  display: inline-block; 
  background: #1E3A8A;
  mask-size: contain; 
  mask-repeat: no-repeat; 
  mask-position: center;
}

[data-theme="dark"] .icon {
  background: #60A5FA;
}
.icon-humidity { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="%23ffffff" fill="none" stroke-width="2"><path d="M12 3s5 5.5 5 9.5A5 5 0 0 1 7 12.5C7 8.5 12 3 12 3Z"/><path d="M12 18a3 3 0 0 0 3-3"/></svg>'); }
.icon-wind { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="%23ffffff" fill="none" stroke-width="2"><path d="M4 10h11a3 3 0 1 0-3-3"/><path d="M4 16h9a3 3 0 1 1-3 3"/></svg>'); }
.icon-aqi { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="%23ffffff" fill="none" stroke-width="2"><circle cx="12" cy="12" r="7"/><path d="M12 9v3l2 2"/></svg>'); }
.icon-pressure { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="%23ffffff" fill="none" stroke-width="2"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 3"/></svg>'); }
.icon-visibility { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="%23ffffff" fill="none" stroke-width="2"><circle cx="12" cy="12" r="2"/><path d="M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6-10-6-10-6Z"/></svg>'); }
.icon-sunrise { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="%23ffffff" fill="none" stroke-width="2"><path d="M12 3v6"/><path d="m9 6 3-3 3 3"/><path d="M4 18a8 8 0 0 1 16 0"/><path d="M4 22h16"/></svg>'); }
.icon-sunset { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="%23ffffff" fill="none" stroke-width="2"><path d="M12 11v-6"/><path d="m9 8 3 3 3-3"/><path d="M4 18a8 8 0 0 1 16 0"/><path d="M4 22h16"/></svg>'); }

.aqi { 
  font-size: 24px; 
  font-weight: 700;
}

.aqi.good { 
  color: #22C55E;
}

.aqi.moderate { 
  color: #EA580C;
}

.aqi.poor { 
  color: #DC2626;
}

.table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.table th, .table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.table td { color: var(--text); font-size: 14px; }
.table tr:hover { background: rgba(255,255,255,0.04); }

.pill { 
  display: inline-flex; 
  align-items: center; 
  gap: 8px; 
  padding: 8px 14px; 
  border-radius: 999px; 
  border: 1px solid #E2E8F0; 
  background: #F8FAFC;
  color: #475569; 
  font-size: 12px;
  font-weight: 500;
}

[data-theme="dark"] .pill {
  background: #1E293B;
  border-color: #334155;
  color: #CBD5E1;
}
.pill.positive { color: #16a34a; border-color: rgba(22,163,74,0.3); }
.pill.negative { color: #ef4444; border-color: rgba(239,68,68,0.3); }

form { 
  display: grid; 
  gap: 16px;
}

.input-row { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); 
  gap: 12px;
}

input, select, textarea {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  font-family: inherit;
}

input:focus-visible, 
select:focus-visible, 
textarea:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
  outline: none;
}

input::placeholder {
  color: var(--text-secondary);
}

.helper { 
  color: var(--text-secondary); 
  font-size: 13px; 
  margin: 0;
  display: block;
}

.result { 
  font-weight: 700; 
  font-size: 18px;
}

.success { 
  color: var(--success);
}

.warning { 
  color: var(--warning);
}

.error { 
  color: var(--error);
}

.skeleton { position: relative; overflow: hidden; background: rgba(255,255,255,0.04); border-radius: 8px; min-height: 14px; }
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer { 100% { transform: translateX(100%); } }

.flex { display: flex; align-items: center; gap: 10px; }
.space-between { justify-content: space-between; }

footer {
  margin-top: 48px;
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  text-align: center;
}

/* Student tools - focused calculators */
body[data-page="students"] {
  padding: 0;
}

body[data-page="students"] main {
  padding: 32px 20px;
  max-width: 900px;
  margin: 0 auto;
}

.student-main {
  margin-top: 0;
  display: grid;
  gap: 16px;
}

.tab-bar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}

.tab {
  padding: 12px 16px;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.tab.active {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.panel { 
  display: none;
}

.panel.active { 
  display: block;
}

.calc {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 20px;
}

.calc h2 {
  margin: 0;
  font-size: 24px;
  color: var(--text);
  font-weight: 700;
}

.grid-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.calc input,
.calc select,
.calc button {
  font-size: 14px;
  padding: 12px;
}

.calc .btn { 
  width: 100%;
}

.table-list {
  display: grid;
  gap: 12px;
}

.table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 14px;
}

.calc-actions {
  display: grid;
  gap: 16px;
  align-items: flex-start;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.result-large {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.result-large span {
  color: var(--secondary);
}

.status { 
  font-size: 13px; 
  color: var(--text-secondary);
  display: block;
}

@media (max-width: 640px) {
  .table-row { 
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .calc { padding: 20px; }
}

@media (max-width: 720px) {
  body { padding: 0; }
  .nav { 
    flex-wrap: nowrap;
    align-items: center;
    position: sticky;
    gap: 6px;
    padding: 8px 12px;
    overflow-x: auto;
  }
  .brand {
    font-size: 13px;
    gap: 4px;
    flex-shrink: 0;
  }
  .nav-links { 
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 4px;
    width: auto;
    flex-shrink: 0;
  }
  .nav-links a {
    font-size: 11px;
    padding: 4px 8px;
    white-space: nowrap;
  }
  .theme-toggle {
    font-size: 11px;
    padding: 4px 8px;
    flex-shrink: 0;
  }
  h1 { 
    font-size: 32px;
  }
  .section,
  .carousel-shell,
  .hero {
    padding: 0 16px;
  }
  .card-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

footer {
  margin-top: 48px;
  color: var(--text-secondary);
  font-size: 13px;
  border-top: 1px solid var(--border);
  padding: 32px 20px;
  text-align: center;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

footer a {
  color: var(--primary);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Remove old page-specific backdrops */
body[data-page="weather"] {
  background: var(--bg);
}

body[data-page="finance"] {
  background: var(--bg);
}

body[data-page="students"] {
  background: var(--bg);
}

/* Remove old glass morphism styles */
[data-page="weather"] .card,
[data-page="finance"] .card,
[data-page="students"] .card {
  color: var(--text);
  background: var(--bg-subtle);
  border-color: var(--border);
}

[data-page="weather"] .card p,
[data-page="finance"] .card p,
[data-page="students"] .card p,
[data-page="weather"] .helper,
[data-page="finance"] .helper,
[data-page="students"] .helper {
  color: var(--text-secondary);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
