* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f4f6fa;
  color: #17253b;
  font:
    14px system-ui,
    -apple-system,
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  background: #274ec6;
  color: white;
  border: 1px solid #274ec6;
  border-radius: 8px;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 600;
}
button:hover {
  filter: brightness(0.94);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
.secondary {
  background: white;
  color: #33445e;
  border-color: #d7deea;
}
header {
  padding: 22px 4%;
  display: flex;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid #e0e6ef;
}
.brand {
  font-weight: 900;
  letter-spacing: 1px;
  font-size: 21px;
}
.brand span {
  font-size: 10px;
  letter-spacing: 2px;
  display: block;
  color: #607496;
  margin-top: 4px;
}
.header-actions,
.title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
main {
  max-width: 1600px;
  margin: 32px auto;
  padding: 0 32px;
}
h1 {
  font-size: 30px;
  letter-spacing: -1px;
  margin: 4px 0;
}
h2 {
  font-size: 23px;
  margin: 0;
}
h3 {
  font-size: 15px;
}
p {
  color: #64728a;
  line-height: 1.6;
}
.eyebrow {
  color: #3b5ccd;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 22px 0;
}
.stat {
  border: 1px solid #dfe5ef;
  background: white;
  border-radius: 12px;
  padding: 20px;
}
.stat strong {
  display: block;
  font-size: 25px;
  margin: 10px 0;
}
.stat span {
  color: #65738b;
  font-size: 12px;
}
.stat.warn {
  background: #fff8ed;
  border-color: #f5dfb3;
}
.stat.blue {
  background: #edf2ff;
  border-color: #d3defa;
}
.panel {
  background: white;
  border: 1px solid #dfe5ef;
  border-radius: 12px;
  margin: 18px 0;
  padding: 18px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}
.filters label {
  min-width: 135px;
}
.grow {
  flex: 1;
  min-width: 250px !important;
}
label {
  display: block;
  font-size: 11px;
  color: #64728a;
  font-weight: 600;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  margin: 6px 0 0;
  border: 1px solid #d8e0eb;
  border-radius: 7px;
  background: #fff;
  color: #17253b;
  padding: 10px;
  min-height: 39px;
}
textarea {
  resize: vertical;
}
.compact {
  border-top: 1px solid #edf0f6;
  padding-top: 16px;
  margin-top: 16px;
}
.hint {
  font-size: 11px;
  color: #71809a;
}
.tablepanel {
  padding: 0;
  overflow: hidden;
}
.tabletitle {
  padding: 18px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.tablewrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}
th,
td {
  text-align: left;
  padding: 15px 16px;
  border-top: 1px solid #e7ecf3;
}
th {
  background: #f8faff;
  font-size: 11px;
  color: #60728e;
}
th button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}
td {
  font-size: 12px;
}
td small {
  display: block;
  color: #738198;
  margin-top: 5px;
}
.customer {
  border: 0;
  background: none;
  padding: 0;
  color: #244cb5;
  text-align: left;
}
.pill {
  display: inline-block;
  background: #edf2fc;
  color: #3456a2;
  border-radius: 20px;
  padding: 4px 8px;
  font-size: 10px;
}
.red {
  background: #fff0ed;
  color: #b84835;
}
.green {
  background: #e9f7f0;
  color: #228664;
}
.money {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}
.pager {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #e7ecf3;
}
.login {
  max-width: 470px;
  margin: 12vh auto;
  background: white;
  padding: 38px;
  border-radius: 16px;
  border: 1px solid #dce4ef;
}
.login label {
  margin: 18px 0;
}
.login button {
  width: 100%;
}
dialog {
  border: 1px solid #dce3ee;
  border-radius: 16px;
  width: min(1100px, 96vw);
  max-height: 94vh;
  padding: 26px;
  box-shadow: 0 30px 100px #10204044;
}
dialog::backdrop {
  background: #17294388;
}
.dialoghead {
  display: flex;
  justify-content: space-between;
  align-items: start;
  border-bottom: 1px solid #e7ebf4;
  padding-bottom: 16px;
}
.detailgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}
.detailgrid label {
  margin-bottom: 13px;
}
.detailgrid form {
  background: #f8faff;
  padding: 16px;
  border-radius: 10px;
}
.event {
  border-left: 2px solid #d9e3f8;
  margin-top: 14px;
  padding: 0 0 0 12px;
}
.event p {
  white-space: pre-wrap;
  color: #33445e;
  margin: 5px 0;
}
.event small {
  color: #75849a;
}
.invoiceSection {
  margin-top: 25px;
  border-top: 1px solid #e7ecf3;
  padding-top: 15px;
  overflow: auto;
}
#detailError,
#loginError {
  color: #bd392e;
}
#message:empty {
  display: none;
}
#message {
  background: #eef4ff;
  padding: 10px;
  border-radius: 8px;
}
@media (max-width: 800px) {
  main {
    padding: 0 12px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .detailgrid {
    grid-template-columns: 1fr;
  }
  .title {
    align-items: start;
  }
  h1 {
    font-size: 24px;
  }
  .filters label {
    flex: 1;
  }
  .tabletitle {
    flex-direction: column;
  }
  .header-actions span {
    display: none;
  }
}
[hidden] {
  display: none !important;
}
/* Collection directory: quieter chrome, stronger names, a customer file with clear sections. */
body {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: #f2f5f8;
  color: #203047;
}
header {
  padding: 18px 3%;
  border-bottom: 3px solid #254da0;
}
.brand {
  letter-spacing: 0.4px;
}
.title h1 {
  font-size: 28px;
  letter-spacing: -0.6px;
}
.title p {
  margin: 7px 0 0;
}
.stats {
  gap: 0;
  background: #fff;
  border: 1px solid #dbe3ed;
  border-radius: 10px;
  overflow: hidden;
}
.stat,
.stat.blue,
.stat.warn {
  background: transparent;
  border: 0;
  border-radius: 0;
  border-right: 1px solid #e3e9f1;
  padding: 18px 22px;
}
.stat:last-child {
  border: 0;
}
.stat strong {
  font-size: 24px;
  color: #254da0;
}
.stat.warn strong {
  color: #ad651a;
}
.stat span {
  letter-spacing: 0;
}
.tablepanel tbody tr:hover {
  background: #f3f7fd;
}
.customer {
  font-size: 13px;
  font-weight: 700;
  max-width: 310px;
  white-space: normal;
  line-height: 1.5;
}
.tablepanel thead th {
  background: #eaf0f7;
  padding-top: 13px;
  padding-bottom: 13px;
}
.tablepanel td {
  padding-top: 17px;
  padding-bottom: 17px;
}
.advanced > summary {
  cursor: pointer;
  color: #365887;
  font-size: 12px;
  font-weight: 600;
  margin-top: 16px;
}
.advanced .compact {
  margin-top: 10px;
}
.filters .grow input {
  background: #f8fafd;
}
.panel > summary {
  cursor: pointer;
  font-weight: 600;
}
.hint {
  line-height: 1.6;
}
.file-label {
  font-size: 12px;
  margin: 0 0 7px;
  color: #617790;
}
.eyebrow {
  display: none;
}
dialog {
  width: min(1240px, 96vw);
  padding: 0;
  max-height: 94vh;
}
dialog .dialoghead {
  padding: 24px 28px 14px;
  background: #f4f7fb;
  position: sticky;
  top: 0;
  z-index: 2;
}
dialog .dialoghead p {
  margin: 7px 0;
}
dialog .detail-tabs {
  display: flex;
  background: #f4f7fb;
  border-bottom: 1px solid #dbe3ed;
  padding: 0 24px;
  gap: 22px;
  position: sticky;
  top: 111px;
  z-index: 2;
}
.detail-tabs button {
  background: none;
  border: 0;
  border-radius: 0;
  color: #697b91;
  padding: 14px 3px;
  border-bottom: 3px solid transparent;
}
.detail-tabs button[aria-selected="true"] {
  color: #254da0;
  border-bottom-color: #254da0;
}
.detail-tabs button:hover {
  background: #edf2f8;
}
.detailgrid,
[role="tabpanel"] {
  padding: 22px 28px;
}
.detailgrid {
  gap: 25px;
}
#detailError {
  margin: 8px 28px;
}
#detailError:empty {
  display: none;
}
.invoiceSection {
  border-top: 0;
  margin-top: 0;
}
.invoiceSection > h3 {
  margin-top: 0;
}
.invoiceSection #invoices {
  margin-bottom: 16px;
}
.invoice-link {
  display: inline-block;
  background: #254da0;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 650;
  font-size: 12px;
}
.balance-strip {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  border-bottom: 1px solid #dbe3ed;
  padding: 4px 0 24px;
  gap: 22px;
}
.balance-strip span,
.balance-strip small {
  display: block;
  color: #6b7d93;
  font-size: 12px;
}
.balance-strip strong {
  display: block;
  margin: 8px 0;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  color: #254da0;
}
.balance-strip div:first-child strong {
  font-size: 30px;
}
.insight-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 18px;
}
.insight-columns p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  margin: 16px 0;
  font-size: 13px;
}
dt {
  color: #738198;
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.remarks-preview {
  border-left: 3px solid #a7bddc;
  padding: 2px 16px;
  background: #f6f8fc;
  margin: 18px 0;
}
.remarks-preview p {
  white-space: pre-wrap;
}
.live-check {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  background: #edf8f5;
  color: #087f75;
  border-radius: 7px;
  padding: 14px;
  margin: 22px 0;
}
.live-check span {
  font-size: 11px;
}
.contact-line {
  grid-template-columns: 70px 1fr 70px 1fr;
}
.detailgrid h3 {
  margin-top: 0;
}
.event {
  padding-bottom: 14px;
}
.event p {
  overflow-wrap: anywhere;
}
.detailgrid form {
  border: 1px solid #e1e7f0;
  background: #f9fbfd;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #6b9bdb;
  outline-offset: 3px;
}
@media (max-width: 850px) {
  .balance-strip {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .balance-strip > div {
    border-bottom: 1px solid #e5eaf2;
    padding-bottom: 12px;
  }
  .insight-columns {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .contact-line {
    grid-template-columns: 80px 1fr;
  }
  .detail-tabs {
    gap: 12px !important;
    overflow: auto;
    position: static !important;
  }
  .detail-tabs button {
    white-space: nowrap;
  }
  .dialoghead {
    position: static !important;
    padding: 20px !important;
  }
  .detailgrid,
  [role="tabpanel"] {
    padding: 18px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stat {
    border-bottom: 1px solid #e3e9f1 !important;
  }
  .balance-strip strong {
    font-size: 24px !important;
  }
  dl {
    grid-template-columns: 110px 1fr;
  }
}

.directory-remark {
  margin-top: 8px;
  padding: 7px 9px;
  border-left: 3px solid #ad651a;
  background: #fff8e9;
  color: #694512;
  font-size: 12px;
  line-height: 1.5;
  max-width: 360px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.directory-remark strong {
  margin-right: 5px;
}
.common-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  padding: 16px 28px;
  border-bottom: 1px solid #dce3ec;
  background: #f8fafc;
  align-items: center;
}
.common-summary strong {
  color: #61748f;
  font-size: 11px;
  display: block;
  margin-bottom: 3px;
}
.common-settings,
.pending-section {
  margin: 16px 28px;
  border: 1px solid #dce3ec;
  border-radius: 10px;
  padding: 14px 18px;
}
.common-settings summary,
.pending-section summary {
  cursor: pointer;
  font-weight: 650;
}
.common-settings form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.common-settings .hint {
  grid-column: 1/-1;
  margin: 0;
}
.common-settings button {
  align-self: end;
}
.pending-scroll {
  overflow: auto;
  max-height: 300px;
  margin-top: 12px;
}
.pending-scroll table {
  min-width: 660px;
}
.pending-remark {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  min-width: 240px;
}
.next-action {
  background: #edf4ff;
  border-left: 3px solid #254da0;
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.time-tag {
  display: inline-block;
  font-size: 11px;
  color: #4e617b;
  padding: 4px 7px;
  border: 1px solid #dce3ec;
  border-radius: 5px;
  background: #f7f9fc;
  margin: 3px 5px 3px 0;
  font-variant-numeric: tabular-nums;
}
.event {
  position: relative;
  padding: 16px 18px;
  margin: 0 0 18px 10px;
  border: 1px solid #dce3ec;
  border-left: 3px solid #6a8bc6;
  border-radius: 0 10px 10px 0;
  background: white;
}
.event header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.event header strong {
  font-size: 12px;
}
.event p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
}
.event-times {
  margin: 8px 0;
}
.event-followup {
  border-left-color: #087f75;
}
.event-update {
  border-left-color: #a7b4c6;
}
.event .outcome {
  color: #087f75;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.key-points {
  background: #fff8e9;
  border-radius: 7px;
  padding: 10px 12px;
  color: #694512;
}
.key-points p {
  margin: 5px 0 0;
}
.event footer {
  margin-top: 10px;
}
.event details {
  font-size: 12px;
  color: #61748f;
}
@media (max-width: 760px) {
  .common-settings form {
    grid-template-columns: 1fr;
  }
  .common-summary {
    padding: 12px 16px;
  }
  .common-settings,
  .pending-section {
    margin: 12px 10px;
  }
  .event header {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

/* Summary shortcuts use native buttons for keyboard and pointer access. */
button.stat { text-align: left; font: inherit; cursor: pointer; }
button.stat:hover { background: #f3f7fd; }
button.stat:focus-visible { outline: 3px solid #254da0; outline-offset: -4px; }
.store-link { background: transparent; border: 0; color: #254da0; padding: 4px 0; font: inherit; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.store-link:hover { background: transparent; color: #17356e; }
.store-link:focus-visible { outline: 2px solid #254da0; outline-offset: 3px; }
#storeTotals tr[data-store] { cursor: pointer; }
#storeTotals tr[data-store]:hover { background: #f3f7fd; }

/* Collection workspace: status → composer beside a day-grouped timeline.
   Colour families: blue spoke, slate no answer, teal promise, orange dispute,
   green resolved; notes indigo/emerald/rose/violet; settings grey. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.ico {
  width: 16px;
  height: 16px;
  flex: none;
  vertical-align: -3px;
}
.t-contacted, .hue-blue { --c: #1d4ed8; --bg: #eaf1ff; --line: #bcd0fb; }
.t-no_answer, .hue-slate { --c: #475569; --bg: #f1f4f8; --line: #cfd8e3; }
.t-promised, .hue-teal { --c: #0f766e; --bg: #e3f7f3; --line: #a5e3d8; }
.t-disputed { --c: #c2410c; --bg: #fff1e8; --line: #fbc9a8; }
.t-resolved { --c: #15803d; --bg: #e8f8ee; --line: #b0e3c2; }
.t-note-general, .hue-indigo { --c: #4338ca; --bg: #eef0ff; --line: #c7cbfb; }
.t-note-payment { --c: #047857; --bg: #e5f7ef; --line: #a7e2c9; }
.t-note-dispute { --c: #be123c; --bg: #fff0f3; --line: #f8bccb; }
.t-note-contact, .hue-violet { --c: #7e22ce; --bg: #f6effe; --line: #dcc3f7; }
.t-update { --c: #52627a; --bg: #f3f5f9; --line: #d6dde8; }
#panel-collection {
  padding: 22px 28px 30px;
  background: linear-gradient(180deg, #f6f8fc 0, #fff 220px);
}
.collection-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.status-tile {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(135deg, var(--bg), #fff 75%);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  min-width: 0;
}
.status-tile > div {
  min-width: 0;
}
.tile-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--c);
  color: #fff;
  flex: none;
  box-shadow: 0 4px 10px -4px var(--c);
}
.tile-icon .ico {
  width: 19px;
  height: 19px;
}
.status-tile span:not(.tile-icon) {
  display: block;
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--c);
  font-weight: 700;
}
.status-tile strong {
  display: block;
  font-size: 17px;
  margin: 3px 0 2px;
  color: #172238;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.status-tile small {
  display: block;
  font-size: 12px;
  color: #55657d;
  line-height: 1.4;
}
.status-tile.tone-red { --c: #c0352b; --bg: #fff0ee; --line: #f5c2bc; }
.status-tile.tone-amber { --c: #b45309; --bg: #fff6e6; --line: #f6d6a0; }
.status-tile.tone-green { --c: #15803d; --bg: #e8f8ee; --line: #b0e3c2; }
.status-tile.tone-red small,
.status-tile.tone-amber small,
.status-tile.tone-green small {
  color: var(--c);
  font-weight: 650;
}
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(340px, 440px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.composer {
  border: 1px solid #dfe6f0;
  border-radius: 16px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 6px 20px -12px rgba(30, 50, 90, 0.25);
}
.composer-head,
.timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.composer-head h3,
.timeline-head h3 {
  margin: 0;
  font-size: 16px;
}
.segmented {
  display: inline-flex;
  border-radius: 10px;
  padding: 3px;
  background: #eef2f8;
}
.segmented button {
  background: transparent;
  border: 0;
  color: #4e617b;
  padding: 7px 13px;
  border-radius: 8px;
}
.segmented button[aria-pressed="true"] {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.15);
}
.composer form {
  display: grid;
  gap: 15px;
}
.composer fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.composer legend {
  font-size: 11px;
  color: #64728a;
  font-weight: 700;
  margin-bottom: 7px;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.optional {
  font-weight: 400;
  color: #8a97aa;
  text-transform: none;
  letter-spacing: 0;
}
.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.choice {
  position: relative;
  color: #33445e;
  font-size: 13px;
  --c: #1d4ed8;
  --bg: #eaf1ff;
}
.choice input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
}
.choice span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #d7deea;
  background: #fff;
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.choice span .ico {
  color: var(--c);
  width: 15px;
  height: 15px;
}
.choice:hover span {
  border-color: var(--c);
  background: var(--bg);
}
.choice input:focus-visible + span {
  outline: 3px solid #6b9bdb;
  outline-offset: 2px;
}
.choice input:checked + span {
  background: var(--c);
  border-color: var(--c);
  color: #fff;
  box-shadow: 0 4px 10px -5px var(--c);
}
.choice input:checked + span .ico {
  color: #fff;
}
.choice input:disabled + span {
  opacity: 0.5;
  cursor: default;
}
.outcome-no_answer { --c: #475569; --bg: #f1f4f8; }
.outcome-promised { --c: #0f766e; --bg: #e3f7f3; }
.outcome-disputed { --c: #c2410c; --bg: #fff1e8; }
.outcome-resolved { --c: #15803d; --bg: #e8f8ee; }
#noteForm .choice:has([value="PAYMENT"]) { --c: #047857; --bg: #e5f7ef; }
#noteForm .choice:has([value="DISPUTE"]) { --c: #be123c; --bg: #fff0f3; }
#noteForm .choice:has([value="CONTACT"]) { --c: #7e22ce; --bg: #f6effe; }
#noteForm .choice:has([value="GENERAL"]) { --c: #4338ca; --bg: #eef0ff; }
.compact-choices .choice span {
  padding: 6px 11px;
  font-size: 12px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.promise-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e3f7f3, #f4fbfa);
  border: 1px solid #a5e3d8;
}
.promise-fields label {
  color: #0f766e;
}
.promise-fields[hidden] {
  display: none;
}
.bill-choices {
  max-height: 200px;
  overflow: auto;
  border: 1px solid #dfe6f0;
  border-radius: 12px;
  background: #fff;
}
.bill-choices .hint {
  margin: 10px 12px;
}
.bill-choice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid #eef1f6;
  font-size: 12px;
  color: #203047;
  font-weight: 400;
  cursor: pointer;
}
.bill-choice:last-child {
  border-bottom: 0;
}
.bill-choice:has(input:checked) {
  background: #eaf1ff;
}
.bill-choice input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  accent-color: #1d4ed8;
}
.bill-choice small {
  display: block;
  color: #61748f;
}
.schedule {
  display: grid;
  gap: 8px;
  padding: 14px !important;
  border: 1px solid #c7cbfb !important;
  border-radius: 12px;
  background: linear-gradient(135deg, #eef0ff, #fafaff);
}
.schedule legend {
  float: left;
  margin-bottom: 2px;
  color: #4338ca;
}
.schedule label {
  color: #4a5876;
}
.schedule .hint {
  margin: 0;
}
.quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.quick button {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  border-color: #c7cbfb;
  color: #4338ca;
  background: #fff;
}
.quick button:hover:not(:disabled) {
  background: #4338ca;
  color: #fff;
  filter: none;
}
.quick button[hidden] {
  display: none;
}
#saveFollowup,
#saveNote {
  border-radius: 10px;
  padding: 12px;
  background: linear-gradient(135deg, #1d4ed8, #4338ca);
  border: 0;
  box-shadow: 0 6px 16px -8px #1d4ed8;
}
.form-error {
  margin: 0;
  color: #c0352b;
  font-weight: 600;
  font-size: 13px;
}
.form-error:empty {
  display: none;
}
.dnd-notice {
  background: #fff0ee;
  border: 1px solid #f5c2bc;
  color: #7c2f22;
  padding: 12px 14px;
  border-radius: 12px;
  line-height: 1.5;
}
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: #4e617b;
  border: 1px solid #d7deea;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
}
.chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}
.chip-all i { background: linear-gradient(135deg, #1d4ed8, #0f766e, #7e22ce); }
.chip-followup i { background: #0f766e; }
.chip-note i { background: #4338ca; }
.chip-update i { background: #94a3b8; }
.chip span {
  color: #8a97aa;
  font-variant-numeric: tabular-nums;
}
.chip[aria-pressed="true"] {
  background: #172238;
  border-color: #172238;
  color: #fff;
}
.chip[aria-pressed="true"] span {
  color: #c9d3e2;
}
.pinned-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.pinned {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fff7e6;
  border: 1px solid #f6d6a0;
  border-radius: 12px;
  padding: 11px 13px;
  color: #6b4410;
}
.pinned .ico {
  color: #b45309;
  margin-top: 2px;
}
.pinned-dnd {
  background: #fff0ee;
  border-color: #f5c2bc;
  color: #7c2f22;
}
.pinned-dnd .ico {
  color: #c0352b;
}
.pinned-ref {
  background: #f6effe;
  border-color: #dcc3f7;
  color: #4c1d7a;
}
.pinned-ref .ico {
  color: #7e22ce;
}
.pinned strong {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pinned p {
  margin: 3px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.rail {
  position: relative;
  padding-left: 52px;
}
.rail::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(#c7d4ea, #e8edf5);
}
#timeline .day {
  position: relative;
  margin: 22px 0 10px -52px;
  font-size: 12px;
}
#timeline .day:first-child {
  margin-top: 0;
}
#timeline .day span {
  display: inline-block;
  background: #172238;
  color: #fff;
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}
#timeline .event {
  position: relative;
  margin: 0 0 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--bg), #fff 56px);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: box-shadow 0.15s, transform 0.15s;
}
#timeline .event:hover {
  box-shadow: 0 8px 22px -12px rgba(30, 50, 90, 0.35);
  transform: translateY(-1px);
}
#timeline .event .node {
  position: absolute;
  left: -52px;
  top: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--c);
  color: #fff;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--line), 0 4px 10px -4px var(--c);
}
#timeline .event .node .ico {
  width: 17px;
  height: 17px;
}
#timeline .event.t-update {
  background: #fafbfd;
}
#timeline .event.t-update .node {
  width: 30px;
  height: 30px;
  left: -47px;
  background: #fff;
  color: var(--c);
}
#timeline .event header {
  padding: 0;
  border: 0;
  background: none;
  justify-content: flex-start;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
#timeline .event header time {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #61748f;
  font-variant-numeric: tabular-nums;
}
#timeline .event header time .ico {
  width: 13px;
  height: 13px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 10px 4px 8px;
  background: var(--c, #eef1f6);
  color: #fff;
}
.badge .ico {
  width: 14px;
  height: 14px;
}
.t-update .badge {
  background: #e7ebf2;
  color: #3d4b61;
}
.channel {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--c);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}
.channel .ico {
  width: 13px;
  height: 13px;
}
.by {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #203047;
}
.avatar {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #52627a;
}
.av-0 { background: #1d4ed8; }
.av-1 { background: #0f766e; }
.av-2 { background: #7e22ce; }
.av-3 { background: #c2410c; }
.av-4 { background: #be123c; }
.av-5 { background: #4338ca; }
.av-6 { background: #047857; }
.av-7 { background: #9a4a07; }
#timeline .event-body {
  margin: 10px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
  color: #1f2a3d;
}
.promise-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
}
.promise-line > .ico {
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.2);
}
.promise-line strong {
  display: block;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.promise-line span {
  font-size: 12px;
  opacity: 0.92;
}
#timeline .key-points {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  background: #fff7e6;
  border: 1px solid #f6d6a0;
  border-radius: 10px;
  padding: 10px 12px;
  color: #6b4410;
}
#timeline .key-points .ico {
  color: #d97706;
  fill: #fcd34d;
  margin-top: 2px;
}
#timeline .key-points strong {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
#timeline .key-points p {
  margin: 3px 0 0;
}
.bill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin: 10px 0 0;
  color: #1d4ed8;
}
.tag {
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 650;
  color: #1d4ed8;
  background: #eaf1ff;
  border: 1px solid #bcd0fb;
}
#timeline .event footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  border-radius: 8px;
  padding: 4px 9px;
  background: #f3f5f9;
  color: #4a5876;
  font-variant-numeric: tabular-nums;
}
.meta b {
  font-weight: 650;
}
.meta .ico {
  width: 14px;
  height: 14px;
}
.meta-next { background: #eef0ff; color: #4338ca; }
.meta-reminder { background: #fff6e6; color: #9a4a07; }
.meta-balance { background: #e5f7ef; color: #047857; }
.meta-done { background: #e8f8ee; color: #15803d; }
.meta-muted { background: transparent; color: #71809a; padding-left: 0; }
.muted {
  font-size: 12px;
  color: #71809a;
}
#timeline details {
  margin-top: 10px;
}
#timeline summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #52627a;
  cursor: pointer;
}
.changes {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 5px 14px;
  margin: 10px 0 0;
  font-size: 12px;
}
.changes dt {
  color: #61748f;
}
.changes dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.changes del {
  color: #b4533f;
  background: #fff0ee;
  border-radius: 4px;
  padding: 0 4px;
}
.changes ins {
  text-decoration: none;
  font-weight: 650;
  color: #15803d;
  background: #e8f8ee;
  border-radius: 4px;
  padding: 0 4px;
}
.empty-state {
  color: #61748f;
  padding: 22px;
  border: 1px dashed #cfd8e3;
  border-radius: 14px;
  text-align: center;
  background: #fafbfd;
}
@media (max-width: 980px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  #panel-collection {
    padding: 16px;
  }
  .collection-status {
    grid-template-columns: 1fr;
  }
  .promise-fields {
    grid-template-columns: 1fr;
  }
  .changes {
    grid-template-columns: 1fr;
  }
  .rail {
    padding-left: 40px;
  }
  .rail::before {
    left: 14px;
  }
  #timeline .day {
    margin-left: -40px;
  }
  #timeline .event .node {
    left: -40px;
    width: 30px;
    height: 30px;
  }
  #timeline .event.t-update .node {
    left: -38px;
    width: 26px;
    height: 26px;
  }
}
.bill-all {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f7fb;
  border-bottom: 1px solid #dce3ec;
}
.bill-all:has(input:checked) {
  background: #eaf1ff;
}

/* ============================================================
   App theme: the colour families from the follow-up workspace
   applied to the header, directory, customer file and login.
   ============================================================ */
.hue-red { --c: #c0352b; --bg: #fff0ee; --line: #f5c2bc; }
.hue-amber { --c: #b45309; --bg: #fff6e6; --line: #f6d6a0; }
.hue-orange { --c: #c2410c; --bg: #fff1e8; --line: #fbc9a8; }
.hue-green { --c: #15803d; --bg: #e8f8ee; --line: #b0e3c2; }

body {
  background: linear-gradient(180deg, #eef3fb 0, #f6f8fc 320px);
}
button {
  border-radius: 10px;
}
#sync,
#loginForm button,
#staffForm button,
#saveSettings {
  background: linear-gradient(135deg, #1d4ed8, #4338ca);
  border-color: transparent;
  box-shadow: 0 6px 16px -10px #1d4ed8;
}
button .ico {
  margin-right: 6px;
}
.secondary {
  border-radius: 10px;
  border-color: #d5dcea;
  color: #2c3d5a;
}
.secondary:hover {
  background: #f3f6fc;
  filter: none;
}
input,
select,
textarea {
  border-radius: 10px;
  border-color: #d5dcea;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:hover,
select:hover,
textarea:hover {
  border-color: #aebcd4;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #4f6fd6;
  box-shadow: 0 0 0 3px rgba(79, 111, 214, 0.15);
  outline: none;
}

/* Header */
#app > header {
  background: linear-gradient(100deg, #111a2e 0%, #1b2f63 55%, #1d4ed8 120%);
  border-bottom: 0;
  padding: 16px 4%;
  align-items: center;
  box-shadow: 0 6px 20px -12px rgba(17, 26, 46, 0.6);
}
#app > header .brand {
  color: #fff;
}
#app > header .brand span {
  color: #93b4ff;
}
#user {
  color: #dbe4f7;
  margin-right: 12px;
  font-weight: 600;
}
#logout {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}
#logout:hover {
  background: rgba(255, 255, 255, 0.2);
}
.title h1 {
  font-size: 28px;
  letter-spacing: -0.01em;
}
#sync {
  display: inline-flex;
  align-items: center;
}

/* Summary cards */
.stats {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.stats .stat-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  text-align: left;
  border: 1px solid var(--line) !important;
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(135deg, var(--bg), #fff 70%) !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  color: #172238;
  transition: transform 0.15s, box-shadow 0.15s;
}
.stats .stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -16px var(--c);
}
.stats .tile-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
}
.stats .tile-icon .ico {
  width: 22px;
  height: 22px;
  margin: 0;
}
.stat-text {
  display: block;
  min-width: 0;
}
.stats .stat-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c);
}
.stats .stat-card strong {
  display: block;
  font-size: 24px;
  margin: 4px 0 2px;
  color: #172238 !important;
  font-variant-numeric: tabular-nums;
}
.stats .stat-sub {
  display: block;
  font-size: 12px;
  color: #56677f;
}

/* Panels and collapsible sections */
.panel,
.common-settings,
.pending-section {
  border: 1px solid #e0e7f1 !important;
  border-radius: 16px !important;
  background: #fff;
  box-shadow: 0 2px 8px -4px rgba(30, 50, 90, 0.12);
}
.panel > summary,
.common-settings > summary,
.pending-section > summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.panel > summary::-webkit-details-marker,
.common-settings > summary::-webkit-details-marker,
.pending-section > summary::-webkit-details-marker {
  display: none;
}
.panel > summary::after,
.common-settings > summary::after,
.pending-section > summary::after {
  content: "";
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid #8a97aa;
  border-bottom: 2px solid #8a97aa;
  transform: rotate(45deg);
  transition: transform 0.2s;
}
details[open] > summary::after {
  transform: rotate(-135deg) !important;
}
summary small {
  font-weight: 500;
  color: #71809a;
  font-size: 12px;
}
.sum-ico {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--c);
  border: 1px solid var(--line);
}
.sum-ico .ico {
  width: 17px;
  height: 17px;
}
.advanced > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #4338ca;
  font-weight: 650;
}
.search-field > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.search-field .ico {
  color: #1d4ed8;
  width: 14px;
  height: 14px;
}
#storeTotals table {
  margin-top: 12px;
}
.store-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none !important;
  font-weight: 650;
  color: #0f766e !important;
}
.store-link .ico {
  width: 15px;
  height: 15px;
  margin: 0;
}

/* Directory table */
.tablepanel {
  overflow: hidden;
  padding: 0 !important;
}
.tabletitle {
  padding: 16px 18px !important;
  background: linear-gradient(90deg, #f4f7fd, #fff);
  border-bottom: 1px solid #e6ecf4;
}
.tabletitle strong {
  font-size: 16px;
}
.tablepanel thead th {
  background: #172238 !important;
  color: #cfd9ec !important;
  border-bottom: 0 !important;
}
.tablepanel thead th button {
  color: #e4ebf8 !important;
  font-weight: 650;
  background: transparent;
  box-shadow: none;
}
.tablepanel thead th[aria-sort="ascending"] button,
.tablepanel thead th[aria-sort="descending"] button {
  color: #93b4ff !important;
}
.tablepanel tbody tr {
  transition: background 0.12s;
}
.tablepanel tbody tr:hover {
  background: #f5f8ff !important;
}
.tablepanel tbody tr.row-overdue {
  box-shadow: inset 4px 0 0 #c0352b;
}
.tablepanel tbody tr.row-dnd {
  box-shadow: inset 4px 0 0 #9aa6b8;
  background: #fbfbfd;
}
.customer {
  font-size: 14px !important;
  color: #1d3fae !important;
}
.cust-meta {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 4px;
}
.cust-meta .ico,
.ref-line .ico,
.next-date .ico,
.pill .ico {
  width: 12px;
  height: 12px;
  margin: 0;
}
.store-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #e3f7f3;
  color: #0f766e;
  font-weight: 600;
}
.ref-line {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  color: #7e22ce !important;
  margin-top: 4px;
}
.settled {
  color: #b45309 !important;
}
.amount-cell {
  font-size: 15px;
  color: #172238;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.st-open { background: #f1f4f8; color: #475569; border-color: #cfd8e3; }
.st-contacted { background: #eaf1ff; color: #1d4ed8; border-color: #bcd0fb; }
.st-promised { background: #e3f7f3; color: #0f766e; border-color: #a5e3d8; }
.st-disputed { background: #fff1e8; color: #c2410c; border-color: #fbc9a8; }
.st-closed { background: #e8f8ee; color: #15803d; border-color: #b0e3c2; }
.pill-dnd { background: #fff0ee; color: #c0352b; border-color: #f5c2bc; }
.pill-overdue { background: #c0352b; color: #fff; }
.awaiting-pill { background: #f6effe; color: #7e22ce; border-color: #dcc3f7; }
.pill-none { background: transparent; color: #9aa6b8; border-color: #e3e8f0; }
.kind-invoice { background: #eaf1ff; color: #1d4ed8; border-color: #bcd0fb; }
.kind-awaiting { background: #f6effe; color: #7e22ce; border-color: #dcc3f7; }
.age {
  display: inline-block;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
}
.age-green { background: #e8f8ee; color: #15803d; }
.age-amber { background: #fff6e6; color: #b45309; }
.age-orange { background: #fff1e8; color: #c2410c; }
.age-red { background: #fff0ee; color: #c0352b; }
.age-slate { background: #f1f4f8; color: #475569; }
.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 8px;
  background: #eef0ff;
  color: #4338ca;
  font-weight: 700;
}
.owner {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
}
.av-none {
  background: #cbd3df;
  color: #52627a;
}
.next-date {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: #4338ca;
  background: #eef0ff;
  border-radius: 8px;
  padding: 3px 8px;
}
.pager button {
  border-radius: 999px;
}

/* Customer file dialog */
dialog {
  border: 0;
  border-radius: 20px;
  box-shadow: 0 30px 80px -30px rgba(17, 26, 46, 0.55);
}
dialog::backdrop {
  background: rgba(17, 26, 46, 0.55);
  backdrop-filter: blur(3px);
}
dialog .dialoghead {
  background: linear-gradient(100deg, #111a2e 0%, #1b2f63 60%, #1d4ed8 130%) !important;
  color: #fff;
}
dialog .dialoghead h2 {
  color: #fff;
  font-size: 24px;
}
dialog .file-label {
  color: #93b4ff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  font-size: 11px;
}
#customerMeta {
  color: #cfd9ec;
}
#close {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}
#close:hover {
  background: rgba(255, 255, 255, 0.2);
}
.common-summary {
  gap: 10px !important;
  background: #f6f8fc !important;
}
.info-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px 7px 9px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: #172238;
  font-weight: 600;
}
.info-chip > .ico {
  width: 28px;
  height: 28px;
  padding: 6px;
  border-radius: 8px;
  background: var(--c);
  color: #fff;
}
.info-chip strong {
  display: block;
  font-size: 10px !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c) !important;
  margin-bottom: 1px !important;
}
dialog .detail-tabs {
  background: #fff !important;
  gap: 6px !important;
  padding: 8px 24px !important;
}
.detail-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 10px !important;
  border-bottom: 0 !important;
  padding: 9px 14px !important;
  font-weight: 650;
}
.detail-tabs button[aria-selected="true"] {
  background: linear-gradient(135deg, #1d4ed8, #4338ca) !important;
  color: #fff !important;
  box-shadow: 0 6px 14px -8px #1d4ed8;
}
.detail-tabs button .ico {
  margin: 0;
}

/* Customer settings */
.common-settings form {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 16px 18px !important;
}
.field-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: #33445e;
}
.field-label .ico {
  width: 26px;
  height: 26px;
  padding: 5px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--c);
  border: 1px solid var(--line);
}
.call-pref {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.call-pref legend {
  font-size: 12px;
  font-weight: 700;
  color: #33445e;
  padding: 0;
  margin-bottom: 8px;
}
.pref {
  position: relative;
  cursor: pointer;
}
.pref input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
}
.pref > span {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  padding: 14px;
  border: 2px solid #e0e7f1;
  border-radius: 14px;
  background: #fff;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.pref i {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg);
  color: var(--c);
}
.pref i .ico {
  width: 20px;
  height: 20px;
}
.pref strong {
  color: #172238;
  font-size: 14px;
}
.pref small {
  color: #61748f;
  font-size: 12px;
  font-weight: 500;
}
.pref-allow { --c: #15803d; --bg: #e8f8ee; }
.pref-dnd { --c: #c0352b; --bg: #fff0ee; }
.pref:hover > span {
  border-color: var(--c);
}
.pref input:checked + span {
  border-color: var(--c);
  background: linear-gradient(135deg, var(--bg), #fff 80%);
  box-shadow: 0 8px 20px -14px var(--c);
}
.pref input:checked + span i {
  background: var(--c);
  color: #fff;
}
.pref input:checked + span strong {
  color: var(--c);
}
.pref input:focus-visible + span {
  outline: 3px solid #6b9bdb;
  outline-offset: 2px;
}
.field-remarks {
  grid-column: 1 / -1;
}
.field-remarks textarea {
  background: #fffbf2;
  border-color: #f6d6a0;
}
#caseForm.is-dnd .field-remarks textarea {
  background: #fff6f5;
  border-color: #f5c2bc;
}
#caseForm.is-dnd #dndHint {
  color: #c0352b;
  font-weight: 600;
}
#dndHint {
  grid-column: 1 / 2;
  align-self: center;
}
#saveSettings {
  grid-column: 2 / 3;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  padding: 11px 22px;
}
.pending-scroll {
  border: 1px solid #e6ecf4;
  border-radius: 12px;
}
.pending-scroll thead th {
  background: #f4f7fd;
  position: sticky;
  top: 0;
}
#refreshPending,
#invoices {
  display: inline-flex;
  align-items: center;
}

/* Overview tab */
.insight-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.insight-columns {
  gap: 14px !important;
}
.insight-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  background: linear-gradient(180deg, var(--bg), #fff 70px);
}
.insight-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  color: var(--c);
}
.insight-card h3 .ico {
  width: 28px;
  height: 28px;
  padding: 6px;
  border-radius: 9px;
  background: var(--c);
  color: #fff;
}
.remarks-preview {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fff7e6 !important;
  border: 1px solid #f6d6a0 !important;
  border-radius: 14px !important;
  padding: 14px 16px !important;
  color: #6b4410;
}
.remarks-preview > .ico {
  color: #b45309;
  margin-top: 3px;
}
.remarks-preview h3 {
  margin: 0 0 4px;
  color: #9a4a07;
}
.live-check {
  border-radius: 14px !important;
  background: linear-gradient(135deg, #e3f7f3, #fff 70%) !important;
  border: 1px solid #a5e3d8 !important;
  color: #0f766e;
}
.invoice-link {
  background: linear-gradient(135deg, #1d4ed8, #4338ca) !important;
  border-radius: 999px !important;
}

/* Login */
.login {
  border-radius: 20px !important;
  box-shadow: 0 30px 70px -30px rgba(17, 26, 46, 0.45) !important;
  border-top: 5px solid #1d4ed8;
}
body:has(#login:not([hidden])) {
  background: radial-gradient(circle at 20% 10%, #dbe6ff 0, transparent 40%),
    radial-gradient(circle at 85% 80%, #e3f7f3 0, transparent 40%), #f3f6fb;
}

@media (max-width: 760px) {
  .common-settings form,
  .call-pref {
    grid-template-columns: 1fr !important;
  }
  #dndHint,
  #saveSettings {
    grid-column: 1 / -1;
    justify-self: stretch;
  }
  .stats {
    grid-template-columns: 1fr !important;
  }
  .info-chip {
    flex: 1 1 100%;
  }
}
.stats .tile-icon,
.status-tile .tile-icon {
  color: #fff !important;
  background: var(--c) !important;
}
html,
body {
  min-height: 100vh;
}
