:root {
  --ink: #102234;
  --muted: #607281;
  --brand: #06345f;
  --brand-2: #087db8;
  --mint: #18bfe8;
  --mint-soft: #e0f7ff;
  --gold: #f3c84f;
  --paper: #f4f8fb;
  --white: #ffffff;
  --line: #d9e7ef;
  --danger: #b74444;
  --danger-soft: #fde9e9;
  --shadow: 0 18px 48px rgba(3, 30, 58, 0.12);
  --shadow-lift: 0 26px 70px rgba(3, 30, 58, 0.18);
  --radius: 8px;
  --font-body: Aptos, "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Aptos Display", Aptos, "Segoe UI Variable Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  background:
    linear-gradient(135deg, rgba(224, 247, 255, 0.86), rgba(255, 255, 255, 0) 34%),
    linear-gradient(180deg, #fbfdff, var(--paper));
  letter-spacing: 0;
}

a {
  color: inherit;
}

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

.portal-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 14px clamp(18px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(217, 231, 239, 0.82);
  backdrop-filter: blur(18px);
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--brand);
  text-decoration: none;
}

.portal-brand img {
  flex: 0 0 auto;
}

.portal-brand span {
  display: grid;
  line-height: 1.08;
}

.portal-brand strong {
  font-size: 1.12rem;
  font-weight: 900;
}

.portal-brand small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.portal-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.portal-nav a,
.portal-link {
  padding: 9px 12px;
  color: var(--brand);
  font-size: 0.92rem;
  font-weight: 850;
  text-decoration: none;
  border-radius: 6px;
  transition: background 180ms ease, color 180ms ease, transform 180ms var(--ease-out);
}

.portal-nav a:hover,
.portal-nav a:focus-visible,
.portal-link:hover,
.portal-link:focus-visible {
  color: var(--brand-2);
  background: var(--mint-soft);
  transform: translateY(-1px);
}

.portal-main {
  width: min(100% - 36px, 1180px);
  margin-inline: auto;
  padding-block: 34px 70px;
}

.portal-footer {
  width: min(100% - 36px, 1180px);
  margin-inline: auto;
  padding: 0 0 28px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

.portal-footer a {
  color: var(--brand-2);
  font-weight: 850;
  text-decoration: none;
}

.portal-footer a:hover,
.portal-footer a:focus-visible {
  text-decoration: underline;
}

.portal-alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  color: var(--brand);
  font-weight: 800;
  background: var(--mint-soft);
  border: 1px solid rgba(24, 191, 232, 0.28);
  border-radius: var(--radius);
}

.portal-alert.error {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(183, 68, 68, 0.26);
}

.auth-shell {
  min-height: calc(100vh - 180px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 46px;
  align-items: center;
}

.auth-copy {
  max-width: 640px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--brand-2);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--brand);
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  font-weight: 850;
}

h2 {
  font-size: 1.6rem;
  font-weight: 820;
}

.auth-copy p:not(.eyebrow),
.empty-state {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.portal-card {
  padding: 26px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(217, 231, 239, 0.94);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-card,
.portal-card form,
form.portal-card {
  display: grid;
  gap: 14px;
}

label {
  color: var(--brand);
  font-size: 0.92rem;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  color: var(--ink);
  background: #fbfdfb;
  border: 1px solid #c9dce8;
  border-radius: 6px;
  outline: none;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  background: var(--white);
  border-color: var(--mint);
  box-shadow: 0 0 0 4px rgba(24, 191, 232, 0.16);
}

.portal-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  padding: 11px 16px;
  color: var(--brand);
  font-weight: 900;
  text-decoration: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 180ms var(--ease-out), background 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.portal-button:hover,
.portal-button:focus-visible {
  transform: translateY(-2px);
}

.portal-button.primary {
  color: var(--brand);
  background: var(--gold);
  box-shadow: 0 14px 30px rgba(243, 200, 79, 0.22);
}

.portal-button.secondary {
  color: var(--brand);
  background: var(--mint-soft);
}

.portal-button.danger {
  color: #ffffff;
  background: var(--danger);
}

.portal-button.ghost {
  color: var(--brand);
  background: transparent;
  border: 1px solid var(--line);
}

.portal-button.wide {
  width: 100%;
}

.portal-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
  gap: 22px;
  margin-bottom: 22px;
}

.admin-grid {
  align-items: start;
}

.profile-card {
  min-height: 280px;
}

.profile-list,
.tracker-meta {
  display: grid;
  gap: 12px;
  margin: 24px 0 0;
}

.profile-list div,
.tracker-meta div {
  padding: 14px;
  background: #f5fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  text-transform: uppercase;
}

dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-weight: 800;
}

.tracker-card {
  display: grid;
  gap: 22px;
}

.tracker-head,
.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.status-pill,
.summary-chip {
  flex: 0 0 auto;
  padding: 8px 11px;
  color: var(--brand);
  font-size: 0.86rem;
  font-weight: 900;
  background: var(--mint-soft);
  border-radius: 999px;
}

.summary-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, auto));
  gap: 14px;
  align-items: end;
  margin-top: 24px;
  padding: 16px;
  background: #f5fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.filter-bar div {
  display: grid;
  gap: 7px;
}

.filter-bar .portal-button {
  width: 100%;
}

.status-pill.pause {
  color: #745200;
  background: #fff4c4;
}

.status-pill.idle {
  color: var(--muted);
  background: #eef2ef;
}

.time-display {
  padding: 24px;
  color: var(--brand);
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 6.2rem);
  font-weight: 900;
  line-height: 1;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(224, 247, 255, 0.88), rgba(255, 255, 255, 0.88)),
    #ffffff;
  border: 1px solid rgba(24, 191, 232, 0.22);
  border-radius: var(--radius);
}

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

.end-form {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  margin-top: 18px;
}

th,
td {
  padding: 13px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 950;
  text-transform: uppercase;
  background: #f5fafc;
}

td {
  color: var(--muted);
}

td strong {
  color: var(--brand);
}

.mini-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.mini-list div {
  display: grid;
  gap: 3px;
  padding: 13px;
  background: #f5fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.mini-list strong {
  color: var(--brand);
}

.mini-list span {
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 860px) {
  .portal-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-nav {
    justify-content: flex-start;
  }

  .auth-shell,
  .portal-grid {
    grid-template-columns: 1fr;
  }

  .section-title,
  .tracker-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-group {
    justify-content: flex-start;
  }

  .filter-bar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .portal-main {
    width: min(100% - 24px, 1180px);
  }

  .portal-footer {
    width: min(100% - 24px, 1180px);
    text-align: left;
  }

  .portal-card {
    padding: 20px;
  }

  .portal-nav a {
    padding-inline: 9px;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }
}

@media print {
  :root {
    --ink: #111111;
    --muted: #333333;
    --brand: #111111;
    --line: #cfcfcf;
  }

  body {
    background: #ffffff;
    font-size: 12px;
  }

  .portal-header,
  .portal-footer,
  .portal-alert,
  .no-print,
  .print-button,
  .admin-grid {
    display: none !important;
  }

  .portal-main {
    width: 100%;
    padding: 0;
  }

  .portal-card {
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: row;
    margin-bottom: 14px;
    border-bottom: 1px solid #999999;
    padding-bottom: 10px;
  }

  h1,
  h2 {
    font-size: 20px;
  }

  .summary-chip {
    border: 1px solid #999999;
    background: #ffffff;
  }

  .table-wrap {
    overflow: visible;
  }

  table {
    min-width: 0;
    margin-top: 0;
    font-size: 11px;
  }

  th,
  td {
    padding: 7px 6px;
    border-bottom: 1px solid #d6d6d6;
  }

  th {
    background: #f0f0f0;
  }
}
