:root {
  --af-blue: #00308F;
  --dark-blue: #002554;
  --yellow: #FFD400;
  --black: #090909;
  --bg: #f3f6fb;
  --card: #ffffff;
  --ink: #111827;
  --muted: #64748b;
  --line: #cbd5e1;
  --danger: #b91c1c;
  --good: #15803d;
  --danger-soft: #fee2e2;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

button {
  font: inherit;
  font-weight: 800;
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  background: var(--af-blue);
  color: white;
  cursor: pointer;
}

button:hover { filter: brightness(1.08); }
button.secondary { background: #334155; }
button.active-filter { background: var(--danger); }
button.link-button {
  background: transparent;
  color: var(--af-blue);
  padding: 8px;
  margin-top: 8px;
  box-shadow: none;
}

input, select {
  font: inherit;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  width: 100%;
}

label {
  display: block;
  margin: 12px 0;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
}

.hidden { display: none !important; }

.auth-page {
  min-height: 100vh;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(255,212,0,.22), transparent 34%),
    linear-gradient(135deg, var(--dark-blue), var(--af-blue));
}

.auth-card {
  width: min(500px, 94vw);
  background: white;
  padding: 34px;
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
  border: 7px solid var(--yellow);
  text-align: center;
}

.home-card {
  width: min(860px, 94vw);
}

.intro-pill {
  display: inline-block;
  margin: 0 0 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e0ecff;
  color: var(--dark-blue);
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: 13px;
}

.home-copy {
  max-width: 720px;
  margin: 0 auto;
  text-align: left;
}

.home-copy p {
  margin: 12px 0;
  color: #263244;
  font-size: 17px;
  line-height: 1.45;
}

.home-copy .caveat {
  border-left: 5px solid var(--yellow);
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
}

.auth-card h1 {
  margin: 10px 0 16px;
  color: var(--dark-blue);
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.1;
}

.joke, .muted {
  color: var(--muted);
  font-size: 17px;
}

.home-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 420px;
  margin: 28px auto 0;
}

.home-buttons button {
  min-height: 50px;
  font-size: 18px;
}

.bee-badge {
  display: inline-grid;
  place-items: center;
  width: 122px;
  height: 122px;
  border: 10px solid var(--black);
  background: repeating-linear-gradient(45deg, var(--yellow) 0 16px, var(--black) 16px 32px);
  color: white;
  text-shadow: 0 2px 5px black;
  font-size: 38px;
  font-weight: 900;
  border-radius: 999px;
  margin: 0 auto 14px;
}

.auth-message {
  min-height: 24px;
  font-weight: 800;
}

.auth-message.error { color: var(--danger); }
.auth-message.good { color: var(--good); }

.inline {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: auto;
}

.inline input {
  width: auto;
}

.auth-check {
  font-weight: 800;
  justify-content: center;
  width: 100%;
}

.dashboard {
  max-width: 1920px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 22px 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 12px 6px 18px;
}

.topbar h1 { margin: 0; font-size: 30px; }
.topbar p { margin: 5px 0 0; font-size: 16px; color: var(--muted); font-weight: 700; }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.full-row { grid-column: 1 / -1; }

.task-box {
  position: relative;
  background: var(--card);
  border: 7px solid var(--af-blue);
  border-radius: 16px;
  padding: 18px;
  min-height: 165px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(15,23,42,.08);
  font-size: 16px;
}

.task-box h2 {
  margin: 0 0 9px;
  font-size: 22px;
  color: var(--dark-blue);
}

.task-box .status {
  font-size: 18px;
  min-height: 28px;
}

.task-box label, .task-box button, .task-box input[type=file] { font-size: 16px; }
.status.good { color: var(--good); font-weight: 800; }
.status.danger { color: var(--danger); font-weight: 900; }
.status.warn { color: #9a6700; font-weight: 900; }

.task-box.hazard {
  border: 0;
  padding: 25px;
}

.task-box.hazard::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 9px;
  border-radius: 16px;
  background: repeating-linear-gradient(
    135deg,
    var(--yellow) 0 22px,
    var(--yellow) 22px 44px,
    var(--black) 44px 66px,
    var(--black) 66px 88px
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.task-box.hazard.flip::before {
  background: repeating-linear-gradient(
    135deg,
    var(--black) 0 22px,
    var(--black) 22px 44px,
    var(--yellow) 44px 66px,
    var(--yellow) 66px 88px
  );
}

.filter-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.filter-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  font-weight: 800;
}

.due-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 17px;
}

.due-table th {
  text-align: left;
  background: var(--dark-blue);
  color: white;
  padding: 9px;
}

.due-table td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
}

.due-table td:first-child {
  width: 90px;
  font-weight: 900;
  text-align: right;
}

.due-table tr:nth-child(even) td { background: #f8fafc; }

.modal {
  border: 0;
  border-radius: 18px;
  padding: 24px;
  width: min(520px, 92vw);
  box-shadow: 0 26px 90px rgba(0,0,0,.35);
}

.modal::backdrop { background: rgba(15,23,42,.55); }
.modal h2 { margin-top: 0; color: var(--af-blue); }
.modal label { font-weight: 700; }
.modal input, .modal select { width: 100%; margin-top: 4px; }
.modal.wide { width: min(850px, 94vw); }
.modal.alert { border: 9px solid var(--yellow); }
.row-right { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.recurring-modal {
  width: min(1200px, 96vw);
  height: min(900px, 92vh);
}

.tracker-controls {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin: 10px 0 12px;
}

.tracker-controls .inline { margin: 0; }

.recurring-cards {
  margin-top: 12px;
  max-height: calc(92vh - 205px);
  overflow: auto;
  padding-right: 6px;
}

.req-card {
  border: 4px solid var(--af-blue);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  margin: 12px 0;
}

.req-card.hidden-na {
  border-color: #777;
  opacity: .7;
}

.req-card.req-due {
  border-color: var(--danger);
  background: #fff7f7;
}

.req-card.flash-due {
  animation: recurringDuePulse .9s infinite alternate;
}

@keyframes recurringDuePulse {
  from {
    box-shadow: 0 0 0 0 rgba(185, 28, 28, .18);
    border-color: var(--danger);
    background: #fff;
  }
  to {
    box-shadow: 0 0 0 8px rgba(185, 28, 28, .22);
    border-color: var(--yellow);
    background: var(--danger-soft);
  }
}

.due-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 13px;
  vertical-align: middle;
}

.req-card h3 {
  margin: 0 0 8px;
  color: var(--dark-blue);
}

.req-card .meta {
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 10px;
}

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

.req-actions input {
  width: 165px;
}

@media (max-width: 1000px) {
  .grid { grid-template-columns: 1fr; }
  .full-row { grid-column: auto; }
  .topbar { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
  .home-buttons { grid-template-columns: 1fr; }
  .auth-card { padding: 26px; }
}
