/* =====================================================
   Compliance calendar — /tools/compliance-calendar.php
   Uses the tokens declared in style.css (--navy-*, --gold-*, --line, etc.).
   Nothing here is used by any other page.
   ===================================================== */

/* ---------- Intro + filter panel ---------- */
.cal-intro { padding-bottom: 1rem; }
.cal-intro .section-head { max-width: 60ch; }
.cal-intro h1 { margin-bottom: 0.6rem; }

.cal-filters {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  margin-top: 1.6rem;
}

.cal-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.cal-field { display: flex; flex-direction: column; gap: 0.35rem; }
.cal-field label { font-weight: 600; font-size: 0.88rem; color: var(--navy-800); }

.cal-field select {
  font: inherit;
  font-size: 0.95rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  width: 100%;
}
.cal-field select:focus-visible,
.cal-check input:focus-visible {
  outline: 3px solid var(--gold-400);
  outline-offset: 2px;
}

.cal-hint { font-size: 0.78rem; color: var(--muted); }

.cal-checks {
  border: 0;
  margin-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
}
.cal-checks legend {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--navy-800);
  margin-bottom: 0.5rem;
  padding: 0;
}
.cal-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.3rem 0;
}
.cal-check input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: var(--navy-700); }

.cal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.2rem;
}

.cal-selected {
  margin-top: 0.9rem;
  font-size: 0.84rem;
  color: var(--muted);
}
.cal-selected strong { color: var(--navy-700); font-weight: 600; }

/* ---------- Results ---------- */
.cal-results-section { padding-top: 1rem; }
.cal-results-head { max-width: 60ch; margin-bottom: 1.6rem; }

.cal-alert {
  background: var(--gold-100);
  border-left: 4px solid var(--gold-500);
  padding: 0.8rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.4rem;
  font-size: 0.92rem;
}

.cal-months { display: flex; flex-direction: column; gap: 2rem; }

.cal-month-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gold-500);
  margin-bottom: 0.9rem;
}
.cal-month-count {
  background: var(--navy-800);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
}

/* Wide content scrolls inside its own box. The page body never scrolls
   sideways — that is what the max-width on the container is for. */
.cal-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
}

.cal-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.cal-table thead th {
  text-align: left;
  background: var(--navy-800);
  color: #fff;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.65rem 0.9rem;
  white-space: nowrap;
}
.cal-table tbody tr + tr { border-top: 1px solid var(--line); }
.cal-table tbody tr:nth-child(even) { background: var(--bg-soft); }
.cal-table td { padding: 0.85rem 0.9rem; vertical-align: top; }

.cal-col-date { width: 4.5rem; }
.cal-col-date time { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.cal-day {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy-800);
}
.cal-dow { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

.cal-col-form { width: 15rem; }
.cal-form-name {
  display: block;
  font-weight: 700;
  color: var(--navy-800);
  margin-bottom: 0.35rem;
}
.cal-period { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 0.35rem; }

.cal-tag {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: var(--line);
  color: var(--navy-700);
  margin-right: 0.25rem;
}
.cal-tag-gst        { background: #dbeafe; color: #1e40af; }
.cal-tag-income-tax { background: #dcfce7; color: #166534; }
.cal-tag-roc-mca    { background: #fee2e2; color: #991b1b; }
.cal-tag-payroll    { background: #ede9fe; color: #5b21b6; }
.cal-tag-ngo        { background: var(--gold-100); color: #7c5c00; }
.cal-tag-optional   { background: #f1f5f9; color: var(--muted); }

.cal-desc { margin-bottom: 0.4rem; }
.cal-penalty {
  font-size: 0.84rem;
  color: #8a1c1c;
  background: #fff5f5;
  border-left: 3px solid var(--red);
  padding: 0.4rem 0.6rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: 0.4rem;
}
.cal-note {
  font-size: 0.82rem;
  color: #7c5c00;
  background: var(--gold-100);
  border-left: 3px solid var(--gold-500);
  padding: 0.4rem 0.6rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: 0.4rem;
}
.cal-docs { font-size: 0.82rem; color: var(--muted); }

/* ---------- Download + empty + disclaimer ---------- */
.cal-download {
  margin-top: 2.2rem;
  background: var(--navy-800);
  color: #dbe6f2;
  border-radius: var(--radius);
  padding: 1.8rem;
  text-align: center;
}
.cal-download h3 { color: #fff; margin-bottom: 0.5rem; }
.cal-download p { max-width: 58ch; margin: 0 auto 1.1rem; }
.cal-download-note { font-size: 0.82rem; color: #9fb3c8; margin-top: 1rem; margin-bottom: 0; }

.cal-empty {
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}
.cal-empty h2 { margin-bottom: 0.7rem; }
.cal-empty p { max-width: 60ch; margin: 0 auto 0.9rem; }
.cal-empty .btn { margin: 0.3rem 0.25rem 0; }

.cal-disclaimer {
  margin-top: 2.2rem;
  border-top: 1px solid var(--line);
  padding-top: 1.4rem;
  font-size: 0.84rem;
  color: var(--muted);
}
.cal-disclaimer h3 { font-size: 1rem; margin-bottom: 0.7rem; }
.cal-disclaimer ul { display: flex; flex-direction: column; gap: 0.5rem; max-width: 78ch; }
.cal-disclaimer li { padding-left: 1rem; position: relative; }
.cal-disclaimer li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--gold-500);
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .cal-filters { padding: 1rem; }
  .cal-actions .btn { width: 100%; text-align: center; }
  .cal-download { padding: 1.3rem; }
  .cal-month-head { font-size: 1.1rem; }

  /* On a phone the three-column table would force the visitor to scroll
     sideways just to read what a form IS, which is the column that matters
     most. Below 640px each row is restacked as a card instead: the date sits
     inline with the form name, and the explanation runs full width beneath.
     The scroll container stays in place for anything that still overflows. */
  .cal-table-scroll { overflow-x: visible; border: 0; box-shadow: none; background: none; }
  .cal-table { min-width: 0; display: block; }
  .cal-table thead { display: none; }
  .cal-table tbody, .cal-table tbody tr { display: block; }
  .cal-table tbody tr {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 0.9rem;
    margin-bottom: 0.8rem;
  }
  .cal-table tbody tr:nth-child(even) { background: var(--bg); }
  .cal-table tbody tr + tr { border-top: 1px solid var(--line); }
  .cal-table td { display: block; padding: 0; width: auto; }

  /* Date badge floats beside the form name rather than owning a column. */
  .cal-col-date { float: left; margin: 0 0.8rem 0.3rem 0; }
  .cal-col-date time {
    background: var(--navy-800);
    border-radius: 10px;
    padding: 0.35rem 0.55rem;
    min-width: 3rem;
  }
  .cal-day { color: #fff; font-size: 1.35rem; }
  .cal-dow { color: var(--gold-400); }

  .cal-col-form { overflow: hidden; }        /* contain the float */
  .cal-col-what { clear: both; padding-top: 0.6rem; }
}
