:root {
  --navy: #1a73e8;
  --navy-deep: #174ea6;
  --brand: #0b3264;
  --ink: #202124;
  --muted: #5f6368;
  --line: #e8eaed;
  --paper: #f8f9fa;
  --card: #ffffff;
  --danger: #d93025;
  --focus: #1a73e8;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 4px 20px rgba(11, 50, 100, 0.06);
  --shadow-hover: 0 8px 28px rgba(11, 50, 100, 0.1);
  --elev-1: 0 1px 2px rgba(60, 64, 67, 0.2), 0 1px 3px 1px rgba(60, 64, 67, 0.08);
  --print-pastel-1: #d9ecfb;
  --print-pastel-2: #d9f3e3;
  --print-pastel-3: #f8d9de;
  --print-pastel-4: #f3e7c8;
  --print-pastel-5: #e7ddf7;
  --print-pastel-6: #f8e2d2;
  --print-pastel-7: #e8f0fe;
  --print-pastel-8: #e6f4ea;
  --print-arc-a3: var(--navy);
  --print-arc-a4: #0ea5e9;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: "Assistant", "Heebo", "Segoe UI", "Arial Hebrew", Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand strong {
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

button { cursor: pointer; }

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

.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}

.login-hero {
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.16), transparent 34%),
    linear-gradient(165deg, #1a73e8 0%, #174ea6 55%, #0b3264 100%);
  color: white;
  display: flex;
  align-items: flex-end;
  padding: 64px;
}

.mark {
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 28px;
}

.login-hero h1 {
  margin: 0 0 12px;
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.login-hero p {
  margin: 0;
  max-width: 420px;
  font-size: 18px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.login-card {
  width: min(420px, 100%);
}

.login-card h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.lede {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}

input, select {
  width: 100%;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  color: var(--ink);
  font-size: 15px;
  max-width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus {
  border-color: #aecbfa;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.18);
  outline: none;
}

input[readonly] {
  background: #f8fafc;
  color: #334155;
  cursor: default;
}

.btn {
  background: var(--navy);
  color: white;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--elev-1);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  background: var(--navy-deep);
  box-shadow: var(--shadow-hover);
}

.btn .icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
}

.btn .icon svg { width: 18px; height: 18px; display: block; }

.btn.ghost {
  background: white;
  color: var(--navy);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn.ghost:hover {
  background: #f1f3f4;
  box-shadow: none;
}

.btn.danger {
  background: #fce8e6;
  color: var(--danger);
  box-shadow: none;
}

.btn.danger:hover { background: #f9d4d1; }

.btn.tiny {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 999px;
}

.btn.block { width: 100%; margin-top: 6px; }

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.btn.google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: white;
  color: var(--ink);
  border: 1px solid #cfd6e0;
  text-decoration: none;
  margin-top: 0;
}

.btn.google:hover { background: #f7f9fc; }

.btn.google::before {
  content: "";
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23EA4335' d='M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z'/%3E%3Cpath fill='%234285F4' d='M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z'/%3E%3Cpath fill='%23FBBC05' d='M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z'/%3E%3Cpath fill='%2334A853' d='M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.form-error {
  min-height: 1.2em;
  margin: 0 0 8px;
  color: var(--danger);
  font-size: 14px;
}

.shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.side {
  width: 248px;
  flex: none;
  background: #ffffff;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-inline-start: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.brand { padding: 22px 18px 12px; }

.brand strong {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--brand);
}

.brand span, .year-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.nav { display: flex; flex-direction: column; padding: 8px 10px; gap: 4px; }

.nav-btn {
  text-align: right;
  background: transparent;
  color: #3c4043;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-btn .icon {
  width: 20px;
  height: 20px;
  color: #5f6368;
  flex: none;
  display: inline-grid;
  place-items: center;
}

.nav-btn .icon svg { width: 20px; height: 20px; display: block; }

.nav-btn:hover { background: #f1f3f4; }

.nav-btn.active {
  background: #e8f0fe;
  color: #1967d2;
  box-shadow: none;
  font-weight: 600;
}

.nav-btn.active .icon { color: #1967d2; }

.side-year {
  margin-top: auto;
  padding: 12px 16px 10px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
  background: #fff;
}

.side-year label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.side-year .year-select {
  width: 100%;
  min-width: 0;
}

.side-user {
  padding: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  justify-items: start;
  gap: 8px;
  background: #fff;
}

.side-user-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.side-user-head b {
  display: block;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.side-prefs {
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f1f3f4;
  color: #5f6368;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.side-prefs svg {
  width: 18px;
  height: 18px;
}

.side-prefs:hover {
  background: #e8f0fe;
  color: #1967d2;
}

.side-user small {
  display: block;
  margin: 0;
  color: var(--muted);
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #e8f0fe;
  border: 2px solid #d2e3fc;
}

.user-avatar.placeholder {
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #1967d2;
  letter-spacing: 0.02em;
}

.user-avatar.side {
  width: 48px;
  height: 48px;
}

.user-avatar.lg {
  width: 88px;
  height: 88px;
  border-color: var(--line);
  background: #eef2f6;
  color: var(--navy);
}

.logout {
  width: 100%;
  background: transparent;
  color: #5f6368;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.logout:hover {
  background: #f1f3f4;
  color: var(--ink);
}

.prefs-body {
  display: grid;
  gap: 16px;
}

.prefs-block h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.prefs-avatar-row {
  display: flex;
  gap: 14px;
  align-items: center;
}

.prefs-avatar-actions {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.file-btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.main { flex: 1; min-width: 0; padding: 28px 32px 48px; }

.main.tight { padding: 16px 16px 20px; }

.page-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 18px;
}

h1 { margin: 0; font-size: 28px; letter-spacing: -0.02em; }

.toolbar { display: flex; gap: 10px; align-items: center; }

.head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  overflow: visible;
  padding-bottom: 2px;
}

.head-actions > * {
  flex: 0 1 auto;
  max-width: 100%;
}

.head-actions select,
.head-actions .year-select {
  width: auto;
  min-width: 110px;
}

.toolbar { margin-bottom: 14px; }

.toolbar input[type="search"] { flex: 1; min-width: 160px; }

.toolbar select, .year-select { width: 190px; }

.card {
  background: var(--card);
  border: 0;
  border-radius: 20px;
  box-shadow: var(--shadow);
  min-width: 0;
  max-width: 100%;
}

.banner {
  background: #e8f0fe;
  color: #1967d2;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  margin-bottom: 14px;
  font-weight: 500;
  font-size: 13px;
}

.count-scroll {
  overflow: visible;
  margin-bottom: 16px;
  max-width: 100%;
}

.count-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  min-width: 0;
  width: 100%;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.count-strip div { text-align: center; padding-top: 10px; font-size: 13px; color: var(--muted); }

.count-strip strong {
  display: block;
  margin-top: 8px;
  background: var(--navy);
  color: white;
  padding: 9px 0;
  font-size: 18px;
}

.data { width: 100%; border-collapse: collapse; }

.data th, .data td {
  text-align: right;
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  border-inline: 0;
  vertical-align: middle;
}

.data th {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: #f8f9fa;
  letter-spacing: 0.01em;
}

.data tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}

.data tbody tr:hover { background: #f8f9fa; }

.data tbody tr:last-child td { border-bottom: 0; }

.tags { display: flex; flex-wrap: wrap; gap: 4px; }

.tag {
  background: #eef3f8;
  color: var(--navy);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
}

.empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
}

.board-wrap {
  overflow: visible;
  max-height: none;
  border: 0;
  background: transparent;
}

.board {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  background: transparent;
}

.board th, .board td {
  border: 1px solid #e4e9f0;
  text-align: center;
  padding: 0;
  font-size: 14px;
  height: 34px;
}

.board thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  font-weight: 700;
  padding: 10px 4px;
  height: auto;
}

.board tfoot td {
  position: sticky;
  bottom: 0;
  background: var(--navy);
  color: white;
  font-weight: 700;
  font-size: 16px;
  border-color: var(--navy);
  height: 36px;
}

.name-btn {
  width: 100%;
  min-height: 34px;
  border: 0;
  background: transparent;
  padding: 6px 4px;
  line-height: 1.35;
}

.name-btn:hover, .name-btn:focus-visible { background: #e8f1ff; }

.soon { padding: 28px; }

.soon h2 { margin: 0 0 8px; font-size: 20px; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(32, 33, 36, 0.4);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 16px;
  z-index: 30;
  backdrop-filter: blur(2px);
}

.overlay.unsaved-overlay {
  z-index: 40;
  align-items: center;
  background: rgba(32, 33, 36, 0.55);
}

.dialog {
  width: min(680px, 100%);
  background: white;
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(60, 64, 67, 0.18);
  max-height: calc(100vh - 80px);
  overflow: auto;
  border: 0;
}

.dialog.narrow { width: min(440px, 100%); }

.dialog.wide { width: min(860px, 100%); }

.dialog h2 { margin: 0; padding: 18px 20px 0; font-size: 22px; }

.dialog .hint {
  margin: 8px 20px 0;
  color: var(--muted);
  line-height: 1.5;
}

.dialog-body { padding: 16px 20px 0; min-width: 0; }

.dialog fieldset.fields,
.dialog fieldset.dialog-section {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  min-inline-size: 0;
  width: 100%;
}

.dialog-section + .dialog-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line, #e4e9f0);
}

.dialog-section-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink, #202124);
}

.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  min-width: 0;
  width: 100%;
}

.fields.fields-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fields .field {
  min-width: 0;
  margin-bottom: 0;
}

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

.field textarea,
.fields textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  font: inherit;
  line-height: 1.45;
  padding: 10px 12px;
  border: 1px solid var(--line, #d5dde8);
  border-radius: 10px;
  background: #fff;
  color: inherit;
}

.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
}

.check input { width: auto; }

.dialog-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 20px 18px;
}

.dialog-actions .group { display: flex; gap: 8px; }

.page-error { color: var(--danger); margin-bottom: 12px; }

.pay-wrap {
  overflow: auto;
  max-height: calc(100vh - 210px);
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
}

.pay {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
}

.pay th, .pay td {
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  padding: 6px;
  background: white;
  vertical-align: middle;
  font-size: 13px;
  white-space: nowrap;
}

.pay th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f4f7fb;
  color: var(--navy);
  font-size: 12px;
  font-weight: 650;
}

.pay .sticky { position: sticky; right: 0; z-index: 1; box-shadow: -8px 0 12px rgba(16, 36, 64, 0.04); }

.pay thead .sticky { z-index: 3; }

.pay input, .pay select {
  width: 100%;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 13px;
}

.pay .num { width: 64px; }

.pay .status { width: 112px; }

.family-cell { min-width: 168px; }

.family-cell small, .family-cell .linkish { display: block; margin-top: 3px; }

.family-cell small { color: var(--muted); font-size: 12px; white-space: normal; }

.family-cell input { margin-top: 4px; }

.linkish {
  border: 0;
  background: transparent;
  color: var(--focus);
  padding: 0;
  font-size: 12px;
}

.money { font-weight: 700; }

.debt-hot { color: var(--danger); font-weight: 700; }

.charges { min-width: 170px; }

.chips { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }

.chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #e8f0fe;
  color: #1967d2;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border: 0;
}

.chip button {
  border: 0;
  background: transparent;
  color: var(--danger);
  padding: 0 2px;
  font-size: 16px;
  line-height: 1;
}

.notes { min-width: 140px; }

.checkline { text-align: center; }

.checkline input { width: auto; }

.status,
select.status {
  border: 0 !important;
  border-radius: 999px !important;
  padding: 6px 12px !important;
  font-weight: 600;
  font-size: 12px;
  min-height: 32px;
  box-shadow: none;
  appearance: none;
  background-image: none;
}

.st-paid,
select.status.st-paid { background: #e6f4ea !important; color: #137333 !important; }

.st-alt,
select.status.st-alt { background: #e8f0fe !important; color: #1967d2 !important; }

.st-due,
select.status.st-due { background: #fef7e0 !important; color: #b06000 !important; }

.st-bad,
select.status.st-bad { background: #fce8e6 !important; color: #c5221f !important; }

.st-exempt,
select.status.st-exempt { background: #f1f3f4 !important; color: #5f6368 !important; }

.st-new,
select.status.st-new { background: #fef7e0 !important; color: #b06000 !important; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.filters button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
}

.filters button.on { background: var(--navy); color: white; border-color: var(--navy); }

.filters select { width: 120px; padding: 6px 8px; }

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 200px));
  gap: 8px;
  margin-bottom: 12px;
}

.summary div {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
}

.summary strong { display: block; margin-top: 2px; color: var(--ink); font-size: 18px; }

.settings-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 16px;
  align-items: start;
}

.page-ok,
.status-ok {
  margin: 0 0 12px;
  color: #0f6a3f;
  background: #e8f7ef;
  border: 1px solid #b7e0c8;
  border-radius: 10px;
  padding: 10px 12px;
}

.btn.is-loading {
  opacity: 0.85;
  cursor: wait;
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  display: inline-block;
  margin-inline-end: 8px;
  vertical-align: -2px;
  animation: btn-spin 0.7s linear infinite;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.pending-payslips {
  margin-bottom: 16px;
}

.pending-payslip-list {
  display: grid;
  gap: 12px;
}

.pending-payslip-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 12px 0;
  border-top: 1px solid var(--line, #e4e9f0);
}

.pending-payslip-actions {
  margin-top: 0;
}

.payslip-preview-dialog {
  width: min(960px, 96vw);
  max-height: 92vh;
}

.payslip-preview-body {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
}

.payslip-frame {
  width: 100%;
  flex: 1;
  min-height: 65vh;
  border: 1px solid var(--line, #e4e9f0);
  border-radius: 10px;
  background: #f7f8fa;
}

.mail-compose-dialog .mail-compose-body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: stretch;
  min-height: 62vh;
}

.mail-compose-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.mail-compose-preview .mail-preview-frame {
  min-height: 58vh;
  flex: 1;
}

.mail-preview-fallback {
  flex: 1;
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line, #d5dde8);
  border-radius: 10px;
  background: #f7f8fa;
  padding: 16px;
  text-align: center;
}

.mail-compose-fields {
  align-content: start;
}

.mail-attach-label {
  margin: 0;
}

.mail-recipient-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.mail-recipient-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 10px;
  border-radius: 999px;
  background: #eef3f9;
  border: 1px solid #d7e0eb;
  font-size: 13px;
  color: #243247;
}

.mail-recipient-remove {
  border: 0;
  background: transparent;
  color: #6b778a;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}

.mail-recipient-remove:hover {
  color: #b42318;
}

.mail-recipient-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.mail-recipient-suggestions {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
}

.mail-recipient-chip.suggest {
  cursor: pointer;
  background: #f3f7fb;
  border-style: dashed;
}

.mail-recipient-chip.suggest:hover {
  background: #e7eef8;
}

.mail-html-preview {
  flex: 1;
  min-height: 58vh;
  overflow: auto;
  border: 1px solid var(--line, #e4e9f0);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
}

@media (max-width: 860px) {
  .mail-compose-dialog .mail-compose-body {
    grid-template-columns: 1fr;
  }

  .mail-compose-preview .mail-preview-frame {
    min-height: 42vh;
  }
}

.pending-payslip-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.pending-payslip-row .field {
  margin: 0;
}

@media (max-width: 820px) {
  .pending-payslip-row {
    grid-template-columns: 1fr;
  }
}

.card.pad, .card-head { padding: 16px 18px; }

.card .group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.card h2 { margin: 0 0 12px; font-size: 18px; }

.card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  overflow: visible;
}

.card-head h2 { margin: 0; flex: 0 1 auto; }

.card-head .btn,
.card-head .btn.ghost {
  flex: 0 0 auto;
  white-space: nowrap;
}

.data.plain tbody tr { cursor: default; }

.salary-payslip-cell {
  min-width: 160px;
  vertical-align: middle;
}

.salary-payslip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}

.salary-payslip-cell .hint {
  display: block;
  margin: 0;
  font-size: 12px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.salary-share-table .check-col {
  width: 42px;
  text-align: center;
}

.salary-share-table tr.is-selected td {
  background: color-mix(in srgb, var(--accent, #0b3264) 8%, transparent);
}

.salary-share-table .check-col input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent, #0b3264);
}

.row-actions { display: flex; gap: 6px; white-space: nowrap; }

.btn.tiny { padding: 6px 10px; font-size: 13px; }

.empty-row { text-align: center; color: var(--muted); padding: 24px; }

.expense-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 0.9fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

.expense-layout > * { min-width: 0; }

.expense-side { display: grid; gap: 16px; min-width: 0; }

.table-scroll {
  overflow: visible;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.scroll-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.mobile-only { display: none; }
.mobile-top,
.side-backdrop,
.side-drawer-head { display: none; }

.expense-table td:nth-child(2) input { min-width: 180px; }

.expense-table tfoot td, .salary-table tfoot td {
  font-weight: 700;
  background: #f7f9fc;
}

.salary-table input[data-field="name"],
.salary-table input[data-field="role"] { min-width: 120px; }

.salary-money-cell,
.salary-days-cell {
  min-width: 96px;
}

.salary-money-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 96px;
  box-sizing: border-box;
  padding: 0 10px 0 12px;
  background: #fff;
  border: 1px solid var(--line, #e4e9f0);
  border-radius: 12px;
  overflow: hidden;
  direction: ltr;
}

.salary-money-wrap:focus-within {
  border-color: #aecbfa;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.18);
}

.salary-money-wrap .salary-currency {
  flex: 0 0 auto;
  color: var(--muted, #64748b);
  font-weight: 700;
  line-height: 1;
}

.salary-money-wrap input.num {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent;
  border-radius: 0;
  padding: 11px 0;
  direction: ltr;
  text-align: left;
}

.salary-days-cell input.num {
  min-width: 72px;
}

.totals-card .total-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.totals-card .total-line:last-child { border-bottom: 0; }

.totals-card strong { font-size: 16px; }

@media print {
  .side, .mobile-top, .side-backdrop, .page-head .head-actions, .btn, .scroll-hint { display: none !important; }
  .main { padding: 0 !important; }
}

@media (max-width: 1100px) {
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .expense-layout { grid-template-columns: minmax(0, 1fr); }
  .summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .mobile-only { display: block; }

  .login-wrap { grid-template-columns: 1fr; min-height: 100dvh; }
  .login-hero {
    min-height: 0;
    padding: 28px 20px 24px;
    align-items: flex-end;
  }
  .login-hero h1 { font-size: 34px; }
  .login-hero p { font-size: 16px; }
  .mark { width: 52px; height: 52px; margin-bottom: 16px; }
  .login-panel {
    align-items: flex-start;
    padding: 24px 16px 32px;
  }

  .shell {
    flex-direction: column;
    min-height: 100dvh;
  }
  .shell.nav-open {
    overflow: hidden;
  }

  .mobile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 10px 12px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 6px 18px rgba(8, 38, 75, 0.08);
  }
  .mobile-top-brand {
    min-width: 0;
    display: grid;
    gap: 2px;
  }
  .mobile-top-brand strong {
    font-size: 17px;
    font-weight: 700;
    color: var(--brand);
    line-height: 1.2;
  }
  .mobile-top-brand .year-note {
    margin: 0;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
    direction: ltr; /* תפריט משמאל, תמונה מימינו */
  }
  .mobile-menu-btn,
  .mobile-avatar-btn,
  .mobile-avatar-wrap {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    padding: 0;
    display: grid;
    place-items: center;
    background: #f1f3f4;
    color: #3c4043;
    cursor: pointer;
    flex: none;
  }
  .mobile-menu-btn svg {
    width: 22px;
    height: 22px;
    display: block;
  }
  .mobile-menu-btn:hover,
  .mobile-avatar-btn:hover {
    background: #e8f0fe;
    color: #1967d2;
  }
  .mobile-avatar-btn,
  .mobile-avatar-wrap {
    background: transparent;
    overflow: hidden;
  }
  .user-avatar.top {
    width: 38px;
    height: 38px;
    border-width: 2px;
  }

  .side-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }
  .shell.nav-open .side-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .side {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    width: min(320px, 88vw);
    height: 100dvh;
    z-index: 50;
    display: flex;
    flex-direction: column;
    overflow: auto;
    overscroll-behavior: contain;
    background: #fff;
    border-inline-start: 0;
    box-shadow: -12px 0 40px rgba(8, 38, 75, 0.22);
    transform: translateX(105%);
    transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    pointer-events: none;
  }
  .shell.nav-open .side {
    transform: translateX(0);
    pointer-events: auto;
  }
  .side-drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 12px;
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
  }
  .side-drawer-head strong {
    display: block;
    font-size: 18px;
    color: var(--brand);
  }
  .side-drawer-head .year-note {
    margin-top: 4px;
    font-size: 12px;
  }
  .side-drawer-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #f1f3f4;
    color: #5f6368;
    display: grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
    flex: none;
  }
  .side-drawer-close svg {
    width: 18px;
    height: 18px;
  }
  .side-drawer-close:hover {
    background: #e8f0fe;
    color: #1967d2;
  }
  .side .brand { display: none; }
  .nav {
    flex-direction: column;
    flex-wrap: nowrap;
    overflow: visible;
    gap: 4px;
    padding: 12px 12px 8px;
  }
  .nav-btn {
    white-space: nowrap;
    padding: 12px 14px;
    font-size: 15px;
    flex: none;
    width: 100%;
  }
  .nav-btn.active {
    box-shadow: none;
  }
  .side-year {
    margin-top: auto;
    padding: 12px 16px 10px;
    border-top: 1px solid var(--line);
    border-bottom: 0;
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .side-year label { margin: 0; white-space: nowrap; }
  .side-user {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "avatar head"
      "avatar role"
      "logout logout";
    align-items: center;
    column-gap: 10px;
    row-gap: 4px;
    padding: 12px 16px 16px;
  }
  .side-user .user-avatar { grid-area: avatar; width: 44px; height: 44px; }
  .side-user-head { grid-area: head; }
  .side-user small { grid-area: role; font-size: 12px; }
  .side-user .logout {
    grid-area: logout;
    width: 100%;
    margin-top: 6px;
    padding: 9px 12px;
    font-size: 14px;
  }
  .side-user b { font-size: 14px; }

  .main { padding: 16px 12px 28px; }
  .main.tight { padding: 12px 8px 20px; }

  .page-head {
    margin-bottom: 14px;
  }
  h1 { font-size: 24px; }
  .lede { font-size: 14px; margin-bottom: 12px; }
  .toolbar {
    flex-wrap: wrap;
    width: 100%;
  }
  .toolbar > * {
    flex: 1 1 auto;
  }
  .head-actions .view-switch {
    flex: 0 0 auto;
  }
  .toolbar input[type="search"] { min-width: 0; flex: 1 1 100%; }
  .toolbar select, .year-select, .filters select { width: auto; min-width: 0; flex: 1 1 140px; }
  .head-actions select,
  .head-actions .year-select {
    flex: 0 0 auto;
    width: auto;
    min-width: 110px;
  }

  .summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .summary strong { font-size: clamp(14px, 4vw, 16px); }
  .summary div { font-size: 12px; padding: 10px 8px; }

  .count-strip {
    min-width: 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
    gap: 0;
  }
  .count-strip div { font-size: 11px; padding-top: 8px; }
  .count-strip strong { font-size: 14px; padding: 8px 0; }

  .board-wrap {
    max-height: none;
    border-radius: 10px;
    overflow: visible;
  }
  .board {
    min-width: 0;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .board th, .board td, .name-btn { font-size: 13px; }

  .pay-wrap {
    max-height: none;
    border-radius: 10px;
    overflow: visible;
  }
  .pay .sticky {
    min-width: 0;
    max-width: none;
  }
  .family-cell { min-width: 0; }
  .pay .num { width: 100%; max-width: 96px; }
  .pay .status { width: auto; min-width: 0; }

  .data {
    min-width: 0;
    width: 100%;
  }
  .data.plain { min-width: 0; width: 100%; }
  .data th, .data td {
    padding: 10px 12px;
    font-size: 14px;
  }
  .salary-table,
  .expense-table { min-width: 0; width: 100%; }
  .expense-table td:nth-child(2) input { min-width: 0; width: 100%; }
  .head-actions .btn,
  .head-actions .btn.ghost {
    flex: 1 1 auto;
    text-align: center;
  }

  .card-head {
    flex-wrap: wrap;
    gap: 8px;
  }

  .table-scroll,
  .board-scroll,
  .pay-year-scroll {
    overflow: visible !important;
  }

  .overlay {
    padding: 12px 8px;
    align-items: stretch;
  }
  .dialog, .dialog.narrow, .dialog.wide {
    width: 100%;
    max-height: calc(100dvh - 24px);
    border-radius: 14px;
  }
  .fields, .checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fields.fields-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dialog-actions {
    flex-wrap: wrap;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
}

.search-wide {
  width: 100%;
  margin-bottom: 12px;
}

.class-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow: visible;
  margin-bottom: 14px;
}

.class-tab {
  border: 0;
  background: #f1f3f4;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  color: #3c4043;
}

.class-tab.on {
  background: #e8f0fe;
  color: #1967d2;
  font-weight: 600;
}

.dash-orbit {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 16px;
  align-items: stretch;
}

.dash-orbit-top {
  order: -1;
}

.dash-orbit-birthdays-only {
  grid-template-columns: minmax(0, 1fr);
}

.dash-chart-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 280px);
  gap: 14px;
  align-items: stretch;
  min-width: 0;
}

.dash-birthdays {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
  min-width: 0;
  min-height: 100%;
  align-content: start;
}

.dash-birthdays-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.dash-bday-panes {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.dash-birthdays.is-split .dash-bday-panes {
  grid-template-rows: repeat(2, minmax(0, 1fr));
  height: 100%;
}

.dash-bday-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  min-height: 0;
  padding: 8px 10px;
  border: 1px solid var(--line, #e4e9f0);
  border-radius: 12px;
  background: #f8fafc;
}

.dash-bday-pane h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted, #64748b);
}

.dash-bday-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  align-content: start;
  overflow-y: auto;
  max-height: 280px;
  min-height: 0;
}

.dash-bday-item {
  display: grid;
  gap: 2px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line, #e4e9f0);
  border-radius: 10px;
  background: #fff;
  text-align: right;
  font: inherit;
  color: inherit;
  cursor: default;
}

button.dash-bday-item {
  cursor: pointer;
}

button.dash-bday-item:hover {
  border-color: color-mix(in srgb, var(--accent, #2563eb) 40%, #cbd5e1);
  background: #f8fbff;
}

.dash-bday-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 10px;
}

.dash-bday-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.dash-bday-class {
  font-size: 12px;
  font-weight: 700;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.dash-bday-meta {
  font-size: 12px;
  color: var(--muted, #64748b);
  font-weight: 600;
}

.dash-bday-empty {
  margin: 0;
  font-size: 13px;
  color: var(--muted, #64748b);
}

.dash-alerts-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.dash-alerts-row.is-split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dash-alerts-row.is-triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .dash-alerts-row.is-triple {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .dash-alerts-row.is-triple {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-alerts-row.is-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.payslip-drop {
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
  margin-bottom: 14px;
  padding: 16px 14px;
  border: 1.5px dashed color-mix(in srgb, var(--accent, #2563eb) 45%, #cbd5e1);
  border-radius: 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent, #2563eb) 6%, #fff), #fff);
  color: var(--ink, #0f172a);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.payslip-drop strong {
  font-size: 14px;
}

.payslip-drop > span {
  font-size: 13px;
  color: var(--muted, #64748b);
}

.payslip-drop .hint {
  font-size: 12px;
}

.payslip-drop:hover,
.payslip-drop.is-dragover {
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #2563eb) 14%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent, #2563eb) 10%, #fff), #fff);
}

.payslip-year-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.payslip-year-filter label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted, #64748b);
}

.payslip-year-filter select {
  min-width: 120px;
  padding: 8px 10px;
  border: 1px solid var(--line, #e4e9f0);
  border-radius: 10px;
  background: #fff;
  font: inherit;
}

.perm-widgets {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line, #e4e9f0);
  border-radius: 14px;
  background: #f8fafc;
}

.perm-widgets h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.perm-widget-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.perm-widget {
  margin: 0;
}

.dash-summary {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  border-radius: 20px;
  padding: 20px 18px;
  display: grid;
  gap: 14px;
  align-content: center;
  min-height: 220px;
  box-shadow: var(--shadow);
}

.dash-metric {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.dash-metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #bfdbfe;
  display: grid;
  place-items: center;
  color: #1d4ed8;
}

.dash-metric-icon .icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.dash-metric-icon .icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.dash-metric-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dash-metric-text strong {
  font-size: 32px;
  letter-spacing: -0.04em;
  line-height: 1;
  font-weight: 700;
  color: #1e3a8a;
}

.dash-metric-text span {
  font-size: 13px;
  font-weight: 600;
  color: #1e40af;
}

.dash-metric-sep {
  height: 1px;
  background: #bfdbfe;
  opacity: 0.9;
}

.class-chart {
  padding: 14px 14px 12px;
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
  height: 100%;
}

.dash-chart-row > .class-chart,
.dash-chart-row > .dash-birthdays {
  min-height: 220px;
}

.class-chart-title {
  margin: 0;
  font-size: 15px;
  color: var(--ink);
  font-weight: 700;
}

.class-vbars {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: clamp(2px, 0.7vw, 6px);
  min-width: 0;
  width: 100%;
  overflow: visible;
  padding-bottom: 2px;
}

.vbar {
  flex: 1 1 0;
  min-width: 0;
  max-width: 72px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-rows: auto 210px auto;
  gap: 6px;
  align-items: center;
  justify-items: center;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: transform 0.15s ease;
}

.vbar:disabled {
  cursor: default;
  opacity: 0.85;
}

.vbar-count {
  font-size: clamp(10px, 2.5vw, 13px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.vbar-track {
  width: 70%;
  max-width: 36px;
  min-width: 8px;
  height: 210px;
  background: #f1f5f9;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

.vbar-fill {
  width: 100%;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #38bdf8 0%, #0ea5e9 45%, #0284c7 100%);
  transition: height 0.2s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.vbar.is-empty .vbar-fill {
  background: #cbd5e1;
  border-radius: 2px;
}

.vbar-label {
  font-size: clamp(9px, 2.2vw, 12px);
  font-weight: 600;
  color: var(--muted);
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vbar:not(:disabled):hover {
  transform: translateY(-2px);
}

.vbar:not(:disabled):hover .vbar-fill {
  background: linear-gradient(180deg, #7dd3fc 0%, #0ea5e9 40%, #0369a1 100%);
  box-shadow: 0 6px 14px rgba(14, 165, 233, 0.28);
}

.vbar:not(:disabled):hover .vbar-count,
.vbar:not(:disabled):hover .vbar-label {
  color: #0c4a6e;
}

.vbar:not(:disabled):focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 3px;
  border-radius: 10px;
}

.dash-alerts {
  padding: 14px;
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 0;
}

.dash-alerts h3 {
  margin: 0;
  font-size: 15px;
  color: var(--ink);
}

.dash-alert-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  max-height: 300px;
}

.dash-row.has-fixed-height .dash-alert-list {
  max-height: none;
}

.dash-alert {
  border: 0;
  background: #f8f9fa;
  border-radius: 14px;
  padding: 10px 12px;
  text-align: right;
  display: grid;
  gap: 2px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.dash-alert:hover {
  background: #e8f0fe;
  box-shadow: var(--shadow);
}

.dash-alert.warn {
  background: #fef7e0;
}

.dash-alert.warn:hover { background: #feefc3; }

.dash-alert.bad {
  background: #fce8e6;
}

.dash-alert.bad:hover { background: #fad2cf; }

.dash-alert-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.dash-alert-text {
  font-size: 13px;
  color: #1967d2;
  font-weight: 600;
}

.dash-alert.bad .dash-alert-text { color: #c5221f; }

.dash-alert-meta {
  font-size: 12px;
  color: var(--muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.person-card {
  background: white;
  border: 0;
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 10px;
}

.person-card.clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.person-card.clickable:hover,
.person-card.clickable:focus-visible {
  border-color: color-mix(in srgb, var(--navy) 35%, var(--line));
  box-shadow: 0 8px 22px rgba(11, 50, 100, 0.08);
  outline: none;
}

.person-card h3 { margin: 0; font-size: 16px; }

.person-card .meta { margin: 0; color: var(--muted); font-size: 13px; }
.person-card .meta.soft { opacity: 0.85; font-size: 12px; }

.staff-card {
  align-content: start;
}

.staff-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.staff-extra-classes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px 12px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line, #e4e9f0);
  border-radius: 14px;
  background: #f8fafc;
}

.chip.class-tag {
  display: inline-flex;
  justify-content: center;
  background: #e6f4ea;
  color: #137333;
  border: 1px solid #ceead6;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
}

.card-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.view-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 0;
  border-radius: 999px;
  background: #e8eaed;
}

.view-btn {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.view-btn.on {
  background: white;
  color: #1967d2;
  box-shadow: var(--elev-1);
  font-weight: 600;
}

.view-btn .icon,
.view-btn .icon svg {
  width: 16px;
  height: 16px;
}

.board-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 12px;
}

.board-toolbar .hint { margin: 0; }

.student-list-table tbody tr.click-row {
  cursor: pointer;
}

.student-list-table tbody tr.click-row:hover td {
  background: #f4f7fb;
}

.student-float {
  max-height: min(92dvh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.student-float-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 12px;
  padding: 12px 20px 16px;
}

@media (min-width: 820px) {
  .student-float-body {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: start;
  }

  .student-float-body .student-main-form {
    grid-column: 1;
    grid-row: 1 / span 3;
  }

  .student-float-body .student-side-block {
    grid-column: 2;
  }
}

.chip.sea {
  background: #e6f4f1;
  color: #1f7a6c;
}

.detail { display: grid; gap: 14px; }

.detail-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 18px 20px 8px;
  min-width: 0;
}

.detail-head > div:first-child {
  min-width: 0;
}

.detail-head h2 {
  margin: 0;
  font-size: 24px;
  overflow-wrap: anywhere;
}

.detail-head .lede {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
}

.detail-head .head-actions {
  max-width: none;
}

.detail-head > .btn,
.detail-head > .btn.ghost {
  align-self: flex-start;
}

.child-list { display: grid; gap: 8px; }

.child-row {
  border: 1px solid var(--line);
  background: #f6f8fb;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: right;
}

.pay-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.pay-toolbar .search-wide {
  flex: 1;
  min-width: 200px;
  margin-bottom: 0;
}

.pay-toolbar select { width: 140px; }

.pay-list { display: grid; gap: 10px; }

.pay-card {
  border: 0;
  border-radius: 20px;
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.pay-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.pay-card.paid { box-shadow: var(--shadow), inset -3px 0 0 #34a853; }

.pay-card.alt { box-shadow: var(--shadow), inset -3px 0 0 #1a73e8; }

.pay-card.due { box-shadow: var(--shadow), inset -3px 0 0 #f9ab00; }

.pay-card.bad { box-shadow: var(--shadow), inset -3px 0 0 #ea4335; }

.pay-card.exempt { box-shadow: var(--shadow), inset -3px 0 0 #9aa0a6; }

.pay-line {
  display: grid;
  grid-template-columns: minmax(180px, 1.8fr) 72px 100px;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  font-size: 13px;
}

.pay-line.secondary {
  grid-template-columns: 140px 160px minmax(0, 1fr);
  border-top: 1px solid rgba(27, 36, 48, 0.08);
  padding-top: 10px;
  padding-bottom: 12px;
}

.family-link {
  border: 0;
  background: transparent;
  text-align: right;
  padding: 0;
}

.family-link b { display: block; font-size: 15px; }

.family-link.inline {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  max-width: 100%;
}

.family-link.inline b {
  display: inline;
  white-space: nowrap;
}

.pay-phone {
  color: var(--muted);
  font-size: 13px;
  direction: ltr;
  unicode-bidi: plaintext;
  white-space: nowrap;
}

.pay-year-wrap { padding: 0; overflow: hidden; }

.pay-year-scroll {
  max-height: calc(100dvh - 250px);
  overflow: auto;
}

.pay-year-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: max-content;
}

.pay-year-table th,
.pay-year-table td {
  white-space: nowrap;
  vertical-align: middle;
}

.pay-year-table .pay-sticky {
  position: sticky;
  background: white;
  z-index: 2;
}

.pay-year-table thead .pay-sticky {
  z-index: 3;
  background: #f4f7fb;
}

.pay-year-table .pay-sticky.name {
  right: 0;
  width: 170px;
  min-width: 170px;
  max-width: 170px;
  text-align: right;
  box-shadow: -1px 0 0 var(--line);
}

.pay-year-table .pay-sticky.amount {
  right: 170px;
  width: 92px;
  min-width: 92px;
  text-align: left;
  box-shadow: -1px 0 0 var(--line);
}

.pay-year-table .pay-month-col {
  min-width: 118px;
  padding-inline: 6px;
}

.pay-year-table select.status.compact {
  width: 100%;
  min-width: 0;
  padding: 4px 6px;
  font-size: 12px;
}

.pay-card input,
.pay-card select {
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13px;
}

.pay-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 38px;
  padding: 8px 14px 8px 34px;
  border: 1px solid var(--line, #e4e9f0);
  border-radius: 999px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%231f2937' d='M1.2 1.3 6 6.1l4.8-4.8 1.2 1.2L6 8.5 0 2.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  background-size: 10px 7px;
  color: var(--ink, #0f172a);
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
  cursor: pointer;
}

.pay-select:focus {
  border-color: #aecbfa;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.16);
}

.pay-select.is-placeholder,
.pay-select:has(option[value=""]:checked) {
  color: #94a3b8;
}

.pay-select option {
  color: var(--ink, #0f172a);
}

.pay-card .pay-select,
.pay-card select.pay-select {
  border: 1px solid var(--line, #e4e9f0) !important;
  border-radius: 999px !important;
  padding: 8px 14px 8px 34px !important;
  min-height: 38px;
  font-size: 13px;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%231f2937' d='M1.2 1.3 6 6.1l4.8-4.8 1.2 1.2L6 8.5 0 2.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  background-size: 10px 7px;
}

.pay-card select.pay-select.status {
  box-shadow: none;
}

.pay-card select.pay-select.status:not(.st-paid):not(.st-alt):not(.st-due):not(.st-bad):not(.st-exempt):not(.st-new),
.pay-card select.pay-select.status.is-placeholder {
  background-color: #fff !important;
  color: #94a3b8 !important;
}

.pay-year-table select.pay-select.status.compact {
  min-height: 32px;
  padding: 4px 8px 4px 26px !important;
  border-radius: 999px !important;
  border: 1px solid var(--line, #e4e9f0) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%231f2937' d='M1.2 1.3 6 6.1l4.8-4.8 1.2 1.2L6 8.5 0 2.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 8px center;
  background-size: 9px 6px;
  font-size: 12px;
}

.pay-year-table select.pay-select.status.compact.is-placeholder,
.pay-year-table select.pay-select.status.compact:has(option[value=""]:checked) {
  background-color: #fff !important;
  color: #94a3b8 !important;
}

.dialog .pay-select {
  border-radius: 999px;
}

.board-scroll {
  overflow: visible;
  max-height: none;
}

.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.board .col {
  background: white;
  border: 1px solid #d5dce6;
  border-radius: 12px;
  min-width: 88px;
  overflow: hidden;
}

.board .col header {
  background: #f3eee4;
  padding: 7px 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.board .col header small { font-weight: 400; color: var(--muted); }

.board .col ul {
  list-style: none;
  margin: 0;
  padding: 4px;
  display: grid;
  gap: 2px;
}

.board .col li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  gap: 2px;
  align-items: center;
}

.board .col .name {
  border: 0;
  background: transparent;
  text-align: right;
  padding: 5px 4px;
  border-radius: 7px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board .col .name:hover { background: #eef2f6; }

.board-empty {
  padding: 6px;
  color: var(--muted);
  font-size: 11px;
  grid-column: 1 / -1;
}

.icon-btn {
  border: 1px solid var(--line);
  background: white;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--navy);
}

.icon-btn svg { width: 12px; height: 12px; }

.checkline.sea {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  background: #e6f4f1;
  border-radius: 10px;
  color: #1f7a6c;
  font-size: 14px;
}

.checkline.sea input { width: auto; }

.type-list { display: grid; gap: 8px; padding: 12px 14px; }

.type-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #f6f8fb;
  font-size: 13px;
}

.kind-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  grid-column: 1 / -1;
}

.kind-toggle label {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  background: #f6f8fb;
  color: var(--ink);
}

.kind-toggle input { width: auto; }

@media (max-width: 1100px) {
  .dash-chart-row {
    grid-template-columns: 1fr;
  }

  .dash-birthdays.is-split .dash-bday-panes {
    grid-template-rows: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: auto;
  }

  .dash-bday-list {
    max-height: 220px;
  }
}

@media (max-width: 980px) {
  .dash-orbit {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .dash-summary {
    min-height: 0;
    padding: 14px 12px;
    gap: 10px;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }
  .dash-metric-sep {
    width: 1px;
    height: 100%;
    min-height: 42px;
    align-self: stretch;
  }
  .dash-metric-text strong { font-size: clamp(20px, 6vw, 28px); }
  .dash-metric-text span { font-size: 12px; }
  .dash-metric-icon { width: 36px; height: 36px; border-radius: 10px; }
  .class-chart { padding: 12px 10px 10px; }
  .class-chart-title { font-size: 14px; }
  .class-vbars { gap: 3px; }
  .vbar {
    grid-template-rows: auto 150px auto;
    max-width: none;
    gap: 4px;
  }
  .vbar-track { height: 150px; width: 62%; }
  .dash-chart-row { grid-template-columns: 1fr; }
  .dash-birthdays.is-split .dash-bday-panes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .dash-win-summary {
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  }
  .dash-staff-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
  .dash-windows-list {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
  .notice-gen-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .notice-student-list {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .pay-line { grid-template-columns: minmax(0, 1fr) auto auto; }
  .pay-line.secondary { grid-template-columns: 1fr 1fr; }
  .type-row { grid-template-columns: 1fr 1fr; }
  .pay-year-table .pay-sticky.name,
  .pay-year-table .pay-sticky.amount {
    position: static;
    box-shadow: none;
    width: auto;
    min-width: 110px;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .login-hero { padding: 22px 16px 18px; }
  .login-hero h1 { font-size: 28px; }
  .login-card h2 { font-size: 22px; }

  .mobile-top { padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
  .mobile-top-brand strong { font-size: 16px; }
  .nav { padding: 10px 10px 8px; }
  .nav-btn { padding: 11px 12px; font-size: 14px; }

  .main { padding: 12px 10px calc(24px + env(safe-area-inset-bottom, 0px)); }
  h1 { font-size: 22px; }

  .fields, .checks { grid-template-columns: 1fr 1fr; }
  .dialog-actions .group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .dialog-actions .btn.danger {
    width: 100%;
    order: 2;
  }

  .filters { width: 100%; }
  .filters button { flex: 1 1 calc(50% - 6px); text-align: center; }

  .row-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn, .nav-btn, .logout { min-height: 40px; }
  .btn.tiny { min-height: 36px; }

  .pay-wrap { max-height: calc(100dvh - 320px); }
  .board-wrap { max-height: calc(100dvh - 230px); }

  .totals-card .total-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .dash-alerts-row.is-split,
  .dash-alerts-row.is-triple {
    grid-template-columns: 1fr;
  }
  .dash-birthdays.is-split .dash-bday-panes {
    grid-template-columns: 1fr;
  }
  .vbar {
    grid-template-rows: auto 120px auto;
    gap: 3px;
  }
  .vbar-track { height: 120px; }
  .summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .notice-gen-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

.perm-grid {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line, #e4e9f0);
  border-radius: 14px;
  background: #fbfcfe;
}

.perm-head,
.perm-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 88px 88px;
  gap: 8px;
  align-items: center;
}

.perm-head {
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 700;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line, #e4e9f0);
}

.perm-label {
  font-weight: 600;
}

.perm-check {
  justify-content: flex-start;
  margin: 0;
  white-space: nowrap;
}

.preview-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #e8eef6;
}

.preview-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  background: #0f2d5a;
  color: #fff;
  box-shadow: 0 8px 24px rgba(15, 45, 90, 0.18);
}

.preview-bar-copy {
  display: grid;
  gap: 2px;
}

.preview-bar-copy strong {
  font-size: 15px;
}

.preview-bar-copy span {
  font-size: 12px;
  opacity: 0.78;
}

.preview-user-tabs {
  margin: 0;
  padding: 0;
  border: 0;
}

.preview-bar .dash-user-tab {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: transparent;
}

.preview-bar .dash-user-tab:hover {
  background: rgba(255, 255, 255, 0.18);
}

.preview-bar .dash-user-tab.on {
  background: #fff;
  color: #0f2d5a;
  border-color: #fff;
}

.preview-exit {
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.preview-exit:hover {
  background: rgba(255, 255, 255, 0.2);
}

.preview-layout .shell {
  flex: 1;
  min-height: 0;
}

@media (max-width: 960px) {
  .preview-bar {
    grid-template-columns: 1fr;
  }
}

.dash-user-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: visible;
  margin: 0 0 16px;
  padding: 4px 2px 10px;
  border-bottom: 1px solid var(--line, #e4e9f0);
}

.dash-user-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #f4f7fb;
  color: inherit;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.dash-user-tab:hover {
  background: #eaf0f8;
}

.dash-user-tab.on {
  background: #fff;
  border-color: #9db6db;
  box-shadow: 0 4px 14px rgba(15, 45, 90, 0.08);
  font-weight: 700;
}

.user-avatar.tiny {
  width: 22px;
  height: 22px;
  font-size: 10px;
}

.dash-personal-head {
  margin-bottom: 14px;
}

.dash-personal-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.dash-sortable {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 22px;
}

.dash-sortable.is-rows {
  width: 100%;
}

.dash-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
  min-width: 0;
  border-radius: 16px;
  transition: outline-color 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.dash-sortable.is-arranging .dash-row {
  position: relative;
  padding: 10px 12px;
  border: 1px solid var(--line, #e4e9f0);
  background: #fff;
}

.dash-row.is-dragging {
  opacity: 0.55;
}

.dash-row.is-drop-target {
  outline: 2px dashed color-mix(in srgb, var(--accent, #2563eb) 55%, #94a3b8);
  outline-offset: 2px;
}

.dash-row-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 2px 0;
}

.dash-row-toolbar .dash-mini-settings {
  position: static;
  flex: none;
}

.dash-row-label {
  flex: 1 1 auto;
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
}

.dash-row-empty-body {
  min-height: 64px;
  display: grid;
  place-items: center;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
  background: #f8fafc;
}

.dash-row-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
  min-width: 0;
}

.dash-row.has-fixed-height .dash-row-grid,
.dash-row.has-fixed-height .dash-block {
  height: var(--dash-row-height);
  min-height: var(--dash-row-height);
}

.dash-row.has-fixed-height .dash-block {
  overflow: hidden;
}

.dash-row.has-fixed-height .dash-block-body {
  overflow-y: auto;
  height: 100%;
}

.dash-block {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  align-self: stretch;
}

.dash-block-body {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
}

.dash-block-body > * {
  width: 100%;
  margin-bottom: 0;
}

.dash-block.is-dragging {
  opacity: 0.55;
}

.dash-block.is-drop-target {
  outline: 2px dashed color-mix(in srgb, var(--accent, #2563eb) 55%, #94a3b8);
  outline-offset: 4px;
  border-radius: 16px;
}

.dash-block-toolbar {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 16px);
}

.dash-block-handle {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line, #e4e9f0);
  border-radius: 10px;
  background: #fff;
  color: #64748b;
  font-size: 16px;
  line-height: 1;
  cursor: grab;
  box-shadow: var(--elev-1, 0 1px 2px rgba(15, 23, 42, 0.08));
}

.dash-block-handle:active {
  cursor: grabbing;
}

.dash-width-controls {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line, #e4e9f0);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--elev-1, 0 1px 2px rgba(15, 23, 42, 0.08));
}

.dash-width-btn {
  margin: 0;
  border: 0;
  border-radius: 8px;
  padding: 6px 8px;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.dash-width-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.dash-width-btn.on {
  background: #eff6ff;
  color: #1d4ed8;
}

@media (max-width: 900px) {
  .dash-row-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .dash-row-grid > .dash-block {
    grid-column: span 6 !important;
  }
}

@media (max-width: 720px) {
  .dash-row-grid {
    grid-template-columns: 1fr;
  }

  .dash-row-grid > .dash-block {
    grid-column: 1 / -1 !important;
  }

  .dash-row.has-fixed-height .dash-row-grid,
  .dash-row.has-fixed-height .dash-block {
    height: auto;
    min-height: 0;
  }
}

.dash-arrange-hint {
  margin: 8px 0 0;
}

.dash-windows-picker {
  margin-top: 14px;
  padding: 14px 16px;
}

.dash-card-rows-admin {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.dash-card-row-admin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line, #e4e9f0);
  border-radius: 12px;
  background: #fff;
}

.dash-card-row-admin-actions {
  display: flex;
  gap: 6px;
  flex: none;
}

.dash-row-cards {
  margin-top: 18px;
  margin-bottom: 22px;
}

.dash-shortcut-row {
  display: grid;
  grid-template-columns: repeat(var(--dash-card-cols, 6), minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  margin: 0;
  min-width: 0;
}

.dash-shortcut-wrap {
  position: relative;
  min-width: 0;
  width: 100%;
  display: flex;
}

.dash-mini-settings {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #475569;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.dash-mini-settings svg {
  width: 16px;
  height: 16px;
  display: block;
}

.dash-shortcut-card.is-placeholder {
  border: 1px dashed #94a3b8;
  background: #f8fafc !important;
  box-shadow: none;
  color: #64748b;
}

.dash-shortcut-card.is-placeholder .dash-shortcut-copy strong,
.dash-shortcut-card.is-placeholder .dash-shortcut-copy span {
  color: #64748b;
}

.dash-windows-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.dash-window-check.is-disabled {
  opacity: 0.55;
}

.dash-shortcut-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 108px;
  margin: 0;
  padding: 16px 14px;
  border: 0;
  border-radius: 22px;
  box-sizing: border-box;
  text-align: right;
  cursor: pointer;
  font: inherit;
  color: #1f2937;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset, 0 8px 20px rgba(15, 23, 42, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dash-shortcut-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 12px 26px rgba(15, 23, 42, 0.1);
}

.dash-shortcut-card:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.dash-shortcut-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.dash-shortcut-copy strong {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  color: #111827;
}

.dash-shortcut-copy span {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  color: #4b5563;
}

.dash-shortcut-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.dash-shortcut-icon .icon,
.dash-shortcut-icon .icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.dash-shortcut-icon .icon svg {
  fill: currentColor;
}

.dash-shortcut-card.color-blue { background: #d9ecfb; }
.dash-shortcut-card.color-green { background: #d9f3e3; }
.dash-shortcut-card.color-pink { background: #f8d9de; }
.dash-shortcut-card.color-yellow { background: #f3e7c8; }
.dash-shortcut-card.color-purple { background: #e7ddf7; }
.dash-shortcut-card.color-peach { background: #f8e2d2; }

.dash-card-edit-grid {
  display: grid;
  gap: 14px;
}

.dash-card-edit-slot {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line, #e4e9f0);
  border-radius: 14px;
  background: #f8fafc;
}

.dash-card-edit-slot h3 {
  margin: 0;
  font-size: 14px;
}

.dash-card-window-body {
  max-height: min(70vh, 760px);
  overflow: auto;
}

.dash-card-window-body > .dash-card,
.dash-card-window-body > .dash-orbit,
.dash-card-window-body > .dash-alerts-row,
.dash-card-window-body > .dash-birthdays,
.dash-card-window-body > .weekly-prints-card,
.dash-card-window-body > .card {
  margin: 0;
  box-shadow: none;
}

.dash-block-body:has(> .weekly-prints-card) {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.weekly-prints-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  flex: 1 1 auto;
}

.weekly-prints-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.weekly-prints-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.weekly-prints-view-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
}

.weekly-prints-view-toggle .view-btn {
  margin: 0;
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.weekly-prints-view-toggle .view-btn.on {
  background: var(--navy);
  color: #fff;
}

.weekly-prints-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(150px, 0.85fr);
  gap: 14px;
  align-items: stretch;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.weekly-prints-layout.is-chart-only {
  grid-template-columns: 1fr;
}

.weekly-prints-chart {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  height: 100%;
  width: 100%;
}

.weekly-prints-card:not(.is-chart-only) .weekly-prints-chart {
  min-height: 220px;
}

.weekly-prints-card.is-chart-only .weekly-prints-chart {
  min-height: min(100%, 240px);
  aspect-ratio: 1;
  max-height: 100%;
}

.dash-row.has-fixed-height .weekly-prints-card.is-chart-only .weekly-prints-chart {
  aspect-ratio: auto;
  min-height: 0;
}

.weekly-print-svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  overflow: visible;
  direction: ltr;
}

.weekly-print-slice path,
.weekly-print-arc path {
  cursor: pointer;
  transform-origin: center;
  transition: filter 0.15s ease, opacity 0.15s ease, stroke-width 0.15s ease;
}

.weekly-print-slice:hover path,
.weekly-print-arc:hover path,
.weekly-print-slice.is-hot path,
.weekly-print-arc.is-hot path {
  filter: brightness(1.08) saturate(1.08);
  stroke-width: 3.5;
}

.weekly-prints-chart:has(.weekly-print-slice:hover) .weekly-print-slice:not(:hover),
.weekly-prints-chart:has(.weekly-print-arc:hover) .weekly-print-arc:not(:hover),
.weekly-prints-chart.is-tipping .weekly-print-slice:not(.is-hot),
.weekly-prints-chart.is-tipping .weekly-print-arc:not(.is-hot) {
  opacity: 0.55;
}

.weekly-print-slice-label,
.weekly-print-arc-value,
.weekly-print-callout-text,
.weekly-print-hub-label,
.weekly-print-hub-value {
  pointer-events: none;
  fill: var(--ink);
  font-family: Assistant, "Segoe UI", Arial, sans-serif;
}

.weekly-print-slice-label {
  font-size: 11px;
  font-weight: 700;
}

.weekly-print-arc-value {
  font-size: 14px;
  font-weight: 800;
  fill: #fff;
  paint-order: stroke fill;
  stroke: rgba(11, 50, 100, 0.28);
  stroke-width: 2.5px;
}

.weekly-print-callout-line {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.35;
  pointer-events: none;
}

.weekly-print-callout-box {
  fill: var(--card);
  stroke: var(--line);
  stroke-width: 1.25;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(11, 50, 100, 0.08));
}

.weekly-print-arc.is-hot .weekly-print-callout-box,
.weekly-print-arc:hover .weekly-print-callout-box {
  stroke: var(--navy);
}

.weekly-print-callout-text {
  font-size: 10.5px;
  font-weight: 700;
  fill: var(--brand);
}

.weekly-print-hub-label {
  font-size: 9px;
  font-weight: 600;
  fill: var(--muted);
}

.weekly-print-hub-value {
  font-size: 14px;
  font-weight: 800;
  fill: var(--brand);
}

.weekly-print-tooltip {
  position: absolute;
  z-index: 5;
  max-width: min(240px, 90%);
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: var(--shadow-hover);
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
  white-space: normal;
  text-align: center;
}

.weekly-print-tooltip[hidden] {
  display: none !important;
}

.weekly-prints-legend {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.weekly-print-legend-block {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.weekly-print-legend-block h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.weekly-print-legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.weekly-print-legend-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--ink);
}

.weekly-print-swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  border: 1px solid rgba(11, 50, 100, 0.08);
}

.weekly-print-legend-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weekly-print-legend-item strong {
  font-variant-numeric: tabular-nums;
  color: var(--brand);
}

.weekly-print-legend-total {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.weekly-print-legend-total strong {
  color: var(--ink);
}

@media (max-width: 720px) {
  .weekly-prints-layout:not(.is-chart-only) {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 1fr) auto;
  }

  .weekly-prints-card:not(.is-chart-only) .weekly-prints-chart {
    min-height: 200px;
  }
}

@media (max-width: 1200px) {
  .dash-shortcut-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .dash-shortcut-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .dash-shortcut-card {
    min-height: 96px;
    padding: 12px 10px;
    border-radius: 18px;
  }
  .dash-shortcut-copy strong { font-size: 14px; }
  .dash-shortcut-copy span { font-size: 11px; }
  .dash-shortcut-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
}

@media (max-width: 420px) {
  .dash-shortcut-row {
    grid-template-columns: 1fr;
  }
}

.dash-windows-picker h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.dash-windows-sub {
  margin: 14px 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted, #64748b);
}

.dash-windows-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 12px;
  margin-top: 10px;
}

.dash-window-check {
  margin: 0;
  align-items: center;
}

.dash-page-window-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dash-win-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.dash-win-summary > div {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--line, #e4e9f0);
}

.dash-win-summary strong {
  font-size: 18px;
  color: var(--ink, #0f172a);
}

.dash-win-summary span {
  font-size: 12px;
  color: var(--muted, #64748b);
  font-weight: 600;
}

.dash-staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.dash-staff-chip {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line, #e4e9f0);
  border-radius: 12px;
  background: #fff;
}

.dash-staff-chip strong {
  font-size: 14px;
}

.dash-staff-chip span {
  font-size: 12px;
  color: var(--muted, #64748b);
}

.dash-block .dash-orbit,
.dash-block .dash-alerts-row,
.dash-block .dash-card,
.dash-block .dash-chart-row,
.dash-block .weekly-prints-card {
  margin-bottom: 0;
}

.dash-row.has-fixed-height .dash-orbit,
.dash-row.has-fixed-height .dash-alerts-row,
.dash-row.has-fixed-height .dash-card,
.dash-row.has-fixed-height .dash-chart-row,
.dash-row.has-fixed-height .dash-alerts {
  height: auto;
  max-height: none;
  min-height: 0;
}

.dash-row.has-fixed-height .weekly-prints-card {
  height: 100%;
  max-height: none;
  min-height: 0;
}

.dash-row.has-fixed-height .dash-block-body:has(> .weekly-prints-card) {
  overflow: hidden;
}

.dash-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.dash-card {
  border: 1px solid var(--line, #e4e9f0);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
  min-width: 0;
}

.dash-card-wide {
  grid-column: 1 / -1;
}

.dash-card-head {
  padding: 14px 16px 0;
}

.dash-card-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.dash-card-body {
  padding: 12px 16px 16px;
}

.dash-card-body > .card,
.dash-card-body > .card.empty,
.dash-card-body .payslip-years,
.dash-card-body .my-area-notices {
  box-shadow: none;
}

.dash-card-body > .card {
  border: 0;
  background: transparent;
  padding: 0;
}

.dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  margin-top: 8px;
  overflow: visible;
}

.dash-actions > * {
  flex: 1 1 auto;
  max-width: 100%;
}

.btn.dash-cta {
  min-height: 56px;
  padding: 16px 28px;
  font-size: 18px;
  border-radius: 16px;
  box-shadow: var(--shadow-hover);
}

.btn.dash-cta .icon,
.btn.dash-cta .icon svg {
  width: 22px;
  height: 22px;
}

/* Google-clean polish */
.search-wide,
#student-search,
#pay-search {
  border-radius: 999px;
  border: 0;
  background: #f1f3f4;
  box-shadow: none;
  padding-inline: 16px;
}

.search-wide:focus,
#student-search:focus,
#pay-search:focus {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.18);
}

.chip.sea {
  background: #e6f4ea !important;
  color: #137333 !important;
}

.person-card.clickable:hover,
.person-card.clickable:focus-visible {
  border-color: transparent;
  box-shadow: var(--shadow-hover);
}

.board-wrap,
.pay-year-wrap,
.table-scroll {
  border: 0;
  border-radius: 20px;
  box-shadow: var(--shadow);
  background: #fff;
}

.icon {
  display: inline-grid;
  place-items: center;
  line-height: 0;
}

.icon svg {
  display: block;
  fill: currentColor;
}

.my-area-greet {
  margin: -6px 0 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.payslip-years {
  display: grid;
  gap: 16px;
}

.payslip-year-section {
  border: 1px solid var(--line, #e4e9f0);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.payslip-year-section.is-current {
  border-color: #c7d7ef;
  box-shadow: 0 10px 24px rgba(15, 45, 90, 0.06);
}

.payslip-year-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border: 0;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  text-align: right;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.payslip-year-section.is-current .payslip-year-head {
  background: linear-gradient(180deg, #eef4ff 0%, #fff 100%);
}

.payslip-year-head-text h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.payslip-year-head-text p {
  margin: 4px 0 0;
  color: var(--muted, #64748b);
  font-size: 13px;
}

.payslip-year-chevron {
  color: #64748b;
  font-size: 16px;
}

.payslip-year-body {
  padding: 4px 16px 18px;
  border-top: 1px solid var(--line, #e4e9f0);
}

.payslip-docs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
  direction: rtl;
}

.payslip-doc-wrap {
  position: relative;
}

.payslip-doc-delete {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border: 1px solid #f1c0bc;
  border-radius: 999px;
  background: #fff;
  color: #c5221f;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(15, 45, 90, 0.08);
}

.payslip-doc-delete:hover {
  background: #fce8e6;
  border-color: #ea4335;
}

.payslip-doc {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  padding: 12px 12px 14px;
  border: 1px solid #e5ebf3;
  border-radius: 14px;
  background: #fbfcfe;
  cursor: pointer;
  text-align: center;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.payslip-doc:hover {
  border-color: #9db6db;
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(15, 45, 90, 0.08);
}

.payslip-doc-sheet {
  position: relative;
  height: 92px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f3f6fb 100%);
  border: 1px solid #d9e2ef;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.payslip-doc-sheet::before {
  content: "";
  position: absolute;
  inset: 16px 14px auto;
  height: 8px;
  border-radius: 999px;
  background: #dbe4f1;
}

.payslip-doc-sheet::after {
  content: "";
  position: absolute;
  inset: 32px 14px auto;
  height: 8px;
  border-radius: 999px;
  background: #e8eef6;
  width: 58%;
  margin-inline-start: auto;
  margin-inline-end: 0;
}

.payslip-doc-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.payslip-doc-month {
  font-size: 15px;
  font-weight: 800;
}

.payslip-doc-meta {
  font-size: 11px;
  color: var(--muted, #64748b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payslip-year-body .empty.soft {
  padding: 18px 8px;
  color: var(--muted, #64748b);
  text-align: center;
}

@media (max-width: 960px) {
  .dash-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .payslip-docs {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  }
}

.my-area-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: visible;
  margin-bottom: 14px;
  padding-bottom: 2px;
}

.my-area-tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  cursor: pointer;
}

.my-area-tab.on {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e3a8a;
}

.my-area-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  overflow: visible;
}

.my-area-toolbar .search-wide {
  flex: 1 1 220px;
  min-width: 160px;
}

.my-area-toolbar .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.my-area-notices {
  display: grid;
  gap: 14px;
}

.my-area-notice-form h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.my-area-notice-form textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}

.notice-list {
  display: grid;
  gap: 10px;
}

.notice-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: grid;
  gap: 10px;
}

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

.notice-card h3 {
  margin: 0;
  font-size: 16px;
}

.notice-card .meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.notice-body {
  margin: 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

#save-toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 1200;
  padding: 10px 14px;
  border-radius: 999px;
  background: #137333;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(19, 115, 51, 0.28);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#save-toast.show {
  opacity: 1;
  transform: translateY(0);
}

#save-toast[hidden] {
  display: none !important;
}

#save-toast.is-error {
  background: #c5221f;
  box-shadow: 0 8px 24px rgba(197, 34, 31, 0.28);
}

/* ===== Responsive: vertical scroll only, no horizontal page scroll ===== */
html, body, #app, .shell, .main, .card, .overlay, .dialog {
  max-width: 100%;
}

html, body {
  overflow-x: hidden;
}

#app, .shell, .main {
  overflow-x: clip;
}

.table-scroll,
.board-scroll,
.pay-year-scroll,
.pay-wrap {
  max-width: 100%;
}

@media (max-width: 980px) {
  .scroll-hint,
  .mobile-only.scroll-hint {
    display: none !important;
  }

  .toolbar,
  .pay-toolbar,
  .board-toolbar,
  .filters,
  .head-actions,
  .card-head,
  .my-area-toolbar {
    flex-wrap: wrap !important;
    overflow: visible !important;
    max-width: 100%;
  }

  .head-actions > *,
  .toolbar > *,
  .my-area-toolbar > * {
    max-width: 100%;
  }

  .head-actions .btn,
  .head-actions .btn.ghost,
  .head-actions select {
    flex: 1 1 calc(50% - 8px);
    min-width: min(100%, 140px);
  }

  .table-scroll,
  .board-scroll,
  .pay-year-scroll,
  .pay-wrap,
  .board-wrap {
    overflow-x: visible !important;
    overflow-y: visible !important;
    max-height: none !important;
    width: 100%;
  }

  /* Stack wide data tables into labeled cards */
  .salary-table thead,
  .expense-table thead,
  .pay-year-table thead,
  table.data.responsive-cards thead {
    display: none;
  }

  .salary-table,
  .expense-table,
  .pay-year-table,
  table.data.responsive-cards {
    min-width: 0 !important;
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .salary-table tbody,
  .expense-table tbody,
  .pay-year-table tbody,
  table.data.responsive-cards tbody,
  .salary-table tfoot,
  .expense-table tfoot {
    display: grid;
    gap: 10px;
  }

  .salary-table tbody tr,
  .expense-table tbody tr,
  .pay-year-table tbody tr,
  table.data.responsive-cards tbody tr,
  .salary-table tfoot tr,
  .expense-table tfoot tr {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
    margin: 0;
    background: #fff;
    border: 1px solid var(--line, #e4e9f0);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
  }

  .salary-table tbody td,
  .salary-table tbody th,
  .expense-table tbody td,
  .expense-table tbody th,
  .pay-year-table tbody td,
  .pay-year-table tbody th,
  table.data.responsive-cards tbody td,
  table.data.responsive-cards tbody th,
  .salary-table tfoot td,
  .expense-table tfoot td {
    display: grid;
    grid-template-columns: minmax(88px, 34%) minmax(0, 1fr);
    align-items: center;
    gap: 8px 12px;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100%;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }

  .salary-table tbody td::before,
  .salary-table tbody th::before,
  .expense-table tbody td::before,
  .expense-table tbody th::before,
  .pay-year-table tbody td::before,
  .pay-year-table tbody th::before,
  table.data.responsive-cards tbody td::before,
  table.data.responsive-cards tbody th::before,
  .salary-table tfoot td::before,
  .expense-table tfoot td::before {
    content: attr(data-label);
    color: var(--muted, #5f6368);
    font-size: 12px;
    font-weight: 700;
  }

  .salary-table tbody td:not([data-label])::before,
  .salary-table tbody td[data-label=""]::before,
  .expense-table tbody td:not([data-label])::before,
  .expense-table tbody td[data-label=""]::before,
  .pay-year-table tbody td:not([data-label])::before,
  .pay-year-table tbody td[data-label=""]::before {
    display: none;
  }

  .salary-table tbody td:not([data-label]),
  .salary-table tbody td[data-label=""],
  .expense-table tbody td:not([data-label]),
  .expense-table tbody td[data-label=""],
  .pay-year-table tbody td:not([data-label]),
  .pay-year-table tbody td[data-label=""] {
    grid-template-columns: 1fr;
  }

  .salary-table input,
  .salary-table select,
  .expense-table input,
  .expense-table select,
  .pay-year-table select,
  .salary-money-wrap,
  .salary-days-cell input.num {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100%;
  }

  .salary-table tfoot td[colspan],
  .expense-table tfoot td[colspan] {
    grid-template-columns: 1fr;
  }

  .pay-year-table tbody tr {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pay-year-table .pay-sticky.name,
  .pay-year-table .pay-sticky.amount {
    grid-column: 1 / -1;
  }

  .pay-sticky {
    position: static !important;
    left: auto !important;
    right: auto !important;
    box-shadow: none !important;
  }

  .board {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    min-width: 0 !important;
  }

  .board .col {
    min-width: 0 !important;
  }

  .perm-head,
  .perm-row {
    grid-template-columns: minmax(0, 1fr) 72px 72px;
  }

  .mail-compose-dialog .mail-compose-body {
    grid-template-columns: 1fr;
  }

  .mail-compose-preview .mail-preview-frame,
  .mail-html-preview {
    min-height: 42vh;
  }

  .dialog.wide,
  .payslip-preview-dialog {
    width: 100%;
  }

  .payslip-frame {
    min-height: 50vh;
  }
}

@media (max-width: 640px) {
  .board {
    grid-template-columns: 1fr !important;
  }

  .count-strip {
    grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
  }

  .head-actions .btn,
  .head-actions .btn.ghost,
  .head-actions select {
    flex: 1 1 100%;
  }

  .pay-year-table tbody tr {
    grid-template-columns: 1fr;
  }

  .side-user {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "avatar head"
      "avatar role"
      "logout logout";
  }

  .side-user .logout {
    width: 100%;
  }
}

@font-face {
  font-family: "PFT_Vilna";
  src: url("/static/notices/fonts/PFT_vilna.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PFT_Vilna";
  src: url("/static/notices/fonts/PFT_vilna-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PFT Vilna";
  src: url("/static/notices/fonts/PFT_vilna.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "EFT_Besimches";
  src: url("/static/notices/fonts/EFT_Besimches-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "EFT_Besimches";
  src: url("/static/notices/fonts/EFT_Besimches.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "EFT_Besimches_Light";
  src: url("/static/notices/fonts/EFT_Besimches-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "EFT_Besimches_Mechuyat";
  src: url("/static/notices/fonts/EFT_Besimches-mechuyat.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "EFT Besimches";
  src: url("/static/notices/fonts/EFT_Besimches-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DBSHAND";
  src: url("/static/notices/fonts/DBSHAND.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

.notice-gen-page {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: calc(100dvh - 72px);
}

.main.tight .notice-gen-page {
  min-height: calc(100dvh - 48px);
}

.notice-gen-page .page-head {
  margin-bottom: 0;
}

.notice-gen-page h1 {
  margin: 0;
  font-size: 24px;
}

.notice-gen-card {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  flex: 1 1 auto;
  align-content: start;
}

.notice-gen-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.notice-gen-footer {
  position: sticky;
  bottom: 0;
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: auto -16px -20px;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(8, 38, 75, 0.08);
  backdrop-filter: blur(10px);
}

.notice-gen-footer .btn {
  flex: none;
  min-width: 160px;
}

@media (max-width: 980px) {
  .notice-gen-page {
    min-height: calc(100dvh - 64px - env(safe-area-inset-top, 0px));
    gap: 8px;
  }
  .main.tight .notice-gen-page {
    min-height: calc(100dvh - 56px - env(safe-area-inset-top, 0px));
  }
  .notice-gen-card {
    padding: 12px;
    border-radius: 14px;
  }
  .notice-gen-footer {
    margin-inline: -8px;
    margin-bottom: -20px;
    padding-inline: 12px;
  }
  .notice-gen-footer .btn {
    min-width: 0;
    flex: 0 0 auto;
  }
}

@media (max-width: 640px) {
  .notice-gen-footer {
    margin-inline: -8px;
    margin-bottom: calc(-20px - env(safe-area-inset-bottom, 0px));
    gap: 10px;
  }
  .notice-gen-summary span {
    font-size: 13px;
  }
}

.notice-type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notice-type-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  border: 1px solid var(--line, #e4e9f0);
  border-radius: 12px;
  padding: 10px 14px;
  background: #fff;
  color: var(--ink, #0f172a);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.notice-type-tab small {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  text-align: center;
}

.notice-type-tab.on {
  border-color: color-mix(in srgb, var(--accent, #2563eb) 45%, #cbd5e1);
  background: #eff6ff;
  color: #1d4ed8;
}

.notice-type-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line, #e4e9f0);
  border-radius: 14px;
  background: #f8fafc;
}

.notice-type-panel h3 {
  margin: 0;
  font-size: 16px;
}

.notice-student-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.notice-student-check.is-disabled {
  opacity: 0.55;
}

.notice-gen-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: #64748b;
  min-width: 0;
}

.notice-gen-summary strong {
  font-size: 22px;
  color: var(--ink, #0f172a);
}

.notice-preview-dialog {
  width: min(1100px, 100%);
}

.notice-preview-body {
  max-height: min(72vh, 820px);
  overflow: auto;
}

.notice-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  justify-items: center;
}

.notice-preview-item {
  margin: 0;
  width: 100%;
  max-width: 320px;
}

.notice-preview-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
  background: #fff;
}

.notice-sheet-frame {
  width: calc(210mm * 0.42);
  height: calc(297mm * 0.42);
  overflow: hidden;
}

.notice-sheet-frame .notice-sheet {
  transform: scale(0.42);
  transform-origin: top left;
}

.notice-sheet {
  position: relative;
  width: 210mm;
  height: 297mm;
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
  overflow: hidden;
  --notice-meta-color: #C33100;
}

.notice-meta,
.notice-student,
.notice-educator,
.notice-extra {
  position: absolute;
  margin: 0;
  padding: 0;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
}

.notice-sheet.is-editing .notice-meta,
.notice-sheet.is-editing .notice-student,
.notice-sheet.is-editing .notice-educator,
.notice-sheet.is-editing .notice-extra {
  pointer-events: auto;
  cursor: grab;
  outline: 1px dashed transparent;
  outline-offset: 6px;
}

.notice-sheet.is-editing .notice-meta:hover,
.notice-sheet.is-editing .notice-student:hover,
.notice-sheet.is-editing .notice-educator:hover,
.notice-sheet.is-editing .notice-extra:hover,
.notice-sheet.is-editing .is-selected {
  outline-color: color-mix(in srgb, var(--accent, #2563eb) 70%, #94a3b8);
}

.notice-extra {
  text-align: center;
  z-index: 2;
}

.notice-field-tab.notice-field-add {
  border-style: dashed;
  color: #1d4ed8;
  background: #f8fbff;
}

.notice-field-tab.notice-field-add:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.notice-meta {
  left: var(--notice-meta-x, 105mm);
  bottom: var(--notice-meta-y, 200mm);
  font-family: var(--notice-meta-font, PFT_Vilna), serif;
  font-weight: var(--notice-meta-weight, 400);
  font-size: var(--notice-meta-size, 16pt);
  color: var(--notice-meta-color, #C33100);
  text-align: center;
}

.notice-student {
  left: var(--notice-student-x, 105mm);
  bottom: var(--notice-student-y, 155mm);
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  direction: rtl;
  text-align: center;
}

.notice-honor {
  font-family: var(--notice-honor-font, EFT_Besimches), serif;
  font-weight: var(--notice-honor-weight, 700);
  font-size: var(--notice-honor-size, 22pt);
  color: var(--notice-honor-color, #07052C);
}

.notice-name {
  font-family: var(--notice-name-font, EFT_Besimches), serif;
  font-weight: var(--notice-name-weight, 700);
  font-size: var(--notice-name-size, 30pt);
  color: var(--notice-name-color, #5E0707);
}

.notice-educator {
  left: var(--notice-educator-x, 78mm);
  bottom: var(--notice-educator-y, 57mm);
  font-family: var(--notice-educator-font, DBSHAND), cursive;
  font-weight: var(--notice-educator-weight, 400);
  font-size: var(--notice-educator-size, 19pt);
  color: var(--notice-educator-color, #3A3185);
  text-align: center;
}

.notice-edit-card {
  display: grid;
  gap: 14px;
}

.notice-edit-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.notice-edit-side {
  display: grid;
  gap: 12px;
}

.notice-field-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notice-field-tab {
  margin: 0;
  border: 1px solid var(--line, #e4e9f0);
  border-radius: 10px;
  padding: 8px 12px;
  background: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.notice-field-tab.on {
  background: #eff6ff;
  border-color: color-mix(in srgb, var(--accent, #2563eb) 45%, #cbd5e1);
  color: #1d4ed8;
}

.notice-edit-controls {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line, #e4e9f0);
  border-radius: 14px;
  background: #f8fafc;
}

.notice-edit-controls h3 {
  margin: 4px 0 0;
  font-size: 15px;
}

.notice-xy {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.notice-edit-preview {
  display: grid;
  gap: 10px;
  justify-items: center;
  overflow: auto;
}

.notice-edit-preview .notice-sheet {
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
}

@media (max-width: 980px) {
  .notice-edit-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .notice-gen-fields {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .notice-gen-fields {
    grid-template-columns: 1fr;
  }

  .notice-preview-grid {
    grid-template-columns: 1fr;
  }
}
