/* ============================================================
   AssignmentTracker — design tokens & base
============================================================ */

:root {
  --mint:   #06D6A0;
  --teal:   #118AB2;
  --deep:   #073B4C;
  --amber:  #FFD166;
  --rose:   #EF476F;
  --green:  #34C759;

  --gradient: linear-gradient(135deg, #06D6A0 0%, #118AB2 50%, #073B4C 100%);
  --gradient-soft: linear-gradient(135deg, rgba(6,214,160,0.18), rgba(17,138,178,0.18));

  --bg-0: #050d12;
  --bg-1: #07141c;
  --bg-2: #0a1f2a;

  --text:       rgba(255,255,255,0.96);
  --text-muted: rgba(255,255,255,0.62);
  --text-dim:   rgba(255,255,255,0.36);

  --border:    rgba(255,255,255,0.10);
  --border-2:  rgba(255,255,255,0.16);
  --surface:   rgba(255,255,255,0.04);
  --surface-2: rgba(255,255,255,0.07);
  --surface-3: rgba(255,255,255,0.10);

  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body {
  background:
    radial-gradient(1400px 900px at 18% 12%, rgba(6,214,160,0.18), transparent 65%),
    radial-gradient(1200px 800px at 82% 88%, rgba(17,138,178,0.22), transparent 65%),
    radial-gradient(900px 600px at 60% 50%, rgba(7,59,76,0.40), transparent 70%),
    linear-gradient(135deg, #050d12 0%, #07141c 60%, #0a1f2a 100%);
  background-attachment: fixed;
}

a { color: inherit; }

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.10);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.20); }

/* ============================================================
   Header
============================================================ */

.at-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  max-width: 1400px;
  margin: 0 auto;
}

.at-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.5px;
  font-size: 19px;
  text-decoration: none;
}

.at-logo-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--gradient);
  display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 6px 18px rgba(6,214,160,0.30);
}

.at-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.at-tab {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  letter-spacing: -0.2px;
  transition: all 0.15s;
  white-space: nowrap;
}
.at-tab:hover { color: var(--text); }
.at-tab.active {
  background: var(--gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(6,214,160,0.30);
}

.at-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ============================================================
   Buttons
============================================================ */

.at-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.at-btn:hover {
  background: var(--surface-3);
  transform: translateY(-1px);
}
.at-btn.primary {
  background: var(--gradient);
  border: none;
  box-shadow: 0 8px 24px rgba(6,214,160,0.35);
}
.at-btn.primary:hover {
  box-shadow: 0 12px 32px rgba(6,214,160,0.50);
}
.at-btn.danger {
  color: var(--rose);
  border-color: rgba(239, 71, 111, 0.40);
}
.at-btn.danger:hover {
  background: rgba(239, 71, 111, 0.15);
}
.at-btn.large { padding: 14px 24px; font-size: 15px; }
.at-btn.small { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.at-btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
}

.at-icon-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s;
}
.at-icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

/* ============================================================
   Page chrome
============================================================ */

.at-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 32px 80px;
}

.at-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.at-page-head h1 {
  margin: 0;
  font-size: 36px;
  letter-spacing: -1.2px;
  font-weight: 800;
  line-height: 1;
}

.at-page-head h1 .accent {
  background: var(--gradient);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.at-page-head .sub {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  margin-top: 4px;
  letter-spacing: -0.2px;
}

/* ============================================================
   Stat cards
============================================================ */

.at-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

@media (max-width: 800px) {
  .at-stats { grid-template-columns: repeat(2, 1fr); }
}

.at-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 22px;
  position: relative;
  overflow: hidden;
}
.at-stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.at-stat-value {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1;
  margin-bottom: 4px;
}
.at-stat-meta {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.at-stat.danger .at-stat-value { color: var(--rose); }
.at-stat.warning .at-stat-value { color: var(--amber); }
.at-stat.success .at-stat-value { color: var(--mint); }

/* ============================================================
   Section heads
============================================================ */

.at-section {
  margin-bottom: 28px;
}
.at-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  gap: 12px;
}
.at-section-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.4px;
}
.at-section-meta {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ============================================================
   Assignment row card
============================================================ */

.at-assignment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.at-assignment {
  display: grid;
  grid-template-columns: 4px 28px 1fr auto auto auto;
  gap: 14px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px 12px 0;
  cursor: pointer;
  transition: all 0.12s;
}
.at-assignment:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
}
.at-assignment.done {
  opacity: 0.5;
}
.at-assignment.done .at-a-title {
  text-decoration: line-through;
}
.at-assignment.late .at-a-due {
  color: var(--rose);
  font-weight: 800;
}

.at-class-stripe {
  width: 4px;
  height: 100%;
  min-height: 44px;
  border-radius: 12px 0 0 12px;
}

.at-checkbox {
  width: 22px; height: 22px;
  border: 1.5px solid var(--border-2);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all 0.12s;
  margin-left: 12px;
}
.at-checkbox:hover {
  border-color: var(--mint);
  background: rgba(6,214,160,0.08);
}
.at-checkbox.checked {
  background: var(--mint);
  border-color: var(--mint);
}
.at-checkbox.checked::after {
  content: "✓";
  color: white;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.at-a-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.at-a-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.at-a-meta {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  align-items: center;
}
.at-class-chip {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.at-priority-chip {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 999px;
}
.at-priority-chip.high {
  color: var(--rose);
  background: rgba(239, 71, 111, 0.14);
}
.at-priority-chip.medium {
  color: var(--amber);
  background: rgba(255, 209, 102, 0.14);
}
.at-priority-chip.low {
  color: var(--mint);
  background: rgba(6, 214, 160, 0.14);
}

.at-a-due {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.at-a-due-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.at-a-weight {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.at-a-weight strong {
  color: var(--text);
  font-size: 13px;
}

/* ============================================================
   Empty state
============================================================ */

.at-empty {
  background: var(--surface);
  border: 1px dashed var(--border-2);
  border-radius: 18px;
  padding: 60px 32px;
  text-align: center;
}
.at-empty h3 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.at-empty p {
  margin: 0 0 22px;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  max-width: 440px;
  margin-left: auto; margin-right: auto;
  line-height: 1.5;
}

/* ============================================================
   Calendar
============================================================ */

.at-calendar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}

.at-cal-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 8px;
}
.at-cal-month {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.at-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.at-cal-dow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-align: center;
  padding: 6px 0 10px;
  text-transform: uppercase;
}

.at-cal-day {
  min-height: 96px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.at-cal-day.other { opacity: 0.32; }
.at-cal-day.today {
  border-color: var(--mint);
  box-shadow: inset 0 0 0 1px rgba(6,214,160,0.30);
}
.at-cal-day.weekend {
  background: var(--surface);
}
.at-cal-day-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.at-cal-day.today .at-cal-day-num {
  color: var(--mint);
}

.at-cal-event {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.1px;
  cursor: pointer;
}

/* ============================================================
   Classes page
============================================================ */

.at-classes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.at-class-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.at-class-card-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
}
.at-class-card-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-bottom: 4px;
}
.at-class-card-meta {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 14px;
}
.at-class-card-stats {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.at-class-card-stats strong {
  color: var(--text);
  font-size: 14px;
  display: block;
  margin-top: 1px;
}

/* ============================================================
   Modal
============================================================ */

.at-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: at-fade-in 0.18s ease-out;
}
@keyframes at-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.at-modal {
  background: linear-gradient(180deg, #0d1d28 0%, #07141c 100%);
  border: 1px solid var(--border-2);
  border-radius: 18px;
  padding: 24px;
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
  animation: at-modal-in 0.2s ease-out;
}
@keyframes at-modal-in {
  from { transform: translateY(20px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.at-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.at-modal-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.at-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   Form fields
============================================================ */

.at-field {
  margin-bottom: 16px;
}
.at-field-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.at-input, .at-select, .at-textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  letter-spacing: -0.2px;
  transition: border-color 0.12s;
}
.at-input:focus, .at-select:focus, .at-textarea:focus {
  outline: none;
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(6,214,160,0.15);
}
.at-textarea {
  min-height: 80px;
  resize: vertical;
}
.at-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23ffffff80' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.at-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.at-row.three { grid-template-columns: 1fr 1fr 1fr; }

.at-field-help {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   Color picker (inline swatches)
============================================================ */

.at-color-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.at-color-swatch {
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  position: relative;
}
.at-color-swatch.selected {
  border-color: white;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.2);
}

/* ============================================================
   Detail page
============================================================ */

.at-detail {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
}
@media (max-width: 880px) {
  .at-detail { grid-template-columns: 1fr; }
}

.at-detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
}

.at-detail-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.at-detail-title-row h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.8px;
  font-weight: 800;
  flex: 1;
  min-width: 0;
}

.at-detail-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.at-detail-desc {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
  white-space: pre-wrap;
}

.at-detail-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.at-side-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.at-side-card h4 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ============================================================
   Toast
============================================================ */

.at-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 22px;
  background: var(--gradient);
  color: white;
  font-weight: 700;
  font-size: 14px;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  z-index: 10000;
  animation: at-toast-in 0.22s ease-out;
}
.at-toast.error { background: linear-gradient(135deg, #EF476F, #B5354F); }
@keyframes at-toast-in {
  from { transform: translate(-50%, 16px); opacity: 0; }
  to   { transform: translate(-50%, 0); opacity: 1; }
}

/* ============================================================
   Hero / landing
============================================================ */

.at-landing {
  max-width: 920px;
  margin: 60px auto 0;
  padding: 0 32px;
  text-align: center;
}
.at-landing h1 {
  margin: 0 0 14px;
  font-size: clamp(48px, 7vw, 88px);
  letter-spacing: -2.5px;
  line-height: 1;
  font-weight: 800;
}
.at-landing h1 .accent {
  background: var(--gradient);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
.at-landing p {
  font-size: clamp(18px, 2.2vw, 24px);
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto 32px;
  font-weight: 500;
  line-height: 1.45;
}

/* ============================================================
   Filter row
============================================================ */

.at-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.at-filter-chip {
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s;
  letter-spacing: -0.1px;
}
.at-filter-chip:hover {
  background: var(--surface-2);
  color: var(--text);
}
.at-filter-chip.active {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--border-2);
}

/* ============================================================
   Footer
============================================================ */

.at-footer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
  flex-wrap: wrap;
  gap: 12px;
}
.at-footer a {
  text-decoration: none;
  color: var(--text-muted);
  transition: color 0.15s;
}
.at-footer a:hover { color: var(--text); }
