/* Rethink Academy colours and logo on top of the kit back office (DESIGN.md §2.3 + §9, palette B
   "Hybrid"). Colours only: layout, sizes and behaviour stay as the kit's (kit/ is an exact copy).
   Load after every kit stylesheet. Contrast of each text/background pair is AA (4.5:1) in both
   themes; input borders and focus rings are at least 3:1. */

/* ---- Kit tokens ---- */
:root {
  --navy: #0f3a3d;
  --green: #2f676b;
  --blue: #2f676b;
  --gold: #e3a07f; /* the kit's accent slot: Rethink copper */
  --bg: #f3f6f5;
  --paper: #fff;
  --ink: #0f3a3d;
  --muted: #4c5c5d;
  --line: #dde5e3;
  --soft: #e8f0ee;
  --danger: #b42318;
  --shadow: 0 4px 24px #0f3a3d12;
}
html[data-theme="dark"] {
  --bg: #071e20;
  --paper: #0e2c2e;
  --ink: #eaf1ef;
  --muted: #a8bebc;
  --line: #234345;
  --soft: #123437;
  --green: #7fb7b5;
  --blue: #7fb7b5;
  --gold: #e3a07f;
  --danger: #f97066; /* #b42318 is 2.4:1 on the dark paper */
}

/* ---- Sidebar (the kit hardcodes the #102a43 family) ---- */
.sidebar {
  background: #0f3a3d;
  color: #c9d9d7;
}
.navgroup {
  color: #a3bdb9;
}
.navlink {
  color: #c9d9d7;
}
.navlink.active {
  color: #fff;
  background: #1d5357;
}
.navlink:hover {
  color: #fff;
  background: #174649;
}
.navlink .count,
.navgroup-toggle .count {
  background: #2a5f63;
  color: #e2ecea;
}
.navgroup-toggle {
  color: #b9cdca;
}
.navgroup-toggle:hover {
  color: #fff;
}
.navgroup-toggle:focus-visible {
  outline-color: #c9d9d7;
}
.sidebar a:focus-visible,
.sidebar button:focus-visible {
  outline-color: #c9d9d7;
}
.navsub-link {
  color: #c9d9d7;
}
.navsub-link:hover {
  background: #174649;
}
.sidebar-foot {
  border-top-color: #2a5357;
}
.sidebar-foot a {
  color: #c9e3de;
}
/* Logo: the colour file turned white for the dark sidebar (DESIGN.md §2.1, §11). */
.sidebar .brand img {
  filter: brightness(0) invert(1);
}
@media (max-width: 760px) {
  .sidebar {
    box-shadow: 0 0 0 100vmax #071e2066;
  }
}

/* ---- Buttons, toasts, dialogs ---- */
.btn.primary {
  background: #0f3a3d;
  border-color: #0f3a3d;
}
.btn.green {
  background: #2f676b;
  border-color: #2f676b;
}
html[data-theme="dark"] .btn.primary {
  background: #7fb7b5;
  border-color: #7fb7b5;
  color: #071e20;
}
.toast {
  background: #0f3a3d;
}
html[data-theme="dark"] .toast {
  background: #1d5357;
  border: 1px solid var(--line);
}
html[data-theme="dark"] .toast.danger {
  background: var(--danger);
  color: #071e20;
}
dialog::backdrop {
  background: #071e2080;
}
.notice.green {
  border-color: #b9d3cd;
}

/* ---- Form controls: borders at 3:1 (DESIGN.md --color-border-strong) ---- */
.field input,
.field select,
.field textarea,
.filters input,
.filters select,
.toolbar select {
  border-color: #7a8f8f;
}
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .filters input,
html[data-theme="dark"] .filters select,
html[data-theme="dark"] .toolbar select {
  border-color: #5f7f80;
}
.check input,
.check-col input,
.switchrow input {
  accent-color: #2f676b;
}
html[data-theme="dark"] .check input,
html[data-theme="dark"] .check-col input,
html[data-theme="dark"] .switchrow input {
  accent-color: #7fb7b5;
}

/* ---- Top bar ---- */
.fontseg button[aria-pressed="true"] {
  background: #0f3a3d;
}
html[data-theme="dark"] .fontseg button[aria-pressed="true"] {
  background: #7fb7b5;
  color: #071e20;
}
.tb-avatar::before {
  background: conic-gradient(from 200deg, #7fb7b5, #2f676b, #a4654f, #e3a07f, #7fb7b5);
}
.tb-avatar-in {
  background:
    radial-gradient(circle at 30% 25%, rgb(255 255 255 / 0.22), transparent 55%),
    linear-gradient(150deg, #2f676b, #0f3a3d 75%);
}
.avatar {
  background: var(--soft);
  color: var(--green);
}

/* ---- Phone and tablet app shell ---- */
.m-chip[aria-pressed="true"] {
  border-color: #0f3a3d;
  background: #0f3a3d;
}
html[data-theme="dark"] .m-chip[aria-pressed="true"] {
  border-color: #7fb7b5;
  background: #7fb7b5;
  color: #071e20;
}
html[data-theme="dark"] .pager .btn[aria-current="page"] {
  color: #071e20;
}
html[data-theme="dark"] .tab-dot,
html[data-theme="dark"] .tile-dot {
  color: #071e20;
}
@media (max-width: 1023px) {
  .s-panel .tabs .tab[aria-pressed="true"],
  .s-panel .tabs .tab.active,
  .s-panel.ce-tabbar .tabs .tab.active {
    border-color: #0f3a3d;
    background: #0f3a3d;
    color: #fff;
  }
  html[data-theme="dark"] .s-panel .tabs .tab[aria-pressed="true"],
  html[data-theme="dark"] .s-panel .tabs .tab.active,
  html[data-theme="dark"] .s-panel.ce-tabbar .tabs .tab.active {
    border-color: #7fb7b5;
    background: #7fb7b5;
    color: #071e20;
  }
  .tabbar {
    box-shadow: 0 -6px 24px #0f3a3d14;
  }
  .tab-fab {
    color: #0f3a3d;
    box-shadow:
      0 6px 16px #0f3a3d33,
      0 0 0 4px var(--paper);
  }
}
