/* Mobile-first usability layer */
body,
input,
select,
textarea,
button {
  font-family: Arial, Helvetica, sans-serif;
}
.eyebrow {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .075em;
  line-height: 1.4;
}
.hero .eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .07em;
}
.sidebar {
  width: 270px;
  padding-left: 20px;
  padding-right: 20px;
  background: #dfece6;
  color: #183129;
}
main { margin-left: 270px; }
.sidebar .brand { color: #17372d; }
.sidebar .brand small {
  color: #4f6e63;
}
.sidebar nav { gap: 7px; }
.sidebar nav {
  overflow-y: auto;
  padding-bottom: 76px;
}
.sidebar > form {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  margin: 0;
}
.sidebar nav a,
.logout {
  min-height: 48px;
  padding: 13px 15px;
  color: #24463b;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
}
.sidebar nav a:has(.nav-count) { padding-right: 54px; }
.sidebar nav a > span { flex: 1; }
.nav-count {
  margin: 0;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 27px;
  height: 27px;
  padding: 0 7px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #b9d2c7;
  color: #17372d;
  font-size: 12px;
  font-weight: 900;
}
.sidebar nav a.active .nav-count {
  background: #ffffff;
  color: #17372d;
  border: 1px solid #abc8bb;
}
.title-with-count {
  display: flex;
  align-items: center;
  gap: 20px;
}
.title-with-count h2 { margin-right: 0; }
.list-count {
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  border-radius: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #d7f15d;
  color: #17372d;
  font-size: 13px;
  font-weight: 900;
}
.search-select { position: relative; }
.search-select-trigger {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #c5d1cb;
  border-radius: 11px;
  background: white;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.search-select-trigger b { font-size: 20px; color: var(--green); }
.search-select.open .search-select-trigger { border-color: var(--green2); outline: 4px solid rgba(11,138,104,.13); }
.search-select-menu {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  padding: 10px;
  border: 1px solid #cbd7d1;
  border-radius: 12px;
  background: white;
  box-shadow: 0 18px 45px rgba(24,49,41,.18);
}
.search-select.open .search-select-menu { display: block; }
.search-select-input { min-height: 44px; margin-bottom: 8px; }
.search-select-options { max-height: 260px; overflow-y: auto; }
.search-select-options button {
  width: 100%;
  min-height: 52px;
  padding: 9px 10px;
  border: 0;
  border-bottom: 1px solid #edf1ef;
  border-radius: 7px;
  background: white;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.search-select-options button:hover,
.search-select-options button:focus { background: #eaf4ef; outline: none; }
.search-select-options button strong,
.search-select-options button small { display: block; }
.search-select-options button small { margin-top: 3px; color: var(--muted); }
.search-select-empty { display: none; padding: 14px; color: var(--muted); text-align: center; }
.client-derived-field.is-hidden { display: none; }
.client-picker-error { display: none; margin-top: 5px; color: #a62f2f; font-size: 12px; font-weight: 700; }
.search-select.invalid .search-select-trigger { border-color: #c74444; outline: 4px solid rgba(199,68,68,.12); }
.search-select.invalid + small + .client-picker-error,
.client-search-label:has(.search-select.invalid) .client-picker-error { display: block; }
.external-request-alert {
  min-height: 82px;
  margin-bottom: 17px;
  padding: 15px 18px;
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 15px;
  border: 2px solid #d3a51a;
  border-radius: 15px;
  background: #fff5cc;
  color: #3e3312;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(145,106,0,.10);
}
.external-alert-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e1b72b;
  color: #302400;
  font-size: 24px;
  font-weight: 900;
}
.external-request-alert strong,.external-request-alert small { display: block; }
.external-request-alert strong { font-size: 18px; }
.external-request-alert small { margin-top: 5px; color: #746126; font-size: 13px; }
.external-request-alert > b { color: #594600; font-size: 14px; }
.external-request-alert:hover { background: #ffefae; border-color: #c79500; }
.billing-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 12px;
  border: 1px solid #d7e0dc;
  border-radius: 10px;
  background: #f8faf9;
}
.billing-legend span { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; }
.billing-legend i { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; font-style: normal; font-size: 14px; font-weight: 900; }
.billing-legend .pending i { background: #f4c842; border: 1px solid #c89500; color: #4f3b00; }
.billing-legend .invoiced i { background: #27966d; border: 1px solid #16805a; color: white; }
.billing-row td { transition: background .15s; }
.billing-row.billing-pending td { background: #fff7dc; border-bottom-color: #ead9a5; }
.billing-row.billing-pending td:first-child { border-left: 7px solid #d6a928; }
.billing-row.billing-invoiced td { background: #eaf6f1; border-bottom-color: #c9e2d7; }
.billing-row.billing-invoiced td:first-child { border-left: 7px solid #42a17c; }
.billing-row.billing-pending:hover td { background: #ffefbd; }
.billing-row.billing-invoiced:hover td { background: #dcefe7; }
.billing-row a { color: #164d3c; font-weight: 800; }
.billing-status { display: inline-flex; align-items: center; gap: 10px; min-width: 165px; }
.billing-status > i {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-style: normal;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 3px 9px rgba(24,49,41,.12);
}
.billing-status > span,.billing-status strong,.billing-status small { display: block; }
.billing-status strong { font-size: 13px; }
.billing-status small { margin-top: 3px; font-size: 10px; }
.billing-status.is-invoiced > i { background: #218d65; color: white; }
.billing-status.is-invoiced strong { color: #146648; }
.billing-status.is-invoiced small { color: #53816f; }
.billing-status.is-pending > i { background: #f3c438; color: #493600; }
.billing-status.is-pending strong { color: #755300; }
.billing-status.is-pending small { color: #8b7538; }
.calendar-viewbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.calendar-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 9px 14px;
  border: 1px solid #d2ddd7;
  border-radius: 11px;
  background: white;
  color: #3d5a50;
  font-size: 13px;
}
.calendar-legend strong { color: #183129; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.calendar-legend i {
  width: 18px;
  height: 18px;
  display: inline-block;
  border-radius: 5px;
  border-left: 4px solid;
}
.calendar-legend .legend-internal i { background: #e3f4ed; border-color: #0b8a68; }
.calendar-legend .legend-external i { background: #fff3d5; border-color: #d99812; }
.view-switch {
  display: inline-flex;
  padding: 4px;
  border: 1px solid #cdd9d3;
  border-radius: 12px;
  background: #eaf1ed;
}
.view-switch a {
  min-width: 110px;
  padding: 10px 16px;
  border-radius: 9px;
  color: #4d695f;
  text-align: center;
  text-decoration: none;
  font-weight: 800;
}
.view-switch a.active {
  background: white;
  color: #006b4f;
  box-shadow: 0 4px 13px rgba(24,49,41,.10);
}
.month-toolbar {
  display: grid;
  grid-template-columns: 190px 1fr 190px;
  align-items: center;
  gap: 20px;
  margin-bottom: 14px;
}
.month-toolbar > div { text-align: center; }
.month-toolbar h2 { margin: 4px 0 0; font-size: 25px; }
.month-calendar {
  overflow: hidden;
  border: 1px solid #ccd8d2;
  border-radius: 17px;
  background: white;
  box-shadow: 0 8px 28px rgba(24,49,41,.06);
}
.month-weekdays,.month-grid { display: grid; grid-template-columns: repeat(7,minmax(130px,1fr)); }
.month-weekdays {
  background: #e4eee9;
  color: #36564b;
  font-size: 14px;
  font-weight: 900;
}
.month-weekdays div { padding: 15px 12px; border-right: 1px solid #cedbd4; text-align: center; }
.month-cell {
  min-height: 185px;
  padding: 12px;
  border-top: 1px solid #dce4e0;
  border-right: 1px solid #dce4e0;
  background: white;
}
.month-cell.outside { background: #f4f7f5; }
.month-cell.today { background: #fbffe9; box-shadow: inset 0 0 0 2px #c7e64c; }
.month-date { min-height: 30px; display: flex; align-items: center; justify-content: space-between; }
.month-date strong { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font-size: 16px; }
.month-cell.today .month-date strong { background: #d7f15d; }
.month-date span { color: #668000; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.month-events { display: grid; gap: 6px; margin-top: 5px; }
.month-event {
  display: block;
  padding: 10px;
  border-left: 4px solid #0b8a68;
  border-radius: 8px;
  background: #e3f4ed;
  color: #183129;
  text-decoration: none;
}
.month-event.external { border-left-color: #d99812; background: #fff3d5; }
.month-event > div { display: flex; align-items: baseline; gap: 6px; }
.month-event time { color: #006b4f; font-size: 13px; font-weight: 900; }
.month-event b { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.month-event span { display: block; overflow: hidden; margin-top: 5px; color: #4f6b61; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

/* Programmazione settimanale: testi e schede più leggibili */
.calendar { grid-template-columns: 190px repeat(7,minmax(175px,1fr)); }
.cal-corner,.cal-day,.cal-driver,.cal-cell {
  min-height: 118px;
  padding: 14px;
}
.cal-corner,.cal-day {
  min-height: 58px;
  font-size: 14px;
}
.cal-day strong { font-size: 15px; text-transform: uppercase; }
.cal-day span { margin-top: 4px; font-size: 13px; }
.cal-driver strong { display: block; font-size: 15px; }
.cal-driver small { margin-top: 5px; font-size: 12px; line-height: 1.35; }
.event {
  padding: 11px;
  border-left-width: 4px;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.35;
}
.event time { display: block; color: #006b4f; font-size: 13px; font-weight: 900; }
.event strong { margin-top: 4px; font-size: 14px; }
.event span { margin-top: 4px; color: #4f6b61; font-size: 12px; }
.audit-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding: 22px 24px;
  border-radius: 16px;
  background: #e4f0ea;
  border: 1px solid #c9dcd3;
}
.audit-intro h2 { margin: 5px 0; font-size: 23px; }
.audit-intro p { margin: 0; color: #587168; }
.audit-total {
  min-width: 130px;
  padding: 13px 18px;
  border-radius: 12px;
  background: white;
  text-align: center;
}
.audit-total strong,.audit-total span { display: block; }
.audit-total strong { color: #006b4f; font-size: 28px; }
.audit-total span { color: var(--muted); font-size: 11px; }
.audit-filters {
  display: grid;
  grid-template-columns: 1.25fr 1.25fr 1.1fr .7fr .7fr auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}
.audit-filters label { font-size: 12px; }
.audit-panel { padding-top: 10px; }
.audit-action {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 8px;
  background: #e3f4ed;
  color: #006b4f;
  font-size: 12px;
  font-weight: 900;
}
.audit-note { margin: 14px 0 0; color: var(--muted); font-size: 11px; text-align: right; }
.wizard-form { max-width: 1180px; margin: 0 auto; }
.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -4px 0 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.wizard-progress > i { width: 80px; height: 2px; background: #d7e0dc; }
.wizard-progress-item { display: flex; align-items: center; gap: 8px; color: #82938d; }
.wizard-progress-item span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #e8eeeb; font-weight: 800; }
.wizard-progress-item b { font-size: 13px; }
.wizard-progress-item.active { color: #006b4f; }
.wizard-progress-item.active span { background: #d7f15d; color: #17372d; box-shadow: 0 0 0 4px #f2facd; }
.wizard-progress-item.done span { background: #006b4f; color: white; }
.wizard-step { display: none; }
.wizard-step.active { display: block; animation: wizard-in .22s ease-out; }
@keyframes wizard-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.wizard-heading { max-width: 720px; margin: 0 auto 26px; text-align: center; }
.wizard-heading h2 { margin: 7px 0 8px; font-size: 28px; }
.wizard-heading p { margin: 0; color: var(--muted); font-size: 16px; }
.wizard-category-select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.category-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; max-width: 950px; margin: 0 auto; }
.category-card {
  min-height: 108px;
  padding: 18px;
  display: grid;
  grid-template-columns: 47px 1fr 28px;
  align-items: center;
  gap: 15px;
  border: 2px solid #dbe4df;
  border-radius: 15px;
  background: white;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s,background .15s,transform .15s;
}
.category-card:hover { border-color: #70ad97; background: #f4faf7; transform: translateY(-2px); }
.category-card.selected { border-color: #006b4f; background: #e9f5ef; box-shadow: 0 0 0 3px rgba(0,107,79,.10); }
.category-card > span { width: 47px; height: 47px; display: grid; place-items: center; border-radius: 12px; background: #d7f15d; color: #17372d; font-size: 13px; font-weight: 900; }
.category-card strong,.category-card small { display: block; }
.category-card strong { font-size: 17px; }
.category-card small { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.category-card > b { color: #006b4f; font-size: 24px; }
.wizard-service-row { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.wizard-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.wizard-actions .btn { min-width: 170px; }
.wizard-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; max-width: 900px; margin: 0 auto; }
.wizard-summary > div { padding: 16px; border: 1px solid #dce5e1; border-radius: 12px; background: #f6f9f7; }
.wizard-summary span,.wizard-summary strong { display: block; }
.wizard-summary span { margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.wizard-summary strong { font-size: 15px; line-height: 1.4; }
.wizard-summary .wide { grid-column: 1/-1; }
.admin-grid { display: block; }
.admin-grid > .panel:first-child { display: none; }
.directory-panel { width: 100%; min-height: 390px; }
.directory-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.directory-title { display: flex; align-items: center; gap: 14px; }
.directory-title h2 { margin: 0; font-size: 24px; }
.add-record-button { min-height: 54px; padding: 9px 18px 9px 10px; display: inline-flex; align-items: center; gap: 11px; border: 0; border-radius: 12px; background: #006b4f; color: white; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 20px rgba(0,107,79,.18); }
.add-record-button span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: #d7f15d; color: #17372d; font-size: 25px; line-height: 1; }
.add-record-button:hover { background: #00563f; }
.directory-panel .list > div { min-height: 66px; padding: 14px 10px; align-items: center; }
.directory-panel .list strong { font-size: 15px; }
.record-modal { display: none; position: fixed; inset: 0; z-index: 100; padding: 24px; align-items: center; justify-content: center; }
.record-modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(17,40,32,.58); backdrop-filter: blur(3px); cursor: default; }
.modal-dialog { position: relative; z-index: 1; width: min(620px,100%); max-height: calc(100vh - 48px); overflow-y: auto; padding: 30px; border-radius: 20px; background: white; box-shadow: 0 30px 90px rgba(0,0,0,.30); animation: modal-in .18s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-dialog > h2 { margin: 0 45px 6px 0; font-size: 26px; }
.modal-close { position: absolute; top: 18px; right: 18px; width: 42px; height: 42px; border: 0; border-radius: 50%; background: #edf2ef; color: #26483d; font-size: 27px; line-height: 1; cursor: pointer; }
.modal-close:hover { background: #dce9e3; }
.modal-dialog form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-top: 24px; }
.modal-dialog form > input[type="hidden"] { display: none; }
.modal-dialog form > label { min-width: 0; }
.modal-dialog form > label:first-of-type { grid-column: 1/-1; }
.modal-actions { grid-column: 1/-1; display: flex; justify-content: flex-end; gap: 10px; margin: 8px -30px -30px; padding: 16px 30px; border-top: 1px solid var(--line); background: #f7f9f8; }
.modal-actions .btn { min-width: 130px; }
body.modal-is-open { overflow: hidden; }
.logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: #c7ddd3;
  border: 1px solid #abcabd;
  color: #17372d;
  font-weight: 800;
}
.logout::before {
  content: "↪";
  margin-right: 8px;
  font-size: 18px;
}
.logout:hover {
  background: #b6d3c6;
}
.sidebar nav a:hover {
  background: #c7ddd3;
  color: #12372b;
}
.sidebar nav a.active {
  background: #d7f15d;
  color: #16382d;
  font-weight: 700;
  box-shadow: inset 5px 0 #006b4f, 0 4px 12px rgba(24,49,41,.08);
}
.nav-section {
  margin-top: 24px;
  color: #58746a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
}
.sidebar .brand {
  font-size: 16px;
}
.sidebar .brand small {
  margin-top: 3px;
  color: #4f6e63;
  opacity: 1;
  font-size: 12px;
}
input, select, textarea {
  min-height: 48px;
  border-radius: 11px;
  padding: 12px 13px;
  font-size: 15px;
  border-color: #c5d1cb;
}
textarea { min-height: 100px; resize: vertical; }
.btn { min-height: 46px; }
.form-grid { gap: 18px; }
.section-title > span { width: 36px; height: 36px; min-width: 36px; }

@media (max-width: 820px) {
  body { font-size: 15px; }
  .sidebar { position: static; width: auto; padding: 14px 16px 10px; }
  .brand { justify-content: center; }
  .brand-mark { width: 42px; height: 42px; }
  .sidebar nav {
    margin-top: 14px;
    display: flex;
    flex-direction: row;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
  }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .sidebar nav a {
    background: #c9ddd4;
    color: #17372d;
    white-space: nowrap;
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 10px 14px;
    font-size: 15px;
  }
  .sidebar nav a.active { background: #d7f15d; color: #16382d; box-shadow: inset 5px 0 #006b4f; }
  .logout { background: #bfd6cb; color: #17372d; }
  .logout::after { color: #17372d; }
  .sidebar nav a.active { background: var(--lime); color: var(--ink); box-shadow: inset 5px 0 #006b4f; }
  .nav-section { display: none; }
  .sidebar > form { position: absolute; left: auto; right: 10px; top: 12px; bottom: auto; width: 43px; }
  .logout { font-size: 0; width: 43px; height: 43px; padding: 0; background: #29483e; }
  .logout::before { content: ""; margin: 0; }
  .logout::after { content: "↪"; font-size: 22px; color: #17372d; }
  .sidebar .brand span:not(.brand-mark) { font-size: 13px; }
  main { margin-left: 0; padding: 0 14px 35px; }
  .topbar { height: 84px; }
  .topbar h1 { font-size: 23px; }
  .user-chip { padding: 7px; }
  .user-chip div { display: none; }
  .user-chip > span { width: 38px; height: 38px; }
  .hero { padding: 24px; align-items: flex-start; gap: 20px; flex-direction: column; border-radius: 16px; }
  .hero h2 { font-size: 25px; line-height: 1.15; }
  .hero p { line-height: 1.45; }
  .hero .btn { width: 100%; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stats article { padding: 16px; border-radius: 13px; }
  .stats strong { font-size: 28px; }
  .panel { padding: 17px; border-radius: 14px; }
  .panel-head { align-items: flex-start; gap: 10px; }
  .form-panel { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; gap: 18px; }
  .wide { grid-column: auto; }
  .section-title { margin-top: 24px; }
  .section-title p { line-height: 1.35; }
  .btn { min-height: 48px; font-size: 15px; }
  .form-actions {
    position: sticky;
    bottom: 0;
    background: rgba(255,255,255,.97);
    margin: 24px -18px -18px;
    padding: 12px 18px;
    border-top: 1px solid var(--line);
    z-index: 3;
  }
  .form-actions .btn { flex: 1; }
  .filters { flex-direction: column; background: white; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
  .filters select { width: 100%; }
  .detail dl > div { grid-template-columns: 1fr; gap: 5px; }
  .table-wrap { overflow: visible; }
  table { display: block; }
  table thead { display: none; }
  table tbody { display: grid; gap: 12px; }
  table tr {
    display: block;
    background: white;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 10px 13px;
    box-shadow: 0 5px 18px rgba(24,49,41,.05);
  }
  table td {
    display: grid;
    grid-template-columns: 118px 1fr;
    gap: 10px;
    border-bottom: 1px solid #edf0ee;
    padding: 9px 0;
    min-height: 39px;
  }
  table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 800;
  }
  table td.row-action { display: block; border: 0; padding-top: 12px; }
  table td.row-action::before { display: none; }
  .row-action .icon-btn {
    display: flex;
    background: var(--green);
    color: white;
    border-radius: 9px;
    min-height: 46px;
    align-items: center;
    justify-content: center;
  }
  .empty { display: block !important; text-align: center; }
  .empty::before { display: none; }
  .inline { flex-direction: column; }
  .calendar-toolbar { gap: 8px; }
  .calendar-toolbar .btn { font-size: 12px; padding: 8px; }
  .login-main { padding: 14px; }
  .login-card { padding: 26px 21px; }
  .login-card input { font-size: 16px; min-height: 52px; }
  .admin-grid { grid-template-columns: 1fr; }
  .list > div { flex-direction: column; }
  .attachments a { min-height: 48px; align-items: center; }
  .external-request-alert { grid-template-columns: 42px 1fr; }
  .external-request-alert > b { grid-column: 2; }
  .billing-legend { width: 100%; justify-content: center; }
  table tr.billing-pending { background: #fff7dc; border-left: 7px solid #d6a928; }
  table tr.billing-invoiced { background: #eaf6f1; border-left: 7px solid #42a17c; }
  .billing-row.billing-pending td,.billing-row.billing-invoiced td { background: transparent; }
  .billing-row.billing-pending td:first-child,.billing-row.billing-invoiced td:first-child { border-left: 0; }
  .audit-intro { align-items: flex-start; flex-direction: column; }
  .audit-total { width: 100%; }
  .audit-filters { grid-template-columns: 1fr; }
  .wizard-progress { justify-content: space-between; overflow-x: auto; }
  .wizard-progress > i { width: 24px; min-width: 24px; }
  .wizard-progress-item b { display: none; }
  .category-cards { grid-template-columns: 1fr; }
  .category-card { min-height: 94px; padding: 14px; }
  .wizard-heading h2 { font-size: 24px; }
  .wizard-actions { position: sticky; bottom: 0; z-index: 4; margin: 24px -18px -18px; padding: 12px 18px; background: rgba(255,255,255,.97); }
  .wizard-actions .btn { min-width: 0; flex: 1; }
  .wizard-summary { grid-template-columns: 1fr; }
  .wizard-summary .wide { grid-column: auto; }
  .directory-header { align-items: stretch; flex-direction: column; }
  .add-record-button { width: 100%; justify-content: center; }
  .record-modal { padding: 0; align-items: flex-end; }
  .modal-dialog { width: 100%; max-height: 92vh; padding: 24px 18px; border-radius: 20px 20px 0 0; }
  .modal-dialog form { grid-template-columns: 1fr; }
  .modal-dialog form > label:first-of-type { grid-column: auto; }
  .modal-actions { margin: 8px -18px -24px; padding: 14px 18px; position: sticky; bottom: -24px; }
  .calendar-viewbar { align-items: stretch; flex-direction: column; }
  .view-switch { display: grid; grid-template-columns: 1fr 1fr; }
  .view-switch a { min-width: 0; }
  .month-toolbar { grid-template-columns: 1fr 1fr; }
  .month-toolbar > div { grid-column: 1/-1; grid-row: 1; margin-bottom: 4px; }
  .month-calendar { overflow-x: auto; }
  .month-weekdays,.month-grid { min-width: 980px; }
}

@media (max-width: 430px) {
  .stats { grid-template-columns: 1fr; }
  .topbar .eyebrow { display: none; }
  .topbar h1 { font-size: 21px; }
  .panel-head .btn.small { font-size: 0; width: 48px; min-width: 48px; }
  .panel-head .btn.small::after { content: "+"; font-size: 24px; }
  .calendar-toolbar strong { font-size: 12px; }
  table td { grid-template-columns: 102px 1fr; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
}
