/* ─── ROOT VARIABLES ─────────────────────── */
:root {
  --bg:        #0a0a0f;
  --surface:   #12121a;
  --surface2:  #1a1a26;
  --border:    #2a2a3d;
  --accent:    #00b894;
  --accent2:   #00cec9;
  --danger:    #e74c3c;
  --warning:   #f39c12;
  --text:      #eaeaea;
  --muted:     #888;
  --radius:    12px;
}

/* ─── RESET & BASE ───────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 24px 20px;
  min-height: 100vh;
  line-height: 1.5;
}

/* ─── HEADINGS ───────────────────────────── */
h1 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  text-align: center;
  font-size: 1.1rem;
  color: var(--muted);
  margin: 20px 0 12px;
  letter-spacing: 0.05em;
}

/* ─── BACK LINK ──────────────────────────── */
.back {
  display: inline-block;
  text-align: center;
  width: 100%;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 20px;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}

.back:hover {
  opacity: 0.7;
}

/* ─── TABS ───────────────────────────────── */
.tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tabs button {
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.tabs button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: translateY(-2px);
}

/* ─── INPUT BOX ──────────────────────────── */
.input-box {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

input {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  flex: 1;
  min-width: 140px;
}

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

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

/* date input icon color fix */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

button {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}

button:hover {
  background: var(--accent2);
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
}

/* ─── EXPORT BOX ─────────────────────────── */
.export-box {
  text-align: center;
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── CLEAR ALL BUTTON ───────────────────── */
.clear-btn {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}

.clear-btn:hover {
  background: var(--danger);
  color: white;
  transform: translateY(-2px);
}

/* ─── TABLE WRAPPER ──────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* ─── TABLE ──────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

thead tr {
  background: var(--surface);
}

th {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
  padding: 14px 10px;
  text-align: center;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
}

td {
  border: 1px solid var(--border);
  padding: 12px 10px;
  text-align: center;
  font-size: 0.88rem;
  vertical-align: middle;
  transition: background 0.2s;
}

tr:hover td {
  background: var(--surface2);
}

.chapter {
  text-align: left;
  min-width: 140px;
}

.chapter b {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.chapter small {
  color: var(--accent);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─── REVISION CELL LABEL ────────────────── */
td label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--muted);
}

td label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  min-width: unset;
  flex: unset;
}

/* ─── ROW HIGHLIGHTS ─────────────────────── */
td.today {
  background: rgba(0, 184, 148, 0.12) !important;
  border-left: 3px solid var(--accent);
}

td.overdue {
  background: rgba(231, 76, 60, 0.1) !important;
  border-left: 3px solid var(--danger);
}

td.overdue label {
  color: var(--danger);
}

/* ─── PROGRESS BAR ───────────────────────── */
.progress {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 6px;
}

.progress div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* ─── EMPTY STATE ────────────────────────── */
td[colspan] {
  color: var(--muted);
  font-size: 1rem;
  padding: 40px !important;
  border: none !important;
}

/* ─── SCROLLBAR ──────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ─── MOBILE ─────────────────────────────── */
@media (max-width: 600px) {
  body {
    padding: 16px 12px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .input-box {
    flex-direction: column;
    padding: 12px;
  }

  input {
    width: 100%;
  }

  .tabs button {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}
/* ─── SUBTITLE ───────────────────────────── */
.subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
  margin-bottom: 20px;
}

/* ─── STATS BAR ──────────────────────────── */
.stats-bar {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 24px;
  text-align: center;
  min-width: 100px;
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-3px);
}

.stat-number {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* ─── FOOTER ─────────────────────────────── */
footer {
  text-align: center;
  padding: 30px 20px 16px;
  color: var(--muted);
  font-size: 0.85rem;
}

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

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