/* Codeesk Hub.
   Colours follow codeesk.com's "soft professional" palette: deep navy-teal for dark areas,
   sage for accents on dark, slate for links, warm off-white pages, and the blue code-bracket mark.
   Bootstrap 5.3 supplies the grid and form controls; everything visual is set here.
   Phone-first: the sidebar appears from 992px, tables become cards below 768px. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../lib/inter/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../lib/inter/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root,
[data-bs-theme="light"] {
  /* dark areas: sidebar, dashboard band, sign-in panel (the website's hero colours) */
  --navy-950: #050b18;
  --navy-900: #0a1729;
  --navy-800: #122a3b;
  --sage: #90c4bf;
  --sage-light: #a3d0cc;
  --teal: #275b5c;
  --logo-blue: #1a56db;

  /* light pages */
  --ink: #0c1830;
  --muted: #5b6a7d;
  --line: #dce3e7;
  --line-strong: #c3d0cf;
  --paper: #f7f5f0;
  --surface: #fdfcfa;
  --surface-2: #f1f4f3;
  --field: #ffffff;

  --primary: #122a3b;
  --primary-hover: #1d3d53;
  --primary-active: #0a1729;
  --primary-text: #f7f5f0;
  --accent: #4b677d;

  --danger: #b93a26;
  --danger-soft: #fbece8;
  --warn: #8a5a0b;
  --warn-soft: #fbf0d6;
  --info: #275b5c;
  --info-soft: #e3efec;
  --ok: #285849;
  --ok-soft: #e8f2ed;

  --radius: 14px;
  --radius-sm: 8px;
  --side-width: 248px;

  --bs-body-font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--paper);
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-bg: var(--surface-2);
  --bs-link-color-rgb: 75, 103, 125;
  --bs-link-hover-color-rgb: 39, 91, 92;
  --bs-border-radius: var(--radius-sm);
}

[data-bs-theme="dark"] {
  --ink: #f2f0ea;
  --muted: #9fb0c2;
  --line: #1a2d3d;
  --line-strong: #2b4355;
  --paper: #050b18;
  --surface: #0a1729;
  --surface-2: #122a3b;
  --field: #071120;

  /* on dark, the website's main button is off-white with dark text */
  --primary: #edf2f1;
  --primary-hover: #fbfaf7;
  --primary-active: #dbe5e3;
  --primary-text: #172638;
  --accent: #a3d0cc;

  --danger: #ff9c8c;
  --danger-soft: #3a1714;
  --warn: #f0c877;
  --warn-soft: #33270c;
  --info: #a3d0cc;
  --info-soft: #12303a;
  --ok: #8fd6b6;
  --ok-soft: #0e2c22;

  --bs-body-color: var(--ink);
  --bs-body-bg: var(--paper);
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-bg: var(--surface-2);
  --bs-link-color-rgb: 163, 208, 204;
  --bs-link-hover-color-rgb: 201, 229, 226;
}

body {
  font-size: 0.9375rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  font-feature-settings: "cv11", "ss01";
}

a {
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- logo ---------- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: #fff;
}

.logo-mark {
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
}

.logo-frame {
  fill: var(--logo-blue);
}

.logo-glyph {
  stroke: #fff;
}

.logo-word {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.logo-product {
  margin-left: 0.4rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--sage-light);
}

/* ---------- sidebar (992px and up) ---------- */
.side {
  display: none;
}

@media (min-width: 992px) {
  .side {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1030;
    width: var(--side-width);
    display: flex;
    flex-direction: column;
    padding: 1.4rem 0.9rem 1.2rem;
    color: #d3dce5;
    background-color: var(--navy-900);
    background-image:
      linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
      linear-gradient(165deg, var(--navy-950), var(--navy-900) 55%, var(--navy-800));
    background-size: 48px 48px, 48px 48px, auto;
  }

  .side .logo {
    padding: 0 0.5rem;
    margin-bottom: 1.9rem;
  }

  .signed-in .shell {
    margin-left: var(--side-width);
  }
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.side-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.62rem 0.75rem;
  border-radius: 10px;
  color: #b9c7d4;
  font-weight: 500;
  text-decoration: none;
}

.side-nav a .bi {
  font-size: 1.05rem;
  color: #8598a8;
}

.side-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.side-nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.side-nav a.active .bi {
  color: var(--sage);
}

.side-nav a.active::before {
  content: "";
  position: absolute;
  left: -0.9rem;
  top: 0.55rem;
  bottom: 0.55rem;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--sage);
}

.side-nav-admin {
  margin-top: 1rem;
}

.side-nav-admin::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  top: -0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-count {
  margin-left: auto;
  min-width: 1.35rem;
  padding: 0 0.4rem;
  border-radius: 1rem;
  background: #e5484d;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.side-note {
  margin: auto 0.5rem 0;
  padding-top: 1rem;
  font-size: 0.76rem;
  line-height: 1.5;
  color: #7d909f;
}

/* ---------- top bar ---------- */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  padding-top: calc(0.6rem + env(safe-area-inset-top));
  background: var(--navy-900);
}

.user-button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2rem;
  background: transparent;
  color: #fff;
  font-weight: 500;
  font-size: 0.875rem;
}

.user-name {
  display: none;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--teal);
  color: #f7f5f0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

@media (min-width: 992px) {
  .top-bar {
    position: static;
    padding: 1rem 2rem 0;
    background: transparent;
  }

  .top-logo {
    display: none;
  }

  .user-button {
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink);
    padding-right: 0.8rem;
  }

  .user-name {
    display: inline;
  }
}

.dropdown-menu {
  --bs-dropdown-bg: var(--surface);
  --bs-dropdown-border-color: var(--line);
  --bs-dropdown-border-radius: 12px;
  --bs-dropdown-link-hover-bg: var(--surface-2);
  --bs-dropdown-link-active-bg: var(--primary);
  --bs-dropdown-link-active-color: var(--primary-text);
  --bs-dropdown-item-padding-y: 0.45rem;
  box-shadow: 0 12px 32px rgba(5, 11, 24, 0.14);
  font-size: 0.9rem;
}

.dropdown-item .bi {
  margin-right: 0.45rem;
  color: var(--muted);
}

.demo-banner {
  background: var(--warn-soft);
  color: var(--warn);
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
}

/* ---------- page body ---------- */
.app-main {
  padding: 1.1rem 1rem calc(5.5rem + env(safe-area-inset-bottom));
}

@media (min-width: 768px) {
  .app-main {
    padding: 1.25rem 1.5rem calc(5.5rem + env(safe-area-inset-bottom));
  }
}

@media (min-width: 992px) {
  .app-main {
    max-width: 1280px;
    padding: 1.4rem 2rem 3rem;
  }
}

.signed-out .app-main {
  max-width: none;
  padding: 0;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.page-head h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.page-head .sub {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.25rem;
}

.panel > h2,
.section-title {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

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

.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.empty {
  padding: 1.75rem 0.5rem;
  text-align: center;
  color: var(--muted);
}

/* ---------- buttons and forms ---------- */
.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-border-radius: var(--radius-sm);
  --bs-btn-padding-x: 0.95rem;
  --bs-btn-padding-y: 0.48rem;
  --bs-btn-font-size: 0.9rem;
}

.btn-sm {
  --bs-btn-padding-x: 0.7rem;
  --bs-btn-padding-y: 0.28rem;
  --bs-btn-font-size: 0.82rem;
  --bs-btn-border-radius: 7px;
}

.btn-primary {
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary-hover);
  --bs-btn-hover-border-color: var(--primary-hover);
  --bs-btn-active-bg: var(--primary-active);
  --bs-btn-active-border-color: var(--primary-active);
  --bs-btn-disabled-bg: var(--primary);
  --bs-btn-disabled-border-color: var(--primary);
  --bs-btn-color: var(--primary-text);
  --bs-btn-hover-color: var(--primary-text);
  --bs-btn-active-color: var(--primary-text);
  --bs-btn-disabled-color: var(--primary-text);
}

.btn-outline-primary {
  --bs-btn-color: var(--info);
  --bs-btn-border-color: var(--line-strong);
  --bs-btn-bg: var(--surface);
  --bs-btn-hover-color: var(--primary-text);
  --bs-btn-hover-bg: var(--primary);
  --bs-btn-hover-border-color: var(--primary);
  --bs-btn-active-color: var(--primary-text);
  --bs-btn-active-bg: var(--primary-active);
  --bs-btn-active-border-color: var(--primary-active);
  --bs-btn-disabled-color: var(--muted);
  --bs-btn-disabled-border-color: var(--line);
}

.btn-check:checked + .btn-outline-primary {
  --bs-btn-active-color: var(--primary-text);
  --bs-btn-active-bg: var(--primary);
  --bs-btn-active-border-color: var(--primary);
}

.btn-outline-secondary {
  --bs-btn-color: var(--ink);
  --bs-btn-border-color: var(--line-strong);
  --bs-btn-bg: var(--surface);
  --bs-btn-hover-color: var(--ink);
  --bs-btn-hover-bg: var(--surface-2);
  --bs-btn-hover-border-color: var(--line-strong);
  --bs-btn-active-color: var(--ink);
  --bs-btn-active-bg: var(--surface-2);
  --bs-btn-active-border-color: var(--line-strong);
}

.btn-outline-danger {
  --bs-btn-color: var(--danger);
  --bs-btn-border-color: var(--line-strong);
  --bs-btn-bg: var(--surface);
}

.btn-icon {
  --bs-btn-padding-x: 0.42rem;
  --bs-btn-padding-y: 0.16rem;
}

.form-label {
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.form-control,
.form-select {
  border-color: var(--line-strong);
  border-radius: var(--radius-sm);
  background-color: var(--field);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  font-size: 1rem; /* 16px stops iOS zooming in on focus */
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(82, 111, 134, 0.24);
}

.form-check-input {
  border-color: var(--line-strong);
}

.form-check-input:checked {
  background-color: var(--teal);
  border-color: var(--teal);
}

.form-text {
  color: var(--muted);
  font-size: 0.82rem;
}

.form-narrow {
  max-width: 46rem;
}

.alert {
  --bs-alert-border-radius: 10px;
  --bs-alert-padding-y: 0.7rem;
  font-size: 0.92rem;
}

.nav-pills {
  --bs-nav-pills-link-active-bg: var(--primary);
  --bs-nav-pills-link-active-color: var(--primary-text);
  --bs-nav-pills-border-radius: 2rem;
  --bs-nav-link-color: var(--muted);
  --bs-nav-link-hover-color: var(--ink);
  --bs-nav-link-font-weight: 600;
  --bs-nav-link-font-size: 0.86rem;
  gap: 0.25rem;
}

/* ---------- small pieces ---------- */
.badge.tag {
  padding: 0.22em 0.55em;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: 0.08em;
}

.due {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
}

.due::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

.due-danger {
  color: var(--danger);
}

.due-warning {
  color: var(--warn);
}

.due-info {
  color: var(--info);
}

.due-secondary {
  color: var(--muted);
  font-weight: 500;
}

.due-date {
  margin-left: 0.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

/* ---------- tables ---------- */
.panel .table {
  margin-bottom: 0;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--line);
  --bs-table-color: var(--ink);
}

.table > :not(caption) > * > * {
  padding: 0.8rem 0.75rem;
}

.table-sm > :not(caption) > * > * {
  padding: 0.5rem 0.75rem;
}

.table thead th {
  border-bottom-color: var(--line-strong);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.table tbody tr:last-child > * {
  border-bottom: 0;
}

.table td.cell-title {
  font-weight: 600;
}

.table td.cell-title a {
  color: var(--ink);
  text-decoration: none;
}

.table td.cell-title a:hover {
  color: var(--info);
  text-decoration: underline;
}

@media (min-width: 768px) {
  .table-stack tbody tr:hover > * {
    background: var(--surface-2);
  }

  .table-stack td.cell-title {
    min-width: 9.5rem;
  }

  .table-stack td.cell-secret {
    min-width: 13.5rem;
    max-width: 20rem;
  }

  .table-stack td.cell-client {
    min-width: 8.5rem;
  }

  .panel.panel-flush {
    padding: 0.35rem 0.6rem 0.25rem;
    overflow-x: auto; /* a very wide table scrolls inside its panel, never the page */
  }

  .panel.panel-flush > h2,
  .panel.panel-flush > .section-title,
  .panel.panel-flush > .d-flex {
    padding: 0.8rem 0.65rem 0;
  }
}

/* Tables become cards on phones. */
@media (max-width: 767.98px) {
  .table-stack thead {
    display: none;
  }

  .table-stack,
  .table-stack tbody {
    display: block;
  }

  .table-stack tr {
    display: block;
    margin-bottom: 0.7rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }

  .table-stack td {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: baseline;
    gap: 0.15rem 0.5rem;
    padding: 0.2rem 0;
    border: 0;
    text-align: right;
    overflow-wrap: anywhere;
  }

  .table-stack td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    margin-right: auto; /* label on the left, value grouped on the right */
    padding-right: 0.5rem;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 400;
    text-align: left;
  }

  .table-stack td.cell-title {
    display: block;
    padding-bottom: 0.35rem;
    font-size: 1rem;
    text-align: left;
  }

  .table-stack td.cell-title::before,
  .table-stack td.cell-actions::before {
    content: none;
  }

  .table-stack td.cell-actions {
    justify-content: flex-end;
    gap: 0.4rem;
    padding-top: 0.55rem;
  }

  .table-stack td.cell-skip {
    display: none;
  }

  .panel.panel-flush {
    padding: 0;
    border: 0;
    background: transparent;
  }
}

/* ---------- summary strip (client page, ledger) ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.tile {
  display: block;
  padding: 0.95rem 1.15rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

a.tile:hover {
  background: var(--surface-2);
}

.tile .label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.tile .value {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.tile .value.small-value {
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.tile.is-danger .value {
  color: var(--danger);
}

@media (min-width: 768px) {
  .tiles {
    display: flex;
  }

  .tile {
    flex: 1 1 0;
    min-width: 0;
  }

  .tile {
    border-bottom: 0;
  }

  .tile:last-child {
    border-right: 0;
  }
}

/* ---------- dashboard ---------- */
.today {
  position: relative;
  margin-bottom: 1.25rem;
  padding: 1.4rem 1.25rem 2.6rem;
  border-radius: 18px;
  color: #fff;
  background-color: var(--navy-900);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    radial-gradient(circle at 82% 12%, rgba(62, 91, 111, 0.34) 0, transparent 34%),
    linear-gradient(125deg, var(--navy-950), var(--navy-900) 58%, var(--navy-800));
  background-size: 56px 56px, 56px 56px, auto, auto;
  overflow: hidden;
}

[data-bs-theme="dark"] .today {
  border: 1px solid var(--line);
}

.today-date {
  margin: 0 0 0.5rem;
  color: #a9b9c6;
  font-size: 0.86rem;
  font-weight: 500;
}

.today-line {
  max-width: 30ch;
  margin: 0;
  text-wrap: balance;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.035em;
}

.timeline {
  display: grid;
  gap: 1.1rem 1rem;
  margin-top: 1.6rem;
}

.tl-overdue {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2rem;
  color: #a9b9c6;
  font-size: 0.8rem;
  font-weight: 600;
}

.tl-overdue.has {
  color: #ffb3a6;
}

.tl-overdue-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tl-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(31, minmax(0, 1fr));
  align-items: end;
  height: 2.6rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.16);
}

.tl-day {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 0.25rem;
  height: 100%;
  padding-bottom: 0.45rem;
}

.tl-day.tl-week::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 2px;
  height: 6px;
  margin-left: -1px;
  background: rgba(255, 255, 255, 0.3);
}

.tl-tick {
  position: absolute;
  top: calc(100% + 0.7rem);
  left: 50%;
  transform: translateX(-50%);
  color: #a9b9c6;
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
}

.tl-day:first-child .tl-tick {
  left: 0;
  transform: none;
  color: #fff;
  font-weight: 600;
}

.tl-dot {
  display: block;
  flex: 0 0 auto;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 3px rgba(144, 196, 191, 0.24);
}

.tl-dot.due-warning {
  background: #f2c66d;
  box-shadow: 0 0 0 3px rgba(242, 198, 109, 0.24);
}

.tl-dot.due-danger {
  background: #ff8a78;
  box-shadow: 0 0 0 3px rgba(255, 138, 120, 0.26);
}

a.tl-dot:hover,
a.tl-dot:focus-visible {
  transform: scale(1.35);
  outline-color: #fff;
}

.tl-key {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  margin: 2.1rem 0 0;
  padding: 0;
  list-style: none;
  color: #a9b9c6;
  font-size: 0.74rem;
}

.tl-key li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.tl-key .tl-dot {
  width: 0.5rem;
  height: 0.5rem;
  box-shadow: none;
}

@media (min-width: 768px) {
  .today {
    padding: 1.9rem 2rem 2.2rem;
  }

  .today-line {
    font-size: 2.1rem;
  }

  .timeline {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: end;
  }

  .tl-overdue {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.45rem;
    min-width: 6.5rem;
    height: 3.6rem;
    padding: 0 1rem 0.45rem 0;
    border-right: 1px dashed rgba(255, 255, 255, 0.2);
    border-bottom: 2px solid rgba(255, 255, 255, 0.16);
  }

  .tl-track {
    height: 3.6rem;
  }

  .tl-dot {
    width: 0.85rem;
    height: 0.85rem;
    box-shadow: 0 0 0 4px rgba(144, 196, 191, 0.24);
  }

  .tl-dot.due-warning {
    box-shadow: 0 0 0 4px rgba(242, 198, 109, 0.24);
  }

  .tl-dot.due-danger {
    box-shadow: 0 0 0 4px rgba(255, 138, 120, 0.26);
  }

  .tl-tick {
    font-size: 0.76rem;
  }

  .tl-key {
    grid-column: 2;
  }
}

.dash-grid {
  display: grid;
  gap: 0 1.25rem;
}

@media (min-width: 1200px) {
  .dash-grid {
    grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
    align-items: start;
  }
}

.plain-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.plain-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

.plain-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0.1rem;
}

.plain-list a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.plain-list a:hover {
  color: var(--info);
  text-decoration: underline;
}

.plain-list .amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- secrets ---------- */
.secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  overflow-wrap: break-word;
}

/* A revealed password can be any length, so it may break anywhere. */
[data-secret-value] {
  overflow-wrap: anywhere;
}

.secret-notes {
  white-space: pre-wrap;
  color: var(--muted);
  font-size: 0.85rem;
}

.qr-box {
  display: inline-block;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.qr-box img {
  display: block;
  width: 13rem;
  height: 13rem;
  image-rendering: pixelated;
}

.manual-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
}

.recovery-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 1.5rem;
  max-width: 22rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
}

/* ---------- sign-in ---------- */
.auth {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-rows: auto 1fr;
}

.auth-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem 1.25rem 1.75rem;
  padding-top: calc(1.5rem + env(safe-area-inset-top));
  color: #fff;
  background-color: var(--navy-900);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    radial-gradient(circle at 80% 14%, rgba(62, 91, 111, 0.34) 0, transparent 36%),
    linear-gradient(125deg, var(--navy-950), var(--navy-900) 58%, var(--navy-800));
  background-size: 56px 56px, 56px 56px, auto, auto;
}

.auth-line {
  max-width: 16ch;
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.auth-foot {
  display: none;
  margin: 0;
  color: #9aabb8;
  font-size: 0.82rem;
}

.auth-form {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1.25rem 3rem;
}

.auth-card {
  width: 100%;
  max-width: 23rem;
}

.auth-card h1 {
  margin: 0 0 0.3rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.auth-card .lead-in {
  margin-bottom: 1.4rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-card .btn-primary {
  --bs-btn-padding-y: 0.62rem;
}

.auth-links {
  margin-top: 1.25rem;
  font-size: 0.86rem;
}

@media (min-width: 900px) {
  .auth {
    grid-template-rows: none;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  }

  .auth-side {
    justify-content: space-between;
    padding: 2.5rem 3rem;
  }

  .auth-line {
    max-width: 14ch;
    font-size: clamp(2.2rem, 3.6vw, 3.4rem);
    line-height: 1.04;
  }

  .auth-foot {
    display: block;
  }

  .auth-form {
    align-items: center;
    padding: 2rem;
  }
}

/* Small centred card for the error page. */
.auth-wrap {
  max-width: 26rem;
  margin: 12vh auto 0;
  padding: 0 1rem;
}

/* ---------- bottom tab bar (below 992px) ---------- */
.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--navy-900);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tab-bar a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.55rem 0.15rem 0.45rem;
  color: #95a6b3;
  font-size: 0.68rem;
  font-weight: 500;
  text-decoration: none;
}

.tab-bar a.active {
  color: #fff;
}

.tab-bar a.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 30%;
  right: 30%;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--sage);
}

.tab-bar a.active .bi {
  color: var(--sage);
}

.tab-icon {
  position: relative;
  font-size: 1.25rem;
  line-height: 1;
}

.tab-badge {
  position: absolute;
  top: -0.3rem;
  left: 0.9rem;
  min-width: 1.05rem;
  padding: 0 0.25rem;
  border-radius: 1rem;
  background: #e5484d;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.05rem;
  text-align: center;
}

@media (min-width: 992px) {
  .tab-bar {
    display: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .tl-dot {
    transition: transform 0.12s ease;
  }

  .side-nav a,
  .btn {
    transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  }
}

/* Links inside tables read as text until hovered, so rows stay calm. */
.table td a:not(.btn) {
  text-decoration: none;
}

.table td a:not(.btn):hover {
  text-decoration: underline;
}
