:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #17253a;
  background: #f5f7fb;
  font-synthesis: none;
  --navy: #101e33;
  --blue: #245bd7;
  --muted: #6a778c;
  --line: #e4e9f1;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
[hidden] {
  display: none !important;
}
button,
input,
select,
textarea {
  border-radius: 9px;
}
button {
  border: 0;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #69a2ff;
  outline-offset: 3px;
}
button.primary {
  background: var(--blue);
  color: white;
  padding: 12px 18px;
  font-weight: 650;
  box-shadow: 0 4px 12px #245bd71a;
}
button.primary:hover {
  background: #1648b5;
}
.secondary {
  background: white;
  border: 1px solid var(--line);
  color: #273b59;
  padding: 9px 14px;
}
.secondary:hover {
  background: #f0f4fa;
}
.quiet {
  background: transparent;
  color: var(--muted);
  padding: 8px;
}
.full {
  width: 100%;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: 1px;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  display: grid;
  place-items: center;
  background: #4077f0;
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 26px;
  letter-spacing: -2px;
}
.muted-brand {
  font-weight: 400;
  color: #aab8cd;
}
.eyebrow {
  color: var(--blue);
  font-size: 11px;
  letter-spacing: 1.7px;
  text-transform: uppercase;
  font-weight: 750;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 34px;
  letter-spacing: -1.1px;
  line-height: 1.2;
  margin-bottom: 10px;
}
h2 {
  font-size: 24px;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}
p {
  color: var(--muted);
  line-height: 1.65;
}
input,
select,
textarea {
  border: 1px solid #d8e0ed;
  background: white;
  color: #203048;
  padding: 11px 12px;
  min-width: 0;
}
label {
  font-size: 13px;
  font-weight: 600;
  display: block;
  margin-bottom: 7px;
}
textarea {
  resize: vertical;
  width: 100%;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}
.field-help {
  font-size: 12px;
  margin: 7px 0 16px;
  line-height: 1.5;
}
.error {
  color: #b32935;
  font-size: 13px;
  margin-top: 15px;
  margin-bottom: 0;
}
.error:empty {
  display: none;
}
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  background: linear-gradient(125deg, #eef3ff, #f8fafc);
}
.login-intro {
  background: var(--navy);
  color: white;
  padding: 60px 9%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-intro:after {
  content: "";
  position: absolute;
  width: 450px;
  height: 450px;
  border: 1px solid #ffffff10;
  border-radius: 50%;
  right: -240px;
  bottom: -110px;
  box-shadow:
    0 0 0 80px #ffffff03,
    0 0 0 160px #ffffff02;
  pointer-events: none;
}
.login-intro .brand {
  margin-bottom: 100px;
}
.login-intro .eyebrow {
  color: #8fb7ff;
  margin-bottom: 22px;
}
.login-intro h1 {
  font-size: clamp(30px, 3.5vw, 52px);
  line-height: 1.18;
  margin-bottom: 22px;
}
.login-intro p {
  color: #b5c5dd;
  max-width: 400px;
}
.intro-line {
  font-size: 12px;
  margin-top: 60px;
  color: #7990b0;
}
.login-card {
  align-self: center;
  justify-self: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 38px;
  width: min(440px, 85%);
  box-shadow: 0 20px 70px #152a4c0c;
}
.login-card .eyebrow {
  display: block;
  margin-bottom: 13px;
}
.login-card p {
  font-size: 14px;
}
.app-shell {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: var(--navy);
  color: white;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand {
  margin: 0 10px 50px;
}
.nav-heading {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #7f96b5;
  margin: 0 14px 14px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: transparent;
  color: #afbed5;
  width: 100%;
  padding: 13px 14px;
  margin: 4px 0;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}
.nav-item span {
  width: 18px;
  font-size: 20px;
  color: #7f96b5;
}
.nav-item.selected {
  background: #223752;
  color: white;
}
.nav-item.selected span {
  color: #8fb7ff;
}
.nav-item:hover {
  background: #1d304b;
}
.sidebar-foot {
  margin-top: auto;
  padding: 22px 13px 0;
  border-top: 1px solid #ffffff0c;
  font-size: 11px;
  color: #d0d9e8;
}
.sidebar-foot small {
  display: block;
  color: #7f96b5;
  margin-top: 8px;
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #62d6bc;
  border-radius: 100%;
  margin-right: 6px;
}
.topbar {
  height: 82px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 0 38px;
  color: var(--muted);
  font-size: 12px;
}
.divider {
  margin: 0 12px;
  color: #bbc5d5;
}
.session {
  display: flex;
  gap: 11px;
  align-items: center;
}
.avatar {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eaf0fd;
  color: var(--blue);
  font-weight: 700;
}
.workspace {
  max-width: 1500px;
  padding: 38px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}
.page-heading .eyebrow {
  display: block;
  margin-bottom: 12px;
}
.page-heading p {
  font-size: 14px;
  margin-bottom: 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}
.stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}
.stat span {
  color: var(--muted);
  font-size: 12px;
}
.stat strong {
  display: block;
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -1px;
  margin: 12px 0 5px;
}
.stat small {
  font-size: 11px;
  color: #91a0b4;
}
.panel {
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 20px #183c7003;
}
.panel-toolbar {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.filters input {
  width: 260px;
  font-size: 12px;
}
.filters select {
  font-size: 12px;
}
.table-wrap {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  white-space: nowrap;
}
th {
  text-align: left;
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  background: #fafbfd;
  padding: 13px 20px;
}
td {
  padding: 18px 20px;
  border-bottom: 1px solid #edf0f5;
  color: #40516b;
}
tr:last-child td {
  border-bottom: 0;
}
.cell-title {
  display: block;
  color: #1d304b;
  font-weight: 650;
  font-size: 13px;
}
.cell-sub {
  display: block;
  font-size: 10px;
  color: #8c9ab0;
  margin-top: 4px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 5px;
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 600;
  background: #f0f2f6;
  color: #738197;
}
.badge.active {
  background: #e9f7f1;
  color: #218761;
}
.badge.active:before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}
.row-action {
  font-size: 11px;
  padding: 7px 10px;
}
.panel-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.pagination {
  display: flex;
  gap: 8px;
}
.pagination button {
  font-size: 11px;
  padding: 7px 12px;
}
.workspace-foot {
  font-size: 11px;
  color: #91a0b4;
  margin-top: 20px;
}
.notice {
  background: #e9f7f1;
  border: 1px solid #d1eddf;
  border-radius: 9px;
  padding: 13px 16px;
  margin-bottom: 20px;
  color: #26764f;
  font-size: 13px;
}
.notice.failure {
  background: #fff0f1;
  border-color: #f4d5d9;
  color: #a32c39;
}
.empty {
  text-align: center;
  padding: 45px 20px;
}
.empty > div {
  font-size: 35px;
  color: #afbbcd;
}
.empty h3 {
  font-size: 15px;
  margin: 12px 0 5px;
}
.empty p {
  font-size: 12px;
  margin: 0;
}
.integrity {
  font-size: 11px;
  color: #218761;
  white-space: nowrap;
}
dialog {
  width: min(560px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 27px;
  box-shadow: 0 25px 100px #10233a33;
  max-height: 90vh;
  overflow-y: auto;
}
dialog::backdrop {
  background: #10233a66;
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 20px;
}
.dialog-heading h2 {
  margin: 6px 0 0;
  font-size: 22px;
}
.close {
  background: transparent;
  color: #78869c;
  font-size: 28px;
  padding: 0 5px;
}
.form-fields {
  display: grid;
  gap: 17px;
}
.form-fields input:not([type="checkbox"]),
.form-fields select {
  width: 100%;
}
.form-fields input[readonly] {
  background: #f5f7fb;
  color: #78869c;
}
.switch-label {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
}
.switch-label input {
  width: 17px;
  height: 17px;
  accent-color: var(--blue);
}
.dialog-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
details {
  border-top: 1px solid var(--line);
  padding-top: 15px;
}
summary {
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 14px;
}
.hash {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  overflow-wrap: anywhere;
}
.audit-snapshots pre {
  background: #f5f7fb;
  padding: 15px;
  border-radius: 9px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
  color: #40516b;
}
.audit-snapshots h3 {
  font-size: 13px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .sidebar {
    padding: 24px 12px;
  }
  .workspace {
    padding: 28px;
  }
  .topbar {
    padding: 0 28px;
  }
  .stats {
    gap: 12px;
  }
  .stat {
    padding: 17px;
  }
  .panel-toolbar {
    align-items: start;
    flex-direction: column;
  }
}
@media (max-width: 760px) {
  .login-screen {
    grid-template-columns: 1fr;
  }
  .login-intro {
    padding: 30px;
  }
  .login-intro .brand {
    margin-bottom: 35px;
  }
  .login-intro h1 {
    font-size: 30px;
  }
  .intro-line {
    display: none;
  }
  .login-card {
    width: calc(100% - 32px);
    padding: 25px;
    margin: 25px 0;
  }
  .app-shell {
    display: block;
  }
  .sidebar {
    position: relative;
    height: auto;
    padding: 20px 18px 10px;
  }
  .sidebar .brand {
    margin: 0 0 17px;
    font-size: 19px;
  }
  .sidebar nav {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 6px;
  }
  .nav-item {
    width: auto;
    margin: 0;
    font-size: 11px;
    padding: 10px 12px;
    flex-shrink: 0;
  }
  .nav-item span {
    font-size: 15px;
    width: auto;
  }
  .nav-heading,
  .sidebar-foot {
    display: none;
  }
  .topbar {
    height: 63px;
    padding: 0 18px;
  }
  .topbar > span {
    display: none;
  }
  .session {
    width: 100%;
  }
  .session .quiet {
    margin-left: auto;
    font-size: 12px;
  }
  .workspace {
    padding: 24px 16px;
  }
  .page-heading {
    align-items: start;
    flex-direction: column;
    margin-bottom: 22px;
    gap: 17px;
  }
  .page-heading h1 {
    font-size: 29px;
  }
  .page-heading p {
    font-size: 13px;
  }
  .page-heading .primary {
    font-size: 12px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 22px;
  }
  .stat {
    padding: 15px;
  }
  .stat span {
    font-size: 10px;
  }
  .stat strong {
    font-size: 26px;
    margin: 10px 0 3px;
  }
  .stat small {
    font-size: 10px;
  }
  .panel-toolbar {
    padding: 14px;
  }
  .filters {
    width: 100%;
    gap: 8px;
  }
  .filters input {
    width: 100%;
  }
  .filters select {
    flex: 1;
  }
  .panel-footer {
    padding: 14px;
    flex-wrap: wrap;
  }
  .workspace-foot {
    line-height: 1.6;
  }
  td,
  th {
    padding-left: 15px;
    padding-right: 15px;
  }
  .notice {
    font-size: 12px;
  }
  dialog {
    padding: 21px;
  }
  .sidebar .brand-mark {
    height: 31px;
    width: 31px;
    font-size: 22px;
  }
}

.session #actor-name {
  min-width: 0;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session .quiet {
  flex-shrink: 0;
}
/* Local sign-in shares the responsive administration design. */
.login-card input { width:100%; margin:8px 0 18px; padding:12px; border:1px solid #cbd5e1; border-radius:8px; }
.login-card button { margin-top:12px; }
#totp-setup { overflow-wrap:anywhere; padding:14px; background:#f1f5f9; border-radius:10px; }
#totp-secret { font-family:monospace; font-size:14px; }

/* Search cards share the existing shell and remain readable on small screens. */
.order-filters { display:flex; flex-wrap:wrap; align-items:end; gap:12px; margin:24px 0; }
.order-filters > div { flex:1 1 220px; min-width:0; }
.order-filters input { width:100%; }
.order-results { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr)); gap:16px; }
.order-card, .order-detail { padding:22px; overflow-wrap:anywhere; }
.order-card h2 { margin-top:14px; font-size:20px; }
.order-card p { margin-bottom:12px; }
.order-card button { max-width:100%; white-space:normal; overflow-wrap:anywhere; }
.order-detail { margin-top:20px; }
.order-detail dl { display:grid; grid-template-columns:minmax(0,140px) minmax(0,1fr); gap:12px; }
.order-detail dt { font-weight:600; }
.order-detail dd { margin:0; white-space:pre-wrap; }
.order-search .panel-footer { flex-wrap:wrap; }
.order-search .pagination { flex-wrap:wrap; }
@media (max-width:600px) { .order-detail dl { grid-template-columns:1fr; gap:8px; } .order-detail dd { margin-bottom:12px; } }

/* Order creation reuses the order shell; inputs keep values after server errors. */
.order-create { margin:20px 0; padding:22px; }
.order-create-form { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); gap:12px 16px; }
.order-create-form > div { min-width:0; }
.order-create-form input, .order-create-form textarea { width:100%; box-sizing:border-box; }
.order-create-form textarea { min-height:96px; resize:vertical; }
.order-create-form .wide, .order-create-actions { grid-column:1 / -1; }
.order-create-actions { display:flex; flex-wrap:wrap; gap:12px; }

/* A2: appointments in the order detail, office day order and the employee day list. */
.order-search-actions, .appointment-actions, .my-day-navigation, .day-order-buttons { display:flex; flex-wrap:wrap; gap:12px; }
.order-appointments { margin-top:24px; border-top:1px solid var(--line); padding-top:20px; }
.appointment-list { display:grid; gap:12px; margin:12px 0; }
.appointment-card { border:1px solid var(--line); border-radius:12px; padding:16px; overflow-wrap:anywhere; }
.appointment-card.cancelled, .my-day-card.cancelled { opacity:.75; border-style:dashed; }
.appointment-time { font-weight:600; }
.appointment-form { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); gap:12px 16px; margin:12px 0; }
.appointment-form > div { min-width:0; }
.appointment-form input, .appointment-form select { width:100%; box-sizing:border-box; }
.appointment-people, .appointment-actions { grid-column:1 / -1; }
.appointment-people { border:1px solid var(--line); border-radius:9px; padding:12px; display:flex; flex-wrap:wrap; gap:8px 16px; min-width:0; }
.appointment-people .check { display:inline-flex; align-items:center; gap:6px; font-weight:400; }
.warning { color:#9a5b00; }
.day-order { margin:20px 0; padding:22px; }
.day-order-filters { display:flex; flex-wrap:wrap; align-items:end; gap:12px; margin:16px 0; }
.day-order-filters > div { flex:1 1 200px; min-width:0; }
.day-order-filters select, .day-order-filters input { width:100%; box-sizing:border-box; }
.day-order-list { display:grid; gap:10px; padding-left:24px; }
.day-order-item { display:grid; gap:6px; overflow-wrap:anywhere; }
.day-order-item .badge { justify-self:start; }
.my-day { margin-top:24px; }
.my-day-list { display:grid; gap:14px; padding:0; list-style:none; }
.my-day-card { padding:18px; overflow-wrap:anywhere; }
.my-day-card h3 { margin:10px 0 6px; font-size:20px; }
.my-day-card p { margin:6px 0; }
.my-day-description { white-space:pre-wrap; }
.my-day-navigation button { flex:1 1 auto; }
