/* Shared visual hierarchy for the web interface. Feature styles own their layouts. */
body.sm-body {
  font-size: .9375rem;
  line-height: 1.5;
}

.sm-body .sm-content {
  padding: clamp(1.125rem, 2.35vw, 2rem) clamp(.875rem, 2.35vw, 2.25rem) 3rem;
}

.sm-body :is(.sm-page-header, .page-header) {
  gap: .875rem 1.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0;
  border-bottom: 0;
}

.sm-body :is(.sm-page-title, .page-header h1) {
  font-size: clamp(1.625rem, 2.5vw, 2.125rem);
  line-height: 1.16;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.sm-body .sm-page-title-row { flex-wrap: wrap; }
.sm-body :is(.sm-kicker, .page-kicker) {
  color: var(--sm-text-muted);
  font-size: .75rem;
  letter-spacing: .055em;
}

.sm-body :is(.sm-page-description, .page-header p) {
  color: var(--sm-text-muted);
  line-height: 1.5;
}

.sm-body :is(.sm-page-actions, .page-actions, .dashboard-layout-header-actions) {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.sm-body :is(.sm-content, .sm-auth-main, .sm-public-main) :is(
  .card, .section-card, .dashboard-section, .metric-card, .sm-table-wrap, .sm-object-hero
) {
  border-color: var(--sm-border);
  border-radius: var(--sm-radius);
  box-shadow: none;
}

.sm-body :is(.sm-content, .sm-auth-main, .sm-public-main) :is(.card-header, .section-head) {
  background: var(--sm-surface);
}

.sm-body :is(.sm-card-header, .section-head) :is(h2, h3, .card-title) {
  font-size: 1.0625rem;
  line-height: 1.35;
  font-weight: 680;
  overflow-wrap: anywhere;
}

.sm-body .sm-main :is(.sm-card-subtitle, .sm-cell-note, .form-hint, .sm-field-help, .listitem small, .sm-work-note) {
  color: var(--sm-text-muted);
  font-size: .875rem;
  line-height: 1.45;
}

.sm-body .sm-content :is(.form-label, .sm-form-label, .metric-label) {
  font-size: .875rem;
  font-weight: 650;
}

.sm-body .sm-content :is(.form-control, .form-select, textarea) {
  font-size: .9375rem;
}

.sm-body .sm-content .metric-card::before { content: none; }
.sm-body .sm-content a.metric-card:hover {
  background: var(--sm-surface-muted);
  border-color: var(--sm-border-strong);
  box-shadow: none;
}

.sm-body .sm-content .metric-value { font-variant-numeric: tabular-nums; }
.sm-body .sm-content .listitem { column-gap: .875rem; row-gap: .5rem; }
.sm-body .sm-content .listitem:not(:last-child) { border-bottom-color: var(--sm-border); }

.sm-body .sm-main .table > thead > tr > th {
  color: var(--sm-text-muted);
  background: var(--sm-surface-muted);
  font-size: .8125rem;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
}

.sm-body .sm-main .table > tbody > tr > td {
  font-size: .875rem;
  line-height: 1.45;
}

.sm-body .sm-main .table-hover > tbody > tr:hover > * {
  --tblr-table-bg-state: var(--sm-surface-muted);
}

.sm-body :is(.sm-content, .sm-auth-main, .sm-public-main) .btn {
  box-shadow: none;
  font-weight: 640;
}

.sm-body :is(.sm-content, .sm-topbar) .btn > .ti { margin-inline-end: .3rem; }
.sm-body :is(.sm-content, .sm-topbar) .btn-icon > .ti { margin-inline-end: 0; }

.sm-body :is(.sm-content, .sm-topbar, .sm-sidebar, .sm-auth-main, .sm-public-main)
  :is(a, button, input, select, textarea, summary, [tabindex="0"]):focus-visible {
  outline: 2px solid var(--sm-primary);
  outline-offset: 2px;
}

.sm-body .sm-sidebar :is(a, button, input):focus-visible { outline-color: #93c5fd; }
.sm-body .sm-sidebar .sm-nav-item { font-size: .875rem; }
.sm-body .sm-sidebar .sm-nav-group-toggle { font-size: .75rem; letter-spacing: .045em; }
.sm-body .sm-work-indicator { font-variant-numeric: tabular-nums; }

/* Deadlines use one list surface, with a section for each planning group. */
.sm-deadline-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: .875rem;
}

.sm-deadline-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
}

.sm-deadline-filters a {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 2.5rem;
  padding: .375rem .75rem;
  border: 1px solid var(--sm-border);
  border-radius: var(--sm-radius-sm);
  background: var(--sm-surface);
  color: var(--sm-text);
  font-size: .875rem;
  font-weight: 620;
  text-decoration: none;
}

.sm-deadline-filters a:hover { border-color: var(--sm-border-strong); background: var(--sm-surface-muted); }
.sm-deadline-filters a[aria-current="page"] {
  border-color: color-mix(in srgb, var(--sm-primary) 45%, var(--sm-border));
  background: var(--sm-primary-soft);
  color: var(--sm-info);
}

.sm-deadline-count {
  min-width: 1.375rem;
  padding: 0 .25rem;
  border-radius: .25rem;
  background: var(--sm-surface-muted);
  color: var(--sm-text-muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.sm-deadline-list {
  scroll-margin-top: calc(var(--sm-topbar-height) + .75rem);
  border: 1px solid var(--sm-border);
  border-radius: var(--sm-radius-lg);
  background: var(--sm-surface);
}

.sm-deadline-list-head { padding: .875rem 1rem; }
.sm-deadline-list-head h2 { margin: 0; font-size: 1.0625rem; line-height: 1.35; }
.sm-deadline-list-head p,
.sm-deadline-group-head p {
  margin: .2rem 0 0;
  color: var(--sm-text-muted);
  font-size: .875rem;
}

.sm-deadline-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  padding: .625rem 1rem;
  border-block: 1px solid var(--sm-border);
  background: var(--sm-surface-muted);
}

.sm-deadline-group-head h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .125rem .625rem;
  margin: 0;
  font-size: .9375rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.sm-deadline-group-head h3 span { color: var(--sm-text-muted); font-weight: 500; }
.sm-deadline-group-head form { margin: 0; }

.sm-deadline-entries { margin: 0; padding: 0; list-style: none; }
.sm-deadline-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(6.5rem, .22fr) minmax(8rem, .24fr);
  align-items: center;
  gap: .625rem 1rem;
  padding: .6875rem 1rem;
}
.sm-deadline-entry + .sm-deadline-entry { border-top: 1px solid var(--sm-border); }

.sm-deadline-device { display: flex; min-width: 0; align-items: center; gap: .625rem; }
.sm-deadline-device > div { min-width: 0; overflow-wrap: anywhere; }
.sm-deadline-device-link { color: var(--sm-text); font-weight: 680; text-decoration: underline; text-underline-offset: .2em; text-decoration-color: var(--sm-border-strong); }
.sm-deadline-device-link:hover { color: var(--sm-info); text-decoration-color: currentColor; }
.sm-deadline-device small,
.sm-deadline-action small,
.sm-deadline-due span {
  display: block;
  color: var(--sm-text-muted);
  font-size: .8125rem;
}
.sm-deadline-select.form-check-input { flex: 0 0 auto; width: 1.125rem; height: 1.125rem; margin: 0; cursor: pointer; }

.sm-deadline-due { font-size: .875rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.sm-deadline-due .sm-deadline-overdue { color: var(--sm-danger-text); }
.sm-deadline-action { display: grid; justify-items: end; gap: .2rem; }
.sm-deadline-action .btn { white-space: nowrap; }
.sm-deadline-pagination { padding: .875rem 1rem; border-top: 1px solid var(--sm-border); color: var(--sm-text-muted); }

@media (max-width: 767.98px) {
  .sm-body :is(.sm-page-header, .page-header) { align-items: flex-start; }
  .sm-body .sm-content :is(.form-control, .form-select, textarea) { font-size: 1rem; }
  .sm-deadline-entry { grid-template-columns: minmax(0, 1fr) auto; }
  .sm-deadline-device { grid-column: 1 / -1; }
  .sm-deadline-action:empty { display: none; }
  .sm-deadline-action .btn { white-space: normal; min-height: 2.5rem; }
  .sm-deadline-group-head form .btn { min-height: 2.5rem; }
}

/* Tabler resets input padding in some directory forms. Reserve the icon space
   on the actual input so typed text and placeholders share the same start. */
.sm-body .sm-search-field {
  position: relative;
  min-width: 0;
}
.sm-body .sm-search-field > .form-control {
  width: 100%;
  padding-inline-start: 2.625rem;
}
.sm-body .sm-search-icon {
  position: absolute;
  inset-inline-start: .875rem;
  top: 50%;
  display: grid;
  place-items: center;
  width: 1rem;
  color: var(--sm-text-muted);
  transform: translateY(-50%);
  pointer-events: none;
}
.sm-body .sm-search-field > .form-control::placeholder,
.sm-body .sm-global-search > input::placeholder {
  color: var(--sm-text-muted);
  opacity: 1;
}
.sm-body .sm-vacation-person {
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .625rem 1.25rem;
}
