:root {
  --tt-bg: linear-gradient(180deg, #fff7f1 0%, #fefdf8 40%, #fefefe 100%);
  --tt-card: rgba(255, 255, 255, 0.92);
  --tt-muted: #64748b;
}

body.theme-neon.timetable-body,
body.timetable-body.theme-neon {
  --tt-bg:
    radial-gradient(circle at 12% 10%, rgba(78, 240, 255, 0.12), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(96, 139, 255, 0.14), transparent 30%),
    linear-gradient(180deg, #06131f 0%, #07121c 100%);
  --tt-card: rgba(9, 24, 38, 0.85);
  --tt-muted: #a9c7ca;
}

body.timetable-body {
  font-family: "Baloo 2", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--tt-bg);
  min-height: 100vh;
  color: #0f172a;
  margin: 0;
}

body.theme-neon.timetable-body,
body.timetable-body.theme-neon {
  color: #e6f4ff;
}

.timetable-shell {
  width: min(1800px, 98vw);
  margin: 0 auto;
  padding: 40px clamp(18px, 4vw, 60px) 80px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.schedule-hero {
  background: var(--tt-card);
  border-radius: 32px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.schedule-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.schedule-hero p {
  margin: 0;
  color: var(--tt-muted);
}

body.theme-neon .schedule-hero {
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(126, 240, 255, 0.14);
}

.hero-highlights {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-chip {
  background: rgba(16, 185, 129, 0.12);
  color: #0f766e;
  padding: 12px 18px;
  border-radius: 20px;
  font-weight: 600;
}

body.theme-neon .hero-chip {
  background: rgba(108, 242, 223, 0.16);
  color: #6cf2df;
  border: 1px solid rgba(126, 240, 255, 0.2);
}

.schedule-board {
  background: var(--tt-card);
  border-radius: 28px;
  padding: 24px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05), 0 18px 48px rgba(15, 23, 42, 0.08);
  width: 100%;
}

body.theme-neon .schedule-board {
  box-shadow: inset 0 0 0 1px rgba(126, 240, 255, 0.12), 0 20px 50px rgba(0, 0, 0, 0.35);
}

.board-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}

.board-header h2 {
  margin: 0;
}

.board-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.share-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--tt-muted);
}

.share-badge {
  padding: 10px 16px;
  background: #dcfce7;
  color: #15803d;
  border-radius: 16px;
  font-size: 0.9rem;
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #bbf7d0;
}

.share-badge.is-error {
  background: #fee2e2;
  border-color: #fecaca;
  color: #b91c1c;
}

.share-badge.is-info {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #0369a1;
}

.share-badge.is-success {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #166534;
}

body.theme-neon .share-badge,
body.timetable-body.theme-neon .share-badge {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(74, 222, 128, 0.24);
  color: #86efac;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.theme-neon .share-badge.is-error,
body.timetable-body.theme-neon .share-badge.is-error {
  background: rgba(248, 113, 113, 0.16);
  border-color: rgba(248, 113, 113, 0.28);
  color: #fca5a5;
}

body.theme-neon .share-badge.is-info,
body.timetable-body.theme-neon .share-badge.is-info {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.26);
  color: #7dd3fc;
}

body.theme-neon .share-badge.is-success,
body.timetable-body.theme-neon .share-badge.is-success {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(74, 222, 128, 0.24);
  color: #86efac;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 18px;
  overflow-x: hidden;
}

.day-column {
  background: #f8fafc;
  border-radius: 20px;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  min-height: 220px;
}

body.theme-neon .day-column {
  background: rgba(8, 22, 34, 0.8);
  border-color: rgba(126, 240, 255, 0.12);
}

body.theme-neon .day-column.is-today,
body.timetable-body.theme-neon .day-column.is-today {
  background:
    radial-gradient(circle at top right, rgba(108, 242, 223, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(10, 32, 46, 0.96) 0%, rgba(8, 22, 34, 0.92) 100%);
  border-color: rgba(108, 242, 223, 0.36);
  box-shadow: inset 0 0 0 1px rgba(108, 242, 223, 0.16), 0 0 0 1px rgba(108, 242, 223, 0.08), 0 18px 38px rgba(0, 0, 0, 0.35);
}

body.theme-neon .day-column.is-today h3,
body.timetable-body.theme-neon .day-column.is-today h3 {
  color: #9ffcf1;
}

body.theme-neon .day-today-badge,
body.timetable-body.theme-neon .day-today-badge {
  background: linear-gradient(135deg, rgba(108, 242, 223, 0.18), rgba(126, 240, 255, 0.22));
  color: #9ffcf1;
  border-color: rgba(126, 240, 255, 0.22);
  box-shadow: 0 0 18px rgba(108, 242, 223, 0.12);
}

.day-column h3 {
  margin: 0;
  font-size: 1rem;
}

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

.day-today-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(45, 212, 191, 0.22));
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid rgba(15, 118, 110, 0.14);
}

.day-column.is-today {
  background: linear-gradient(180deg, #ecfeff 0%, #f8fafc 100%);
  border-color: rgba(15, 118, 110, 0.22);
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.18), 0 18px 38px rgba(15, 118, 110, 0.08);
}

.day-column.is-today h3 {
  color: #0f766e;
}

.day-add {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #f97316, #fb923c);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-6px);
  transition: all 0.2s ease;
  box-shadow: 0 6px 16px rgba(249, 115, 22, 0.35);
}

.day-column:hover .day-add,
.day-column:focus-within .day-add {
  opacity: 1;
  transform: translateY(0);
}

.slot-card {
  background: #fff;
  border-radius: 16px;
  padding: 12px 14px;
  border-left: 4px solid #fb923c;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  position: relative;
}

body.theme-neon .slot-card {
  background: rgba(10, 28, 42, 0.9);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

.slot-card[data-tone="focus"] {
  border-color: #38bdf8;
}

.slot-card[data-tone="fun"] {
  border-color: #a78bfa;
}

.slot-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
}

.slot-delete {
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.slot-delete:hover {
  background: rgba(239, 68, 68, 0.2);
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.25);
  transform: translateY(-1px);
}

body.theme-neon .slot-delete,
body.timetable-body.theme-neon .slot-delete {
  background: rgba(248, 113, 113, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.slot-time {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

body.theme-neon .slot-time {
  color: rgba(191, 219, 234, 0.75);
}

.slot-title {
  margin: 6px 0 2px;
  font-weight: 700;
  color: #0f172a;
}

.slot-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--tt-muted);
}

.board-footer {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--tt-muted);
}

body.theme-neon .board-footer {
  color: rgba(191, 219, 234, 0.85);
  background: rgba(8, 22, 34, 0.85);
  border: 1px solid rgba(126, 240, 255, 0.12);
  border-radius: 16px;
  padding: 12px 16px;
}

.deadline-board {
  background: var(--tt-card);
  border-radius: 28px;
  padding: 24px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05), 0 18px 48px rgba(15, 23, 42, 0.08);
  width: 100%;
}

body.theme-neon .deadline-board {
  border: 1px solid rgba(126, 240, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(126, 240, 255, 0.08), 0 20px 50px rgba(0, 0, 0, 0.35);
}

.deadline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.deadline-header h2 {
  margin: 0;
}

.deadline-header p {
  margin: 4px 0 0;
  color: var(--tt-muted);
}

.deadline-table {
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.deadline-head,
.deadline-row {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr 1fr 1fr;
  padding: 14px 18px;
  gap: 12px;
  align-items: center;
}

.deadline-head {
  background: #f1f5f9;
  font-weight: 600;
  color: #475569;
}

body.theme-neon .deadline-head {
  background: rgba(12, 30, 46, 0.9);
  color: rgba(191, 219, 234, 0.95);
}

.deadline-row {
  background: #fff;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.deadline-row:nth-child(even) {
  background: #f9fafb;
}

body.theme-neon .deadline-row {
  background: rgba(9, 24, 38, 0.9);
  border-top: 1px solid rgba(126, 240, 255, 0.08);
}

body.theme-neon .deadline-row:nth-child(even) {
  background: rgba(8, 22, 34, 0.85);
}

.deadline-empty {
  text-align: center;
  padding: 28px;
  color: var(--tt-muted);
}

.status-pill {
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.status-pill.is-working {
  background: #e2e8f0;
  color: #475569;
}

.status-pill.is-pending {
  background: #f8fafc;
  color: #475569;
}

.status-pill.is-done {
  background: #d1fae5;
  color: #15803d;
}

.status-pill.is-overdue {
  background: #fee2e2;
  color: #b91c1c;
}

body.theme-neon .status-pill.is-working,
body.timetable-body.theme-neon .status-pill.is-working {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

body.theme-neon .status-pill.is-pending,
body.timetable-body.theme-neon .status-pill.is-pending {
  background: rgba(191, 219, 234, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

body.theme-neon .status-pill.is-done,
body.timetable-body.theme-neon .status-pill.is-done {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
  border: 1px solid rgba(74, 222, 128, 0.24);
}

body.theme-neon .status-pill.is-overdue,
body.timetable-body.theme-neon .status-pill.is-overdue {
  background: rgba(248, 113, 113, 0.16);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.26);
}

.deadline-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.deadline-delete {
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.deadline-delete:hover {
  background: rgba(239, 68, 68, 0.2);
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.25);
  transform: translateY(-1px);
}

body.theme-neon .deadline-delete,
body.timetable-body.theme-neon .deadline-delete {
  background: rgba(248, 113, 113, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.deadline-done-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #166534;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid rgba(34, 197, 94, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.deadline-done-badge i {
  font-size: 0.74rem;
}

body.theme-neon .deadline-done-badge,
body.timetable-body.theme-neon .deadline-done-badge {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.18) 0%, rgba(74, 222, 128, 0.2) 100%);
  color: #86efac;
  border-color: rgba(74, 222, 128, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.deadline-note {
  display: block;
  font-size: 0.8rem;
  color: var(--tt-muted);
}

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

.timeline-card {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  padding: 16px;
  border: 1px dashed rgba(15, 23, 42, 0.08);
}

body.theme-neon .timeline-card {
  background: rgba(9, 24, 38, 0.85);
  border: 1px dashed rgba(126, 240, 255, 0.2);
  color: rgba(191, 219, 234, 0.9);
}

.timeline-card strong {
  display: block;
  margin-bottom: 8px;
}

.tt-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 90;
}

.tt-modal-backdrop[hidden] {
  display: none;
}

.tt-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  z-index: 91;
}

.tt-modal[hidden] {
  display: none;
}

.tt-confirm {
  z-index: 150;
}

.tt-modal-card {
  background: #fff;
  border-radius: 24px;
  padding: 24px;
  width: min(420px, 90vw);
  max-height: min(calc(100vh - 48px), 720px);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.tt-confirm-card {
  width: min(380px, 92vw);
  padding: 22px 22px 20px;
  text-align: center;
  align-items: center;
  gap: 12px;
}

.tt-confirm-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.tt-confirm-card header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tt-confirm-card header h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.tt-confirm-card header p {
  margin: 0;
  color: var(--tt-muted);
  font-size: 0.95rem;
}

.tt-confirm-card .tt-modal-actions {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
}

.tt-confirm-card .btn-ghost {
  min-width: 110px;
}

.tt-confirm-card .btn-danger {
  min-width: 110px;
}

.tt-confirm .tt-modal-card {
  width: min(380px, 92vw);
  padding: 22px 22px 20px;
  text-align: center;
  align-items: center;
  gap: 12px;
}

.tt-confirm .tt-modal-card header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tt-confirm .tt-modal-card header h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.tt-confirm .tt-modal-card header p {
  margin: 0;
  color: var(--tt-muted);
  font-size: 0.95rem;
}

.tt-confirm .tt-modal-actions {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
}

.tt-confirm [data-tt-confirm] {
  min-width: 112px;
  min-height: 42px;
  padding: 10px 18px;
  font-size: 0.95rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.theme-neon .tt-modal-card {
  background: rgba(9, 24, 38, 0.92);
  border: 1px solid rgba(126, 240, 255, 0.14);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  color: #e6f4ff;
}

body.theme-neon .tt-confirm-icon,
body.timetable-body.theme-neon .tt-confirm-icon {
  background: rgba(248, 113, 113, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.btn-danger {
  background: #ef4444;
  color: #fff;
  border: none;
}

.btn-danger:hover {
  background: #dc2626;
}

body.theme-neon .btn-danger,
body.timetable-body.theme-neon .btn-danger {
  background: linear-gradient(135deg, #f87171, #ef4444);
  box-shadow: 0 10px 22px rgba(248, 113, 113, 0.35);
}

.tt-modal-card header h3 {
  margin: 0;
}

.tt-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}

.tt-field-inline {
  flex-direction: row;
  gap: 12px;
}

.tt-field-inline label {
  flex: 1;
}

.tt-field input,
.tt-field textarea,
.tt-field select {
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 1rem;
}

.tt-modal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  padding-top: 2px;
}

.tt-modal-actions .btn-primary,
.tt-modal-actions .btn-ghost {
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  line-height: 1;
  font-weight: 700;
}

.tt-modal-actions .btn-ghost {
  background: #f8fafc;
  color: #334155;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.tt-modal-actions .btn-ghost:hover {
  background: #eef2f7;
}

body.theme-neon .tt-modal-actions .btn-ghost,
body.timetable-body.theme-neon .tt-modal-actions .btn-ghost {
  background: rgba(148, 163, 184, 0.08);
  color: #d8eefe;
  border-color: rgba(126, 240, 255, 0.18);
}

body.theme-neon .tt-modal-actions .btn-ghost:hover,
body.timetable-body.theme-neon .tt-modal-actions .btn-ghost:hover {
  background: rgba(126, 240, 255, 0.12);
}

@media (max-width: 720px) {
  .tt-modal {
    padding: 16px;
    align-items: flex-start;
  }

  .tt-modal-card {
    width: min(100%, 460px);
    max-height: calc(100vh - 32px);
    margin: 0 auto;
  }

  .tt-field-inline {
    flex-direction: column;
  }

  .tt-modal-actions {
    justify-content: stretch;
  }

  .tt-modal-actions .btn-primary,
  .tt-modal-actions .btn-ghost {
    flex: 1 1 100%;
    width: 100%;
  }

  .board-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
