:root {
  --color-bg: #edf3f9;
  --color-sidebar: #0f1724;
  --color-surface: rgba(255, 255, 255, 0.92);
  --color-surface-solid: #ffffff;
  --color-surface-soft: #f8fafc;
  --color-field: #ffffff;
  --color-border: #d7e1ec;
  --color-border-strong: #cbd7e3;
  --color-text: #132033;
  --color-text-muted: #64748b;
  --color-label: #516174;
  --color-primary: #1f6feb;
  --color-accent: #ff6a00;
  --color-success: #22c55e;
  --color-warning: #facc15;
  --color-danger: #ef4444;
  --bg-canvas: #edf3f9;
  --bg-surface: rgba(255, 255, 255, 0.92);
  --bg-sidebar: #0f1724;
  --bg-sidebar-accent: #1a2a40;
  --bg-primary: #1f6feb;
  --bg-primary-hover: #1758bb;
  --bg-muted: #eef3f8;
  --border-subtle: #d7e1ec;
  --text-primary: #132033;
  --text-secondary: #64748b;
  --danger: #c73d45;
  --warning: #b96d14;
  --success: #217a52;
  --neutral: #516174;
  --shadow-soft: 0 24px 60px rgba(12, 27, 44, 0.12);
  --shadow-panel: 0 34px 80px rgba(15, 23, 36, 0.16);
  --radius-card: 24px;
  --radius-button: 14px;
  --font-ui: "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--text-primary);
  background:
    radial-gradient(circle at top left, rgba(31, 111, 235, 0.2), transparent 24rem),
    radial-gradient(circle at 78% 14%, rgba(115, 240, 193, 0.18), transparent 26rem),
    radial-gradient(circle at bottom right, rgba(19, 32, 51, 0.12), transparent 20rem),
    linear-gradient(180deg, #f8fbfe 0%, var(--bg-canvas) 50%, #e3edf7 100%);
}

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

button {
  border: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px 1fr;
  position: relative;
}

.is-hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 520px);
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 28px;
}

.login-card h1 {
  margin: 0 0 8px;
}

.sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent), var(--bg-sidebar);
  color: #f8fbff;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: relative;
  overflow: hidden;
}

.sidebar::before,
.sidebar::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.sidebar::before {
  width: 220px;
  height: 220px;
  top: -72px;
  right: -96px;
  background: radial-gradient(circle, rgba(68, 183, 255, 0.24), transparent 70%);
}

.sidebar::after {
  width: 180px;
  height: 180px;
  bottom: 120px;
  left: -100px;
  background: radial-gradient(circle, rgba(115, 240, 193, 0.16), transparent 72%);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #44b7ff, #73f0c1);
  color: #09131f;
  font-weight: 800;
  box-shadow: 0 18px 34px rgba(68, 183, 255, 0.3);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  justify-content: center;
}

.activity-log-shell {
  display: grid;
  gap: 18px;
}

.activity-filter-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.8fr) repeat(5, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: center;
}

.activity-timeline {
  position: relative;
  display: grid;
  gap: 12px;
  padding-left: 18px;
}

.activity-timeline::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: #dbe6f3;
}

.activity-event {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid #dbe6f3;
  border-left: 5px solid #94a3b8;
  background: #fff;
}

.activity-marker {
  z-index: 1;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid #dbe6f3;
  font-weight: 900;
}

.activity-content {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.activity-head,
.activity-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.activity-head time {
  font-weight: 900;
  color: #0f172a;
}

.activity-head span,
.activity-chips span {
  border-radius: 999px;
  padding: 4px 9px;
  background: #eef4fb;
  color: #52657d;
  font-size: .78rem;
  font-weight: 800;
}

.activity-content strong {
  overflow-wrap: anywhere;
}

.activity-content p {
  margin: 0;
  color: #52657d;
}

.activity-success {
  border-left-color: #16a34a;
  background: #fbfffc;
}

.activity-info {
  border-left-color: #2563eb;
  background: #fbfdff;
}

.activity-danger {
  border-left-color: #dc2626;
  background: #fffafa;
}

.activity-neutral {
  border-left-color: #94a3b8;
}

.settings-shell {
  display: grid;
  gap: 16px;
}

.settings-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px;
  border: 1px solid #dbe6f3;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--foxtask-card-shadow);
}

.settings-tab {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #52657d;
  font-weight: 900;
  cursor: pointer;
}

.settings-tab.is-active {
  border-color: var(--foxtask-orange);
  background: #fff4e8;
  color: var(--foxtask-orange);
}

.settings-panel {
  display: none;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--foxtask-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--foxtask-card-shadow);
}

.settings-panel.is-active {
  display: grid;
  gap: 18px;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.settings-form-grid .field-label,
.settings-option-list .field-label {
  display: grid;
  gap: 7px;
}

.settings-branding-layout,
.settings-roles-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.35fr);
  gap: 18px;
  align-items: start;
}

.branding-preview {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid #dbe6f3;
  border-radius: 10px;
  background: linear-gradient(180deg, #fbfdff, #fff);
}

.branding-preview-logo {
  min-height: 72px;
  display: flex;
  align-items: center;
}

.branding-preview-logo img {
  max-width: 190px;
  max-height: 72px;
  object-fit: contain;
}

.settings-role-list,
.settings-role-detail {
  min-width: 0;
  padding: 16px;
  border: 1px solid #dbe6f3;
  border-radius: 10px;
  background: #fbfdff;
}

.compact-role-list {
  max-height: 640px;
  overflow: auto;
}

.compact-role-list .object-card {
  padding: 12px;
  border-radius: 8px;
}

.settings-permission-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.permission-group {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: #fff;
}

.permission-group h4 {
  margin: 0;
  color: #071d33;
  font-size: 0.9rem;
}

.permission-group > div {
  display: grid;
  gap: 7px;
}

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

.settings-info-grid div,
.settings-option-list article {
  padding: 14px;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: #fbfdff;
}

.settings-info-grid span,
.settings-option-list span {
  display: block;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
}

.settings-info-grid strong,
.settings-option-list strong {
  display: block;
  margin-top: 7px;
  color: #071d33;
}

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

.settings-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: #fbfdff;
  color: #071d33;
  font-weight: 800;
}

.settings-location-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
  padding: 16px;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: #fbfdff;
}

.settings-location-card h4 {
  margin: 0;
  color: #071d33;
}

.settings-location-card .supporting-copy {
  margin-top: 6px;
}

.settings-location-card .settings-toggle,
.settings-location-card article {
  min-width: 0;
}

.settings-location-card article {
  padding: 12px;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: #ffffff;
}

.settings-location-card article strong,
.settings-location-card article span {
  display: block;
}

.settings-location-card article span {
  margin-top: 6px;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
}

.developer-settings-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  border: 1px solid var(--color-border, #d9e2ef);
  border-radius: 8px;
  padding: 16px;
  background: var(--color-surface-soft, #f7faff);
}

.developer-settings-card h4,
.developer-settings-card p {
  margin: 0;
}

.developer-debug-toggle {
  width: fit-content;
  min-height: 40px;
}

@media (max-width: 1100px) {
  .activity-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-branding-layout,
  .settings-roles-layout,
  .settings-info-grid {
    grid-template-columns: 1fr;
  }

  .settings-permission-groups {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .activity-filter-grid,
  .activity-event {
    grid-template-columns: 1fr;
  }

  .settings-form-grid,
  .settings-option-list {
    grid-template-columns: 1fr;
  }

  .settings-location-card {
    grid-template-columns: 1fr;
  }

  .settings-panel {
    padding: 14px;
  }

  .activity-timeline {
    padding-left: 0;
  }

  .activity-timeline::before {
    display: none;
  }

  .activity-marker {
    width: 30px;
    height: 30px;
  }
}

.login-brand h1 {
  margin: 0 0 4px;
}

.fixfox-logo-img {
  display: block;
  width: 100%;
  height: auto;
}

.fixfox-logo-login {
  width: min(100%, 430px);
  max-width: 430px;
}

.fixfox-logo-sidebar {
  width: 248px;
  max-width: 100%;
}

.brand-block h1,
.topbar h2,
.section-head h3 {
  margin: 0;
}

.eyebrow,
.card-label,
.panel-label,
dt,
.field-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.73rem;
}

.eyebrow,
.card-label,
dt,
.field-label {
  color: var(--text-secondary);
}

.sidebar .eyebrow,
.panel-label {
  color: rgba(248, 251, 255, 0.68);
}

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

.nav-ticket-group {
  display: grid;
  gap: 4px;
}

.nav-ticket-group .nav-ticket-main {
  width: 100%;
}

.nav-caret {
  margin-left: 4px;
  color: rgba(248, 251, 255, 0.62);
  font-size: 0.78em;
}

.nav-submenu {
  display: grid;
  gap: 3px;
  padding: 2px 0 4px 34px;
}

.nav-subitem {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 7px;
  background: transparent;
  color: rgba(248, 251, 255, 0.66);
  text-align: left;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.nav-subitem:hover,
.nav-subitem.is-active {
  background: rgba(255, 106, 0, 0.16);
  color: #ffd7bd;
}

.nav-item {
  text-align: left;
  color: rgba(248, 251, 255, 0.8);
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-item.is-active,
.nav-item:hover {
  color: #fff;
  background: linear-gradient(135deg, rgba(47, 111, 237, 0.28), rgba(27, 49, 74, 0.92));
  border-color: rgba(115, 240, 193, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.sidebar-panel,
.surface-card,
.hero-card {
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
}

.sidebar-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.05));
  padding: 18px;
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-stack,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-stack {
  margin: 14px 0 18px;
}

.sidebar-copy {
  color: rgba(248, 251, 255, 0.82);
}

.status-pill,
.priority-chip,
.filter-chip {
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.85rem;
  font-weight: 700;
}

.ticket-status-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.ticket-status-new { background: #2563eb; border-color: #60a5fa; }
.ticket-status-assigned { background: #f97316; border-color: #fb923c; }
.ticket-status-progress { background: #dc2626; border-color: #fb7185; }
.ticket-status-review { background: #facc15; border-color: #fde047; color: #3f2d00; }
.ticket-status-done { background: #16a34a; border-color: #4ade80; }
.ticket-status-waiting { background: #6b7280; border-color: #a78bfa; }
.ticket-status-question { background: #7c3aed; border-color: #a78bfa; }
.ticket-status-neutral { background: #64748b; border-color: #94a3b8; }

.success {
  background: rgba(33, 122, 82, 0.16);
  color: var(--success);
}

.warning {
  background: rgba(185, 109, 20, 0.16);
  color: var(--warning);
}

.danger,
.critical {
  background: rgba(199, 61, 69, 0.14);
  color: var(--danger);
}

.neutral {
  background: rgba(81, 97, 116, 0.14);
  color: var(--neutral);
}

.main-shell {
  padding: 28px;
  display: grid;
  gap: 22px;
  padding-bottom: 108px;
  position: relative;
}

.main-shell::before {
  content: "";
  position: absolute;
  inset: 18px 18px auto 18px;
  height: 280px;
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(31, 111, 235, 0.12), rgba(115, 240, 193, 0.08));
  z-index: 0;
  pointer-events: none;
}

.main-shell > * {
  position: relative;
  z-index: 1;
}

.topbar,
.section-head,
.button-row,
.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-actions {
  flex-wrap: wrap;
}

.topbar {
  flex-wrap: wrap;
  padding: 18px 20px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-soft);
}

.topbar-title {
  min-width: 220px;
}

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

.topbar-nav:empty {
  display: none;
}

.search-input,
.select-input {
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  padding: 12px 14px;
}

textarea.search-input {
  min-width: 0;
  width: 100%;
  resize: vertical;
}

.search-input {
  min-width: 280px;
}

.select-input {
  width: 100%;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.hero-card,
.surface-card {
  background: var(--bg-surface);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.75);
}

.hero-card {
  padding: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.hero-card-action {
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.hero-card-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 44px rgba(12, 27, 44, 0.14);
}

.hero-card-action:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.18), 0 22px 44px rgba(12, 27, 44, 0.14);
}

.hero-card-action.is-active {
  border-color: rgba(31, 111, 235, 0.42);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.08), var(--shadow-soft);
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, rgba(31, 111, 235, 0.9), rgba(115, 240, 193, 0.9));
}

.hero-card:nth-child(1) {
  grid-column: span 2;
  background:
    radial-gradient(circle at top right, rgba(68, 183, 255, 0.24), transparent 34%),
    linear-gradient(135deg, rgba(19, 32, 51, 0.98), rgba(31, 111, 235, 0.92));
  color: #fff;
  box-shadow: var(--shadow-panel);
}

.hero-card:nth-child(1)::before {
  background: linear-gradient(90deg, rgba(115, 240, 193, 0.94), rgba(255, 255, 255, 0.94));
}

.hero-card:nth-child(1) .card-label,
.hero-card:nth-child(1) .metric-foot {
  color: rgba(248, 251, 255, 0.78);
}

.hero-card:nth-child(1) .metric-value {
  color: #fff;
}

.hero-card:nth-child(1).hero-card-action.is-active {
  border-color: rgba(255, 255, 255, 0.36);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08), var(--shadow-panel);
}

.metric-value {
  display: block;
  font-size: clamp(2rem, 3vw, 2.8rem);
  margin: 10px 0 6px;
}

.metric-foot,
.ticket-subline,
.detail-copy,
dd,
.ticket-meta,
.simple-list p,
.supporting-copy {
  margin: 0;
  color: var(--text-secondary);
}

.content-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 16px;
}

.dashboard-grid {
  margin-top: 16px;
  align-items: start;
}

.surface-card {
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.wide-card {
  grid-row: span 2;
}

.detail-card {
  background: linear-gradient(180deg, rgba(31, 111, 235, 0.08), transparent 45%), var(--bg-surface);
}

.dashboard-grid .wide-card:first-child {
  background:
    radial-gradient(circle at top right, rgba(115, 240, 193, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(31, 111, 235, 0.08), rgba(255, 255, 255, 0.94) 46%);
}

.dashboard-grid .surface-card:nth-child(2) {
  background:
    linear-gradient(180deg, rgba(19, 32, 51, 0.98), rgba(23, 88, 187, 0.95)),
    var(--bg-surface);
  color: #fff;
  box-shadow: var(--shadow-panel);
}

.dashboard-grid .surface-card:nth-child(2) .card-label,
.dashboard-grid .surface-card:nth-child(2) .detail-copy,
.dashboard-grid .surface-card:nth-child(2) dt {
  color: rgba(248, 251, 255, 0.74);
}

.dashboard-grid .surface-card:nth-child(2) dd {
  color: #fff;
}

.view-section {
  display: none;
  gap: 16px;
}

.view-section.is-active {
  display: grid;
}

.ticket-list,
.simple-list,
.object-card-list,
.task-board {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.ticket-row,
.simple-list li,
.object-card,
.task-row {
  list-style: none;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.9);
}

.ticket-row,
.object-card,
.task-row {
  padding: 16px;
  display: grid;
  gap: 14px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.ticket-row.is-selected,
.object-card.is-selected {
  border-color: rgba(31, 111, 235, 0.4);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.08);
}

.ticket-row:hover,
.object-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(12, 27, 44, 0.1);
}

.ticket-row.has-resident-answer,
.dashboard-ticket-row.has-resident-answer {
  border-left: 5px solid #ff6c00;
  background: linear-gradient(135deg, #fffaf5 0%, #ffffff 72%);
}

.mobile-ticket-card-icon,
.mobile-ticket-card-chevron,
.mobile-ticket-sheet-backdrop,
.mobile-ticket-sheet {
  display: none;
}

.resident-answer-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-height: 24px;
  margin-top: 8px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #fff1e6;
  color: #c05600;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.ticket-new-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  margin-left: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #ef1d2f;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(239, 29, 47, 0.12);
  font-size: 0.72rem;
  font-weight: 1000;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
}

.ticket-top,
.ticket-meta,
.task-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ticket-title {
  margin: 0;
  font-size: 1rem;
}

.ticket-archive-inline {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 0.78rem;
}

.ticket-archive-actions {
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.ticket-archive-button {
  width: fit-content;
}

.task-archive-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--color-surface);
}

.task-archive-toolbar span {
  margin-right: auto;
  color: var(--color-muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.task-archive-inline {
  border-color: rgba(255, 106, 0, 0.35);
  color: #9a3d00;
}

.ticket-archive-group {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.72);
  padding: 14px;
}

.ticket-archive-group h4 {
  margin: 0;
  font-size: 1rem;
}

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

.ticket-archive-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-surface);
  padding: 12px;
}

.ticket-archive-row strong {
  display: block;
  margin-bottom: 4px;
}

.ticket-archive-row small,
.ticket-archive-row p,
.ticket-archive-row aside span {
  color: var(--text-secondary);
}

.ticket-archive-row p {
  margin: 8px 0 0;
}

.ticket-archive-row aside {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-width: min(320px, 42vw);
}

:root[data-theme="dark"] .ticket-archive-group,
:root[data-theme="dark"] .ticket-archive-row {
  border-color: var(--color-border);
  background: #132c44;
  color: var(--color-text);
}

:root[data-theme="dark"] .ticket-archive-row {
  background: #10263a;
}

:root[data-theme="dark"] .ticket-archive-row small,
:root[data-theme="dark"] .ticket-archive-row p,
:root[data-theme="dark"] .ticket-archive-row aside span {
  color: var(--color-muted);
}

@media (max-width: 760px) {
  .ticket-archive-row {
    grid-template-columns: 1fr;
  }

  .ticket-archive-row aside {
    justify-content: flex-start;
    min-width: 0;
  }
}

.simple-list {
  padding: 0;
}

.simple-list li {
  padding: 14px 16px;
}

.simple-list strong {
  display: block;
  margin-bottom: 4px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 20px;
}

.compact-grid {
  margin: 0;
}

dd {
  margin-top: 4px;
  color: var(--text-primary);
  font-weight: 700;
}

.primary-action,
.secondary-action,
.filter-chip {
  border-radius: var(--radius-button);
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, color 140ms ease;
}

.primary-action {
  background: var(--bg-primary);
  color: #fff;
}

.primary-action:hover {
  background: var(--bg-primary-hover);
}

.secondary-action,
.filter-chip {
  background: #edf2fb;
  color: var(--text-primary);
}

.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.danger-action {
  background: rgba(199, 61, 69, 0.12);
  color: var(--danger);
}

.danger-action:hover {
  background: rgba(199, 61, 69, 0.2);
}

.filter-chip.is-active {
  background: rgba(31, 111, 235, 0.14);
  color: var(--bg-primary);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.primary-action:hover,
.secondary-action:hover,
.filter-chip:hover {
  transform: translateY(-1px);
}

.full-width {
  width: 100%;
}

.detail-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.completion-review-card.is-hidden {
  display: none;
}

.completion-submit-box,
.completion-review-box {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--color-border, #d8e2ef);
  border-left: 4px solid var(--color-primary, #1e7bff);
  border-radius: 8px;
  background: var(--color-surface-soft, #f7fbff);
}

.completion-review-box {
  border-left-color: var(--color-accent, #ff6a00);
}

.completion-file-field input {
  margin-top: 8px;
}

.completion-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.task-review-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(255, 106, 0, 0.14);
  color: var(--color-accent, #ff6a00);
  font-weight: 800;
}

.segmented-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.segmented-tab {
  border: 1px solid rgba(31, 111, 235, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 12px 14px;
  cursor: pointer;
}

.segmented-tab.is-active {
  background: rgba(31, 111, 235, 0.1);
  color: var(--bg-primary);
  border-color: rgba(31, 111, 235, 0.28);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.08);
}

.ticket-tab-panel {
  display: none;
}

.ticket-tab-panel.is-active {
  display: block;
}

.checklist-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.photo-list {
  max-width: 100%;
  overflow: hidden;
}

.photo-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  overflow: hidden;
}

.file-listing {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.file-copy {
  min-width: 0;
  max-width: 100%;
}

.file-copy strong,
.file-copy p {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.file-preview-button,
.file-preview-fallback {
  width: 72px;
  min-width: 72px;
  height: 72px;
  border-radius: 10px;
  border: 1px solid rgba(19, 32, 51, 0.1);
  background: rgba(237, 242, 251, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.file-preview-button {
  cursor: pointer;
  padding: 0;
}

.file-preview-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-preview-fallback {
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.file-open-button {
  white-space: nowrap;
}

.photo-list .supporting-copy {
  font-size: 0.88rem;
}

.lightbox-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 19, 31, 0.7);
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 960px);
  max-height: calc(100vh - 80px);
  margin: 40px auto;
  padding: 24px;
  overflow: auto;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-panel);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 2;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.92);
}

.lightbox-content {
  margin-top: 18px;
  max-height: calc(100dvh - 210px);
  overflow: auto;
  touch-action: pan-x pan-y pinch-zoom;
}

.lightbox-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 220px);
  object-fit: contain;
  border-radius: 20px;
  background: #eef3f8;
  margin: 0 auto;
}

.lightbox-file-card {
  padding: 18px;
  border-radius: 20px;
  background: #eef3f8;
}

.file-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 640px) {
  .photo-list li {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .file-listing {
    align-items: flex-start;
  }

  .file-preview-button,
  .file-preview-fallback {
    width: 64px;
    min-width: 64px;
    height: 64px;
  }

  .file-open-button {
    width: 100%;
  }

  .lightbox-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 24px);
    margin: 12px auto;
    padding: 16px;
    border-radius: 18px;
  }

  .lightbox-close {
    top: 12px;
    right: 12px;
  }

  .lightbox-content {
    max-height: calc(100dvh - 170px);
  }

  .lightbox-image {
    max-height: calc(100dvh - 180px);
    border-radius: 14px;
  }
}

.file-action.is-disabled,
.primary-action:disabled,
.secondary-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.action-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(31, 111, 235, 0.12);
  color: var(--bg-primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

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

.object-card h4,
.task-row h4 {
  margin: 0;
}

.object-card-meta,
.task-row p {
  margin: 0;
  color: var(--text-secondary);
}

.task-board {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-row {
  cursor: default;
}

.task-state {
  font-weight: 700;
  color: var(--text-primary);
}

.compact-list .ticket-row {
  padding: 14px;
}

.worker-status-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(120px, auto);
  gap: 10px;
  align-items: center;
}

.worker-status-row.is-on-site {
  border-left: 4px solid #0f766e;
  padding-left: 8px;
  background: rgba(15, 118, 110, 0.06);
}

.worker-status-dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  background: #64748b;
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.14);
}

.worker-status-dot.active,
.worker-status-label.active {
  background: #16a34a;
}

.worker-status-dot.away,
.worker-status-label.away {
  background: #f97316;
}

.worker-status-dot.on-site,
.worker-status-label.on-site {
  background: #2563eb;
}

.worker-status-dot.inactive,
.worker-status-label.inactive {
  background: #64748b;
}

.worker-status-dot.vacation,
.worker-status-label.vacation {
  background: #2563eb;
}

.worker-status-dot.sick,
.worker-status-label.sick {
  background: #dc2626;
}

.worker-status-dot.disabled,
.worker-status-label.disabled {
  background: #64748b;
}

.worker-status-copy {
  min-width: 0;
}

.worker-status-copy p {
  margin: 0;
  color: var(--text-secondary);
}

.site-visit-line {
  color: #0f766e !important;
  font-weight: 800;
}

.worker-status-label {
  justify-self: end;
  padding: 5px 8px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.site-visit-card {
  border: 1px solid rgba(15, 118, 110, 0.28);
  background: rgba(15, 118, 110, 0.05);
  padding: 12px;
}

.site-visit-status {
  display: grid;
  gap: 4px;
}

.site-visit-status strong {
  color: #0f766e;
}

.site-visit-status p {
  margin: 0;
  color: var(--text-secondary);
}

.site-visit-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 6px;
  padding: 3px 7px;
  background: #0f766e;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  vertical-align: middle;
}

.ticket-message-card {
  position: relative;
  gap: 14px;
  border: 1px solid #ffd5b5;
  border-left: 6px solid #ff6c00;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 108, 0, 0.12) 0%, rgba(255, 248, 242, 0.96) 42%, rgba(239, 246, 255, 0.82) 100%);
  padding: 18px 18px 20px;
  box-shadow: 0 14px 30px rgba(255, 108, 0, 0.10);
}

.ticket-message-card .field-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: #9a3d00;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.ticket-message-card .field-label::before {
  content: "!";
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: #ff6c00;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 950;
  letter-spacing: 0;
  box-shadow: 0 8px 18px rgba(255, 108, 0, 0.22);
}

.ticket-message-text {
  margin: 0;
  color: #0f2038;
  font-size: clamp(1.04rem, 1.2vw, 1.2rem);
  font-weight: 850;
  line-height: 1.48;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ticket-info-request-card {
  border: 1px solid rgba(245, 158, 11, 0.34);
  background: #fffbeb;
  padding: 12px;
}

.quick-request-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.compact-request {
  min-height: 36px;
  padding: 7px 9px;
  font-size: 0.78rem;
}

.push-settings-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #dbe5f0;
  border-radius: 8px;
  background: #f8fafc;
}

.push-settings-card h4 {
  margin: 0 0 4px;
}

.push-test-employee-field {
  margin-top: 12px;
}

.push-action-stack {
  display: grid;
  gap: 8px;
  min-width: 180px;
}

.push-debug-status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
}

.push-debug-status div {
  min-width: 0;
  border: 1px solid #e5edf6;
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
}

.push-debug-status dt {
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.push-debug-status dd {
  margin: 4px 0 0;
  color: #071d33;
  font-size: 0.9rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .push-settings-card {
    grid-template-columns: 1fr;
  }

  .push-action-stack {
    min-width: 0;
  }

  .push-debug-status {
    grid-template-columns: 1fr;
  }
}

.worker-status-select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  font-size: 0.9rem;
}

.dashboard-worker-row.is-on-site {
  border-left: 3px solid #2563eb;
}

.dashboard-worker-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.compact-link {
  min-height: auto;
  padding: 0;
  font-size: 0.78rem;
}

.dashboard-worker-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 290px);
  gap: 16px;
  align-items: start;
  padding: 16px;
  border: 1px solid #dbe5f0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 32, 56, 0.05);
}

.dashboard-worker-card.is-on-site {
  border-color: #93c5fd;
  background: #f8fbff;
  box-shadow: inset 4px 0 0 #2563eb, 0 10px 26px rgba(37, 99, 235, 0.08);
}

.dashboard-worker-card-main {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.dashboard-worker-card .worker-avatar {
  width: 42px;
  height: 42px;
}

.dashboard-worker-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dashboard-worker-copy strong {
  color: #0f2038;
  font-size: 1rem;
  font-weight: 900;
}

.dashboard-worker-copy small {
  color: #64748b;
  font-size: 0.86rem;
  line-height: 1.35;
}

.dashboard-worker-side {
  display: grid;
  gap: 10px;
  justify-items: stretch;
  min-width: 0;
}

.dashboard-worker-status {
  justify-self: end;
  width: fit-content;
  padding: 7px 11px;
  border-radius: 9px;
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 900;
}

.dashboard-worker-status.on-site { background: #dcfce7; color: #168044; }
.dashboard-worker-status.away { background: #fff1e8; color: #f97316; }
.dashboard-worker-status.active { background: #dcfce7; color: #168044; }
.dashboard-worker-status.inactive { background: #f1f5f9; color: #64748b; }
.dashboard-worker-status.vacation { background: #dbeafe; color: #2563eb; }
.dashboard-worker-status.sick { background: #fee2e2; color: #dc2626; }
.dashboard-worker-status.disabled { background: #e2e8f0; color: #475569; }
.dashboard-worker-status.offline { background: #f1f5f9; color: #64748b; }

.dashboard-worker-control {
  display: grid;
  gap: 6px;
}

.dashboard-worker-control span {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.worker-location-action {
  width: 100%;
}

.dashboard-worker-visit {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
}

.dashboard-worker-visit .card-label {
  margin: 0 0 4px;
}

.dashboard-worker-visit strong {
  display: block;
  color: #0f2038;
  font-size: 0.96rem;
}

.dashboard-worker-visit span {
  display: block;
  margin-top: 2px;
  color: #0f766e;
  font-size: 0.88rem;
  font-weight: 800;
}

.dashboard-worker-visit small {
  display: block;
  margin-top: 5px;
  color: #475569;
  font-size: 0.8rem;
  line-height: 1.35;
}

.dashboard-worker-action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 720px) {
  .dashboard-worker-card {
    grid-template-columns: 1fr;
  }

  .dashboard-worker-side {
    justify-items: stretch;
  }

  .dashboard-worker-status {
    justify-self: start;
  }

  .dashboard-worker-visit {
    grid-template-columns: 1fr;
  }

  .dashboard-worker-action-row {
    justify-content: stretch;
  }

  .dashboard-worker-action-row .secondary-action {
    width: 100%;
  }
}

.location-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.location-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.location-modal-panel {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(720px, 92vh);
  overflow: auto;
  background: #ffffff;
  border: 1px solid #dbe5f0;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  padding: 18px;
}

.location-osm-map {
  width: 100%;
  min-height: 420px;
  margin-top: 14px;
}

.calendar-jobs-modal {
  position: fixed;
  inset: 0;
  z-index: 1900;
  display: grid;
  place-items: center;
  padding: 20px;
}

.calendar-jobs-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.46);
}

.calendar-jobs-panel {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  max-height: min(820px, 92vh);
  overflow: auto;
  background: #ffffff;
  border: 1px solid #dbe5f0;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  padding: 18px;
}

.calendar-jobs-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(140px, 1fr));
  gap: 8px;
}

.calendar-jobs-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.calendar-job-row {
  display: grid;
  grid-template-columns: 128px minmax(220px, 1fr) 110px 150px 100px;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 1px solid #dbe5f0;
  background: #ffffff;
  color: #132033;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.calendar-job-row:hover,
.calendar-job-row:focus-visible {
  border-color: #1f6feb;
  box-shadow: inset 4px 0 0 #1f6feb;
}

.calendar-job-row.is-overdue {
  background: #fff7ed;
}

.calendar-job-date,
.calendar-job-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.calendar-job-date {
  color: #132033;
  font-weight: 900;
}

.calendar-job-date small,
.calendar-job-main small {
  color: #586a84;
  font-weight: 700;
}

.calendar-job-main strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.employee-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.employee-detail-tabs button {
  min-height: 36px;
  border: 1px solid #dbe5f0;
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  color: #52657d;
  font-family: inherit;
  font-weight: 900;
  cursor: pointer;
}

.employee-detail-tabs button.is-active {
  border-color: #ff6b00;
  background: #fff3e8;
  color: #ff6b00;
}

.employee-detail-panel {
  display: none;
}

.employee-detail-panel.is-active {
  display: block;
}

.employee-assignment-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.employee-assignment-summary span {
  min-height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #e5edf6;
  border-radius: 8px;
  background: #fbfdff;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.employee-assignment-list,
.employee-history-list {
  display: grid;
  gap: 10px;
}

.employee-assignment-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e5edf6;
  border-radius: 8px;
  background: #ffffff;
}

.employee-assignment-row.is-reassignment-required {
  border-color: #f97316;
  box-shadow: inset 4px 0 0 #f97316;
}

.button-row.compact-row {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: none;
  letter-spacing: 0;
}

.calendar-reassignment-panel {
  border: 1px solid #fed7aa;
  background: #fff7ed;
  box-shadow: inset 4px 0 0 #f97316;
}

.calendar-reassignment-panel .detail-grid {
  margin: 12px 0;
}

.employee-assignment-row strong,
.employee-assignment-row small {
  display: block;
  overflow-wrap: anywhere;
}

.employee-assignment-row small {
  margin-top: 3px;
  color: #64748b;
}

.employee-history-row {
  padding: 12px;
  border: 1px solid #e5edf6;
  border-radius: 8px;
  background: #ffffff;
}

.employee-history-row strong,
.employee-history-row span,
.employee-history-row p {
  display: block;
}

.employee-history-row span,
.employee-history-row p {
  margin: 4px 0 0;
  color: #64748b;
}

.employee-reassign-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(180px, 1.4fr) auto auto minmax(180px, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e5edf6;
  border-radius: 8px;
  background: #ffffff;
}

.reassign-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
  overflow: visible;
}

.calendar-cell {
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.9);
  padding: 14px;
  display: grid;
  gap: 8px;
  overflow: visible;
  cursor: pointer;
}

.calendar-cell-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.calendar-cell-head strong {
  min-width: 0;
}

.calendar-day-create {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 106, 0, 0.32);
  border-radius: 999px;
  background: #ff6a00;
  color: #ffffff;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 1000;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(255, 106, 0, 0.22);
}

.calendar-day-create:hover,
.calendar-day-create:focus-visible {
  border-color: #c94f00;
  background: #e85f00;
  outline: none;
  transform: translateY(-1px);
}

.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;
}

.calendar-cell p {
  margin: 0;
  color: var(--text-secondary);
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin: 8px 0 12px;
}

.calendar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 800;
}

.calendar-admin-filter-bar {
  margin-top: 12px;
  align-items: end;
}

.calendar-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  border: 0;
  padding: 6px 10px;
  position: relative;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  white-space: normal;
}

.calendar-chip-icon,
.calendar-list-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.1rem;
  line-height: 1;
}

.calendar-chip-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.calendar-chip-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  margin-left: 0.35rem;
  border: 1px solid rgba(15, 23, 42, 0.2);
}

.calendar-type-ticket {
  --calendar-type-bg: #d9480f;
  --calendar-type-fg: #ffffff;
  --calendar-type-border: rgba(217, 72, 15, 0.35);
}

.calendar-type-appointment {
  --calendar-type-bg: #1f6feb;
  --calendar-type-fg: #ffffff;
  --calendar-type-border: rgba(31, 111, 235, 0.35);
}

.calendar-type-recurring {
  --calendar-type-bg: #16a34a;
  --calendar-type-fg: #ffffff;
  --calendar-type-border: rgba(22, 163, 74, 0.35);
}

.calendar-type-emergency {
  --calendar-type-bg: #b91c1c;
  --calendar-type-fg: #ffffff;
  --calendar-type-border: rgba(185, 28, 28, 0.4);
}

.calendar-type-maintenance {
  --calendar-type-bg: #f59e0b;
  --calendar-type-fg: #111827;
  --calendar-type-border: rgba(245, 158, 11, 0.4);
}

.calendar-type-cleaning {
  --calendar-type-bg: #0f766e;
  --calendar-type-fg: #ffffff;
  --calendar-type-border: rgba(15, 118, 110, 0.35);
}

.calendar-type-waste {
  --calendar-type-bg: #15803d;
  --calendar-type-fg: #ffffff;
  --calendar-type-border: rgba(21, 128, 61, 0.35);
}

.calendar-type-inspection {
  --calendar-type-bg: #1e3a8a;
  --calendar-type-fg: #ffffff;
  --calendar-type-border: rgba(30, 58, 138, 0.35);
}

.calendar-type-object {
  --calendar-type-bg: #2563eb;
  --calendar-type-fg: #ffffff;
  --calendar-type-border: rgba(37, 99, 235, 0.35);
}

.calendar-chip[class*="calendar-type-"] {
  background: var(--calendar-type-bg);
  color: var(--calendar-type-fg);
}

.calendar-legend-item[class*="calendar-type-"] {
  border-color: var(--calendar-type-border);
  box-shadow: inset 4px 0 0 var(--calendar-type-bg);
}

.calendar-list-icon[class*="calendar-type-"] {
  width: auto;
  margin-right: 6px;
}

.calendar-tooltip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 40;
  display: grid;
  gap: 4px;
  min-width: 220px;
  max-width: min(320px, 80vw);
  padding: 10px 12px;
  border-radius: 8px;
  background: #101828;
  color: #ffffff;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.26);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.calendar-tooltip strong {
  font-size: 0.82rem;
  font-weight: 800;
}

.calendar-chip:hover .calendar-tooltip,
.calendar-chip:focus-visible .calendar-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.calendar-cell.is-current {
  border-color: #dc2626;
  background: #fff5f5;
  box-shadow: inset 4px 0 0 #dc2626, 0 0 0 2px rgba(220, 38, 38, 0.08);
}

.calendar-cell.is-current > strong {
  color: #b91c1c;
}

.calendar-cell.is-current .calendar-cell-head > strong {
  color: #b91c1c;
}

.calendar-cell.is-selected-day {
  border-color: #1f6feb;
  box-shadow: inset 4px 0 0 #1f6feb, 0 0 0 2px rgba(31, 111, 235, 0.08);
}

.calendar-cell:focus-visible {
  outline: 2px solid #132033;
  outline-offset: 2px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  max-width: min(420px, calc(100vw - 32px));
  background: #101828;
  color: #fff;
  padding: 12px 16px;
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  background: #7a1d24;
}

.detail-link {
  color: var(--bg-primary);
  text-decoration: none;
  font-weight: 700;
  word-break: break-word;
}

.detail-link:hover {
  text-decoration: underline;
}

.bottom-nav {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 20;
  min-height: 68px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(17, 33, 50, 0.94);
  box-shadow: var(--shadow-soft);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.bottom-nav .nav-item {
  min-width: 0;
  min-height: 52px;
  padding: 7px 4px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.68rem;
  line-height: 1.1;
  text-align: center;
  white-space: normal;
  overflow: hidden;
}

.bottom-nav .nav-icon {
  width: 22px;
  height: 22px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: 999px;
}

.ui-icon {
  display: block;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav .nav-item.has-new-ticket {
  position: relative;
}

.bottom-nav .nav-ticket-alert {
  position: absolute;
  top: 4px;
  right: 6px;
  margin-left: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.bottom-nav .nav-ticket-alert strong {
  display: none;
}

.bottom-nav .nav-ticket-alert em {
  min-width: 19px;
  height: 19px;
  background: #ef1d2f;
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22);
}

.bottom-nav .nav-item[data-action="more"]::before {
  content: "...";
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-weight: 800;
}

.bottom-nav .nav-item[data-action="more"] {
  gap: 4px;
}

.mobile-nav-sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: none;
}

html.mobile-nav-scroll-locked {
  overflow: hidden;
  overscroll-behavior: none;
}

body.mobile-nav-scroll-locked {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.mobile-nav-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 16, 28, 0.42);
}

.mobile-nav-panel {
  position: fixed;
  left: max(12px, env(safe-area-inset-left, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  top: max(12px, env(safe-area-inset-top, 0px));
  bottom: calc(var(--mobile-nav-height, 88px) + max(12px, env(safe-area-inset-bottom, 0px)));
  max-height: calc(100dvh - var(--mobile-nav-height, 88px) - max(24px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)));
  border-radius: 22px;
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow-soft);
  padding: 18px 18px max(18px, env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-gutter: stable;
}

.mobile-nav-panel .nav-item {
  color: var(--text-primary);
  background: #edf2fb;
}

.mobile-nav-panel .nav-item.is-active {
  background: rgba(31, 111, 235, 0.14);
  color: var(--bg-primary);
}

.mobile-logout-action {
  width: 100%;
  margin-top: 14px;
  min-height: 44px;
  justify-content: center;
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

.mobile-logout-action:hover {
  background: #fee2e2;
  color: #7f1d1d;
}

.qr-editor-grid {
  grid-template-columns: minmax(280px, 300px) minmax(0, 1fr);
}

.qr-editor-shell {
  padding: 18px;
  display: grid;
  gap: 18px;
  min-width: 0;
}

.qr-editor-topbar,
.qr-section-card,
.qr-preview-card {
  border-radius: var(--radius-card);
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-soft);
}

.qr-editor-topbar {
  padding: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background:
    radial-gradient(circle at top right, rgba(68, 183, 255, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(240, 247, 255, 0.86));
}

.qr-editor-topbar-main,
.qr-editor-column,
.qr-preview-column {
  display: grid;
  gap: 14px;
}

.qr-preview-column {
  min-width: 0;
  min-height: 0;
  align-content: start;
}

.qr-chip-row,
.qr-editor-actions,
.qr-mobile-tabs,
.qr-richtext-toolbar,
.qr-template-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.qr-template-toolbar {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

.qr-template-toolbar .detail-stack {
  max-width: 340px;
}

.qr-template-toolbar .button-row {
  gap: 8px;
}

.qr-mobile-tabs,
.qr-mobile-export {
  display: none;
}

.qr-editor-workspace {
  display: grid;
  grid-template-columns: minmax(340px, 0.82fr) minmax(460px, 1.18fr);
  gap: 20px;
  align-items: start;
  min-height: 0;
}

.qr-section-card,
.qr-preview-card {
  padding: 18px;
}

.qr-editor-summary {
  background:
    radial-gradient(circle at top right, rgba(115, 240, 193, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(31, 111, 235, 0.08), rgba(255, 255, 255, 0.92));
}

.qr-editor-step-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.qr-editor-step {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(31, 111, 235, 0.12);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.qr-editor-step span,
.qr-preview-note {
  color: var(--text-secondary);
}

.qr-editor-tabbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.qr-editor-tab {
  border: 1px solid rgba(31, 111, 235, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 12px 14px;
  cursor: pointer;
}

.qr-editor-tab.is-active {
  background: rgba(31, 111, 235, 0.1);
  color: var(--bg-primary);
  border-color: rgba(31, 111, 235, 0.28);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.08);
}

.qr-tab-panel {
  display: none;
  gap: 14px;
}

.qr-tab-panel.is-active {
  display: grid;
}

.qr-template-region {
  display: grid;
}

.qr-field-grid,
.qr-color-grid,
.qr-layout-grid {
  display: grid;
  gap: 12px;
}

.qr-field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.qr-control-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
}

.qr-layout-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qr-layout-option {
  text-align: left;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  display: grid;
  gap: 6px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.qr-layout-option span {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.qr-layout-option.is-active {
  border-color: rgba(31, 111, 235, 0.32);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.08);
  background: rgba(31, 111, 235, 0.08);
}

.qr-layout-option:hover,
.qr-template-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(12, 27, 44, 0.08);
}

.qr-richtext-input {
  min-height: 136px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  padding: 14px;
  line-height: 1.55;
}

.qr-richtext-input:focus {
  outline: 2px solid rgba(31, 111, 235, 0.18);
  outline-offset: 2px;
}

.qr-richtext-input p,
.qr-richtext-input ul,
.qr-richtext-input ol {
  margin: 0 0 10px;
}

.qr-color-input {
  min-width: 0;
  padding: 6px;
  height: 48px;
}

.qr-text-style-panel .qr-control-grid {
  margin-top: 12px;
}

.qr-preview-editable-text {
  border-radius: 6px;
  outline: 0 solid transparent;
  outline-offset: 3px;
  cursor: text;
  transition: outline-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.qr-preview-editable-text:hover {
  outline: 2px dashed rgba(249, 115, 22, 0.42);
  background-color: rgba(249, 115, 22, 0.08);
}

.qr-preview-editable-text.is-selected {
  outline: 2px solid #f97316;
  background-color: rgba(249, 115, 22, 0.12);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.12);
}

.qr-logo-tile {
  border: 1px dashed var(--border-subtle);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.82);
  padding: 14px;
  display: grid;
  gap: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.qr-logo-tile-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.qr-logo-preview-mark {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #44b7ff, #73f0c1);
  color: #09131f;
  font-weight: 800;
}

.qr-logo-preview-mark.fixfox-logo-card {
  width: auto;
  min-width: 220px;
  min-height: 70px;
  padding: 8px 10px;
  border-radius: 0;
  background: #fff;
  border: 1px solid #d8e1ea;
  color: #08233f;
  box-shadow: none;
}

.qr-logo-preview-mark.fixfox-logo-card .fixfox-logo-img {
  width: 220px;
  max-width: 100%;
}

.qr-template-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.qr-template-card {
  text-align: left;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  gap: 6px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  overflow: hidden;
  position: relative;
}

.qr-template-card::before {
  content: "";
  display: block;
  height: 42px;
  margin: -12px -12px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: linear-gradient(135deg, rgba(8, 117, 46, 0.09), rgba(23, 78, 164, 0.08));
}

.qr-template-card[data-qr-template-style="modern-corporate"]::before {
  background:
    linear-gradient(125deg, rgba(15, 111, 181, 0.14), rgba(8, 117, 46, 0.08));
}

.qr-template-card[data-qr-template-style="dark-professional"]::before {
  background:
    linear-gradient(125deg, rgba(7, 20, 36, 0.9), rgba(36, 70, 114, 0.9));
}

.qr-template-card[data-qr-template-style="immobilien-expose"]::before {
  background:
    linear-gradient(125deg, rgba(19, 122, 82, 0.2), rgba(208, 236, 220, 0.5));
}

.qr-template-card[data-qr-template-style="minimal-clean"]::before {
  background:
    linear-gradient(125deg, rgba(15, 23, 42, 0.12), rgba(255, 255, 255, 0.8));
}

.object-employee-assignment {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.82);
  padding: 18px 20px;
  display: grid;
  gap: 14px;
}

.object-form-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.82);
  padding: 18px 20px;
}

.object-form-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.object-form-panel-head .field-label,
.object-form-panel-head .supporting-copy,
.object-form-panel .supporting-copy {
  margin: 0;
}

.object-color-control {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

#object-form-color {
  width: 92px;
  min-height: 48px;
  padding: 5px;
}

.object-contact-panel {
  grid-template-columns: minmax(180px, 0.45fr) minmax(260px, 1fr);
  align-items: center;
}

.object-contact-panel .field-label {
  margin: 0;
}

.object-notes-panel textarea {
  min-height: 104px;
}

.compact-head {
  margin-bottom: 0;
}

.assignment-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.assignment-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.assignment-option.is-selected {
  border-color: rgba(255, 108, 0, 0.55);
  background: rgba(255, 108, 0, 0.08);
}

.assignment-option span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.assignment-option strong,
.assignment-option small {
  overflow-wrap: anywhere;
}

.assignment-option small {
  color: var(--text-secondary);
}

.authorized-employee-list {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.85);
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

.authorized-employee-list:empty {
  display: none;
}

.authorized-employee-list ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
}

.authorized-employee-list li {
  overflow-wrap: anywhere;
}

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

.qr-template-card[data-qr-template-style="premium-service"]::before {
  background:
    linear-gradient(125deg, rgba(9, 84, 97, 0.16), rgba(8, 112, 129, 0.1));
}

.qr-template-card span {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.qr-template-card.is-active {
  border-color: rgba(31, 111, 235, 0.32);
  background: rgba(31, 111, 235, 0.08);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.08);
}

.qr-preview-card {
  position: static;
  width: 100%;
  justify-self: stretch;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(115, 240, 193, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(19, 32, 51, 0.05), rgba(255, 255, 255, 0.96) 20%);
}

.qr-preview-paper {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(19, 32, 51, 0.08);
  box-shadow: 0 36px 90px rgba(17, 33, 50, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #fdfefe 100%);
  padding: 28px;
  aspect-ratio: 0.707 / 1;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 20px;
}

.qr-preview-paper[data-qr-template="modern-corporate"] {
  background: linear-gradient(180deg, #ffffff 0%, #f2f8ff 100%);
  box-shadow: 0 30px 70px rgba(18, 44, 84, 0.16);
}

.qr-preview-paper[data-qr-template="modern-corporate"] .qr-preview-kicker {
  background: rgba(15, 111, 181, 0.14);
  color: #0c4a94;
}

.qr-preview-paper[data-qr-template="modern-corporate"] .qr-preview-meta {
  background: rgba(20, 84, 149, 0.08);
  border-color: rgba(15, 111, 181, 0.18);
}

.qr-preview-paper[data-qr-template="dark-professional"] {
  background: linear-gradient(165deg, #0f1f35 0%, #0a1526 48%, #111f32 100%);
  color: #e7f0ff;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 28px 72px rgba(7, 16, 31, 0.35);
}

.qr-preview-paper[data-qr-template="dark-professional"] .qr-preview-title-group h2,
.qr-preview-paper[data-qr-template="dark-professional"] .qr-preview-subtitle,
.qr-preview-paper[data-qr-template="dark-professional"] .qr-preview-copy-column section,
.qr-preview-paper[data-qr-template="dark-professional"] .qr-preview-copy-column h4 {
  color: #eaf2ff;
}

.qr-preview-paper[data-qr-template="dark-professional"] .qr-preview-frame {
  border-color: rgba(255, 255, 255, 0.42);
}

.qr-preview-paper[data-qr-template="dark-professional"] .qr-preview-kicker {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.qr-preview-paper[data-qr-template="dark-professional"] .qr-preview-contact,
.qr-preview-paper[data-qr-template="dark-professional"] .qr-preview-code-block,
.qr-preview-paper[data-qr-template="dark-professional"] .qr-preview-footer {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.qr-preview-paper[data-qr-template="immobilien-expose"] {
  background: linear-gradient(180deg, #ffffff 0%, #f4fff9 100%);
  box-shadow: 0 28px 82px rgba(7, 47, 30, 0.12);
}

.qr-preview-paper[data-qr-template="immobilien-expose"]::before {
  content: "";
  display: block;
  height: 88px;
  margin: 0 -28px 12px;
  background:
    linear-gradient(90deg, rgba(33, 122, 82, 0.22), rgba(23, 101, 64, 0.06)),
    repeating-linear-gradient(90deg, rgba(9, 54, 38, 0.06) 0 1px, transparent 1px 14px),
    #d9efe1;
  border-bottom: 1px solid rgba(13, 74, 45, 0.16);
}

.qr-preview-paper[data-qr-template="immobilien-expose"] .qr-preview-layout {
  grid-template-columns: 1fr;
}

.qr-preview-paper[data-qr-template="immobilien-expose"] .qr-preview-code-block {
  width: min(420px, 100%);
  margin-top: 6px;
}

.qr-preview-paper[data-qr-template="minimal-clean"] {
  border-radius: 12px;
  box-shadow: none;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.qr-preview-paper[data-qr-template="minimal-clean"] .qr-preview-frame {
  inset: 12px;
  border-radius: 10px;
  border-width: 1px;
}

.qr-preview-paper[data-qr-template="minimal-clean"] .qr-preview-kicker,
.qr-preview-paper[data-qr-template="minimal-clean"] .qr-preview-meta,
.qr-preview-paper[data-qr-template="minimal-clean"] .qr-preview-contact,
.qr-preview-paper[data-qr-template="minimal-clean"] .qr-preview-code-block {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
}

.qr-preview-paper[data-qr-template="premium-service"] {
  background: linear-gradient(165deg, #f7fdff 0%, #edf6fb 100%);
  box-shadow: 0 26px 72px rgba(7, 44, 62, 0.16);
}

.qr-preview-paper[data-qr-template="premium-service"] .qr-preview-header {
  position: relative;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(6, 86, 100, 0.22);
}

.qr-preview-paper[data-qr-template="premium-service"] .qr-preview-title-group h2 {
  font-size: clamp(2rem, 3.2vw, 3rem);
}

.qr-preview-paper[data-qr-template="premium-service"] .qr-preview-copy-column {
  position: relative;
}

.qr-preview-paper[data-qr-template="premium-service"] .qr-preview-copy-column::after {
  content: "1. QR-Code scannen  •  2. Meldung absenden  •  3. Rückmeldung erhalten";
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px dashed rgba(6, 86, 100, 0.28);
  border-radius: 12px;
  display: block;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #0c4d5f;
  background: rgba(255, 255, 255, 0.6);
}
.qr-preview-frame {
  position: absolute;
  inset: 20px;
  border-radius: 24px;
  border: 4px solid var(--bg-primary);
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.qr-preview-header,
.qr-preview-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.qr-preview-paper[data-logo-position="top"] .qr-preview-header {
  flex-direction: column;
  align-items: flex-start;
}

.qr-preview-paper[data-logo-position="inline"] .qr-preview-header {
  align-items: center;
}

.qr-preview-title-group {
  display: grid;
  gap: 8px;
}

.qr-preview-kicker {
  display: inline-flex;
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(31, 111, 235, 0.12);
  color: var(--bg-primary);
  font-weight: 700;
}

.qr-preview-title-group h2,
.qr-preview-layout h4 {
  margin: 0;
}

.qr-preview-logo-slot {
  flex-shrink: 0;
}

.qr-preview-paper[data-logo-position="top"] .qr-preview-logo-slot {
  align-self: flex-start;
}

.qr-preview-logo-slot img,
.qr-preview-code-block img {
  display: block;
  width: 100%;
  height: auto;
}

.qr-preview-logo-slot img {
  width: 86px;
  height: 86px;
  object-fit: contain;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  padding: 10px;
}

.qr-preview-meta {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(246, 249, 252, 0.92);
  border: 1px solid rgba(19, 32, 51, 0.06);
}

.qr-preview-meta p,
.qr-preview-contact p,
.qr-preview-footer p {
  margin: 0;
}

.qr-preview-meta strong,
.qr-preview-meta span {
  color: inherit;
}

.qr-preview-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.qr-preview-copy-column {
  display: grid;
  gap: 14px;
}

.qr-preview-copy-column section {
  display: grid;
  gap: 8px;
}

.qr-preview-richtext ul,
.qr-preview-richtext ol {
  margin: 0;
  padding-left: 20px;
}

.qr-preview-richtext p {
  margin: 0 0 10px;
}

.qr-preview-code-block {
  border-radius: 22px;
  background: rgba(246, 249, 252, 0.92);
  padding: 18px;
  display: grid;
  gap: 12px;
  align-content: start;
  border: 1px solid rgba(19, 32, 51, 0.06);
}

.qr-preview-paper[data-qr-layout="bottom"] .qr-preview-code-block {
  justify-self: center;
  width: 100%;
}

.qr-preview-code-block img {
  border-radius: 18px;
  border: 10px solid #fff;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(19, 32, 51, 0.08);
}

.qr-preview-contact {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(31, 111, 235, 0.12), rgba(115, 240, 193, 0.18));
  border: 1px solid rgba(31, 111, 235, 0.08);
}

.qr-preview-footer {
  align-items: flex-end;
  padding-top: 8px;
  border-top: 1px solid rgba(19, 32, 51, 0.08);
}

.qr-preview-footer > div {
  display: grid;
  gap: 6px;
}

@media (max-width: 1540px) {
  .qr-editor-workspace {
    grid-template-columns: minmax(300px, 0.92fr) minmax(380px, 1.08fr);
  }
}

@media (min-width: 1381px) {
  .qr-editor-workspace {
    max-height: calc(100vh - 240px);
    align-items: stretch;
    overflow: hidden;
  }

  .qr-editor-column {
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable both-edges;
  }

  .qr-preview-card {
    position: static;
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
}

@media (max-width: 1380px) {
  .qr-editor-workspace {
    grid-template-columns: 1fr;
  }

  .qr-preview-card {
    position: static;
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 18px 18px 18px;
  }

  .hero-grid,
  .content-grid,
  .filter-grid,
  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qr-editor-grid,
  .qr-editor-workspace,
  .qr-control-grid,
  .qr-template-grid,
  .qr-editor-tabbar {
    grid-template-columns: 1fr;
  }

  .qr-preview-card {
    position: static;
  }

  .wide-card {
    grid-row: auto;
    grid-column: span 2;
  }

  .hero-card:nth-child(1) {
    grid-column: span 2;
  }
}

@media (max-width: 820px) {
  body.qr-mobile-preview #qr-editor-column {
    display: none;
  }

  body.qr-mobile-edit #qr-preview-column {
    display: none;
  }

  .main-shell {
    padding: 18px;
  }

  .hero-grid,
  .content-grid,
  .detail-grid,
  .task-board,
  .filter-grid,
  .calendar-grid,
  .segmented-tabs,
  .qr-field-grid,
  .qr-color-grid,
  .qr-layout-grid,
  .qr-editor-step-list,
  .qr-editor-tabbar {
    grid-template-columns: 1fr;
  }

  .wide-card {
    grid-column: auto;
  }

  .hero-card:nth-child(1) {
    grid-column: auto;
  }

  .topbar,
  .topbar-nav,
  .topbar-actions,
  .section-head,
  .ticket-top,
  .ticket-meta,
  .button-row,
  .task-top,
  .object-card-header,
  .qr-editor-topbar,
  .qr-preview-header,
  .qr-preview-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .search-input {
    min-width: 0;
    width: 100%;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar {
    display: none;
  }

  .bottom-nav {
    display: grid;
  }

  .toast {
    left: 14px;
    right: 14px;
    bottom: calc(104px + env(safe-area-inset-bottom, 0px));
    z-index: 80;
    max-width: none;
    text-align: left;
  }

  .qr-editor-actions {
    display: none;
  }

  .qr-mobile-tabs,
  .qr-mobile-export {
    display: flex;
  }

  .qr-mobile-export {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 88px;
    z-index: 16;
    gap: 10px;
    padding: 12px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-soft);
  }

  .qr-mobile-export > * {
    flex: 1;
  }

  .qr-preview-paper {
    padding: 18px;
  }

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

  .qr-preview-title-group h2 {
    font-size: 1.6rem;
  }

  .qr-preview-paper[data-logo-position="inline"] .qr-preview-header {
    align-items: stretch;
  }
}

@media (max-width: 560px) {
  .main-shell {
    gap: 16px;
  }

  .surface-card,
  .hero-card,
  .sidebar-panel {
    padding: 16px;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  .status-stack,
  .filter-row {
    gap: 6px;
  }
}

/* QR poster editor mockup alignment */
.qr-editor-view.is-active {
  display: block;
}

.qr-editor-view .qr-editor-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  min-height: calc(100vh - 48px);
  overflow: hidden;
  border: 1px solid #dde6ee;
  border-radius: 10px;
  background: #f8fafb;
  box-shadow: 0 26px 70px rgba(14, 24, 37, 0.12);
}

.qr-editor-view .wide-card {
  grid-column: auto;
  grid-row: auto;
  padding: 24px 16px;
  border: 0;
  border-radius: 0;
  background: radial-gradient(circle at 16% 2%, rgba(42, 177, 72, 0.22), transparent 26%), linear-gradient(180deg, #182635 0%, #0c1926 100%);
  color: #f8fcf9;
  box-shadow: none;
  overflow: auto;
}

.qr-editor-view .wide-card .section-head {
  display: grid;
  gap: 20px;
  align-items: start;
}

.qr-editor-view .wide-card .section-head::before {
  content: "HAUSMEISTER\A CRM";
  white-space: pre;
  width: 100%;
  min-height: 72px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(47, 184, 76, 0.48);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.08;
  text-transform: uppercase;
}

.qr-editor-view .wide-card .section-head h3 {
  margin: 0;
  font-size: 1rem;
  color: #fff;
}

.qr-editor-view .wide-card .card-label {
  color: rgba(248, 252, 249, 0.68);
}

.qr-editor-view .wide-card .object-card-list {
  gap: 8px;
  margin-top: 18px;
}

.qr-editor-view .wide-card .object-card {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.055);
  color: #f8fcf9;
  box-shadow: none;
}

.qr-editor-view .wide-card .object-card.is-selected {
  border-color: rgba(78, 220, 112, 0.72);
  background: linear-gradient(135deg, rgba(20, 147, 61, 0.72), rgba(9, 106, 45, 0.58));
}

.qr-editor-view .wide-card .object-card h4,
.qr-editor-view .wide-card .object-card p {
  color: inherit;
}

.qr-editor-view .wide-card .object-card-meta,
.qr-editor-view .wide-card .object-card .card-label {
  color: rgba(248, 252, 249, 0.72);
}

.qr-editor-view .qr-editor-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 0;
  padding: 0;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: #f8fafb;
  box-shadow: none;
}

.qr-editor-view .qr-editor-topbar {
  padding: 20px 28px;
  border: 0;
  border-bottom: 1px solid #dde6ee;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  align-items: center;
}

.qr-editor-view .qr-editor-topbar-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.qr-editor-view .qr-editor-topbar-main .card-label,
.qr-editor-view .qr-editor-topbar-main .supporting-copy,
.qr-editor-view .qr-chip-row {
  display: none;
}

.qr-editor-view #qr-editor-object-title {
  margin: 0;
  font-size: 1.35rem;
  color: #101827;
}

.qr-editor-view .qr-editor-actions {
  align-items: center;
}

.qr-editor-view .qr-editor-actions .primary-action {
  background: linear-gradient(135deg, #14923e, #08752e);
  color: #fff;
}

.qr-editor-view .qr-editor-actions .secondary-action,
.qr-editor-view .qr-editor-actions .primary-action {
  min-height: 42px;
  border-radius: 8px;
}

.qr-editor-view .qr-close-button {
  width: 42px;
  padding: 0;
  font-size: 1.25rem;
}

.qr-editor-view .qr-editor-workspace {
  grid-template-columns: minmax(360px, 0.84fr) minmax(520px, 1.16fr);
  gap: 0;
  min-height: 0;
  overflow: hidden;
}

.qr-editor-view .qr-editor-column,
.qr-editor-view .qr-preview-column {
  min-height: 0;
  overflow: auto;
  padding: 20px 28px 24px;
}

.qr-editor-view .qr-editor-column {
  border-right: 1px solid #dde6ee;
  background: #fff;
}

.qr-editor-view .qr-preview-column {
  background: #fbfcfd;
}

.qr-editor-view .qr-editor-summary {
  display: none;
}

.qr-editor-view .qr-editor-tabbar {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid #dde6ee;
  margin-bottom: 0;
  overflow-x: auto;
}

.qr-editor-view .qr-editor-tab {
  flex: 0 0 auto;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 12px 2px 14px;
  background: transparent;
  color: #293647;
  box-shadow: none;
}

.qr-editor-view .qr-editor-tab.is-active {
  color: #08752e;
  border-color: #08752e;
  background: transparent;
  box-shadow: none;
}

.qr-editor-view .qr-section-card {
  padding: 18px;
  border-radius: 8px;
  border: 1px solid #dde6ee;
  background: #fff;
  box-shadow: 0 16px 44px rgba(16, 24, 39, 0.055);
}

.qr-editor-view .qr-section-card .section-head {
  margin-bottom: 12px;
}

.qr-editor-view .qr-section-card .section-head .card-label,
.qr-editor-view .qr-section-card .section-head .filter-chip {
  display: none;
}

.qr-editor-view .qr-section-card .section-head h3,
.qr-editor-view .qr-section-card h3 {
  margin: 0;
  font-size: 1rem;
  color: #111827;
}

.qr-editor-view .qr-section-card .search-input,
.qr-editor-view .qr-section-card .select-input,
.qr-editor-view .qr-richtext-input {
  border-radius: 7px;
  border-color: #d7e1ea;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(16, 24, 39, 0.035);
}

.qr-editor-view .qr-field-grid {
  grid-template-columns: 1fr;
}

.qr-editor-view .qr-control-grid,
.qr-editor-view .qr-color-grid,
.qr-editor-view .qr-layout-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qr-editor-view .qr-richtext-toolbar .secondary-action {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 6px;
}

.qr-editor-view .qr-richtext-input {
  min-height: 148px;
}

.qr-editor-view .qr-layout-option,
.qr-editor-view .qr-template-card {
  border-radius: 8px;
}

.qr-editor-view .qr-layout-option.is-active {
  border-color: rgba(8, 117, 46, 0.34);
  background: rgba(8, 117, 46, 0.08);
  box-shadow: 0 0 0 3px rgba(8, 117, 46, 0.08);
}

.qr-editor-view .qr-preview-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.qr-editor-view .qr-preview-card > .section-head {
  margin-bottom: 14px;
}

.qr-editor-view .qr-preview-card > .section-head .card-label,
.qr-editor-view .qr-preview-card > .section-head .supporting-copy {
  display: none;
}

.qr-editor-view .qr-preview-card > .section-head h3 {
  margin: 0;
  font-size: 1rem;
  color: #111827;
}

.qr-editor-view .qr-preview-paper {
  width: min(100%, 760px);
  margin: 0 auto;
  aspect-ratio: 0.78 / 1;
  padding: 0;
  gap: 0;
  grid-template-rows: auto auto 1fr auto;
  border: 1.5px solid var(--qr-primary, #08752e);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff 0%, var(--qr-background, #fff) 100%) !important;
  box-shadow: 0 22px 56px rgba(16, 24, 39, 0.14);
}

.qr-editor-view .qr-preview-frame {
  display: none;
}

.qr-editor-view .qr-preview-header {
  position: relative;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: start;
  gap: 8px;
  padding: 34px 38px 18px;
  text-align: center;
}

.qr-editor-view .qr-preview-logo-slot {
  display: grid;
  place-items: center;
}

.qr-editor-view .qr-preview-logo-slot img {
  width: 180px;
  height: 72px;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.qr-editor-view .qr-preview-header .qr-logo-preview-mark {
  width: 260px;
  height: 86px;
  border-radius: 0;
  background: #fff;
  color: #08233f;
  font-size: 1.45rem;
  border: 0;
  justify-content: start;
  box-shadow: none;
}

.qr-editor-view .qr-preview-header .qr-logo-preview-mark .fixfox-logo-img {
  width: 260px;
  max-width: 100%;
}

.qr-editor-view .qr-preview-kicker {
  padding: 0;
  background: transparent !important;
  color: var(--qr-primary, #08752e) !important;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.82rem;
}

.qr-editor-view .qr-preview-title-group h2 {
  margin-top: 8px;
  color: var(--qr-primary, #075f29) !important;
  font-size: clamp(2.3rem, 4vw, 4rem);
  line-height: 0.98;
  text-transform: uppercase;
}

.qr-editor-view .qr-preview-title-group .detail-copy {
  color: var(--qr-secondary, #1f2937);
  font-size: 1.05rem;
}

.qr-editor-view .qr-preview-meta {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 0 22px;
  padding: 15px 22px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--qr-primary, #08752e) 12%, #fff), #f8fbf7);
}

.qr-editor-view .qr-preview-meta::before {
  content: "";
  width: 44px;
  height: 44px;
  grid-row: 1 / 3;
  border-radius: 999px;
  background: radial-gradient(circle at center, #fff 0 6px, var(--qr-primary, #08752e) 7px 100%);
}

.qr-editor-view .qr-preview-meta p {
  margin: 0;
}

.qr-editor-view .qr-preview-meta p:first-of-type {
  font-size: 1.08rem;
}

.qr-editor-view .qr-preview-meta strong,
.qr-editor-view .qr-preview-meta span {
  color: inherit;
}

.qr-editor-view .qr-preview-layout {
  grid-template-columns: 1fr minmax(190px, 0.78fr) !important;
  gap: 24px;
  align-items: center;
  padding: 22px 42px 14px;
}

.qr-editor-view .qr-preview-copy-column section:nth-child(2) {
  display: none;
}

.qr-editor-view .qr-preview-copy-column h4 {
  color: var(--qr-primary, #08752e);
  text-transform: uppercase;
  font-size: 0.95rem;
}

.qr-editor-view .qr-preview-richtext ol,
.qr-editor-view .qr-preview-richtext ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 0;
  list-style: none;
  counter-reset: qrSteps;
}

.qr-editor-view .qr-preview-richtext li {
  position: relative;
  padding-left: 42px;
  line-height: 1.36;
}

.qr-editor-view .qr-preview-richtext li::before {
  counter-increment: qrSteps;
  content: counter(qrSteps);
  position: absolute;
  left: 0;
  top: -1px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--qr-primary, #08752e);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
}

.qr-editor-view .qr-preview-code-block {
  padding: 14px;
  gap: 10px;
  border: 1px solid #dde6ee;
  border-radius: 10px;
  background: #fff !important;
  text-align: center;
  box-shadow: 0 12px 26px rgba(16, 24, 39, 0.06);
}

.qr-editor-view .qr-preview-code-block img {
  border: 8px solid #fff;
  border-radius: 4px;
  box-shadow: none;
}

.qr-editor-view .qr-preview-code-block h4 {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--qr-primary, #14923d), var(--qr-secondary, #08752e));
  color: #fff;
  font-size: 0.94rem;
}

.qr-editor-view .qr-preview-code-block .supporting-copy {
  display: none;
}

.qr-editor-view .qr-preview-contact {
  margin-top: 12px;
  padding: 14px 42px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 36px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(135deg, var(--qr-primary, #08752e), var(--qr-secondary, #0a8435)) !important;
  color: #fff;
}

.qr-editor-view .qr-preview-contact strong {
  display: none;
}

.qr-editor-view .qr-preview-footer {
  justify-content: center;
  text-align: center;
  border: 0;
  padding: 14px 26px;
  background: #fbfdf9;
  color: var(--qr-primary, #08752e);
  font-style: italic;
}

.qr-editor-view .qr-preview-footer > div:nth-child(2),
.qr-editor-view .qr-preview-footer > div:nth-child(3),
.qr-editor-view .qr-preview-footer .field-label {
  display: none;
}

.qr-editor-view .button-row:has(#qr-detail-open-page) {
  justify-content: center;
  margin-top: 14px;
}

.qr-editor-view .qr-template-region {
  padding: 18px 28px 22px;
  border-top: 1px solid #dde6ee;
  background: #fff;
}

.qr-editor-view .qr-template-region > .qr-section-card {
  padding: 0;
  border: 0;
  box-shadow: none;
}

.qr-editor-view .qr-template-region .section-head {
  margin-bottom: 12px;
}

.qr-editor-view .qr-template-region .filter-chip,
.qr-editor-view #qr-template-helper {
  display: none;
}

.qr-editor-view .qr-template-grid {
  grid-template-columns: repeat(5, minmax(116px, 1fr));
  gap: 14px;
}

.qr-editor-view .qr-template-card {
  min-height: 122px;
  align-content: end;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  text-align: center;
}

.qr-editor-view .qr-template-card::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  width: 54px;
  height: 70px;
  transform: translateX(-50%);
  border: 1px solid #d8e1ea;
  border-radius: 4px;
  background: linear-gradient(#08752e 0 10px, transparent 10px 100%), repeating-linear-gradient(90deg, #111 0 4px, #fff 4px 8px), #fff;
  background-size: 100% 100%, 32px 32px, 100% 100%;
  background-position: 0 0, 50% 34px, 0 0;
  background-repeat: no-repeat;
}

.qr-editor-view .qr-template-card strong,
.qr-editor-view .qr-template-card span {
  position: relative;
  z-index: 1;
}

.qr-editor-view .qr-template-card span {
  display: none;
}

.qr-editor-view .qr-template-card.is-active {
  border-color: #1687ff;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(22, 135, 255, 0.22);
}

.qr-editor-view .qr-template-region .button-row {
  margin-top: 12px;
}

@media (max-width: 1180px) {
  .qr-editor-view .qr-editor-grid,
  .qr-editor-view .qr-editor-workspace {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .qr-editor-view .wide-card {
    max-height: none;
  }

  .qr-editor-view .qr-editor-column,
  .qr-editor-view .qr-preview-column {
    overflow: visible;
  }
}

@media (max-width: 820px) {
  .qr-editor-view .qr-editor-topbar,
  .qr-editor-view .qr-editor-topbar-main,
  .qr-editor-view .qr-editor-actions,
  .qr-editor-view .qr-preview-header,
  .qr-editor-view .qr-preview-footer {
    align-items: stretch;
  }

  .qr-editor-view .qr-editor-topbar,
  .qr-editor-view .qr-editor-column,
  .qr-editor-view .qr-preview-column,
  .qr-editor-view .qr-template-region {
    padding-left: 16px;
    padding-right: 16px;
  }

  .qr-editor-view .qr-preview-paper {
    width: 100%;
    aspect-ratio: auto;
  }

  .qr-editor-view .qr-preview-header,
  .qr-editor-view .qr-preview-layout,
  .qr-editor-view .qr-preview-contact {
    padding-left: 18px;
    padding-right: 18px;
  }

  .qr-editor-view .qr-preview-layout,
  .qr-editor-view .qr-preview-contact,
  .qr-editor-view .qr-template-grid,
  .qr-editor-view .qr-control-grid,
  .qr-editor-view .qr-color-grid,
  .qr-editor-view .qr-layout-grid {
    grid-template-columns: 1fr !important;
  }
}
.app-shell:has(#view-qr-posters.is-active) {
  grid-template-columns: 1fr;
}

.app-shell:has(#view-qr-posters.is-active) > .sidebar,
.main-shell:has(#view-qr-posters.is-active) > .topbar {
  display: none;
}

.main-shell:has(#view-qr-posters.is-active) {
  padding: 0;
  background: #f7f9fb;
}

.qr-editor-view.is-active .qr-editor-grid {
  min-height: 100vh;
  border: 0;
  border-radius: 0;
}

.qr-editor-view .qr-editor-actions {
  flex-wrap: nowrap;
}

.qr-editor-view .qr-editor-actions #qr-back-to-objects {
  display: none;
}

/* QR editor refinement: reference sidebar, dropdown and desktop height */
.qr-editor-view .qr-editor-grid {
  grid-template-columns: 232px minmax(0, 1fr);
}

.qr-editor-view .qr-reference-sidebar {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  gap: 18px;
}

.qr-reference-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-transform: uppercase;
  line-height: 1.08;
}

.qr-reference-brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #48d597, #5bc4ff);
  color: #062018;
  font-weight: 900;
}

.qr-reference-nav,
.qr-reference-subnav {
  display: grid;
  gap: 8px;
}

.qr-reference-subnav {
  padding-left: 12px;
  border-left: 2px solid rgba(255, 255, 255, 0.22);
}

.qr-reference-nav-item {
  text-align: left;
  width: 100%;
  border: 0;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(248, 252, 249, 0.82);
  font-weight: 700;
  background: transparent;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.qr-reference-nav-item:hover,
.qr-reference-nav-item:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

.qr-reference-nav-item.is-active {
  color: #fff;
  background: linear-gradient(135deg, #15923d, #08752e);
  box-shadow: 0 12px 30px rgba(6, 111, 47, 0.28);
}

.qr-sidebar-object-picker {
  display: grid;
  gap: 9px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.qr-sidebar-object-picker .field-label {
  color: rgba(248, 252, 249, 0.72);
}

.qr-sidebar-object-picker .search-input,
.qr-sidebar-object-picker .select-input {
  width: 100%;
  min-width: 0;
  border-radius: 8px;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.94);
}

.qr-selected-object-summary .object-card {
  display: none;
}

.qr-editor-view .qr-editor-topbar {
  min-height: 82px;
}

.qr-editor-view .qr-editor-workspace {
  height: calc(100vh - 246px);
  min-height: 560px;
}

.qr-editor-view .qr-editor-column,
.qr-editor-view .qr-preview-column {
  padding-top: 16px;
  padding-bottom: 16px;
}

.qr-editor-view .qr-tab-panel.is-active {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.qr-editor-view [data-qr-editor-panel="content"].is-active {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.qr-editor-view [data-qr-editor-panel="content"] .qr-section-card:first-child,
.qr-editor-view [data-qr-editor-panel="content"] .qr-section-card:nth-child(2) {
  grid-column: span 2;
}

.qr-editor-view [data-qr-editor-panel="content"] .qr-section-card:nth-child(2) {
  max-height: 210px;
  overflow: auto;
}

.qr-editor-view .qr-section-card {
  padding: 14px 16px;
}

.qr-editor-view .qr-richtext-input {
  min-height: 106px;
}

.qr-editor-view .qr-template-region {
  padding-top: 12px;
  padding-bottom: 12px;
}

.qr-editor-view .qr-template-grid {
  grid-template-columns: repeat(5, minmax(106px, 1fr));
}

.qr-editor-view .qr-template-card {
  min-height: 92px;
}

.qr-editor-view .qr-template-card::before {
  top: 8px;
  width: 42px;
  height: 52px;
  background-size: 100% 100%, 24px 24px, 100% 100%;
  background-position: 0 0, 50% 24px, 0 0;
}

.qr-editor-view .qr-template-region .button-row {
  display: none;
}

.qr-editor-view .qr-preview-card > .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qr-editor-view .qr-preview-paper {
  width: min(100%, 690px);
  max-height: calc(100vh - 178px);
  aspect-ratio: 0.76 / 1;
}

.qr-editor-view .qr-preview-header {
  padding-top: 24px;
  padding-bottom: 12px;
}

.qr-editor-view .qr-preview-title-group h2 {
  font-size: clamp(2.15rem, 3.5vw, 3.4rem);
}

.qr-editor-view .qr-preview-layout {
  padding-top: 16px;
  padding-bottom: 10px;
}

.qr-editor-view .qr-preview-contact {
  padding-top: 10px;
  padding-bottom: 10px;
}

.qr-editor-view .qr-preview-footer {
  padding-top: 10px;
  padding-bottom: 10px;
}

@media (min-width: 1500px) {
  .qr-editor-view .qr-editor-grid {
    grid-template-columns: 248px minmax(0, 1fr);
  }

  .qr-editor-view .qr-preview-paper {
    width: min(100%, 760px);
  }
}

@media (max-width: 1180px) {
  .qr-editor-view .qr-reference-sidebar {
    grid-template-rows: auto;
  }

  .qr-reference-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qr-editor-view .qr-editor-workspace {
    height: auto;
    min-height: 0;
  }
}

@media (max-width: 820px) {
  .qr-editor-view [data-qr-editor-panel="content"].is-active,
  .qr-editor-view [data-qr-editor-panel="content"] .qr-section-card:first-child,
  .qr-editor-view [data-qr-editor-panel="content"] .qr-section-card:nth-child(2) {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  .qr-reference-nav {
    grid-template-columns: 1fr;
  }
}

/* QR tab click-layer fix */
.qr-editor-view .qr-editor-tabbar {
  position: sticky;
  top: 0;
  z-index: 6;
  background: #fff;
  padding-top: 2px;
}

.qr-editor-view .qr-tab-panel {
  position: relative;
  z-index: 1;
  padding-top: 12px;
}

/* QR content tab density refinement */
.qr-editor-view [data-qr-editor-panel="content"].is-active {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.qr-editor-view [data-qr-editor-panel="content"] .qr-section-card:first-child {
  grid-column: span 2;
}

.qr-editor-view [data-qr-editor-panel="content"] .qr-section-card:nth-child(2) {
  grid-column: auto;
  max-height: none;
  overflow: visible;
}

.qr-editor-view [data-qr-editor-panel="content"] .qr-section-card:first-child .qr-field-grid,
.qr-editor-view [data-qr-editor-panel="content"] .qr-section-card:nth-child(3) .qr-field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qr-editor-view .qr-contact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qr-editor-view .qr-editor-column .detail-stack,
.qr-editor-view .qr-editor-column .qr-richtext-input,
.qr-editor-view .qr-editor-column textarea,
.qr-editor-view .qr-editor-column .search-input {
  min-width: 0;
}

.qr-editor-view [data-qr-editor-panel="content"] .qr-richtext-input {
  min-height: 118px;
  max-height: 154px;
  overflow: auto;
}

.qr-editor-view [data-qr-editor-panel="content"] textarea.search-input {
  min-height: 86px;
}

.qr-editor-view .qr-section-card .detail-stack {
  gap: 6px;
}

/* Dashboard operations refresh: compact, square, no wasted hero space */
#view-dashboard {
  gap: 12px;
}

#view-dashboard .hero-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

#view-dashboard .hero-card {
  min-height: 116px;
  padding: 16px 18px 14px;
  border-radius: 0;
  border: 1px solid #cfd9e5;
  border-left: 4px solid #1f6feb;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
  color: var(--text-primary);
}

#view-dashboard .hero-card::before {
  display: none;
}

#view-dashboard .hero-card:nth-child(1) {
  grid-column: auto;
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
  border-left-color: #132033;
}

#view-dashboard .hero-card:nth-child(2) {
  border-left-color: #1f6feb;
}

#view-dashboard .hero-card:nth-child(3) {
  border-left-color: #c73d45;
}

#view-dashboard .hero-card:nth-child(4) {
  border-left-color: #217a52;
}

#view-dashboard .hero-card:nth-child(1) .card-label,
#view-dashboard .hero-card:nth-child(1) .metric-foot,
#view-dashboard .hero-card .card-label,
#view-dashboard .hero-card .metric-foot {
  color: var(--text-secondary);
}

#view-dashboard .hero-card:nth-child(1) .metric-value,
#view-dashboard .hero-card .metric-value {
  color: var(--text-primary);
}

#view-dashboard .metric-value {
  font-size: clamp(1.85rem, 2vw, 2.35rem);
  line-height: 1;
  margin: 8px 0 8px;
}

#view-dashboard .metric-value.critical {
  display: inline-block;
  min-width: 48px;
  padding: 2px 10px;
  background: #fde8e8;
  color: #b4232b;
}

#view-dashboard .metric-foot {
  font-size: 0.88rem;
  line-height: 1.35;
}

#view-dashboard .dashboard-grid {
  grid-template-columns: minmax(560px, 1.45fr) minmax(360px, 0.9fr);
  gap: 12px;
  margin-top: 0;
  align-items: start;
}

#view-dashboard .surface-card {
  border-radius: 0;
  border: 1px solid #cfd9e5;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.07);
  padding: 16px;
}

#view-dashboard .dashboard-grid .wide-card:first-child,
#view-dashboard .dashboard-grid .surface-card:nth-child(2),
#view-dashboard .detail-card {
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.07);
}

#view-dashboard .dashboard-grid .surface-card:nth-child(2) {
  border-top: 4px solid #132033;
}

#view-dashboard .dashboard-grid .surface-card:nth-child(2) .card-label,
#view-dashboard .dashboard-grid .surface-card:nth-child(2) .detail-copy,
#view-dashboard .dashboard-grid .surface-card:nth-child(2) dt,
#view-dashboard .dashboard-grid .surface-card:nth-child(2) dd {
  color: inherit;
}

#view-dashboard .wide-card {
  grid-row: span 2;
}

#view-dashboard .section-head {
  align-items: flex-start;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 10px;
}

#view-dashboard .section-head h3 {
  font-size: 1.05rem;
  line-height: 1.2;
}

#view-dashboard .card-label {
  display: block;
  margin-bottom: 5px;
  color: #516174;
  font-size: 0.68rem;
  letter-spacing: 0.11em;
}

#view-dashboard .ticket-list,
#view-dashboard .simple-list {
  gap: 8px;
  margin-top: 0;
}

#view-dashboard .ticket-row,
#view-dashboard .simple-list li {
  border-radius: 0;
  border: 1px solid #d9e2ec;
  background: #f8fafc;
  padding: 12px 14px;
}

#view-dashboard .ticket-row:hover,
#view-dashboard .simple-list li:hover {
  background: #f2f6fa;
  border-color: #b9c8d8;
}

#view-dashboard .ticket-title,
#view-dashboard .simple-list strong {
  font-size: 0.95rem;
  line-height: 1.25;
}

#view-dashboard .ticket-meta {
  margin-top: 8px;
}

#view-dashboard .priority-chip {
  border-radius: 0;
  padding: 5px 9px;
  font-size: 0.76rem;
}

#view-dashboard .detail-grid {
  gap: 8px;
  margin-top: 14px;
}

#view-dashboard .detail-grid > div {
  border-radius: 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 10px;
}

.main-shell {
  gap: 14px;
  padding: 18px;
}

.main-shell::before {
  display: none;
}

.topbar {
  border-radius: 0;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid #cfd9e5;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.topbar h2 {
  font-size: 1.35rem;
}

@media (min-width: 1600px) {
  #view-dashboard .hero-grid {
    gap: 12px;
  }

  #view-dashboard .dashboard-grid {
    grid-template-columns: minmax(680px, 1.5fr) minmax(420px, 0.9fr);
  }
}

@media (max-width: 1180px) {
  #view-dashboard .hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-dashboard .dashboard-grid {
    grid-template-columns: 1fr;
  }

  #view-dashboard .wide-card {
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  .main-shell {
    padding: 12px;
  }

  #view-dashboard .hero-grid {
    grid-template-columns: 1fr;
  }

  #view-dashboard .hero-card,
  #view-dashboard .surface-card {
    padding: 14px;
  }
}

/* Shared workspace refresh for tickets, customers, objects, calendar, employees, tasks and profile */
.view-section:not(#view-dashboard):not(#view-qr-posters) {
  gap: 12px;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) > .content-grid {
  grid-template-columns: minmax(520px, 1.35fr) minmax(360px, 0.9fr);
  gap: 12px;
  align-items: start;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .surface-card {
  border-radius: 0;
  border: 1px solid #cfd9e5;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.07);
  padding: 16px;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .wide-card {
  grid-row: span 2;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .detail-card {
  border-top: 4px solid #132033;
  background: #ffffff;
  color: var(--text-primary);
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .section-head {
  align-items: flex-start;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 10px;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .section-head h3 {
  font-size: 1.05rem;
  line-height: 1.2;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .card-label,
.view-section:not(#view-dashboard):not(#view-qr-posters) .field-label,
.view-section:not(#view-dashboard):not(#view-qr-posters) dt {
  color: #516174;
  font-size: 0.68rem;
  letter-spacing: 0.11em;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .ticket-list,
.view-section:not(#view-dashboard):not(#view-qr-posters) .object-card-list,
.view-section:not(#view-dashboard):not(#view-qr-posters) .task-board,
.view-section:not(#view-dashboard):not(#view-qr-posters) .simple-list {
  gap: 8px;
  margin-top: 0;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .ticket-row,
.view-section:not(#view-dashboard):not(#view-qr-posters) .object-card,
.view-section:not(#view-dashboard):not(#view-qr-posters) .task-row,
.view-section:not(#view-dashboard):not(#view-qr-posters) .simple-list li {
  border-radius: 0;
  border: 1px solid #d9e2ec;
  background: #f8fafc;
  box-shadow: none;
  padding: 12px 14px;
  gap: 8px;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .ticket-row:hover,
.view-section:not(#view-dashboard):not(#view-qr-posters) .object-card:hover,
.view-section:not(#view-dashboard):not(#view-qr-posters) .task-row:hover,
.view-section:not(#view-dashboard):not(#view-qr-posters) .simple-list li:hover {
  transform: none;
  background: #f2f6fa;
  border-color: #b9c8d8;
  box-shadow: none;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .ticket-row.is-selected,
.view-section:not(#view-dashboard):not(#view-qr-posters) .object-card.is-selected {
  border-color: #1f6feb;
  border-left: 4px solid #1f6feb;
  background: #ffffff;
  box-shadow: none;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .ticket-top,
.view-section:not(#view-dashboard):not(#view-qr-posters) .object-card-header {
  align-items: flex-start;
  gap: 10px;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .ticket-title,
.view-section:not(#view-dashboard):not(#view-qr-posters) .object-card h4,
.view-section:not(#view-dashboard):not(#view-qr-posters) .task-row h4,
.view-section:not(#view-dashboard):not(#view-qr-posters) .simple-list strong {
  font-size: 0.95rem;
  line-height: 1.25;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .ticket-meta,
.view-section:not(#view-dashboard):not(#view-qr-posters) .object-card-meta,
.view-section:not(#view-dashboard):not(#view-qr-posters) .task-row p,
.view-section:not(#view-dashboard):not(#view-qr-posters) .simple-list p,
.view-section:not(#view-dashboard):not(#view-qr-posters) .detail-copy {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.35;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .detail-stack {
  gap: 8px;
  margin-top: 12px;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .detail-grid {
  gap: 8px;
  margin: 12px 0;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .detail-grid > div {
  border-radius: 0;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 10px;
  min-width: 0;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) dd {
  overflow-wrap: anywhere;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .search-input,
.view-section:not(#view-dashboard):not(#view-qr-posters) .select-input,
.view-section:not(#view-dashboard):not(#view-qr-posters) textarea.search-input {
  min-width: 0;
  width: 100%;
  border-radius: 0;
  border: 1px solid #cbd7e3;
  background: #ffffff;
  padding: 10px 12px;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.03);
}

.view-section:not(#view-dashboard):not(#view-qr-posters) textarea.search-input {
  min-height: 84px;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .primary-action,
.view-section:not(#view-dashboard):not(#view-qr-posters) .secondary-action,
.topbar .primary-action,
.topbar .secondary-action {
  border-radius: 8px;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid transparent;
  box-shadow: none;
  font-weight: 900;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .primary-action {
  background: var(--foxtask-orange);
  border-color: var(--foxtask-orange);
  color: #ffffff;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .primary-action:hover {
  background: #e85f00;
  border-color: #e85f00;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(255, 108, 0, 0.2);
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .secondary-action,
.topbar .secondary-action {
  background: #f3f6fa;
  border-color: #cfd9e5;
  color: #132033;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .secondary-action:hover,
.topbar .secondary-action:hover {
  background: #e8eef6;
}

#view-objects #object-open-qr,
#view-objects #object-open-public,
#view-objects #object-open-pdf {
  background: var(--foxtask-orange);
  border-color: var(--foxtask-orange);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(255, 108, 0, 0.24);
}

#view-objects #object-open-qr:hover,
#view-objects #object-open-public:hover,
#view-objects #object-open-pdf:hover {
  background: #e85f00;
  border-color: #e85f00;
  transform: translateY(-1px);
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .action-new-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: max-content;
  white-space: nowrap;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .action-new-button::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 1rem;
  line-height: 1;
}

.geo-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.geo-input-row .search-input {
  min-width: 0;
}

#object-geocode-status.is-error {
  color: #a8242c;
  font-weight: 800;
}

.object-geo-map {
  min-height: 220px;
  height: 220px;
  border-radius: 8px;
  border: 1px solid #cfd9e5;
  overflow: hidden;
  background: #eef4fb;
}

.object-geo-map.is-empty {
  display: grid;
  place-items: center;
}

.object-geo-map-empty {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: #516174;
  font-weight: 800;
}

.object-geo-marker {
  position: absolute;
  z-index: 3;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--foxtask-orange);
  color: #ffffff;
  border: 3px solid #ffffff;
  box-shadow: 0 10px 24px rgba(15, 32, 51, 0.22);
  font-weight: 900;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .danger-action {
  border-color: #f0c7ca;
  background: #fde8e8;
  color: #a8242c;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .danger-action:hover {
  background: #fbd4d7;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .priority-chip,
.view-section:not(#view-dashboard):not(#view-qr-posters) .status-pill,
.view-section:not(#view-dashboard):not(#view-qr-posters) .filter-chip,
.topbar .action-badge {
  border-radius: 0;
  padding: 5px 9px;
  font-size: 0.76rem;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .filter-row {
  gap: 6px;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .filter-chip {
  border: 1px solid #cfd9e5;
  background: #ffffff;
  color: #516174;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .filter-chip.is-active {
  border-color: #132033;
  background: #132033;
  color: #ffffff;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .segmented-tabs {
  border-radius: 0;
  border: 1px solid #d9e2ec;
  background: #f8fafc;
  padding: 4px;
  gap: 4px;
  margin-bottom: 12px;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .segmented-tab {
  border-radius: 0;
  color: #516174;
  padding: 8px 10px;
}

.view-section:not(#view-dashboard):not(#view-qr-posters) .segmented-tab.is-active {
  background: #132033;
  color: #ffffff;
}

#view-tickets .detail-card,
#view-customers .detail-card,
#view-objects .detail-card,
#view-employees .detail-card {
  height: auto;
  max-height: none;
  overflow: visible;
}

#view-tickets .ticket-tab-panel.is-active {
  display: grid;
  gap: 10px;
}

#view-tickets,
#view-tickets > .content-grid,
#view-tickets .surface-card,
#view-tickets .detail-card,
#view-tickets .ticket-tab-panel,
#view-tickets .detail-stack {
  min-width: 0;
  max-width: 100%;
}

#view-tickets .detail-card {
  overflow-x: hidden;
  overflow-y: visible;
}

#view-tickets [data-ticket-panel="history"] {
  overflow-wrap: anywhere;
}

#view-tickets [data-ticket-panel="history"] .quick-request-row {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

#view-tickets [data-ticket-panel="history"] .compact-request,
#view-tickets #ticket-info-request-save,
#view-tickets #ticket-comment-save {
  width: 100%;
  min-width: 0;
  white-space: normal;
  line-height: 1.2;
}

#view-tickets #ticket-comment-list,
#view-tickets #ticket-comment-list li,
#view-tickets #ticket-comment-list strong,
#view-tickets #ticket-comment-list p {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#view-tickets #ticket-comment-list .ticket-resident-request-item {
  border-left: 5px solid #1f6feb;
  background: linear-gradient(135deg, #f8fbff 0%, #eef5ff 100%);
  padding: 0;
}

#view-tickets #ticket-comment-list .ticket-resident-answer-item {
  border-left: 5px solid #ff6c00;
  background: linear-gradient(135deg, #fff9f3 0%, #fff1e6 100%);
  padding: 0;
}

#view-tickets #ticket-comment-list .ticket-public-note-item {
  border-left: 5px solid #0b72f0;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fbff 100%);
  padding: 0;
}

#view-tickets #ticket-comment-list .ticket-internal-note-item {
  border-left: 5px solid #334155;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
  padding: 0;
}

.ticket-resident-request-card,
.ticket-resident-answer-card,
.ticket-note-card,
.ticket-history-card {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
}

.ticket-resident-request-meta,
.ticket-resident-answer-meta,
.ticket-note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #516174;
  font-size: 0.84rem;
  font-weight: 800;
}

.ticket-resident-request-type,
.ticket-resident-request-status,
.ticket-resident-answer-type,
.ticket-note-type {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ticket-resident-request-type {
  background: rgba(31, 111, 235, 0.12);
  color: #1f55b8;
}

.ticket-resident-answer-type {
  background: #fff1e6;
  color: #c05600;
}

.ticket-resident-answer-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 9px;
  background: #fff7ed;
  color: #c05600;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ticket-resident-answer-status.is-done {
  background: #ecfdf3;
  color: #168044;
}

#view-tickets #ticket-comment-list .ticket-resident-answer-item.is-new {
  border-left-color: #ff6c00;
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
  box-shadow: 0 0 0 3px rgba(255, 108, 0, 0.12);
}

#view-tickets #ticket-comment-list .ticket-resident-answer-item.is-focused,
.mobile-ticket-history-list .ticket-resident-answer-item.is-focused {
  outline: 3px solid rgba(31, 111, 235, 0.35);
  outline-offset: 3px;
}

.ticket-resident-answer-ack {
  width: max-content;
  min-width: 132px;
}

.ticket-public-note-item .ticket-note-type {
  background: #dbeafe;
  color: #0757c8;
}

.ticket-internal-note-item .ticket-note-type {
  background: #e2e8f0;
  color: #334155;
}

.ticket-resident-request-status.is-pending {
  background: #fff4e6;
  color: #c05600;
}

.ticket-resident-request-status.is-answered {
  background: #ecfdf3;
  color: #168044;
}

.ticket-resident-request-body,
.ticket-resident-answer-body,
.ticket-note-body {
  display: grid;
  gap: 12px;
}

.ticket-history-system-item {
  border-left: 5px solid #1f6feb;
  background: linear-gradient(135deg, #f8fbff 0%, #eef5ff 100%);
  padding: 0;
}

.ticket-history-details {
  display: grid;
  gap: 8px;
  margin: 0;
}

.ticket-history-details div {
  display: grid;
  gap: 3px;
}

.ticket-history-details dt {
  color: #516174;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ticket-history-details dd {
  margin: 0;
  color: #132033;
  font-weight: 850;
  line-height: 1.35;
}

.ticket-history-changes {
  display: grid;
  gap: 10px;
  margin: 2px 0;
}

.ticket-history-change {
  display: grid;
  grid-template-columns: minmax(112px, 0.32fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(31, 111, 235, 0.16);
  border-left: 4px solid #1f6feb;
  border-radius: 8px;
  background: rgba(31, 111, 235, 0.06);
}

.ticket-history-change-label {
  color: #516174;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ticket-history-change-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #334155;
  font-weight: 800;
  line-height: 1.3;
}

.ticket-history-change-old {
  color: #64748b;
}

.ticket-history-change-arrow {
  color: #94a3b8;
  font-weight: 900;
}

.ticket-history-change-new {
  color: #1f6feb;
  font-weight: 950;
}

.ticket-history-change-employee {
  border-left-color: #16a34a;
  background: rgba(22, 163, 74, 0.07);
}

.ticket-history-change-employee .ticket-history-change-new {
  color: #15803d;
}

.ticket-history-change-priority {
  border-left-color: #f97316;
  background: rgba(249, 115, 22, 0.08);
}

.ticket-history-change-priority .ticket-history-change-new {
  color: #c2410c;
}

.ticket-history-badge {
  border: 1px solid rgba(31, 111, 235, 0.18);
}

.ticket-history-badge-status { background: #dbeafe; color: #1d4ed8; }
.ticket-history-badge-employee { background: #dcfce7; color: #15803d; }
.ticket-history-badge-priority { background: #ffedd5; color: #c2410c; }
.ticket-history-badge-public { background: #ede9fe; color: #6d28d9; }
.ticket-history-badge-internal { background: #f1f5f9; color: #475569; }
.ticket-history-badge-edited { background: #fef9c3; color: #854d0e; }
.ticket-history-badge-created { background: #f5e8d7; color: #7c2d12; }
.ticket-history-badge-closed { background: #fee2e2; color: #b91c1c; }

.ticket-history-tone-status { border-left-color: #1f6feb; }
.ticket-history-tone-employee { border-left-color: #16a34a; }
.ticket-history-tone-priority { border-left-color: #f97316; }
.ticket-history-tone-public { border-left-color: #7c3aed; }
.ticket-history-tone-internal { border-left-color: #94a3b8; }
.ticket-history-tone-edited { border-left-color: #eab308; }
.ticket-history-tone-created { border-left-color: #92400e; }
.ticket-history-tone-closed { border-left-color: #dc2626; }

.ticket-history-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ticket-history-attachment {
  width: 92px;
  min-height: 112px;
  display: grid;
  grid-template-rows: 78px auto;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--color-border, #d9e2ef);
  border-radius: 8px;
  background: var(--color-surface, #ffffff);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}

.ticket-history-attachment img,
.ticket-history-attachment > span {
  width: 100%;
  height: 78px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--color-surface-soft, #f3f6fb);
}

.ticket-history-attachment > span {
  display: grid;
  place-items: center;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ticket-history-attachment small {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-muted);
}

@media (max-width: 760px) {
  .ticket-history-change {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .mobile-ticket-history-list .ticket-history-attachments {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mobile-ticket-history-list .ticket-history-attachment {
    width: 100%;
    min-width: 0;
  }
}

.ticket-resident-request-body h4,
.ticket-resident-answer-body h4,
.ticket-note-body h4 {
  margin: 0;
  color: #071d33;
  font-size: 1.06rem;
}

.ticket-resident-request-body p,
.ticket-resident-answer-body p,
.ticket-note-body p {
  margin: 0;
  color: #132033;
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.ticket-resident-answer-body small {
  color: #6b7280;
  font-weight: 800;
  line-height: 1.35;
}

.ticket-resident-answer-attachment {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  padding: 8px 10px;
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.ticket-resident-request-body dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.ticket-resident-request-body dl div {
  display: grid;
  gap: 4px;
}

.ticket-resident-request-body dt {
  color: #516174;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.ticket-resident-request-body dd {
  margin: 0;
  color: #132033;
  font-weight: 750;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.ticket-resident-request-button {
  width: max-content;
  min-width: 132px;
  text-decoration: none;
}

.ticket-resident-request-author,
.ticket-resident-answer-author,
.ticket-note-author {
  margin: 0;
  color: #516174;
  font-weight: 700;
}

.ticket-note-visibility,
.mobile-note-visibility {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid #dbe5f0;
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px 12px;
}

.ticket-note-visibility label,
.mobile-note-visibility label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #132033;
  font-weight: 850;
}

.mobile-note-visibility legend {
  padding: 0 4px;
  color: #516174;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#view-tickets #ticket-calendar-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

#view-tickets #ticket-calendar-card .field-label,
#view-tickets #ticket-calendar-card .primary-action {
  grid-column: 1 / -1;
}

#view-customers .detail-card > .detail-stack,
#view-objects .detail-card > .detail-stack,
#view-employees .detail-card > .detail-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 10px;
  row-gap: 8px;
}

#view-customers .detail-card textarea,
#view-customers .detail-card .button-row,
#view-objects .detail-card textarea,
#view-objects .detail-card .button-row,
#view-objects .detail-card .object-form-panel,
#view-objects .detail-card .object-employee-assignment,
#view-objects .detail-card .public-service-config,
#view-objects .detail-card .object-contractor-config,
#view-employees .detail-card .employee-login-setup,
#view-employees .detail-card textarea,
#view-employees .detail-card .button-row,
#view-employees .detail-card .field-label:has(input) {
  grid-column: 1 / -1;
}

#view-objects #object-action-helper {
  margin-top: 12px;
  margin-bottom: 18px;
}

.employee-login-setup {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(31, 111, 235, 0.12), rgba(255, 111, 15, 0.08));
}

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

.employee-login-actions .secondary-action {
  min-height: 42px;
}

.employee-invite-modal {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 10, 22, 0.72);
}

.employee-invite-modal.is-hidden {
  display: none;
}

.employee-invite-card {
  width: min(520px, 100%);
  max-height: min(760px, calc(100dvh - 48px));
  overflow: auto;
}

.employee-invite-qr-preview {
  display: grid;
  place-items: center;
  padding: 20px;
  border-radius: 8px;
  background: #ffffff;
}

.employee-invite-qr-preview svg {
  width: min(280px, 72vw);
  height: auto;
}

@media (max-width: 720px) {
  .employee-login-actions {
    display: grid;
  }
}

#view-calendar .filter-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 0;
}

#view-calendar .calendar-grid {
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 8px;
}

#view-calendar .calendar-cell {
  border-radius: 0;
  border-color: #d9e2ec;
  background: #ffffff;
  min-height: 132px;
  max-height: 190px;
  padding: 10px;
  align-content: start;
  overflow: hidden;
}

#view-calendar .calendar-cell.is-current {
  border-color: #dc2626;
  background: #fff5f5;
  box-shadow: inset 4px 0 0 #dc2626;
}

#view-calendar .calendar-cell.is-current > strong {
  color: #b91c1c;
}

#view-calendar .calendar-cell.is-selected-day {
  border-color: #1f6feb;
  box-shadow: inset 4px 0 0 #1f6feb;
}

#view-calendar .calendar-cell.is-current.is-selected-day {
  border-color: #dc2626;
  box-shadow: inset 4px 0 0 #dc2626, 0 0 0 2px rgba(220, 38, 38, 0.16);
}

#view-calendar .calendar-chip {
  border-radius: 0;
  background: #132033;
  color: #ffffff;
  min-height: 32px;
  width: 100%;
  gap: 8px;
  padding: 0 10px 0 0;
  overflow: hidden;
  white-space: nowrap;
}

#view-calendar .calendar-chip[class*="calendar-type-"] {
  background: var(--calendar-type-bg);
  color: var(--calendar-type-fg);
}

#view-calendar .calendar-chip-icon {
  align-self: stretch;
  width: 34px;
  min-height: 32px;
  background: #020617;
  color: #ffffff;
  font-size: 0.9rem;
}

#view-calendar .calendar-chip-title {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-calendar .calendar-more-button {
  width: 100%;
  min-height: 26px;
  border: 1px solid #d9e2ec;
  background: #f8fbff;
  color: #1f6feb;
  font-size: 0.78rem;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

#view-calendar .calendar-legend {
  justify-content: flex-end;
}

#view-calendar .calendar-legend-item {
  border-radius: 0;
  background: #ffffff;
}

#view-calendar .calendar-chip:hover,
#view-calendar .calendar-chip:focus-visible,
#view-calendar .calendar-chip.is-selected {
  outline: 2px solid #132033;
  outline-offset: 2px;
  filter: brightness(1.04);
}

#view-calendar .calendar-tooltip {
  border-radius: 0;
  border: 1px solid #2d3a4d;
}

#view-calendar .ticket-row.is-selected {
  border-color: #1f6feb;
  box-shadow: inset 4px 0 0 #1f6feb;
}

.recurrence-options {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe5f0;
  background: #f8fbff;
}

.recurrence-options.is-hidden,
.recurrence-panel.is-hidden {
  display: none;
}

.recurrence-panel {
  display: grid;
  gap: 10px;
}

.weekday-picker {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.weekday-picker label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  border: 1px solid #dbe5f0;
  background: #fff;
  font-weight: 800;
}

.weekday-picker input {
  width: auto;
}

.recurrence-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#view-tasks .task-board {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#view-tasks .task-row {
  border-left: 4px solid #1f6feb;
}

#view-profile .content-grid {
  grid-template-columns: minmax(520px, 720px);
}

#view-profile .detail-card {
  max-height: none;
}

#view-profile .simple-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1180px) {
  .view-section:not(#view-dashboard):not(#view-qr-posters) > .content-grid,
  #view-profile .content-grid {
    grid-template-columns: 1fr;
  }

  .view-section:not(#view-dashboard):not(#view-qr-posters) .wide-card {
    grid-row: auto;
  }

  #view-calendar .filter-grid,
  #view-calendar .calendar-grid,
  #view-tasks .task-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-tickets .detail-card,
  #view-customers .detail-card,
  #view-objects .detail-card,
  #view-employees .detail-card {
    max-height: none;
  }

  .calendar-jobs-filters,
  .calendar-job-row,
  .employee-assignment-row,
  .employee-reassign-row {
    grid-template-columns: 1fr 1fr;
  }

  .calendar-job-main,
  .employee-assignment-row > div,
  .employee-reassign-row .employee-work-main {
    grid-column: 1 / -1;
  }

  .employee-assignment-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .calendar-day-create {
    display: none;
  }

  body.has-mobile-ticket-sheet {
    overflow: hidden;
  }

  body.has-mobile-ticket-sheet .bottom-nav {
    display: none;
  }

  .view-section:not(#view-dashboard):not(#view-qr-posters) .surface-card {
    padding: 14px;
  }

  #view-tickets {
    position: relative;
    padding-bottom: 86px;
  }

  #view-tickets > .content-grid {
    grid-template-columns: 1fr;
  }

  #view-tickets .wide-card {
    padding: 18px 14px 96px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  #view-tickets .wide-card .section-head {
    display: grid;
    gap: 14px;
    margin-bottom: 4px;
  }

  #view-tickets .wide-card .section-head h3 {
    font-size: 1.35rem;
  }

  #view-tickets #ticket-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
  }

  #view-tickets #ticket-filters .filter-chip {
    min-height: 38px;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.86rem;
    font-weight: 800;
  }

  #view-tickets .detail-card {
    display: none;
  }

  #view-tickets .ticket-list {
    gap: 12px;
    margin-top: 16px;
  }

  #view-tickets .ticket-row {
    position: relative;
    grid-template-columns: 52px minmax(0, 1fr) 18px;
    align-items: start;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
    padding: 16px 14px;
    border-radius: 10px;
    border-left: 4px solid #1f6feb;
    background: #ffffff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
    overflow: hidden;
  }

  #view-tickets .ticket-row.is-question {
    border-left-color: #ef4444;
  }

  #view-tickets .ticket-row.is-progress {
    border-left-color: #ff8a00;
  }

  #view-tickets .ticket-row.is-done {
    border-left-color: #16a34a;
  }

  #view-tickets .ticket-row:hover {
    transform: none;
  }

  #view-tickets .ticket-row.is-selected {
    border-color: var(--border-subtle);
    border-left-color: #1f6feb;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
  }

  #view-tickets .ticket-row.is-selected.is-question {
    border-left-color: #ef4444;
  }

  #view-tickets .ticket-row.is-selected.is-progress {
    border-left-color: #ff8a00;
  }

  #view-tickets .ticket-row.is-selected.is-done {
    border-left-color: #16a34a;
  }

  #view-tickets .ticket-row .ticket-top,
  #view-tickets .ticket-row .supporting-copy,
  #view-tickets .ticket-row .ticket-meta {
    grid-column: 2;
    min-width: 0;
  }

  #view-tickets .ticket-row .ticket-top {
    display: grid;
    gap: 8px;
  }

  #view-tickets .ticket-row .ticket-top > div {
    min-width: 0;
  }

  #view-tickets .ticket-row .ticket-title {
    margin: 2px 0 0;
    font-size: 1rem;
    line-height: 1.22;
    overflow-wrap: anywhere;
  }

  #view-tickets .ticket-row .ticket-subline,
  #view-tickets .ticket-row .supporting-copy {
    margin: 0;
    color: #516174;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  #view-tickets .ticket-row .priority-chip {
    width: max-content;
    max-width: 100%;
    border-radius: 6px;
    justify-self: start;
  }

  #view-tickets .ticket-row .ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
  }

  #view-tickets .ticket-row .ticket-meta span {
    border-radius: 999px;
    background: #edf2f7;
    padding: 4px 8px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #516174;
  }

  .mobile-ticket-card-icon {
    display: inline-flex;
    grid-column: 1;
    grid-row: 1 / span 4;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: #eef5ff;
    color: #1f6feb;
    font-size: 1.2rem;
    font-weight: 900;
  }

  .mobile-ticket-card-chevron {
    display: inline-flex;
    grid-column: 3;
    grid-row: 1 / span 4;
    align-self: center;
    justify-self: end;
    color: #6b7280;
    font-size: 1.25rem;
    font-weight: 900;
  }

  .mobile-ticket-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: block;
    background: rgba(15, 23, 42, 0.34);
    backdrop-filter: blur(2px);
  }

  .mobile-ticket-sheet-backdrop.is-hidden {
    display: none;
  }

  .mobile-ticket-sheet {
    position: fixed;
    inset: auto 0 0;
    z-index: 2110;
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: min(78dvh, 720px);
    min-height: 58dvh;
    border-radius: 24px 24px 0 0;
    background: #ffffff;
    box-shadow: 0 -18px 50px rgba(15, 23, 42, 0.22);
    overflow: hidden;
  }

  .mobile-ticket-sheet.is-hidden {
    display: none;
  }

  .mobile-ticket-sheet-content {
    display: grid;
    gap: 16px;
    max-height: min(78dvh, 720px);
    min-width: 0;
    padding: 14px 18px max(34px, env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .mobile-ticket-sheet-handle {
    width: 46px;
    height: 5px;
    border-radius: 999px;
    background: #b8c4d2;
    justify-self: center;
  }

  .mobile-ticket-sheet-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    min-width: 0;
  }

  .mobile-ticket-sheet-head h3 {
    margin: 4px 0 0;
    color: #071d33;
    font-size: 1.25rem;
    line-height: 1.22;
    overflow-wrap: anywhere;
  }

  .mobile-ticket-id {
    margin: 0;
    color: #516174;
    font-weight: 800;
  }

  .mobile-ticket-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .mobile-ticket-status {
    display: inline-flex;
    max-width: 132px;
    border-radius: 8px;
    padding: 6px 8px;
    background: #eaf2ff;
    color: #1f6feb;
    font-size: 0.74rem;
    font-weight: 900;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .mobile-ticket-status.is-question {
    background: #ffe8e8;
    color: #c02626;
  }

  .mobile-ticket-status.is-progress {
    background: #fff4d6;
    color: #92400e;
  }

  .mobile-ticket-status.is-done {
    background: #dcfce7;
    color: #166534;
  }

  .mobile-ticket-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #132033;
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
  }

  .mobile-ticket-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #516174;
    font-weight: 750;
    line-height: 1.35;
  }

  .mobile-ticket-description,
  .mobile-ticket-edit {
    display: grid;
    gap: 10px;
    min-width: 0;
  }

  .mobile-ticket-description p {
    margin: 0;
    color: #516174;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .mobile-ticket-actions {
    display: grid;
    gap: 0;
    border-top: 1px solid #e5edf5;
  }

  .mobile-ticket-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    border: 0;
    border-bottom: 1px solid #e5edf5;
    background: #ffffff;
    color: #132033;
    padding: 0;
    text-align: left;
    font-weight: 900;
    cursor: pointer;
  }

  .mobile-ticket-action:disabled {
    color: #94a3b8;
    cursor: not-allowed;
  }

  .mobile-ticket-panel {
    display: none;
    min-width: 0;
    max-width: 100%;
    padding: 12px 0 16px;
    border-bottom: 1px solid #e5edf5;
    background: #fbfdff;
  }

  .mobile-ticket-panel.is-open {
    display: block;
  }

  .mobile-ticket-subpanel-head {
    display: grid;
    gap: 5px;
    margin-bottom: 12px;
  }

  .mobile-ticket-subpanel-head strong {
    color: #071d33;
    font-size: 1rem;
  }

  .mobile-ticket-subpanel-head p {
    margin: 0;
    color: #516174;
    font-size: 0.9rem;
    line-height: 1.35;
  }

  .mobile-ticket-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
  }

  .mobile-ticket-form-grid .field-label {
    display: grid;
    gap: 6px;
    min-width: 0;
  }

  .mobile-ticket-form-grid .search-input,
  .mobile-ticket-form-grid .select-input {
    min-width: 0;
    width: 100%;
  }

  .mobile-ticket-form-wide {
    grid-column: 1 / -1;
  }

  .mobile-permission-note {
    display: grid;
    gap: 6px;
    border: 1px solid #fed7aa;
    border-left: 4px solid #ff8a00;
    border-radius: 10px;
    background: #fff7ed;
    padding: 12px;
  }

  .mobile-permission-note strong {
    color: #9a3412;
  }

  .mobile-permission-note p {
    margin: 0;
    color: #7c2d12;
    line-height: 1.35;
  }

  .mobile-contractor-list {
    display: grid;
    gap: 10px;
    min-width: 0;
  }

  .mobile-contractor-card {
    display: grid;
    gap: 8px;
    min-width: 0;
    border: 1px solid #dbe5f0;
    border-left: 4px solid #ff8a00;
    border-radius: 10px;
    background: #ffffff;
    padding: 12px;
  }

  .mobile-contractor-card h4,
  .mobile-contractor-card p {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .mobile-contractor-card h4 {
    color: #071d33;
    font-size: 1rem;
  }

  .mobile-contractor-card p {
    color: #516174;
    line-height: 1.35;
  }

  .mobile-ticket-inline-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .mobile-ticket-inline-actions .secondary-action {
    width: 100%;
    min-width: 0;
  }

  .mobile-object-info-grid {
    display: grid;
    gap: 10px;
    margin: 0;
    min-width: 0;
  }

  .mobile-object-info-grid div {
    display: grid;
    gap: 4px;
    min-width: 0;
    border: 1px solid #dbe5f0;
    border-radius: 10px;
    background: #ffffff;
    padding: 10px 12px;
  }

  .mobile-object-info-grid dt {
    color: #516174;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .mobile-object-info-grid dd {
    margin: 0;
    color: #132033;
    font-weight: 800;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .mobile-ticket-history-list,
  .mobile-ticket-history-list li,
  .mobile-ticket-file-list,
  .mobile-ticket-file-list li {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .mobile-ticket-history-list {
    margin-top: 0;
  }

  .mobile-ticket-history-list li {
    border-radius: 10px;
    background: #ffffff;
  }

  .mobile-ticket-history-list .ticket-public-note-item {
    border-left: 5px solid #0b72f0;
    background: #eff6ff;
    padding: 0;
  }

  .mobile-ticket-history-list .ticket-internal-note-item {
    border-left: 5px solid #334155;
    background: #f1f5f9;
    padding: 0;
  }

  .mobile-ticket-primary {
    width: 100%;
    min-height: 48px;
    border-radius: 8px;
  }

  .mobile-ticket-edit {
    border-top: 1px solid #e5edf5;
    padding-top: 14px;
  }

  .mobile-ticket-edit .field-label {
    display: grid;
    gap: 7px;
  }

  .mobile-ticket-edit .secondary-action {
    width: 100%;
  }

  .view-section:not(#view-dashboard):not(#view-qr-posters) .detail-grid,
  #view-customers .detail-card > .detail-stack,
  #view-objects .detail-card > .detail-stack,
  #view-employees .detail-card > .detail-stack,
  #view-calendar .filter-grid,
  #view-calendar .calendar-grid,
  #view-tasks .task-board,
  #view-profile .simple-list,
  .public-service-options,
  .custom-service-row {
    grid-template-columns: 1fr;
  }

  #view-tickets #ticket-calendar-card {
    grid-template-columns: 1fr;
  }

  .object-color-control,
  .object-contact-panel {
    grid-template-columns: 1fr;
  }

  .object-form-panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .calendar-jobs-modal {
    padding: 10px;
    align-items: stretch;
  }

  .calendar-jobs-panel {
    max-height: 94vh;
    padding: 14px;
  }

  .calendar-jobs-filters,
  .calendar-job-row,
  .employee-assignment-row,
  .employee-reassign-row {
    grid-template-columns: 1fr;
  }

  .calendar-job-main,
  .employee-assignment-row > div,
  .employee-reassign-row .employee-work-main {
    grid-column: auto;
  }

  .employee-assignment-summary {
    grid-template-columns: 1fr;
  }
}

/* QR navigation unification: keep the main blue sidebar, remove the green second menu */
.app-shell:has(#view-qr-posters.is-active) {
  grid-template-columns: 292px minmax(0, 1fr);
}

.app-shell:has(#view-qr-posters.is-active) > .sidebar {
  display: flex;
}

.main-shell:has(#view-qr-posters.is-active) {
  padding: 18px;
  gap: 14px;
  background: transparent;
}

.main-shell:has(#view-qr-posters.is-active) > .topbar {
  display: flex;
}

.qr-editor-view.is-active .qr-editor-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-height: auto;
}

.qr-editor-view .qr-reference-sidebar {
  display: block;
  grid-row: auto;
  min-height: 0;
  padding: 14px 16px;
  border-radius: 0;
  border: 1px solid #cfd9e5;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.07);
}

.qr-editor-view .qr-reference-brand,
.qr-editor-view .qr-reference-nav,
.qr-editor-view .qr-reference-subnav,
.qr-editor-view .qr-selected-object-summary {
  display: none;
}

.qr-editor-view .qr-sidebar-object-picker {
  display: grid;
  grid-template-columns: minmax(160px, 0.45fr) minmax(220px, 1fr) minmax(220px, 1fr);
  align-items: end;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.qr-editor-view .qr-sidebar-object-picker .field-label {
  align-self: center;
  margin: 0;
  color: #516174;
}

.qr-editor-view .qr-sidebar-object-picker .search-input,
.qr-editor-view .qr-sidebar-object-picker .select-input {
  min-width: 0;
  width: 100%;
  border-radius: 0;
  border: 1px solid #cbd7e3;
  background: #ffffff;
  color: var(--text-primary);
}

.qr-editor-view .qr-editor-shell {
  border-radius: 0;
  border: 1px solid #cfd9e5;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.07);
}

.qr-editor-view .qr-editor-topbar {
  min-height: 0;
}

.qr-editor-view .qr-editor-workspace {
  height: calc(100vh - 286px);
  min-height: 520px;
}

.qr-editor-view .qr-reference-nav-item.is-active {
  background: #1f6feb;
}

@media (max-width: 1180px) {
  .app-shell:has(#view-qr-posters.is-active) {
    grid-template-columns: 1fr;
  }

  .qr-editor-view .qr-sidebar-object-picker {
    grid-template-columns: 1fr;
  }

  .qr-editor-view .qr-editor-workspace {
    height: auto;
    min-height: 0;
  }
}

/* QR poster templates: final live-preview/PDF overrides */
.qr-editor-view .qr-preview-paper[data-qr-template] {
  border-color: var(--qr-primary, #08752e);
}

.qr-editor-view .qr-preview-paper[data-qr-template] .qr-preview-title-group h2 {
  color: var(--qr-primary, #08752e) !important;
}

.qr-editor-view .qr-preview-paper[data-qr-template] .qr-preview-title-group .detail-copy,
.qr-editor-view .qr-preview-paper[data-qr-template] .qr-preview-subtitle {
  color: var(--qr-secondary, #1f2937) !important;
}

.qr-editor-view .qr-preview-paper[data-qr-template] .qr-preview-kicker,
.qr-editor-view .qr-preview-paper[data-qr-template] .qr-preview-copy-column h4,
.qr-editor-view .qr-preview-paper[data-qr-template] .qr-preview-footer {
  color: var(--qr-primary, #08752e) !important;
}

.qr-editor-view .qr-preview-paper[data-qr-template] .qr-preview-richtext li::before {
  background: var(--qr-primary, #08752e) !important;
}

.qr-editor-view .qr-preview-paper[data-qr-template] .qr-preview-code-block h4,
.qr-editor-view .qr-preview-paper[data-qr-template] .qr-preview-contact {
  background: linear-gradient(135deg, var(--qr-primary, #08752e), var(--qr-secondary, #075f29)) !important;
}

.qr-editor-view .qr-preview-paper[data-qr-template="modern-corporate"] {
  background: linear-gradient(180deg, #fff 0%, var(--qr-background, #f4f8ff) 100%) !important;
}

.qr-editor-view .qr-preview-paper[data-qr-template="modern-corporate"] .qr-preview-header {
  padding-top: 28px;
  border-bottom: 10px solid color-mix(in srgb, var(--qr-primary, #0f6fb5) 16%, #fff);
}

.qr-editor-view .qr-preview-paper[data-qr-template="modern-corporate"] .qr-preview-meta,
.qr-editor-view .qr-preview-paper[data-qr-template="modern-corporate"] .qr-preview-code-block {
  border: 1px solid color-mix(in srgb, var(--qr-primary, #0f6fb5) 18%, #fff);
  background: color-mix(in srgb, var(--qr-primary, #0f6fb5) 7%, #fff) !important;
}

.qr-editor-view .qr-preview-paper[data-qr-template="modern-corporate"] .qr-preview-layout {
  grid-template-columns: minmax(0, 1.12fr) minmax(230px, 0.88fr) !important;
}

.qr-editor-view .qr-preview-paper[data-qr-template="dark-professional"] {
  background: linear-gradient(160deg, #071426 0%, #10253f 100%) !important;
  border-color: color-mix(in srgb, var(--qr-primary, #64f0ff) 70%, #fff);
  color: #edf7ff;
}

.qr-editor-view .qr-preview-paper[data-qr-template="dark-professional"] .qr-preview-header {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.qr-editor-view .qr-preview-paper[data-qr-template="dark-professional"] .qr-preview-meta,
.qr-editor-view .qr-preview-paper[data-qr-template="dark-professional"] .qr-preview-code-block,
.qr-editor-view .qr-preview-paper[data-qr-template="dark-professional"] .qr-preview-contact,
.qr-editor-view .qr-preview-paper[data-qr-template="dark-professional"] .qr-preview-footer {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #edf7ff !important;
  border-color: rgba(255, 255, 255, 0.14);
}

.qr-editor-view .qr-preview-paper[data-qr-template="dark-professional"] .qr-preview-layout {
  grid-template-columns: minmax(0, 0.94fr) minmax(250px, 1.06fr) !important;
}

.qr-editor-view .qr-preview-paper[data-qr-template="immobilien-expose"] {
  background: linear-gradient(180deg, #fff 0%, var(--qr-background, #f8fffb) 100%) !important;
}

.qr-editor-view .qr-preview-paper[data-qr-template="immobilien-expose"]::before {
  content: "";
  display: block;
  min-height: 94px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--qr-primary, #217a52) 22%, transparent), rgba(255, 255, 255, 0.75)),
    repeating-linear-gradient(90deg, rgba(15, 23, 42, 0.06) 0 1px, transparent 1px 14px);
}

.qr-editor-view .qr-preview-paper[data-qr-template="immobilien-expose"] .qr-preview-layout {
  grid-template-columns: 1fr minmax(240px, 0.72fr) !important;
  align-items: start;
}

.qr-editor-view .qr-preview-paper[data-qr-template="immobilien-expose"] .qr-preview-meta {
  border-left: 7px solid var(--qr-primary, #217a52);
}

.qr-editor-view .qr-preview-paper[data-qr-template="immobilien-expose"] .qr-preview-code-block {
  justify-self: end;
  margin-top: 14px;
}

.qr-editor-view .qr-preview-paper[data-qr-template="minimal-clean"] {
  background: #fff !important;
  border-radius: 0;
  box-shadow: none;
}

.qr-editor-view .qr-preview-paper[data-qr-template="minimal-clean"] .qr-preview-header {
  align-items: flex-start;
  text-align: left;
  padding-left: 44px;
  padding-right: 44px;
}

.qr-editor-view .qr-preview-paper[data-qr-template="minimal-clean"] .qr-preview-layout {
  grid-template-columns: 1fr !important;
  gap: 12px;
}

.qr-editor-view .qr-preview-paper[data-qr-template="minimal-clean"] .qr-preview-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 16px 0;
  border-top: 1px solid rgba(15, 23, 42, 0.14);
  border-bottom: 1px solid rgba(15, 23, 42, 0.14);
  border-left: none;
  border-right: none;
  border-radius: 0;
  background: transparent !important;
}

.qr-editor-view .qr-preview-paper[data-qr-template="minimal-clean"] .qr-preview-contact {
  color: var(--qr-secondary, #1f2937) !important;
  background: #f8fafc !important;
  border-top: 2px solid var(--qr-primary, #0f172a);
}

.qr-editor-view .qr-preview-paper[data-qr-template="premium-service"] {
  background: linear-gradient(155deg, #f7fdff 0%, var(--qr-background, #f5fdff) 100%) !important;
}

.qr-editor-view .qr-preview-paper[data-qr-template="premium-service"] .qr-preview-header {
  flex-direction: row-reverse;
  text-align: left;
  align-items: center;
  border-bottom: 1px dashed color-mix(in srgb, var(--qr-primary, #0b5d68) 40%, #fff);
}

.qr-editor-view .qr-preview-paper[data-qr-template="premium-service"] .qr-preview-layout {
  grid-template-columns: minmax(250px, 1fr) minmax(220px, 0.68fr) !important;
  align-items: stretch;
}

.qr-editor-view .qr-preview-paper[data-qr-template="premium-service"] .qr-preview-code-block {
  border: 2px solid color-mix(in srgb, var(--qr-primary, #0b5d68) 20%, #fff);
}

.qr-editor-view .qr-preview-paper[data-qr-template="premium-service"] .qr-preview-contact {
  position: relative;
  padding-top: 30px;
}

.qr-editor-view .qr-preview-paper[data-qr-template="premium-service"] .qr-preview-contact::before {
  content: "Servicefenster";
  position: absolute;
  top: 10px;
  left: 16px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--qr-secondary, #043542) 82%, #fff);
}

.color-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0;
}

.color-preset-swatch {
  width: 2rem;
  height: 2rem;
  border: 2px solid rgba(185, 200, 216, 0.9);
  background: var(--swatch-color, #64748b);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.color-preset-swatch.is-active {
  border-color: #132033;
  box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.16);
}

.public-service-config,
.object-contractor-config {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d9e2ec;
  background: #f8fafc;
}

.public-service-config h4,
.object-contractor-config h4 {
  margin: 0;
  font-size: 0.98rem;
}

.public-service-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.public-service-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #d9e2ec;
  background: #ffffff;
  color: #132033;
  font-weight: 700;
}

.public-service-option input {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.public-service-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.compact-option {
  white-space: nowrap;
}

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

.custom-service-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

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

.contractor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d9e2ec;
  background: #ffffff;
  color: #132033;
  text-align: left;
  cursor: pointer;
}

.contractor-row.is-selected {
  border-color: #1f6feb;
  box-shadow: inset 3px 0 0 #1f6feb;
}

.contractor-row strong,
.contractor-row small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.contractor-row small {
  margin-top: 3px;
  color: #60708a;
  font-weight: 700;
}

.contractor-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.contractor-form textarea,
.contractor-form .button-row {
  grid-column: 1 / -1;
}

.contractor-ticket-card {
  padding: 12px;
  border: 1px solid #d9e2ec;
  background: #f8fafc;
}

.contractor-ticket-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.contractor-ticket-summary strong,
.contractor-ticket-summary p {
  display: block;
  margin: 0 0 4px;
}

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

.contractor-detail {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #d9e2ec;
  background: #ffffff;
}

.contractor-detail p {
  margin: 0;
  overflow-wrap: anywhere;
}

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

.permission-option {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #d9e2ec;
  background: #ffffff;
  color: #132033;
  font-weight: 700;
}

.permission-option input {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.permission-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.permission-option small {
  display: block;
  flex: 1 0 100%;
  padding-left: 1.6rem;
  color: #607088;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
}

@media (max-width: 720px) {
  .public-service-options,
  .custom-service-row,
  .permission-grid,
  .contractor-form,
  .contractor-row {
    grid-template-columns: 1fr;
  }
}

/* FoxTask dashboard mockup refresh */
:root {
  --foxtask-orange: #ff6b00;
  --foxtask-orange-soft: #fff1e8;
  --foxtask-navy: #071d33;
  --foxtask-line: #e6edf5;
  --foxtask-card-shadow: 0 14px 36px rgba(15, 32, 51, 0.08);
}

body {
  background: #f5f8fc;
}

.app-shell {
  grid-template-columns: 264px minmax(0, 1fr);
  background: #f5f8fc;
}

.sidebar {
  min-height: 100vh;
  padding: 22px 16px;
  gap: 20px;
  background: linear-gradient(180deg, #06182c 0%, #071d33 52%, #061527 100%);
}

.sidebar::before,
.sidebar::after {
  display: none;
}

.brand-block {
  min-height: 44px;
  margin-bottom: 8px;
}

.brand-block .eyebrow {
  display: none;
}

.fixfox-logo-sidebar {
  width: 170px;
  max-height: 58px;
  object-fit: contain;
  object-position: left center;
}

.nav-list {
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.88);
  background: transparent;
  font-weight: 700;
}

.nav-label {
  min-width: 0;
}

.nav-item.has-new-ticket {
  align-items: center;
}

.nav-ticket-alert {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: #ef1d2f;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(239, 29, 47, 0.16), 0 8px 18px rgba(239, 29, 47, 0.28);
  text-transform: uppercase;
}

.nav-ticket-alert strong {
  font-size: 0.58rem;
  font-weight: 1000;
  letter-spacing: 0.06em;
  line-height: 1;
  white-space: nowrap;
}

.nav-ticket-alert em {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  background: #ffffff;
  color: #b91c1c;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 1000;
  line-height: 1;
}

.nav-item.is-active .nav-ticket-alert,
.nav-item:hover .nav-ticket-alert {
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14), 0 8px 18px rgba(185, 28, 28, 0.34);
}

.nav-icon {
  width: 22px;
  display: inline-grid;
  place-items: center;
  font-size: 1rem;
}

.nav-item.is-active,
.nav-item:hover {
  color: #fff;
  background: var(--foxtask-orange);
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(255, 107, 0, 0.24);
}

.nav-item.is-disabled {
  opacity: 0.72;
  cursor: default;
}

.nav-item.is-disabled:hover {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.sidebar-panel {
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

.main-shell {
  gap: 22px;
  padding: 0 28px 30px;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 76px;
  margin: 0 -28px;
  padding: 14px 28px;
  border: 0;
  border-bottom: 1px solid var(--foxtask-line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
  backdrop-filter: blur(14px);
}

.topbar-title {
  min-width: 170px;
}

.topbar-title h2 {
  font-size: 1.08rem;
  font-weight: 900;
}

.topbar-actions {
  display: grid;
  grid-template-columns: minmax(280px, 560px) auto auto auto;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  flex: 1;
}

.topbar-actions .search-input {
  width: 100%;
  min-width: 0;
  border-radius: 10px;
  background: #fff;
}

.global-search-box {
  position: relative;
  min-width: 0;
  z-index: 95;
}

.global-search-box .search-input {
  width: 100%;
  min-width: 0;
}

.global-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 1900;
  display: grid;
  gap: 6px;
  max-height: min(62dvh, 460px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-solid);
  box-shadow: 0 18px 50px rgba(2, 8, 23, 0.22);
}

.global-search-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 10px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
}

.global-search-result:hover,
.global-search-result:focus-visible {
  border-color: var(--color-primary);
  outline: none;
}

.global-search-result span {
  align-self: start;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(30, 123, 255, 0.12);
  color: var(--color-primary);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.global-search-result strong {
  min-width: 0;
  color: var(--color-text);
  font-size: 0.92rem;
}

.global-search-result small {
  grid-column: 2;
  color: var(--color-muted);
  font-weight: 750;
}

.global-search-state {
  padding: 12px;
  color: var(--color-muted);
  font-weight: 800;
}

.topbar-nav {
  display: flex;
}

.icon-action,
.date-picker-action {
  min-height: 42px;
  border: 1px solid var(--foxtask-line);
  border-radius: 10px;
  background: #fff;
  color: #0f2038;
  cursor: pointer;
}

.icon-action {
  position: relative;
  width: 44px;
  display: grid;
  place-items: center;
}

.topbar-menu {
  display: none;
}

.date-picker-action {
  padding: 0 16px;
  min-width: 186px;
  text-align: left;
}

.topbar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 170px;
}

.profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--foxtask-orange-soft);
  color: var(--foxtask-orange);
  font-weight: 900;
}

.topbar-profile strong,
.topbar-profile small {
  display: block;
}

.topbar-profile small {
  color: #64748b;
}

#view-dashboard {
  gap: 26px;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 18px;
}

.dashboard-kpi-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  min-height: 138px;
  padding: 22px;
  border: 1px solid var(--foxtask-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--foxtask-card-shadow);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.dashboard-kpi-card:hover,
.dashboard-kpi-card.is-active {
  transform: translateY(-2px);
  border-color: rgba(255, 107, 0, 0.45);
  box-shadow: 0 18px 42px rgba(255, 107, 0, 0.13);
}

.dashboard-kpi-card p {
  margin: 0 0 14px;
  color: #334155;
  font-weight: 800;
}

.dashboard-kpi-card strong {
  display: block;
  color: #071d33;
  font-size: 2.35rem;
  line-height: 1;
}

.dashboard-kpi-card span:not(.dashboard-kpi-icon) {
  display: block;
  margin-top: 12px;
  color: #64748b;
  font-size: 0.85rem;
}

.dashboard-kpi-icon {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.dashboard-kpi-icon.blue { background: #eef4ff; color: #2563eb; }
.dashboard-kpi-icon.orange { background: #fff1e8; color: #ff6b00; }
.dashboard-kpi-icon.sky { background: #edf7ff; color: #1774aa; }
.dashboard-kpi-icon.cobalt { background: #eef4ff; color: #1d4ed8; }
.dashboard-kpi-icon.red { background: #fff0f0; color: #ef4444; }

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(320px, 1.1fr) minmax(280px, 0.75fr);
  gap: 20px;
  align-items: start;
}

.dashboard-panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--foxtask-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--foxtask-card-shadow);
}

.dashboard-panel-large {
  min-height: 384px;
}

.dashboard-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.dashboard-panel-head h3 {
  margin: 0;
  color: #071d33;
  font-size: 1.05rem;
}

.dashboard-panel-head h3 span {
  color: #64748b;
  font-weight: 500;
}

.link-action {
  padding: 0;
  background: transparent;
  color: #005bd3;
  font-weight: 800;
  cursor: pointer;
}

.dashboard-list {
  max-height: 304px;
  overflow: auto;
  padding-right: 6px;
}

.dashboard-task-row,
.dashboard-ticket-row {
  width: 100%;
  display: grid;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 0;
  border-bottom: 1px solid #edf2f7;
  background: transparent;
  text-align: left;
  color: #0f2038;
  cursor: pointer;
}

.dashboard-mini-action {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(88px, 0.2fr) minmax(0, 1fr);
  gap: 8px 18px;
  align-items: start;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.dashboard-mini-action small {
  grid-column: 2;
}

.dashboard-task-row:focus-visible,
.dashboard-ticket-row:focus-visible,
.dashboard-mini-action:focus-visible {
  outline: 3px solid rgba(31, 111, 235, 0.28);
  outline-offset: 3px;
}

.dashboard-focus-target {
  animation: dashboard-focus-pulse 1.6s ease-out;
}

@keyframes dashboard-focus-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 106, 0, 0.52);
  }
  45% {
    box-shadow: 0 0 0 6px rgba(255, 106, 0, 0.24);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 106, 0, 0);
  }
}

.dashboard-task-row {
  grid-template-columns: 24px minmax(0, 1fr) auto auto;
}

.dashboard-ticket-row {
  grid-template-columns: 14px minmax(0, 1fr) auto auto;
}

.dashboard-task-row strong,
.dashboard-ticket-row strong,
.dashboard-worker-row strong,
.dashboard-mini-list strong {
  display: block;
  color: #0f2038;
  font-size: 0.9rem;
}

.dashboard-task-row small,
.dashboard-ticket-row small,
.dashboard-worker-row small,
.dashboard-mini-list small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 0.78rem;
}

.dashboard-check {
  width: 18px;
  height: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
}

.dashboard-row-meta,
.dashboard-ticket-code,
.dashboard-ticket-due {
  color: #475569;
  font-size: 0.78rem;
}

.dashboard-ticket-due {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.dashboard-status-badge {
  padding: 6px 9px;
  border-radius: 7px;
  background: #ecfdf3;
  color: #168044;
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 900;
}

.dashboard-status-badge.warning { background: #fff4e6; color: #f97316; }
.dashboard-status-badge.danger { background: #ffecec; color: #ef4444; }
.dashboard-status-badge.neutral { background: #eef2f7; color: #475569; }

.ticket-timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 0 4px #eef4ff;
}

.ticket-timeline-dot.warning { background: #ff6b00; box-shadow: 0 0 0 4px #fff1e8; }
.ticket-timeline-dot.danger { background: #ef4444; box-shadow: 0 0 0 4px #fff0f0; }

.dashboard-more {
  margin-top: 14px;
  padding: 0;
  background: transparent;
  color: #005bd3;
  font-weight: 800;
  cursor: pointer;
}

.dashboard-empty {
  margin: 18px 0;
  color: #64748b;
}

.dashboard-qr-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.dashboard-big-number {
  display: block;
  color: #071d33;
  font-size: 2.5rem;
  line-height: 1;
}

.dashboard-donut {
  width: 104px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(#ff6b00 0 40%, #2563eb 40% 72%, #84a83c 72% 100%);
  position: relative;
}

.dashboard-donut::after {
  content: "";
  position: absolute;
  inset: 25px;
  border-radius: 50%;
  background: #fff;
}

.dashboard-status-list,
.dashboard-worker-list,
.dashboard-mini-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  gap: 12px;
}

.dashboard-status-list li {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-size: 0.88rem;
}

.dashboard-status-list span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dashboard-status-list .orange { background: #ff6b00; }
.dashboard-status-list .blue { background: #2563eb; }
.dashboard-status-list .green { background: #84a83c; }

.dashboard-mini-list li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  column-gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf2f7;
}

.dashboard-mini-list li > span {
  color: #2563eb;
  font-size: 0.82rem;
}

.timeline-list li {
  border-left: 2px solid #2563eb;
  padding-left: 12px;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quick-action-grid button {
  min-height: 92px;
  display: grid;
  place-items: center;
  gap: 8px;
  border: 1px solid var(--foxtask-line);
  border-radius: 10px;
  background: #fff;
  color: #0f2038;
  font-weight: 800;
  cursor: pointer;
}

.quick-action-grid span {
  color: var(--foxtask-orange);
  font-size: 1.6rem;
}

.dashboard-worker-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.worker-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff1e8;
  color: var(--foxtask-orange);
  font-weight: 900;
}

.dashboard-worker-row em {
  padding: 6px 9px;
  border-radius: 7px;
  font-style: normal;
  font-size: 0.76rem;
  font-weight: 900;
}

.dashboard-worker-row .on-site { background: #dcfce7; color: #168044; }
.dashboard-worker-row .away { background: #fff1e8; color: #f97316; }
.dashboard-worker-row .active { background: #dcfce7; color: #168044; }
.dashboard-worker-row .inactive { background: #f1f5f9; color: #64748b; }
.dashboard-worker-row .vacation { background: #dbeafe; color: #2563eb; }
.dashboard-worker-row .sick { background: #fee2e2; color: #dc2626; }
.dashboard-worker-row .disabled { background: #e2e8f0; color: #475569; }
.dashboard-worker-row .offline { background: #f1f5f9; color: #64748b; }

.dashboard-stat-card {
  grid-column: 1 / -1;
}

.dashboard-stat-frame-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.dashboard-stat-frame {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--foxtask-line);
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.dashboard-stat-frame.is-active {
  border-color: var(--foxtask-orange);
  background: #fff4e8;
  color: var(--foxtask-orange);
}

.dashboard-stat-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.dashboard-stat-kpi {
  min-height: 82px;
  padding: 14px;
  border: 1px solid #e5edf6;
  border-radius: 10px;
  background: #f8fafc;
}

.dashboard-stat-kpi span {
  display: block;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
}

.dashboard-stat-kpi strong {
  display: block;
  margin-top: 8px;
  color: #071d33;
  font-size: 1.85rem;
  line-height: 1;
}

.dashboard-stat-kpi.stat-new { border-left: 4px solid var(--foxtask-orange); }
.dashboard-stat-kpi.stat-done { border-left: 4px solid #44b77b; }
.dashboard-stat-kpi.stat-active { border-left: 4px solid #2563eb; }
.dashboard-stat-kpi.stat-open { border-left: 4px solid #ef4444; }
.dashboard-stat-kpi.stat-rate { border-left: 4px solid #0f2038; }

.dashboard-stat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: stretch;
}

.dashboard-line-chart {
  --dashboard-stat-columns: 7;
  min-height: 248px;
  display: grid;
  grid-template-columns: repeat(var(--dashboard-stat-columns), minmax(0, 1fr));
  gap: clamp(3px, 0.55vw, 10px);
  align-items: end;
  padding: 34px 18px 38px;
  border: 1px solid #e5edf6;
  border-radius: 12px;
  background:
    linear-gradient(to top, rgba(226, 232, 240, 0.95) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  overflow: visible;
}

.chart-day {
  height: 168px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: stretch;
  justify-items: center;
  position: relative;
  min-width: 0;
  outline: none;
}

.chart-day::before {
  content: "";
  position: absolute;
  inset: -12px 0 24px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.06);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.chart-day:hover::before,
.chart-day:focus-visible::before {
  opacity: 1;
  transform: translateY(0);
}

.chart-bars {
  width: min(100%, 74px);
  display: grid;
  grid-template-columns: repeat(3, minmax(8px, 1fr));
  align-items: end;
  gap: clamp(2px, 0.35vw, 5px);
  align-self: end;
}

.chart-day small {
  margin-top: 12px;
  color: #64748b;
  font-size: clamp(0.62rem, 0.7vw, 0.74rem);
  font-weight: 800;
  white-space: nowrap;
}

.chart-bar {
  min-height: 5px;
  border-radius: 999px 999px 4px 4px;
  position: relative;
  box-shadow: 0 10px 18px rgba(15, 32, 51, 0.08);
  transition: transform 140ms ease, filter 140ms ease, opacity 140ms ease;
}

.chart-day:hover .chart-bar,
.chart-day:focus-visible .chart-bar {
  transform: translateY(-4px);
  filter: saturate(1.08);
}

.chart-day.is-empty .chart-bar {
  opacity: 0.36;
}

.chart-bar em {
  position: absolute;
  left: 50%;
  top: -20px;
  transform: translateX(-50%);
  color: #475569;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 800;
}

.dashboard-line-chart[style*="24"] .chart-bar em {
  display: none;
}

.dashboard-line-chart[style*="24"] {
  padding-inline: 12px;
}

.dashboard-line-chart[style*="24"] .chart-bars {
  width: min(100%, 46px);
  grid-template-columns: repeat(3, minmax(4px, 1fr));
}

.chart-new,
.legend-new {
  background: linear-gradient(180deg, #ff8a24, var(--foxtask-orange));
}

.chart-active,
.legend-active {
  background: linear-gradient(180deg, #4f83ff, #2563eb);
}

.chart-done,
.legend-done {
  background: linear-gradient(180deg, #5fd08f, #44b77b);
}

.chart-tooltip {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: calc(100% + 14px);
  width: 220px;
  display: none;
  gap: 7px;
  padding: 12px;
  border: 1px solid #dbe6f3;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(15, 32, 51, 0.18);
  color: #0f172a;
  transform: translateX(-50%);
  text-align: left;
}

.chart-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 12px;
  border-right: 1px solid #dbe6f3;
  border-bottom: 1px solid #dbe6f3;
  background: #fff;
  transform: translateX(-50%) rotate(45deg);
}

.chart-day:hover .chart-tooltip,
.chart-day:focus-visible .chart-tooltip {
  display: grid;
}

.chart-tooltip strong {
  font-size: 0.88rem;
}

.chart-tooltip span {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: #52657d;
  font-size: 0.8rem;
}

.chart-tooltip i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.chart-tooltip b {
  color: #071d33;
}

.chart-tooltip .chart-tooltip-total {
  grid-template-columns: minmax(0, 1fr) auto;
  padding-top: 7px;
  border-top: 1px solid #edf2f7;
  font-weight: 900;
}

.dashboard-stat-summary {
  padding: 16px;
  border: 1px solid #e5edf6;
  border-radius: 10px;
  background: #f8fafc;
}

.dashboard-stat-summary h4 {
  margin: 0 0 12px;
  color: #071d33;
  font-size: 0.98rem;
}

.dashboard-stat-summary dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.dashboard-stat-summary div {
  padding-bottom: 10px;
  border-bottom: 1px solid #e5edf6;
}

.dashboard-stat-summary div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.dashboard-stat-summary dt {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-stat-summary dd {
  margin: 4px 0 0;
  color: #071d33;
  font-size: 1rem;
  font-weight: 900;
}

.dashboard-chart-legend {
  display: flex;
  gap: 18px;
  justify-content: flex-end;
  margin-top: 28px;
  color: #334155;
  font-size: 0.85rem;
}

.dashboard-chart-legend i {
  display: inline-block;
  width: 12px;
  height: 8px;
  margin-right: 6px;
  border-radius: 999px;
}

.dashboard-setup-assistant {
  display: grid;
  gap: 18px;
  border-color: #d7e2ef;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.dashboard-setup-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5edf6;
}

.dashboard-setup-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.dashboard-setup-head h3 {
  margin: 4px 0 0;
  color: #071d33;
  font-size: 1.35rem;
}

.dashboard-setup-head span {
  color: #64748b;
  font-weight: 800;
}

.dashboard-setup-actions .secondary-action {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.dashboard-setup-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-setup-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 5px 14px;
  min-height: 108px;
  padding: 16px;
  color: #071d33;
  text-decoration: none;
  border: 1px solid #d8e3ef;
  border-radius: 10px;
  background: #ffffff;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-setup-card:hover,
.dashboard-setup-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 107, 0, 0.55);
  box-shadow: 0 16px 36px rgba(15, 32, 51, 0.12);
}

.app-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 3200;
  pointer-events: none;
}

.app-tour-overlay.is-hidden {
  display: none;
}

.app-tour-scrim {
  position: absolute;
  inset: 0;
  background: rgba(3, 12, 24, 0.58);
  backdrop-filter: blur(1.5px);
  pointer-events: none;
}

.app-tour-overlay.has-target .app-tour-scrim {
  background: transparent;
  backdrop-filter: none;
}

.app-tour-focus-clone {
  position: fixed;
  z-index: 3201;
  overflow: hidden;
  padding: 8px;
  border-radius: 12px;
  pointer-events: none;
  isolation: isolate;
}

.app-tour-focus-clone.is-hidden {
  display: none;
}

.app-tour-focus-clone > * {
  width: 100%;
  min-width: 100%;
  height: 100%;
  margin: 0 !important;
  filter: none !important;
  opacity: 1 !important;
  transform: none !important;
  pointer-events: none !important;
}

.app-tour-focus-clone[style*="pointer-events: auto"] {
  cursor: pointer;
}

.app-tour-highlight {
  position: fixed;
  z-index: 3202;
  border: 2px solid rgba(255, 107, 0, 0.96);
  border-radius: 12px;
  box-shadow:
    0 0 0 9999px rgba(3, 12, 24, 0.52),
    0 18px 48px rgba(15, 23, 42, 0.32),
    0 0 0 6px rgba(255, 107, 0, 0.18);
  pointer-events: none;
  transition: left 0.22s ease, top 0.22s ease, width 0.22s ease, height 0.22s ease;
}

.app-tour-highlight.is-hidden {
  display: none;
}

.app-tour-card {
  position: fixed;
  z-index: 3203;
  width: min(420px, calc(100vw - 28px));
  padding: 22px;
  border: 1px solid rgba(214, 226, 239, 0.95);
  border-radius: 8px;
  background: #ffffff;
  color: #071d33;
  box-shadow: 0 24px 70px rgba(8, 18, 32, 0.28);
  pointer-events: auto;
}

.app-tour-card.is-centered {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.app-tour-step {
  min-height: 1rem;
  margin: 0 0 6px;
  color: #ff6b00;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.app-tour-card h3 {
  margin: 0 0 10px;
  color: #071d33;
  font-size: 1.35rem;
}

.app-tour-card p {
  margin: 0;
  color: #475569;
  font-size: 0.98rem;
  line-height: 1.55;
}

.app-tour-actions {
  display: grid;
  grid-template-areas:
    "dismiss"
    "nav";
  gap: 10px;
  margin-top: 20px;
}

.app-tour-dismiss-actions,
.app-tour-nav-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.app-tour-dismiss-actions {
  grid-area: dismiss;
}

.app-tour-nav-actions {
  grid-area: nav;
  align-items: center;
  flex-wrap: nowrap;
}

.app-tour-actions .secondary-action,
.app-tour-actions .primary-action {
  min-height: 38px;
}

.app-tour-nav-actions .primary-action {
  flex: 0 0 auto;
  min-width: 118px;
}

.page-help-button {
  min-width: 84px;
  white-space: nowrap;
}

.employee-save-top {
  min-height: 38px;
  padding-inline: 18px;
}

body.app-tour-active {
  overflow: hidden;
}

.app-help-settings-card {
  align-items: center;
}

.app-help-settings-card .secondary-action {
  justify-self: end;
  min-height: 38px;
}

.dashboard-setup-card span {
  display: grid;
  grid-row: span 2;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--foxtask-orange);
  font-size: 1.22rem;
  font-weight: 900;
  background: #fff2e8;
  border-radius: 999px;
}

.dashboard-setup-card strong {
  align-self: end;
  font-size: 0.98rem;
}

.dashboard-setup-card small {
  color: #52657d;
  line-height: 1.35;
}

.dashboard-setup-card.is-done {
  border-color: #bde8cf;
  background: #f0fbf5;
}

.dashboard-setup-card.is-done span {
  color: #168044;
  background: #dff7e9;
}

.employee-dashboard-card {
  display: grid;
  gap: 18px;
}

.employee-dashboard-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.employee-dashboard-summary span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #dbe5f0;
  border-radius: 8px;
  padding: 6px 10px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 900;
}

.employee-dashboard-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.employee-work-section {
  min-width: 0;
  border: 1px solid #dbe5f0;
  border-radius: 10px;
  background: #fbfdff;
  overflow: hidden;
}

.employee-work-section header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e5edf6;
  background: #ffffff;
}

.employee-work-section h4 {
  margin: 0;
  color: #071d33;
  font-size: 1rem;
}

.employee-work-section header strong {
  min-width: 32px;
  min-height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eef4fb;
  color: #0f2038;
}

.employee-work-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.employee-work-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e5edf6;
  border-radius: 8px;
  background: #ffffff;
}

.employee-work-main {
  min-width: 0;
}

.employee-work-main strong,
.employee-work-main p,
.employee-work-main small {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.employee-work-main strong {
  color: #071d33;
}

.employee-work-main p,
.employee-work-main small {
  margin: 4px 0 0;
  color: #64748b;
}

.employee-work-type {
  display: inline-block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.employee-work-meta {
  display: grid;
  gap: 6px;
  color: #52657d;
  font-size: 0.82rem;
  font-weight: 800;
}

.employee-work-actions {
  display: flex;
  gap: 8px;
}

.employee-work-actions .primary-action,
.employee-work-actions .secondary-action {
  min-height: 38px;
  padding: 8px 12px;
}

.employee-calendar-overview {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  position: relative;
}

.employee-month-card {
  border: 1px solid #dbe5f0;
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
}

.employee-month-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid #e5edf6;
}

.employee-month-header h3 {
  margin: 2px 0 0;
  color: #071d33;
  font-size: 1.25rem;
  text-align: center;
}

.employee-month-header .card-label {
  text-align: center;
}

.employee-month-weekdays,
.employee-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.employee-month-weekdays {
  padding: 10px 8px 6px;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.employee-month-grid {
  gap: 4px;
  padding: 8px;
}

.employee-month-day {
  min-width: 0;
  min-height: 58px;
  display: grid;
  align-content: start;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 7px 4px;
  background: #f8fafc;
  color: #0f2038;
  font-family: inherit;
  font-weight: 900;
  cursor: pointer;
}

.employee-month-day.is-muted {
  color: #94a3b8;
  background: #fbfdff;
}

.employee-month-day.is-today {
  border-color: #ff6b00;
  box-shadow: inset 0 0 0 1px rgba(255, 107, 0, 0.2);
}

.employee-month-day.is-selected {
  background: #071d33;
  color: #ffffff;
}

.employee-month-day.has-items:not(.is-selected) {
  background: #fff7ed;
}

.employee-month-markers {
  min-height: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
}

.employee-month-markers i {
  width: 16px;
  height: 4px;
  border-radius: 999px;
  background: #94a3b8;
}

.employee-month-markers i.low {
  background: #22c55e;
}

.employee-month-markers i.medium,
.employee-month-markers i.neutral {
  background: #1f6feb;
}

.employee-month-markers i.high {
  background: #ff6b00;
}

.employee-month-markers i.critical {
  background: #b91c1c;
}

.employee-month-markers small {
  color: inherit;
  font-size: 0.62rem;
}

.employee-calendar-details {
  margin-bottom: 84px;
}

.employee-calendar-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e5edf6;
  border-radius: 8px;
  background: #ffffff;
}

.employee-calendar-item .secondary-action {
  min-height: 38px;
  padding: 8px 12px;
}

.employee-calendar-fab {
  position: fixed;
  right: 22px;
  bottom: 104px;
  z-index: 30;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 999px;
  background: #ff6b00;
  color: #ffffff;
  font-size: 2rem;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(255, 107, 0, 0.32);
  cursor: pointer;
}

.employee-calendar-create-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.employee-calendar-create-form textarea,
.employee-calendar-create-form input[type="file"] {
  grid-column: 1 / -1;
}

.employee-dashboard-card {
  background: #10263a;
  border-color: #27445f;
  color: #f4f7fb;
}

.employee-dashboard-card .dashboard-panel-head {
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #27445f;
}

.employee-dashboard-card .dashboard-panel-head h3,
.employee-dashboard-card .employee-greeting h3,
.employee-dashboard-card h4,
.employee-dashboard-card strong {
  color: #f4f7fb;
}

.employee-dashboard-card .eyebrow,
.employee-dashboard-card .card-label,
.employee-dashboard-card .supporting-copy,
.employee-dashboard-card small,
.employee-dashboard-card p {
  color: #b8c7d6;
}

.employee-dashboard-summary span {
  min-height: 34px;
  border-color: #27445f;
  background: #16324c;
  color: #f4f7fb;
}

.employee-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 999px;
}

.employee-dot.done { background: #22c55e; }
.employee-dot.open { background: #ff6a00; }
.employee-dot.next { background: #1e7bff; }

.employee-greeting {
  display: grid;
  gap: 2px;
}

.employee-greeting h3 {
  margin: 0;
  font-size: clamp(1.25rem, 4vw, 1.8rem);
}

.employee-current-card,
.employee-day-timeline,
.employee-mini-calendar,
.employee-work-section {
  border: 1px solid #27445f;
  border-radius: 12px;
  background: #132c44;
}

.employee-current-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-left: 5px solid #ff6a00;
}

.employee-current-card.is-empty {
  border-left-color: #64748b;
}

.employee-current-head,
.employee-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.employee-current-head h3,
.employee-section-title h4 {
  margin: 0;
}

.employee-current-head p,
.employee-next-hint {
  margin: 4px 0 0;
}

.employee-current-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.employee-current-status.is-open {
  background: rgba(255, 106, 0, 0.18);
  color: #fed7aa;
  border: 1px solid rgba(255, 106, 0, 0.42);
}

.employee-current-status.is-confirmed {
  background: rgba(34, 197, 94, 0.17);
  color: #bbf7d0;
  border: 1px solid rgba(34, 197, 94, 0.42);
}

.employee-current-target {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: rgba(8, 24, 39, 0.32);
}

.employee-current-target span {
  color: #93a4b8;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.employee-current-target strong,
.employee-current-target p {
  margin: 0;
}

.employee-current-target p {
  color: #cbd5e1;
  font-weight: 700;
}

.employee-review-note {
  color: #fde68a;
  font-weight: 900;
}

.employee-work-item.is-review {
  border-left-color: #facc15;
  background: rgba(250, 204, 21, 0.08);
}

.task-detail-review-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(250, 204, 21, 0.38);
  border-radius: 10px;
  background: rgba(250, 204, 21, 0.1);
}

.task-detail-actions.is-review-locked [data-task-confirm],
.task-detail-actions.is-review-locked [data-task-status-quick],
.task-detail-actions.is-review-locked [data-task-complete],
.task-detail-actions.is-review-locked [data-task-decline],
.task-detail-actions.is-review-locked [data-task-detail-status-save] {
  display: none;
}

.task-detail-history-note {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid #27445f;
  border-radius: 10px;
  background: rgba(15, 35, 56, 0.42);
}

.task-detail-history-note span {
  color: #9fb1c5;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.task-detail-history-note p {
  margin: 0;
  color: #f4f7fb;
  font-weight: 800;
  line-height: 1.4;
}

.employee-progress-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 5px solid #ff6a00;
  padding-left: 18px;
}

.employee-progress-steps li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #b8c7d6;
  font-size: 0.9rem;
  font-weight: 800;
}

.employee-progress-steps li span {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 2px solid #64748b;
  border-radius: 999px;
}

.employee-progress-steps li.is-done span {
  border-color: #22c55e;
  background: #22c55e;
}

.employee-progress-steps li.is-skipped {
  color: #fbbf24;
}

.employee-progress-steps li.is-skipped span {
  border-color: #f59e0b;
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18);
}

.employee-progress-steps li.is-current {
  color: #ffffff;
}

.employee-progress-steps li.is-current span {
  border-color: #ff6a00;
  box-shadow: 0 0 0 4px rgba(255, 106, 0, 0.16);
}

.employee-current-actions,
.employee-work-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.employee-current-actions .primary-action,
.employee-current-actions .secondary-action,
.employee-work-actions .primary-action,
.employee-work-actions .secondary-action,
.employee-range-tabs button {
  min-height: 48px;
  padding: 10px 14px;
}

.employee-current-actions .primary-action {
  flex: 1 1 100%;
  min-height: 64px;
  border-radius: 18px;
  font-size: 1.18rem;
}

.task-detail-card.is-employee-workflow .task-detail-grid label,
.task-detail-card.is-employee-workflow > .field-label,
.task-detail-card.is-employee-workflow .task-detail-reassignment-warning,
.task-detail-card.is-employee-workflow [data-task-detail-status-save],
.task-detail-card.is-employee-workflow [data-task-schedule-edit],
.task-detail-card.is-employee-workflow [data-task-open-reassignment] {
  display: none !important;
}

.task-detail-card.is-employee-workflow .task-detail-actions {
  display: grid;
  gap: 12px;
}

.task-detail-card.is-employee-workflow .task-detail-actions .primary-action {
  min-height: 60px;
  border-radius: 18px;
  font-size: 1.1rem;
}

.employee-day-timeline,
.employee-mini-calendar {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.employee-range-tabs {
  display: inline-flex;
  gap: 6px;
  border-radius: 10px;
  background: #10263a;
  padding: 4px;
}

.employee-range-tabs button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #b8c7d6;
  font-weight: 900;
  cursor: pointer;
}

.employee-range-tabs button.is-active {
  background: #ff6a00;
  color: #ffffff;
}

.employee-mobile-schedule-timeline {
  margin-top: 2px;
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
}

.employee-mobile-schedule-timeline .dashboard-timeline-grid {
  min-width: 1704px;
}

.employee-mobile-schedule-timeline .dashboard-timeline-corner {
  font-size: 0.72rem;
}

.employee-mobile-schedule-timeline .dashboard-timeline-free-slot {
  min-height: 128px;
}

.employee-work-list.is-compact,
.employee-own-tasks .employee-work-list {
  gap: 8px;
}

.employee-work-item-compact,
.employee-calendar-item {
  border-color: #27445f;
  background: #10263a;
  padding: 10px;
}

.employee-work-item-compact .employee-work-main strong,
.employee-calendar-item .employee-work-main strong {
  color: #f4f7fb;
  font-size: 0.98rem;
}

.employee-work-item-compact .employee-work-main p,
.employee-work-item-compact .employee-work-main small,
.employee-work-item-compact .employee-work-type,
.employee-calendar-item .employee-work-main p,
.employee-calendar-item .employee-work-main small {
  color: #b8c7d6;
}

.employee-followup-modal,
.employee-work-comment-modal {
  z-index: 2147483640;
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
  background: rgba(2, 8, 23, 0.62);
  overflow: hidden;
  overscroll-behavior: contain;
  isolation: isolate;
}

.employee-followup-modal.is-hidden,
.employee-work-comment-modal.is-hidden {
  display: none;
}

html.employee-followup-scroll-locked,
html.employee-work-comment-scroll-locked {
  overflow: hidden;
  overscroll-behavior: none;
}

body.employee-followup-scroll-locked,
body.employee-work-comment-scroll-locked {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.employee-followup-card,
.employee-work-comment-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0;
  width: min(720px, calc(100vw - 28px));
  max-height: min(760px, calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #27445f;
  border-radius: 16px;
  background: #10263a;
  color: #f4f7fb;
  padding: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

.employee-work-comment-card {
  width: min(620px, calc(100vw - 28px));
}

.employee-followup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.employee-followup-wide {
  grid-column: 1 / -1;
}

.employee-followup-card .search-input,
.employee-followup-card .select-input,
.employee-work-comment-card .search-input,
.employee-work-comment-card .select-input {
  border-color: #27445f;
  background: #162f48;
  color: #f4f7fb;
}

.employee-followup-card .button-row,
.employee-work-comment-card .button-row {
  position: sticky;
  bottom: -20px;
  z-index: 2;
  margin: 4px -20px -20px;
  padding: 14px 20px max(14px, env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(16, 38, 58, 0.86), #10263a 28%);
  border-top: 1px solid rgba(39, 68, 95, 0.88);
}

.employee-work-comment-photo-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.employee-work-comment-file-button {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 48px;
  cursor: pointer;
  overflow: hidden;
}

.employee-work-comment-file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.employee-work-comment-preview {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 4px 0 14px;
  padding: 12px;
  border: 1px solid #27445f;
  border-radius: 12px;
  background: #0d2133;
}

.employee-work-comment-preview[hidden],
.employee-work-comment-progress[hidden],
.employee-work-comment-card .form-error[hidden] {
  display: none;
}

.employee-work-comment-preview img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(184, 199, 214, 0.28);
  background: #071521;
}

.employee-work-comment-preview div {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.employee-work-comment-preview strong,
.employee-work-comment-preview span {
  overflow-wrap: anywhere;
}

.employee-work-comment-progress {
  display: grid;
  gap: 8px;
  margin: 8px 0 14px;
  padding: 12px;
  border: 1px solid rgba(30, 123, 255, 0.34);
  border-radius: 12px;
  background: rgba(30, 123, 255, 0.12);
  color: #dbeafe;
  font-weight: 800;
}

.employee-work-comment-progress div {
  height: 9px;
  border-radius: 999px;
  background: rgba(219, 231, 243, 0.18);
  overflow: hidden;
}

.employee-work-comment-progress i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, #1e7bff, #ff6a00);
  transition: width 0.2s ease;
}

.employee-work-comment-card .form-error {
  margin: 0 0 12px;
  color: #fecaca;
  font-weight: 800;
}

@media (max-width: 1280px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-main-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-setup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-stat-layout {
    grid-template-columns: 1fr;
  }

  .employee-dashboard-sections {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .topbar-menu {
    display: grid;
  }

  .topbar {
    margin: 0 -16px;
    padding: 12px 16px;
  }

  .main-shell {
    padding: 0 16px 94px;
  }

  .topbar-title {
    min-width: 0;
  }

  .topbar-actions {
    grid-template-columns: 1fr auto auto;
    width: 100%;
  }

  .topbar-profile,
  .date-picker-action,
  #reload-button {
    display: none;
  }

  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .dashboard-setup-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-setup-actions {
    justify-content: flex-start;
  }

  .employee-dashboard-summary {
    justify-content: flex-start;
  }

  .dashboard-kpi-card {
    min-height: 124px;
    padding: 16px;
  }

  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-stat-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-panel-large {
    min-height: auto;
  }

  .dashboard-list {
    max-height: 360px;
  }
}

@media (max-width: 560px) {
  .dashboard-kpi-card {
    gap: 10px;
  }

  .dashboard-kpi-card strong {
    font-size: 2rem;
  }

  .dashboard-kpi-icon {
    width: 44px;
    height: 44px;
  }

  .dashboard-stat-kpis {
    grid-template-columns: 1fr;
  }

  .dashboard-stat-frame-toggle {
    justify-content: flex-start;
  }

  .dashboard-line-chart {
    overflow-x: auto;
    grid-auto-columns: minmax(58px, 1fr);
  }

  .dashboard-task-row,
  .dashboard-ticket-row {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .employee-work-item {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .employee-calendar-item {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .employee-calendar-item .secondary-action {
    width: 100%;
  }

  .employee-calendar-create-form {
    grid-template-columns: 1fr;
  }

  .employee-calendar-create-form textarea,
  .employee-calendar-create-form input[type="file"] {
    grid-column: auto;
  }

  .employee-work-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .employee-dashboard-card {
    margin-inline: -4px;
    padding: 14px;
  }

  .employee-dashboard-card .dashboard-panel-head,
  .employee-current-head,
  .employee-section-title {
    flex-direction: column;
    align-items: stretch;
  }

  .employee-dashboard-summary {
    gap: 6px;
  }

  .employee-dashboard-summary span {
    flex: 1 1 auto;
    justify-content: center;
    padding-inline: 8px;
    font-size: 0.78rem;
  }

  .employee-current-card,
  .employee-day-timeline,
  .employee-mini-calendar {
    padding: 12px;
  }

  .employee-current-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .employee-current-actions .primary-action,
  .employee-current-actions .secondary-action,
  .employee-work-actions .primary-action,
  .employee-work-actions .secondary-action {
    width: 100%;
  }

  .employee-range-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .employee-dashboard-sections {
    padding-bottom: 118px;
  }

  .employee-followup-card,
  .employee-work-comment-card {
    width: min(100%, 520px);
    max-height: calc(100dvh - 28px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    border-radius: 16px;
  }

  .employee-followup-grid {
    grid-template-columns: 1fr;
  }

  .employee-followup-card .button-row,
  .employee-work-comment-card .button-row,
  .employee-work-comment-photo-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .employee-work-comment-preview {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .employee-work-comment-preview img {
    width: 84px;
    height: 84px;
  }

  .employee-followup-wide {
    grid-column: auto;
  }

  .dashboard-row-meta,
  .dashboard-ticket-code,
  .dashboard-ticket-due,
  .dashboard-status-badge {
    justify-self: start;
    grid-column: 2;
  }

  .quick-action-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-setup-grid {
    grid-template-columns: 1fr;
  }
}

.fixfox-logo-sidebar {
  width: 196px;
  max-height: none;
}

@media (max-width: 900px) {
  .topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
  }

  .topbar-actions {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto auto;
    margin-left: 0;
  }
}

/* Tasks module refresh */
#view-tasks {
  gap: 0;
}

.tasks-page-shell {
  display: grid;
  gap: 20px;
}

.tasks-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.tasks-page-header h2 {
  margin: 0;
  color: #071d33;
  font-size: 1.6rem;
}

.tasks-tabs {
  display: flex;
  gap: 28px;
  margin-top: 16px;
  border-bottom: 1px solid #e5edf5;
}

.tasks-tabs button {
  padding: 0 0 14px;
  background: transparent;
  color: #64748b;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.tasks-tabs button.is-active {
  color: var(--foxtask-orange);
  border-color: var(--foxtask-orange);
}

.tasks-new-button {
  background: var(--foxtask-orange);
}

.tasks-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 18px;
}

.tasks-kpi-card {
  min-height: 106px;
  padding: 18px 20px;
  border: 1px solid var(--foxtask-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--foxtask-card-shadow);
  text-align: left;
  cursor: pointer;
}

.tasks-kpi-card.is-active {
  border-color: var(--foxtask-orange);
  box-shadow: 0 18px 42px rgba(255, 107, 0, 0.13);
}

.tasks-kpi-card span,
.tasks-kpi-card small {
  display: block;
  color: #475569;
}

.task-kpi-short {
  display: none;
}

.tasks-kpi-card strong {
  display: block;
  margin: 8px 0;
  color: #071d33;
  font-size: 2rem;
}

.tasks-filter-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr)) auto;
  gap: 12px;
}

.tasks-content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 20px;
  align-items: start;
}

.tasks-list-panel,
.tasks-side-card {
  border: 1px solid var(--foxtask-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--foxtask-card-shadow);
}

.tasks-list-panel {
  overflow: hidden;
}

.task-status-groups {
  display: grid;
  gap: 14px;
}

.task-status-section {
  overflow: hidden;
  border: 1px solid #e7edf5;
  border-radius: 10px;
  background: #fff;
}

.task-status-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 14px 18px;
  background: #f8fafc;
}

.task-status-header h3 {
  margin: 0;
  font-size: 1rem;
}

.task-status-header strong {
  margin-left: auto;
  color: #64748b;
}

.task-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.task-status-open .task-status-dot,
.task-color-red::before {
  background: #ef4444;
}

.task-status-progress .task-status-dot,
.task-status-waiting .task-status-dot,
.task-color-orange::before {
  background: #f59e0b;
}

.task-status-planned .task-status-dot,
.task-color-blue::before {
  background: #2563eb;
}

.task-status-done .task-status-dot,
.task-color-green::before {
  background: #27a66a;
}

.task-status-archived .task-status-dot,
.task-color-gray::before {
  background: #64748b;
}

.task-status-open .task-status-header h3 { color: #ef4444; }
.task-status-progress .task-status-header h3 { color: #f59e0b; }
.task-status-waiting .task-status-header h3 { color: #f59e0b; }
.task-status-planned .task-status-header h3 { color: #2563eb; }
.task-status-done .task-status-header h3 { color: #168044; }
.task-status-archived .task-status-header h3 { color: #64748b; }

.task-table,
.task-list-row {
  --task-list-columns: 28px minmax(280px, 1.8fr) minmax(86px, 0.45fr) minmax(170px, 0.9fr) minmax(150px, 0.75fr) minmax(112px, 0.55fr) minmax(268px, 1fr);
  display: grid;
  grid-template-columns: var(--task-list-columns);
  align-items: center;
  column-gap: 16px;
}

.task-table-head {
  padding: 10px 18px;
  border-top: 1px solid #edf2f7;
  border-bottom: 1px solid #edf2f7;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.task-table-head span {
  min-width: 0;
  white-space: nowrap;
}

.task-table-body {
  max-height: 370px;
  overflow: auto;
}

.task-list-row {
  position: relative;
  min-height: 64px;
  padding: 12px 18px;
  border-bottom: 1px solid #edf2f7;
  background: #fff;
}

.task-list-row > span {
  min-width: 0;
}

.task-list-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--task-object-color, #64748b);
}

.task-list-row.task-status-done {
  background: #fbfffd;
}

.task-list-row.task-status-done .task-title-cell strong {
  color: #168044;
}

.task-list-row.task-status-archived {
  background: #f8fafc;
}

.task-select-cell input {
  width: 18px;
  height: 18px;
}

.task-title-cell strong,
.task-title-cell small,
.task-title-cell em {
  display: block;
  overflow-wrap: anywhere;
}

.task-title-cell small {
  margin-top: 4px;
  color: #64748b;
}

.task-status-badge,
.task-priority-badge {
  width: fit-content;
  margin-top: 6px;
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 900;
}

.task-status-open .task-status-badge { background: #fff0f0; color: #ef4444; }
.task-status-progress .task-status-badge { background: #fff7e8; color: #d97706; }
.task-status-waiting .task-status-badge { background: #fff7e8; color: #d97706; }
.task-status-planned .task-status-badge { background: #eef4ff; color: #2563eb; }
.task-status-done .task-status-badge { background: #eafaf2; color: #168044; }
.task-status-archived .task-status-badge { background: #eef2f7; color: #475569; }

.task-priority-badge.success { background: #eafaf2; color: #168044; }
.task-priority-badge.warning { background: #fff7e8; color: #d97706; }
.task-priority-badge.danger { background: #fff0f0; color: #ef4444; }
.task-priority-badge.neutral { background: #eef2f7; color: #475569; }

.task-object-cell {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  white-space: normal;
}

.task-object-cell i {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--task-object-color, #64748b);
}

.task-action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
}

.task-action-cell .primary-action,
.task-action-cell .secondary-action {
  justify-content: center;
  min-height: 30px;
  min-width: 82px;
  padding: 5px 6px;
  font-size: 0.68rem;
  white-space: nowrap;
}

.task-group-more {
  padding: 12px 18px 14px;
  background: transparent;
  color: #005bd3;
  font-weight: 900;
  cursor: pointer;
}

.task-empty {
  margin: 0;
  padding: 18px;
  color: #64748b;
}

.task-calendar-panel {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.task-calendar-section {
  overflow: hidden;
  border: 1px solid #e7edf5;
  border-radius: 10px;
  background: #fff;
}

.task-calendar-section header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #edf2f7;
  background: #f8fafc;
}

.task-calendar-section h3 {
  margin: 0;
  color: #071d33;
  font-size: 1rem;
}

.task-calendar-section header strong {
  min-width: 32px;
  min-height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eef4fb;
  color: #0f2038;
}

.task-calendar-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.task-calendar-item {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  background: #fff;
}

.task-calendar-item strong,
.task-calendar-item small {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.task-calendar-item small {
  margin-top: 4px;
  color: #64748b;
}

.task-calendar-type {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .task-calendar-panel {
    padding: 10px;
  }

  .task-calendar-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .task-calendar-item .secondary-action {
    width: 100%;
  }
}

.tasks-side-panel {
  display: grid;
  gap: 16px;
}

.tasks-side-card {
  padding: 18px;
}

.tasks-side-card h3 {
  margin: 0 0 14px;
  color: #071d33;
}

.task-object-legend,
.task-quick-filter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.task-object-legend li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #334155;
}

.task-object-legend span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.task-quick-filter-list button {
  text-align: left;
  background: transparent;
  color: #334155;
  cursor: pointer;
  font-weight: 700;
}

.task-quick-filter-list button.is-active {
  color: var(--foxtask-orange);
}

@media (max-width: 1280px) {
  .tasks-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tasks-content-layout {
    grid-template-columns: 1fr;
  }

  .tasks-side-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .tasks-page-header,
  .tasks-filter-bar {
    grid-template-columns: 1fr;
  }

  .tasks-page-header {
    display: grid;
  }

  .tasks-kpi-grid {
    display: flex;
    gap: 8px;
    margin: 0 -16px;
    padding: 0 16px 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .tasks-kpi-grid::-webkit-scrollbar {
    display: none;
  }

  .tasks-kpi-card {
    flex: 0 0 auto;
    min-width: 112px;
    min-height: 54px;
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 8px;
    padding: 10px 12px;
    border-radius: 999px;
    box-shadow: none;
    scroll-snap-align: start;
  }

  .tasks-kpi-card.is-active {
    box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.18);
  }

  .tasks-kpi-card::before {
    content: "";
    width: 8px;
    height: 8px;
    grid-row: 1 / span 2;
    border-radius: 999px;
    background: currentColor;
  }

  .tasks-kpi-card .task-kpi-label,
  .tasks-kpi-card small {
    display: none;
  }

  .tasks-kpi-card .task-kpi-short {
    display: block;
    min-width: 0;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1.1;
    white-space: nowrap;
  }

  .tasks-kpi-card strong {
    grid-column: 3;
    margin: 0;
    color: #071d33;
    font-size: 1.15rem;
    line-height: 1;
  }

  .tasks-filter-bar {
    display: none;
  }

  .tasks-content-layout {
    gap: 12px;
  }

  .tasks-page-shell {
    gap: 12px;
    padding-bottom: 104px;
  }

  .tasks-list-panel {
    border-radius: 10px;
  }

  .task-table-head {
    display: none;
  }

  .task-table-body {
    max-height: none;
  }

  .task-list-row {
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: start;
    gap: 8px 12px;
    border-radius: 10px;
    margin: 10px;
    border: 1px solid #edf2f7;
    box-shadow: 0 10px 24px rgba(15, 32, 51, 0.06);
  }

  .task-list-row > span:not(.task-select-cell):not(.task-title-cell) {
    grid-column: 2;
  }

  .task-action-cell {
    justify-content: flex-start;
  }

  .tasks-side-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .tasks-kpi-grid {
    max-height: 92px;
  }
}

.profile-location-card {
  border-top: 1px solid var(--foxtask-line);
  padding-top: 16px;
}

.profile-location-toggle {
  align-items: center;
  font-weight: 900;
  color: #071d33;
}

.employee-map-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}

.employee-map-head-actions {
  align-items: center;
  justify-content: flex-end;
}

.employee-map-card,
.employee-map-list-card {
  min-height: 420px;
}

.employee-map-canvas {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid #dbe5ef;
  border-radius: 10px;
  background: #eaf0f6;
  cursor: grab;
  touch-action: none;
  overscroll-behavior: contain;
  user-select: none;
  contain: layout paint;
}

.employee-map-canvas.is-dragging {
  cursor: grabbing;
}

.employee-map-tiles,
.employee-map-markers {
  position: absolute;
  inset: 0;
  transform: translateZ(0);
  will-change: contents;
}

.employee-map-tiles {
  pointer-events: none;
}

.employee-map-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  user-select: none;
  -webkit-user-drag: none;
}

.employee-map-marker {
  position: absolute;
  z-index: 4;
  width: 38px;
  height: 38px;
  margin: -38px 0 0 -19px;
  border: 3px solid #ffffff;
  border-radius: 50% 50% 50% 8px;
  background: #168044;
  box-shadow: 0 12px 26px rgba(15, 32, 51, 0.28);
  color: #ffffff;
  font-weight: 900;
  transform: rotate(-45deg);
  cursor: pointer;
}

.employee-map-marker span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform: rotate(45deg);
}

.employee-map-marker.offline,
.employee-map-marker.inactive {
  background: #64748b;
}

.employee-map-marker.away {
  background: #d97706;
}

.employee-map-marker.on-site {
  background: #168044;
}

.employee-map-marker.is-selected-route-employee {
  border-color: #facc15;
  box-shadow: 0 0 0 5px rgba(250, 204, 21, 0.28), 0 14px 30px rgba(15, 32, 51, 0.34);
}

.employee-map-marker.object-marker {
  z-index: 3;
  background: #dc2626;
  border-color: #ffffff;
}

.employee-map-marker.object-marker.requires-action {
  background: #b91c1c;
  box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.18), 0 12px 26px rgba(127, 29, 29, 0.34);
}

.employee-map-marker.object-marker.has-new-event::before,
.employee-map-marker.has-employee-request::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 3px solid rgba(249, 115, 22, 0.72);
  background: rgba(239, 68, 68, 0.16);
  animation: employee-map-marker-pulse 1.55s ease-out infinite;
  transform: rotate(45deg);
  pointer-events: none;
}

.employee-map-marker.object-marker.has-new-ticket,
.employee-map-marker.has-employee-request {
  animation: employee-map-marker-new-ticket-bounce 3.2s ease-in-out infinite;
}

@keyframes employee-map-marker-pulse {
  0% {
    opacity: 0.92;
    transform: rotate(45deg) scale(0.58);
  }
  72% {
    opacity: 0;
    transform: rotate(45deg) scale(1.45);
  }
  100% {
    opacity: 0;
    transform: rotate(45deg) scale(1.45);
  }
}

@keyframes employee-map-marker-new-ticket-bounce {
  0%,
  8%,
  18%,
  100% {
    transform: rotate(-45deg) translateY(0);
  }
  4% {
    transform: rotate(-45deg) translateY(-9px);
  }
  12% {
    transform: rotate(-45deg) translateY(-5px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .employee-map-marker.object-marker.has-new-event::before,
  .employee-map-marker.has-employee-request::before {
    animation: none;
    opacity: 0.75;
    transform: rotate(45deg) scale(1);
  }

  .employee-map-marker.object-marker.has-new-ticket,
  .employee-map-marker.has-employee-request {
    animation: none;
  }
}

.employee-map-radius {
  position: absolute;
  z-index: 1;
  border: 2px solid rgba(220, 38, 38, 0.56);
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.12);
  pointer-events: none;
}

.employee-map-route {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

.employee-map-route-line {
  stroke: #ff6a00;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 12 9;
  filter: drop-shadow(0 2px 5px rgba(15, 32, 51, 0.45)) drop-shadow(0 0 3px rgba(255, 255, 255, 0.78));
  fill: none;
  pointer-events: none;
}

.employee-map-route-hit {
  stroke: transparent;
  stroke-width: 22;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  cursor: pointer;
  pointer-events: stroke;
}

.employee-map-route-label {
  position: absolute;
  z-index: 4;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 106, 0, 0.46);
  border-radius: 999px;
  background: #ffffff;
  color: #9a3d00;
  box-shadow: 0 10px 24px rgba(15, 32, 51, 0.22);
  font-size: 0.74rem;
  font-weight: 900;
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.employee-map-route-error {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 54px;
  z-index: 6;
  padding: 11px 14px;
  border: 1px solid var(--color-danger-border, rgba(248, 113, 113, 0.42));
  border-radius: 8px;
  background: var(--color-danger-soft, rgba(127, 29, 29, 0.88));
  color: var(--color-danger-text, #fff7ed);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.24);
  font-size: 0.88rem;
  font-weight: 800;
  pointer-events: none;
}

.navigation-action {
  position: relative;
  z-index: 3;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  touch-action: manipulation;
}

.employee-map-tooltip {
  position: absolute;
  left: 30px;
  bottom: 28px;
  width: 230px;
  display: none;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: #0f263d;
  box-shadow: 0 16px 36px rgba(2, 8, 23, 0.32);
  color: #f8fafc;
  text-align: left;
  transform: rotate(45deg);
  pointer-events: auto;
}

.employee-map-marker:hover,
.employee-map-marker:focus-visible {
  z-index: 5;
}

.employee-map-marker:hover .employee-map-tooltip,
.employee-map-marker:focus-visible .employee-map-tooltip {
  display: grid;
  gap: 4px;
}

.employee-map-tooltip strong,
.employee-map-tooltip small {
  display: block;
}

.employee-map-tooltip small {
  color: #cbd5e1;
  font-size: 0.76rem;
}

.employee-map-tooltip .employee-map-new-ticket-alert {
  color: #dc2626;
  font-weight: 900;
}

.employee-map-active-state {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(100, 116, 139, 0.22);
}

.employee-map-active-state.is-active {
  color: #047857;
}

.employee-map-active-state small strong {
  display: inline;
  color: inherit;
}

.employee-map-active-assignment {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 4px;
  padding: 5px 8px;
  border: 1px solid rgba(74, 222, 128, 0.38);
  border-radius: 999px;
  background: #123f2c;
  color: #bbf7d0;
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
}

.employee-map-active-assignment:hover,
.employee-map-active-assignment:focus-visible {
  outline: 2px solid rgba(34, 197, 94, 0.48);
  outline-offset: 2px;
}

.employee-map-active-hint {
  color: #86efac;
  font-weight: 900;
}

.employee-map-assignment-popover {
  position: absolute;
  z-index: 7;
  display: none;
  width: min(240px, calc(100% - 24px));
  padding: 10px 12px;
  border: 1px solid rgba(74, 222, 128, 0.42);
  border-radius: 8px;
  background: #123f2c;
  color: #f0fdf4;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.32);
  cursor: pointer;
  font: inherit;
  line-height: 1.25;
  text-align: left;
  transform: none !important;
  writing-mode: horizontal-tb;
}

.employee-map-assignment-popover *,
.employee-map-assignment-popover::before,
.employee-map-assignment-popover::after {
  transform: none !important;
  writing-mode: horizontal-tb;
}

.employee-map-marker:hover + .employee-map-assignment-popover,
.employee-map-marker:focus-visible + .employee-map-assignment-popover,
.employee-map-assignment-popover:hover,
.employee-map-assignment-popover:focus-visible,
.employee-map-assignment-popover.is-pinned {
  display: grid;
  gap: 4px;
}

.employee-map-assignment-popover:focus-visible {
  outline: 2px solid rgba(34, 197, 94, 0.7);
  outline-offset: 3px;
}

.employee-map-assignment-popover-label {
  color: #86efac;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.employee-map-assignment-popover strong {
  color: #ffffff;
  font-size: 0.98rem;
}

.employee-map-assignment-popover span,
.employee-map-assignment-popover small {
  display: block;
}

.employee-map-assignment-popover small {
  color: #bbf7d0;
  font-size: 0.76rem;
}

.employee-map-tooltip.object-map-tooltip {
  width: 340px;
}

.employee-map-object-ticket-list {
  display: grid;
  gap: 7px;
  margin: 4px 0;
}

.employee-map-object-ticket-list > strong {
  color: #f8fafc;
  font-size: 0.82rem;
}

.employee-map-object-ticket {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 7px;
  background: rgba(15, 42, 66, 0.92);
  color: #e2e8f0;
  cursor: pointer;
}

.employee-map-object-ticket:hover,
.employee-map-object-ticket:focus-visible,
.employee-map-object-ticket.is-selected {
  border-color: rgba(250, 204, 21, 0.72);
  background: rgba(55, 48, 24, 0.94);
  outline: none;
}

.employee-map-object-ticket b {
  color: #ffffff;
  font-size: 0.78rem;
}

.employee-map-object-ticket small {
  color: #cbd5e1;
}

.employee-map-controls {
  position: absolute;
  z-index: 4;
  top: 14px;
  right: 14px;
  display: grid;
  gap: 6px;
}

.employee-map-controls .secondary-action {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 1.1rem;
  font-weight: 900;
}

.employee-map-attribution {
  position: absolute;
  z-index: 4;
  right: 10px;
  bottom: 8px;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.88);
  color: #475569;
  font-size: 0.68rem;
}

.employee-map-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 24px;
  text-align: center;
  color: #64748b;
}

.employee-map-empty strong {
  display: block;
  margin-bottom: 8px;
  color: #071d33;
}

.employee-map-list-card .simple-list li {
  display: grid;
  gap: 6px;
}

.employee-map-list-card .simple-list li.employee-map-list-muted {
  border-style: dashed;
  opacity: 0.78;
}

.employee-map-list-card .secondary-action {
  justify-self: start;
}

.employee-map-list-assignment {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 106, 0, 0.42);
  border-radius: 8px;
  background: rgba(255, 106, 0, 0.12);
  color: var(--color-text, #0f172a);
}

.employee-map-list-assignment span {
  color: #d95600;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.employee-map-list-assignment strong,
.employee-map-list-assignment small {
  display: block;
}

.employee-map-ticket-prompt-modal {
  z-index: 1290;
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 8, 23, 0.46);
}

.employee-map-ticket-prompt-modal.is-hidden {
  display: none;
}

.employee-map-ticket-prompt-card {
  position: relative;
  width: min(440px, calc(100vw - 28px));
  display: grid;
  gap: 12px;
  border-radius: 16px;
  border: 1px solid var(--color-border, #d9e2ef);
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #0f172a);
  padding: 22px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.employee-map-assignment-card {
  width: min(620px, calc(100vw - 28px));
  border-color: rgba(71, 85, 105, 0.72);
  background: #0f263d;
  color: #f8fafc;
}

.employee-map-assignment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.employee-map-assignment-head h3 {
  margin: 0;
  color: #f8fafc;
}

.employee-map-assignment-head p {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 4px 0 0;
  color: #cbd5e1;
  font-weight: 800;
}

.employee-map-online-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
}

.employee-map-assignment-summary {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: #132c44;
}

.employee-map-assignment-summary .card-label {
  margin: 0;
  color: #93c5fd;
}

.employee-map-assignment-summary strong {
  color: #f8fafc;
  font-size: 0.95rem;
}

.employee-map-assignment-summary h4 {
  margin: 0;
  color: #e2e8f0;
  font-size: 1.05rem;
}

.employee-map-assignment-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.employee-map-assignment-details div {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(19, 44, 68, 0.9);
}

.employee-map-assignment-details dt {
  color: #93a4b8;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.employee-map-assignment-details dd {
  margin: 0;
  color: #f8fafc;
  font-weight: 850;
}

.employee-map-assignment-description {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.28);
  color: #cbd5e1;
}

.employee-map-assignment-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
  font-weight: 900;
}

.route-info-grid {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.route-info-grid div {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid var(--color-border, #dbe5ef);
  border-radius: 8px;
  background: var(--color-surface-soft, #f7fbff);
}

.route-info-grid dt {
  color: var(--color-text-muted, #64748b);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.route-info-grid dd {
  margin: 0;
  color: var(--color-text, #071d33);
  font-weight: 850;
}

body.employee-map-fullscreen-mode {
  overflow: hidden;
}

body.employee-map-fullscreen-mode .app-shell {
  grid-template-columns: 1fr;
  min-height: 100vh;
}

body.employee-map-fullscreen-mode .sidebar,
body.employee-map-fullscreen-mode .topbar,
body.employee-map-fullscreen-mode .employee-map-list-card {
  display: none !important;
}

body.employee-map-fullscreen-mode .main-shell {
  padding: 0;
  min-height: 100vh;
}

body.employee-map-fullscreen-mode .main-shell::before {
  display: none;
}

body.employee-map-fullscreen-mode #view-employee-map {
  height: 100vh;
}

body.employee-map-fullscreen-mode .employee-map-shell {
  height: 100vh;
  display: block;
}

body.employee-map-fullscreen-mode .employee-map-card {
  height: 100vh;
  min-height: 100vh;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  padding: 0;
}

body.employee-map-fullscreen-mode .employee-map-card > .section-head {
  position: absolute;
  z-index: 6;
  top: 14px;
  left: 14px;
  right: 78px;
  width: auto;
  max-width: 760px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 32, 51, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 40px rgba(15, 32, 51, 0.18);
  backdrop-filter: blur(10px);
}

body.employee-map-fullscreen-mode #employee-map-fullscreen-open {
  display: none;
}

body.employee-map-fullscreen-mode #employee-map-canvas {
  height: 100vh;
  min-height: 100vh;
  border: 0;
  border-radius: 0;
}

@media (max-width: 1100px) {
  .employee-map-shell {
    grid-template-columns: 1fr;
  }

  .employee-map-canvas {
    min-height: 440px;
  }
}

@media (max-width: 640px) {
  .employee-map-tooltip {
    width: 190px;
  }

  .employee-map-tooltip.object-map-tooltip {
    width: min(260px, calc(100vw - 48px));
  }

  .employee-map-canvas {
    min-height: 380px;
  }

  .employee-map-assignment-details {
    grid-template-columns: 1fr;
  }
}

/* Compact SaaS-style settings layout */
.main-shell:has(#view-settings.is-active) {
  gap: 12px;
  padding-bottom: 42px;
  align-content: start;
  grid-auto-rows: max-content;
}

.main-shell:has(#view-settings.is-active) > .topbar {
  align-self: start;
  min-height: auto;
  margin-bottom: 0;
  padding-block: 12px;
  align-items: center;
}

.main-shell:has(#view-settings.is-active) .topbar-title {
  min-width: 170px;
}

.main-shell:has(#view-settings.is-active) .topbar-title .card-label {
  margin-bottom: 3px;
}

.main-shell:has(#view-settings.is-active) .topbar-title h2 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.15;
}

.main-shell:has(#view-settings.is-active) .topbar-actions {
  grid-template-columns: minmax(280px, 520px) auto auto auto auto;
  gap: 10px;
}

.main-shell:has(#view-settings.is-active) .topbar-actions .search-input {
  min-height: 38px;
  padding-block: 8px;
}

#view-settings {
  align-content: start;
  gap: 0;
}

#view-settings .settings-shell {
  display: grid;
  gap: 14px;
  align-content: start;
}

#view-settings .settings-tabs {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 22px;
  min-height: 42px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 0 1px;
  border: 0;
  border-bottom: 1px solid #dbe6f3;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  scrollbar-width: thin;
}

#view-settings .settings-tab {
  position: relative;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #52657d;
  font-size: 0.88rem;
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
}

#view-settings .settings-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 999px 999px 0 0;
  background: transparent;
}

#view-settings .settings-tab:hover {
  color: #071d33;
}

#view-settings .settings-tab.is-active {
  border: 0;
  background: transparent;
  color: var(--foxtask-orange);
}

#view-settings .settings-tab.is-active::after {
  background: var(--foxtask-orange);
}

#view-settings .settings-panel {
  min-width: 0;
  padding: 18px 20px;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

#view-settings .settings-panel.is-active {
  display: grid;
  gap: 16px;
}

#view-settings .settings-panel > .section-head {
  min-height: 44px;
  margin-bottom: 2px;
}

@media (max-width: 1180px) {
  .main-shell:has(#view-settings.is-active) .topbar-actions {
    grid-template-columns: minmax(220px, 1fr) repeat(4, auto);
  }

  #view-settings .settings-tabs {
    gap: 18px;
  }
}

@media (max-width: 720px) {
  .main-shell:has(#view-settings.is-active) > .topbar {
    gap: 10px;
  }

  .main-shell:has(#view-settings.is-active) .topbar-actions {
    grid-template-columns: 1fr;
  }

  #view-settings .settings-tabs {
    gap: 16px;
    margin-inline: -2px;
    padding-inline: 2px;
  }

  #view-settings .settings-panel {
    padding: 14px;
  }
}

/* App-wide light/dark theme toggle */
:root[data-theme="dark"] {
  --color-bg: #081827;
  --color-sidebar: #061423;
  --color-surface: #10263a;
  --color-surface-solid: #10263a;
  --color-surface-soft: #132c44;
  --color-field: #162f48;
  --color-border: #27445f;
  --color-border-strong: #355a7a;
  --color-text: #f4f7fb;
  --color-text-muted: #b8c7d6;
  --color-label: #91a4b8;
  --color-primary: #1e7bff;
  --color-accent: #ff6a00;
  --color-success: #22c55e;
  --color-warning: #facc15;
  --color-danger: #ef4444;
  --bg-canvas: var(--color-bg);
  --bg-surface: var(--color-surface);
  --bg-sidebar: var(--color-sidebar);
  --bg-sidebar-accent: #0b1f33;
  --bg-primary: var(--color-primary);
  --bg-primary-hover: #1767d6;
  --bg-muted: var(--color-surface-soft);
  --border-subtle: var(--color-border);
  --foxtask-line: var(--color-border);
  --foxtask-card-shadow: 0 22px 56px rgba(0, 0, 0, 0.34);
  --text-primary: var(--color-text);
  --text-secondary: var(--color-text-muted);
  --danger: var(--color-danger);
  --warning: #f4b740;
  --success: var(--color-success);
  --neutral: var(--color-label);
  --shadow-soft: 0 24px 70px rgba(0, 0, 0, 0.44);
  --shadow-panel: 0 34px 90px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

.theme-toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--foxtask-line, var(--border-subtle));
  border-radius: 999px;
  background: #fff;
  color: #132033;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.theme-toggle-icon {
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff4e8;
  color: var(--foxtask-orange);
  font-size: 0.78rem;
  letter-spacing: 0;
}

.theme-toggle-label {
  font-size: 0.84rem;
}

.topbar-actions {
  grid-template-columns: minmax(240px, 560px) auto auto auto auto;
}

.mobile-theme-toggle {
  width: 100%;
  justify-content: space-between;
  min-height: 48px;
  margin-top: 4px;
  border-radius: 10px;
}

:root[data-theme="dark"] body {
  color: var(--text-primary);
  background:
    radial-gradient(circle at top left, rgba(47, 129, 247, 0.18), transparent 24rem),
    radial-gradient(circle at 78% 14%, rgba(251, 111, 0, 0.08), transparent 26rem),
    linear-gradient(180deg, #07111f 0%, #0a1424 52%, #050a13 100%);
}

:root[data-theme="dark"] .login-card,
:root[data-theme="dark"] .surface-card,
:root[data-theme="dark"] .detail-card,
:root[data-theme="dark"] .dashboard-panel,
:root[data-theme="dark"] .dashboard-kpi-card,
:root[data-theme="dark"] .settings-panel,
:root[data-theme="dark"] .calendar-jobs-panel,
:root[data-theme="dark"] .employee-calendar-create-panel,
:root[data-theme="dark"] .lightbox-dialog,
:root[data-theme="dark"] .mobile-ticket-sheet,
:root[data-theme="dark"] .mobile-nav-panel,
:root[data-theme="dark"] .bottom-nav,
:root[data-theme="dark"] .ticket-row,
:root[data-theme="dark"] .object-card,
:root[data-theme="dark"] .task-row,
:root[data-theme="dark"] .simple-list li,
:root[data-theme="dark"] .activity-event,
:root[data-theme="dark"] .ticket-note-card,
:root[data-theme="dark"] .mobile-ticket-panel,
:root[data-theme="dark"] .mobile-contractor-card,
:root[data-theme="dark"] .mobile-object-info-grid div,
:root[data-theme="dark"] .settings-info-grid div,
:root[data-theme="dark"] .settings-option-list article,
:root[data-theme="dark"] .push-settings-card,
:root[data-theme="dark"] .developer-settings-card {
  border-color: #263449;
  background: rgba(15, 23, 42, 0.92);
  color: var(--text-primary);
  box-shadow: var(--foxtask-card-shadow);
}

:root[data-theme="dark"] .topbar {
  border-bottom-color: #263449;
  background: rgba(7, 17, 31, 0.9);
}

:root[data-theme="dark"] .main-shell {
  background: transparent;
}

:root[data-theme="dark"] .main-shell::before {
  opacity: 0.18;
}

:root[data-theme="dark"] .search-input,
:root[data-theme="dark"] .select-input,
:root[data-theme="dark"] textarea.search-input,
:root[data-theme="dark"] .topbar-actions .search-input,
:root[data-theme="dark"] .icon-action,
:root[data-theme="dark"] .date-picker-action,
:root[data-theme="dark"] .theme-toggle {
  border-color: #2b3a52;
  background: #0b1628;
  color: var(--text-primary);
}

:root[data-theme="dark"] .search-input::placeholder,
:root[data-theme="dark"] textarea.search-input::placeholder {
  color: #71839e;
}

:root[data-theme="dark"] .theme-toggle-icon {
  background: #18253b;
  color: #ffd28a;
}

:root[data-theme="dark"] .secondary-action,
:root[data-theme="dark"] .topbar .secondary-action {
  border-color: #2b3a52;
  background: #101b2e;
  color: #dce8f7;
}

:root[data-theme="dark"] .secondary-action:hover,
:root[data-theme="dark"] .topbar .secondary-action:hover,
:root[data-theme="dark"] .theme-toggle:hover {
  border-color: #3c5270;
  background: #142239;
}

:root[data-theme="dark"] .primary-action {
  background: linear-gradient(135deg, #ff7a1a, #fb6f00);
  color: #fff;
}

:root[data-theme="dark"] .topbar-title h2,
:root[data-theme="dark"] .section-head h3,
:root[data-theme="dark"] .dashboard-panel-head h3,
:root[data-theme="dark"] .ticket-title,
:root[data-theme="dark"] .object-card h4,
:root[data-theme="dark"] .task-row h4,
:root[data-theme="dark"] .simple-list strong,
:root[data-theme="dark"] .mobile-ticket-sheet-head h3,
:root[data-theme="dark"] .mobile-ticket-description strong,
:root[data-theme="dark"] .mobile-ticket-action,
:root[data-theme="dark"] .mobile-ticket-subpanel-head strong {
  color: var(--text-primary);
}

:root[data-theme="dark"] .eyebrow,
:root[data-theme="dark"] .card-label,
:root[data-theme="dark"] .field-label,
:root[data-theme="dark"] dt,
:root[data-theme="dark"] .ticket-meta,
:root[data-theme="dark"] .detail-copy,
:root[data-theme="dark"] .supporting-copy,
:root[data-theme="dark"] .topbar-profile small,
:root[data-theme="dark"] .mobile-ticket-description p,
:root[data-theme="dark"] .mobile-ticket-summary,
:root[data-theme="dark"] .mobile-contractor-card p,
:root[data-theme="dark"] .mobile-object-info-grid dd,
:root[data-theme="dark"] .settings-info-grid span,
:root[data-theme="dark"] .settings-option-list span {
  color: var(--text-secondary);
}

:root[data-theme="dark"] .nav-item {
  color: #dbe7f6;
}

:root[data-theme="dark"] .nav-item.is-active,
:root[data-theme="dark"] .nav-item:hover,
:root[data-theme="dark"] .bottom-nav .nav-item.is-active {
  background: rgba(251, 111, 0, 0.18);
  color: #fff;
}

:root[data-theme="dark"] .bottom-nav {
  background: rgba(7, 17, 31, 0.96);
  box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.42);
}

:root[data-theme="dark"] .bottom-nav .nav-item {
  color: #a8b6ca;
}

:root[data-theme="dark"] .mobile-nav-panel .nav-item {
  border: 1px solid #263449;
  background: #0b1628;
  color: #dce8f7;
}

:root[data-theme="dark"] .mobile-nav-panel .nav-item.is-active,
:root[data-theme="dark"] .mobile-nav-panel .nav-item:hover {
  border-color: rgba(251, 111, 0, 0.42);
  background: rgba(251, 111, 0, 0.16);
  color: #fff;
}

:root[data-theme="dark"] .mobile-nav-panel .nav-item.is-disabled {
  border-color: #1b2638;
  background: #0a1323;
  color: #6f7f95;
}

:root[data-theme="dark"] .mobile-ticket-sheet-backdrop,
:root[data-theme="dark"] .mobile-nav-backdrop,
:root[data-theme="dark"] .calendar-jobs-backdrop,
:root[data-theme="dark"] .lightbox-backdrop {
  background: rgba(1, 6, 14, 0.68);
}

:root[data-theme="dark"] .mobile-ticket-sheet-handle {
  background: #53657d;
}

:root[data-theme="dark"] .mobile-ticket-action {
  border-bottom-color: #263449;
  background: transparent;
}

:root[data-theme="dark"] .mobile-ticket-action.is-open,
:root[data-theme="dark"] .mobile-ticket-action:hover {
  background: rgba(47, 129, 247, 0.1);
}

:root[data-theme="dark"] .filter-chip,
:root[data-theme="dark"] .segmented-tab,
:root[data-theme="dark"] .priority-chip,
:root[data-theme="dark"] .status-pill,
:root[data-theme="dark"] .ticket-history-type,
:root[data-theme="dark"] .ticket-note-type {
  border-color: #33445e;
  background: #111f34;
  color: #dce8f7;
}

:root[data-theme="dark"] .filter-chip.is-active,
:root[data-theme="dark"] .segmented-tab.is-active {
  border-color: #ff7a1a;
  background: rgba(251, 111, 0, 0.16);
  color: #ffd8b8;
}

:root[data-theme="dark"] .ticket-public-note-item,
:root[data-theme="dark"] .ticket-public-note-item .ticket-note-card {
  border-color: #2f81f7;
  background: rgba(47, 129, 247, 0.12);
}

:root[data-theme="dark"] .ticket-internal-note-item,
:root[data-theme="dark"] .ticket-internal-note-item .ticket-note-card {
  border-color: #53657d;
  background: rgba(83, 101, 125, 0.14);
}

:root[data-theme="dark"] .settings-tabs {
  border-bottom-color: #263449;
}

:root[data-theme="dark"] .dashboard-setup-card,
:root[data-theme="dark"] .dashboard-setup-card.is-done {
  border-color: #263449;
  background: #0f1b2d;
  color: var(--text-primary);
}

:root[data-theme="dark"] .dashboard-setup-card.is-done {
  background: rgba(32, 129, 89, 0.14);
}

:root[data-theme="dark"] .dashboard-setup-card strong {
  color: var(--text-primary);
}

:root[data-theme="dark"] .dashboard-setup-card small {
  color: var(--text-secondary);
}

:root[data-theme="dark"] #view-settings .settings-tab {
  color: #9fb0c7;
}

:root[data-theme="dark"] #view-settings .settings-tab:hover,
:root[data-theme="dark"] #view-settings .settings-tab.is-active {
  color: #ff9a3d;
}

:root[data-theme="dark"] table,
:root[data-theme="dark"] .table-card,
:root[data-theme="dark"] .calendar-grid,
:root[data-theme="dark"] .calendar-day,
:root[data-theme="dark"] .calendar-job-card,
:root[data-theme="dark"] .employee-calendar-item,
:root[data-theme="dark"] .task-calendar-item {
  border-color: #263449;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-primary);
}

:root[data-theme="dark"] th,
:root[data-theme="dark"] td {
  border-color: #263449;
}

:root[data-theme="dark"] .toast {
  background: #10213a;
  color: #edf5ff;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.46);
}

@media (max-width: 1180px) {
  .topbar-actions {
    grid-template-columns: minmax(220px, 1fr) repeat(4, auto);
  }
}

@media (max-width: 900px) {
  .app-theme-toggle .theme-toggle-label {
    display: none;
  }

  .app-theme-toggle {
    padding-inline: 10px;
  }
}

@media (max-width: 720px) {
  .app-theme-toggle {
    display: none;
  }
}

/* Final dark-mode polish: keep old hardcoded light surfaces from leaking through */
:root[data-theme="dark"] body,
:root[data-theme="dark"] .app-shell,
:root[data-theme="dark"] .main-shell {
  background: var(--color-bg);
  color: var(--color-text);
}

:root[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, rgba(30, 123, 255, 0.08), transparent), var(--color-sidebar);
}

:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .login-card,
:root[data-theme="dark"] .surface-card,
:root[data-theme="dark"] .detail-card,
:root[data-theme="dark"] .dashboard-panel,
:root[data-theme="dark"] .dashboard-kpi-card,
:root[data-theme="dark"] .dashboard-worker-card,
:root[data-theme="dark"] .dashboard-feed-card,
:root[data-theme="dark"] .dashboard-calendar-card,
:root[data-theme="dark"] .settings-panel,
:root[data-theme="dark"] .settings-role-list,
:root[data-theme="dark"] .settings-role-detail,
:root[data-theme="dark"] .push-settings-card,
:root[data-theme="dark"] .calendar-jobs-panel,
:root[data-theme="dark"] .employee-reassign-panel,
:root[data-theme="dark"] .employee-calendar-create-panel,
:root[data-theme="dark"] .lightbox-dialog,
:root[data-theme="dark"] .mobile-nav-panel,
:root[data-theme="dark"] .mobile-ticket-sheet,
:root[data-theme="dark"] .bottom-nav {
  border-color: var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
}

:root[data-theme="dark"] .topbar {
  background: rgba(8, 24, 39, 0.94);
  backdrop-filter: blur(16px);
}

:root[data-theme="dark"] #view-dashboard .surface-card,
:root[data-theme="dark"] #view-dashboard .detail-card,
:root[data-theme="dark"] #view-dashboard .dashboard-grid .surface-card:nth-child(2),
:root[data-theme="dark"] .view-section:not(#view-qr-posters) .surface-card,
:root[data-theme="dark"] .view-section:not(#view-qr-posters) .detail-card,
:root[data-theme="dark"] .view-section:not(#view-qr-posters) .ticket-row,
:root[data-theme="dark"] .view-section:not(#view-qr-posters) .object-card,
:root[data-theme="dark"] .view-section:not(#view-qr-posters) .task-row,
:root[data-theme="dark"] .view-section:not(#view-qr-posters) .simple-list li,
:root[data-theme="dark"] .detail-grid > div,
:root[data-theme="dark"] .settings-info-grid div,
:root[data-theme="dark"] .settings-option-list article,
:root[data-theme="dark"] .permission-group,
:root[data-theme="dark"] .permission-grid article,
:root[data-theme="dark"] .role-card,
:root[data-theme="dark"] .activity-event,
:root[data-theme="dark"] .calendar-day,
:root[data-theme="dark"] .calendar-job-card,
:root[data-theme="dark"] .employee-calendar-item,
:root[data-theme="dark"] .task-calendar-item,
:root[data-theme="dark"] .object-form-panel,
:root[data-theme="dark"] .object-contact-panel,
:root[data-theme="dark"] .public-service-config,
:root[data-theme="dark"] .object-contractor-config,
:root[data-theme="dark"] .profile-location-card,
:root[data-theme="dark"] .ticket-note-card {
  border-color: var(--color-border);
  background: var(--color-surface-soft);
  color: var(--color-text);
  box-shadow: none;
}

:root[data-theme="dark"] .view-section:not(#view-qr-posters) .ticket-row:hover,
:root[data-theme="dark"] .view-section:not(#view-qr-posters) .object-card:hover,
:root[data-theme="dark"] .view-section:not(#view-qr-posters) .task-row:hover,
:root[data-theme="dark"] .view-section:not(#view-qr-posters) .simple-list li:hover {
  border-color: var(--color-border-strong);
  background: #183653;
}

:root[data-theme="dark"] .view-section:not(#view-qr-posters) .ticket-row.is-selected,
:root[data-theme="dark"] .view-section:not(#view-qr-posters) .object-card.is-selected,
:root[data-theme="dark"] .settings-role-list .is-active,
:root[data-theme="dark"] .role-card.is-active {
  border-color: var(--color-primary);
  border-left-color: var(--color-primary);
  background: #173554;
}

:root[data-theme="dark"] h1,
:root[data-theme="dark"] h2,
:root[data-theme="dark"] h3,
:root[data-theme="dark"] h4,
:root[data-theme="dark"] h5,
:root[data-theme="dark"] h6,
:root[data-theme="dark"] strong,
:root[data-theme="dark"] .ticket-title,
:root[data-theme="dark"] .object-card h4,
:root[data-theme="dark"] .task-row h4,
:root[data-theme="dark"] .section-head h3,
:root[data-theme="dark"] .topbar-title h2,
:root[data-theme="dark"] .dashboard-panel-head h3,
:root[data-theme="dark"] .settings-info-grid strong,
:root[data-theme="dark"] .settings-option-list strong,
:root[data-theme="dark"] .mobile-ticket-sheet-head h3,
:root[data-theme="dark"] .mobile-ticket-subpanel-head strong,
:root[data-theme="dark"] .mobile-ticket-action,
:root[data-theme="dark"] .mobile-contractor-card h4,
:root[data-theme="dark"] .mobile-object-info-grid dd {
  color: var(--color-text);
}

:root[data-theme="dark"] p,
:root[data-theme="dark"] dd,
:root[data-theme="dark"] .detail-copy,
:root[data-theme="dark"] .supporting-copy,
:root[data-theme="dark"] .ticket-meta,
:root[data-theme="dark"] .ticket-subline,
:root[data-theme="dark"] .object-card-meta,
:root[data-theme="dark"] .task-row p,
:root[data-theme="dark"] .simple-list p,
:root[data-theme="dark"] .topbar-profile small,
:root[data-theme="dark"] .dashboard-panel-head h3 span,
:root[data-theme="dark"] .settings-info-grid span,
:root[data-theme="dark"] .settings-option-list span,
:root[data-theme="dark"] .mobile-ticket-summary,
:root[data-theme="dark"] .mobile-ticket-description p,
:root[data-theme="dark"] .mobile-ticket-subpanel-head p,
:root[data-theme="dark"] .mobile-contractor-card p,
:root[data-theme="dark"] .mobile-object-info-grid dt,
:root[data-theme="dark"] .ticket-note-author,
:root[data-theme="dark"] .ticket-note-meta {
  color: var(--color-text-muted);
}

:root[data-theme="dark"] .eyebrow,
:root[data-theme="dark"] .card-label,
:root[data-theme="dark"] .field-label,
:root[data-theme="dark"] label,
:root[data-theme="dark"] dt,
:root[data-theme="dark"] legend {
  color: var(--color-label);
}

:root[data-theme="dark"] .section-head,
:root[data-theme="dark"] .dashboard-panel-head,
:root[data-theme="dark"] .mobile-ticket-actions,
:root[data-theme="dark"] .mobile-ticket-action,
:root[data-theme="dark"] .mobile-ticket-panel,
:root[data-theme="dark"] .mobile-ticket-edit,
:root[data-theme="dark"] .settings-tabs,
:root[data-theme="dark"] table,
:root[data-theme="dark"] th,
:root[data-theme="dark"] td {
  border-color: var(--color-border);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] .search-input,
:root[data-theme="dark"] .select-input,
:root[data-theme="dark"] textarea.search-input,
:root[data-theme="dark"] .view-section:not(#view-qr-posters) .search-input,
:root[data-theme="dark"] .view-section:not(#view-qr-posters) .select-input,
:root[data-theme="dark"] .view-section:not(#view-qr-posters) textarea.search-input,
:root[data-theme="dark"] .topbar-actions .search-input,
:root[data-theme="dark"] .date-picker-action,
:root[data-theme="dark"] .icon-action,
:root[data-theme="dark"] .theme-toggle {
  border-color: var(--color-border);
  background: var(--color-field);
  color: var(--color-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder,
:root[data-theme="dark"] .search-input::placeholder {
  color: var(--color-label);
  opacity: 1;
}

:root[data-theme="dark"] input:focus,
:root[data-theme="dark"] select:focus,
:root[data-theme="dark"] textarea:focus,
:root[data-theme="dark"] .search-input:focus,
:root[data-theme="dark"] .select-input:focus,
:root[data-theme="dark"] textarea.search-input:focus {
  border-color: var(--color-accent);
  outline: 2px solid rgba(255, 106, 0, 0.22);
  outline-offset: 1px;
}

:root[data-theme="dark"] .primary-action,
:root[data-theme="dark"] .view-section:not(#view-qr-posters) .primary-action {
  border-color: var(--color-accent);
  background: linear-gradient(135deg, var(--color-accent), #ff8126);
  color: #ffffff;
}

:root[data-theme="dark"] .secondary-action,
:root[data-theme="dark"] .topbar .secondary-action,
:root[data-theme="dark"] .view-section:not(#view-qr-posters) .secondary-action {
  border-color: var(--color-border);
  background: #132c44;
  color: var(--color-text);
}

:root[data-theme="dark"] .secondary-action:hover,
:root[data-theme="dark"] .topbar .secondary-action:hover,
:root[data-theme="dark"] .view-section:not(#view-qr-posters) .secondary-action:hover,
:root[data-theme="dark"] .theme-toggle:hover {
  border-color: var(--color-border-strong);
  background: #183653;
}

:root[data-theme="dark"] .filter-chip,
:root[data-theme="dark"] .segmented-tab,
:root[data-theme="dark"] .settings-toggle,
:root[data-theme="dark"] .priority-chip,
:root[data-theme="dark"] .status-pill,
:root[data-theme="dark"] .ticket-history-type,
:root[data-theme="dark"] .ticket-note-type,
:root[data-theme="dark"] .action-badge {
  border-color: var(--color-border);
  background: #173554;
  color: var(--color-text);
}

:root[data-theme="dark"] .settings-location-card,
:root[data-theme="dark"] .settings-location-card article {
  border-color: var(--color-border);
  background: #132c44;
  color: var(--color-text);
}

:root[data-theme="dark"] .settings-location-card h4,
:root[data-theme="dark"] .settings-location-card article strong {
  color: var(--color-text);
}

:root[data-theme="dark"] .settings-location-card article span,
:root[data-theme="dark"] .settings-location-card .supporting-copy {
  color: #b8c7d6;
}

:root[data-theme="dark"] .filter-chip.is-active,
:root[data-theme="dark"] .segmented-tab.is-active,
:root[data-theme="dark"] #view-settings .settings-tab.is-active {
  border-color: var(--color-accent);
  color: #ffd7bd;
}

:root[data-theme="dark"] #view-settings .settings-tabs {
  border-bottom-color: var(--color-border);
}

:root[data-theme="dark"] #view-settings .settings-tab {
  color: var(--color-label);
}

:root[data-theme="dark"] #view-settings .settings-tab:hover,
:root[data-theme="dark"] #view-settings .settings-tab.is-active {
  color: var(--color-text);
}

:root[data-theme="dark"] #view-settings .settings-tab.is-active::after {
  background: var(--color-accent);
}

:root[data-theme="dark"] .dashboard-setup-card,
:root[data-theme="dark"] .dashboard-setup-card.is-done {
  border-color: var(--color-border);
  background: #132c44;
}

:root[data-theme="dark"] .dashboard-setup-card.is-done {
  background: rgba(34, 197, 94, 0.12);
}

:root[data-theme="dark"] .dashboard-kpi-card,
:root[data-theme="dark"] .dashboard-worker-row,
:root[data-theme="dark"] .dashboard-feed-item,
:root[data-theme="dark"] .dashboard-calendar-row {
  border-color: var(--color-border);
  background: #132c44;
  color: var(--color-text);
}

:root[data-theme="dark"] .dashboard-status-badge,
:root[data-theme="dark"] .dashboard-worker-status,
:root[data-theme="dark"] .task-status-badge,
:root[data-theme="dark"] .task-priority-badge {
  background: #173554;
  color: var(--color-text);
}

:root[data-theme="dark"] .status-pill.success,
:root[data-theme="dark"] .priority-chip.success,
:root[data-theme="dark"] .dashboard-status-badge.success {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

:root[data-theme="dark"] .status-pill.warning,
:root[data-theme="dark"] .priority-chip.warning,
:root[data-theme="dark"] .dashboard-status-badge.warning {
  background: rgba(250, 204, 21, 0.16);
  color: #fde68a;
}

:root[data-theme="dark"] .status-pill.danger,
:root[data-theme="dark"] .priority-chip.danger,
:root[data-theme="dark"] .dashboard-status-badge.danger {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

:root[data-theme="dark"] .mobile-ticket-sheet {
  background: var(--color-surface);
  box-shadow: 0 -20px 58px rgba(0, 0, 0, 0.44);
}

:root[data-theme="dark"] .mobile-ticket-panel,
:root[data-theme="dark"] .mobile-ticket-history-list li,
:root[data-theme="dark"] .mobile-ticket-file-list li,
:root[data-theme="dark"] .mobile-contractor-card,
:root[data-theme="dark"] .mobile-object-info-grid div {
  border-color: var(--color-border);
  background: var(--color-surface-soft);
  color: var(--color-text);
}

:root[data-theme="dark"] .mobile-ticket-close,
:root[data-theme="dark"] .mobile-ticket-card-icon {
  background: #173554;
  color: #9ec8ff;
}

:root[data-theme="dark"] body.employee-map-fullscreen-mode .employee-map-card > .section-head {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(9, 24, 41, 0.9);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.38);
}

:root[data-theme="dark"] #view-tickets .ticket-row {
  background: var(--color-surface-soft);
}

:root[data-theme="dark"] #view-tickets .ticket-row .ticket-subline,
:root[data-theme="dark"] #view-tickets .ticket-row .supporting-copy,
:root[data-theme="dark"] #view-tickets .ticket-row .ticket-meta,
:root[data-theme="dark"] #view-tickets .ticket-row .ticket-meta span {
  color: var(--color-text-muted);
}

:root[data-theme="dark"] #view-tickets .ticket-row .ticket-meta span {
  background: #173554;
}

:root[data-theme="dark"] .ticket-public-note-item,
:root[data-theme="dark"] .ticket-public-note-item .ticket-note-card,
:root[data-theme="dark"] .mobile-ticket-history-list .ticket-public-note-item {
  border-color: var(--color-primary);
  background: rgba(30, 123, 255, 0.14);
}

:root[data-theme="dark"] .ticket-internal-note-item,
:root[data-theme="dark"] .ticket-internal-note-item .ticket-note-card,
:root[data-theme="dark"] .mobile-ticket-history-list .ticket-internal-note-item {
  border-color: #6b7f95;
  background: rgba(145, 164, 184, 0.12);
}

:root[data-theme="dark"] .calendar-grid,
:root[data-theme="dark"] .calendar-day,
:root[data-theme="dark"] .calendar-weekday,
:root[data-theme="dark"] .table-card,
:root[data-theme="dark"] table {
  border-color: var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
}

:root[data-theme="dark"] .employee-map-canvas,
:root[data-theme="dark"] .employee-map-list-card,
:root[data-theme="dark"] .employee-map-tooltip,
:root[data-theme="dark"] .employee-map-empty {
  border-color: var(--color-border);
  background: var(--color-surface-soft);
  color: var(--color-text);
}

:root[data-theme="dark"] .employee-map-marker.object-marker {
  border-color: #fecaca;
  background: #dc2626;
}

:root[data-theme="dark"] .employee-map-radius {
  border-color: rgba(248, 113, 113, 0.68);
  background: rgba(248, 113, 113, 0.14);
}

:root[data-theme="dark"] .employee-map-route-label {
  border-color: rgba(255, 106, 0, 0.58);
  background: #10263a;
  color: #ffd7bd;
}

:root[data-theme="dark"] .employee-map-active-state {
  border-top-color: rgba(148, 163, 184, 0.24);
}

:root[data-theme="dark"] .employee-map-active-state.is-active {
  color: #86efac;
}

:root[data-theme="dark"] .employee-map-active-assignment {
  border-color: rgba(74, 222, 128, 0.38);
  background: #123f2c;
  color: #dcfce7;
}

:root[data-theme="dark"] .employee-map-assignment-popover {
  border-color: rgba(74, 222, 128, 0.42);
  background: #123f2c;
  color: #f0fdf4;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.42);
}

:root[data-theme="dark"] .employee-map-assignment-status {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
}

:root[data-theme="dark"] .route-info-grid div {
  border-color: var(--color-border);
  background: #132c44;
}

:root[data-theme="dark"] .route-info-grid dt {
  color: var(--color-label);
}

:root[data-theme="dark"] .route-info-grid dd {
  color: var(--color-text);
}

:root[data-theme="dark"] .toast {
  border: 1px solid var(--color-border);
  background: #132c44;
  color: var(--color-text);
}

:root[data-theme="dark"] .toast.is-error {
  border-color: rgba(239, 68, 68, 0.44);
  background: #3a1720;
  color: #fecaca;
}

:root[data-theme="dark"] .main-shell:has(#view-settings.is-active) .topbar-actions {
  grid-template-columns: minmax(220px, 520px) auto auto auto auto;
}

@media (max-width: 720px) {
  :root[data-theme="dark"] #view-tickets .wide-card {
    background: transparent;
  }

  :root[data-theme="dark"] .mobile-nav-panel {
    background: #0b1f33;
  }

  :root[data-theme="dark"] #view-calendar .surface-card,
  :root[data-theme="dark"] #view-calendar .detail-card {
    background: #0b1f33 !important;
  }

  :root[data-theme="dark"] #view-calendar .calendar-grid {
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: #081827 !important;
  }

  :root[data-theme="dark"] #view-calendar .calendar-cell {
    min-height: 104px;
    border-radius: 10px;
    background: #10263a !important;
  }

  :root[data-theme="dark"] #view-calendar .calendar-cell:not(.is-current):not(.is-selected-day) {
    opacity: 0.82;
  }

  :root[data-theme="dark"] #view-calendar .calendar-cell.is-selected-day,
  :root[data-theme="dark"] #view-calendar .calendar-cell.is-current {
    opacity: 1;
  }
}

/* Dark-mode hardening for legacy high-specificity light rules */
:root[data-theme="dark"] .surface-card,
:root[data-theme="dark"] .detail-card,
:root[data-theme="dark"] .settings-panel,
:root[data-theme="dark"] .settings-role-list,
:root[data-theme="dark"] .settings-role-detail,
:root[data-theme="dark"] .compact-role-list .object-card,
:root[data-theme="dark"] .settings-roles-layout .object-card,
:root[data-theme="dark"] #view-settings .settings-panel,
:root[data-theme="dark"] #view-tickets .surface-card,
:root[data-theme="dark"] #view-tickets .detail-card,
:root[data-theme="dark"] #view-tickets .ticket-row,
:root[data-theme="dark"] #view-tickets .ticket-row.is-selected,
:root[data-theme="dark"] #view-customers .surface-card,
:root[data-theme="dark"] #view-objects .surface-card,
:root[data-theme="dark"] #view-employees .surface-card,
:root[data-theme="dark"] #view-calendar .surface-card,
:root[data-theme="dark"] #view-tasks .surface-card,
:root[data-theme="dark"] .dashboard-panel,
:root[data-theme="dark"] .dashboard-kpi-card,
:root[data-theme="dark"] .dashboard-setup-card,
:root[data-theme="dark"] .dashboard-worker-row,
:root[data-theme="dark"] .dashboard-feed-item,
:root[data-theme="dark"] .dashboard-calendar-row,
:root[data-theme="dark"] .mobile-ticket-sheet,
:root[data-theme="dark"] .mobile-ticket-panel,
:root[data-theme="dark"] .mobile-ticket-history-list li,
:root[data-theme="dark"] .mobile-ticket-file-list li {
  border-color: var(--color-border) !important;
  background-color: var(--color-surface-soft) !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-settings .settings-panel,
:root[data-theme="dark"] #view-tickets .detail-card,
:root[data-theme="dark"] .mobile-ticket-sheet,
:root[data-theme="dark"] .dashboard-panel {
  background-color: var(--color-surface) !important;
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] input:disabled,
:root[data-theme="dark"] select:disabled,
:root[data-theme="dark"] textarea:disabled,
:root[data-theme="dark"] input[readonly],
:root[data-theme="dark"] textarea[readonly],
:root[data-theme="dark"] .search-input,
:root[data-theme="dark"] .select-input,
:root[data-theme="dark"] textarea.search-input,
:root[data-theme="dark"] #view-settings input,
:root[data-theme="dark"] #view-settings select,
:root[data-theme="dark"] #view-settings textarea,
:root[data-theme="dark"] #view-tickets input,
:root[data-theme="dark"] #view-tickets select,
:root[data-theme="dark"] #view-tickets textarea {
  border-color: var(--color-border) !important;
  background-color: var(--color-field) !important;
  color: var(--color-text) !important;
  opacity: 1 !important;
  -webkit-text-fill-color: var(--color-text) !important;
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder,
:root[data-theme="dark"] .search-input::placeholder {
  color: var(--color-label) !important;
  opacity: 1 !important;
  -webkit-text-fill-color: var(--color-label) !important;
}

:root[data-theme="dark"] .compact-role-list .object-card.is-selected,
:root[data-theme="dark"] .settings-roles-layout .object-card.is-selected,
:root[data-theme="dark"] #view-tickets .ticket-row.is-selected {
  border-color: var(--color-primary) !important;
  border-left-color: var(--color-primary) !important;
  background-color: #173554 !important;
}

:root[data-theme="dark"] .compact-role-list .object-card *,
:root[data-theme="dark"] .settings-roles-layout .object-card *,
:root[data-theme="dark"] #view-tickets .ticket-row *,
:root[data-theme="dark"] #view-tickets .detail-card *,
:root[data-theme="dark"] .mobile-ticket-sheet * {
  color: inherit;
}

:root[data-theme="dark"] .mobile-ticket-panel {
  border-color: var(--color-border) !important;
  background: #132c44 !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-calendar .surface-card,
:root[data-theme="dark"] #view-calendar .detail-card {
  border-color: var(--color-border) !important;
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-calendar .calendar-grid {
  border-color: var(--color-border) !important;
  background:
    linear-gradient(180deg, rgba(30, 123, 255, 0.08), transparent),
    #0b1f33 !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-calendar .calendar-cell {
  border-color: #27445f !important;
  background: #10263a !important;
  color: var(--color-text) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] #view-calendar .calendar-cell:not(.is-current):not(.is-selected-day) {
  opacity: 0.86;
}

:root[data-theme="dark"] #view-calendar .calendar-cell:hover,
:root[data-theme="dark"] #view-calendar .calendar-cell:focus-visible {
  border-color: #3d6385 !important;
  background: #132c44 !important;
  opacity: 1;
}

:root[data-theme="dark"] #view-calendar .calendar-cell-head strong,
:root[data-theme="dark"] #view-calendar .calendar-cell > strong {
  color: #f4f7fb !important;
}

:root[data-theme="dark"] #view-calendar .calendar-cell p {
  color: #b8c7d6 !important;
}

:root[data-theme="dark"] #view-calendar .calendar-cell.is-current {
  border-color: #fb7185 !important;
  background: #17243a !important;
  box-shadow: inset 4px 0 0 #fb7185, 0 0 0 2px rgba(251, 113, 133, 0.22) !important;
  opacity: 1;
}

:root[data-theme="dark"] #view-calendar .calendar-cell.is-current > strong,
:root[data-theme="dark"] #view-calendar .calendar-cell.is-current .calendar-cell-head > strong {
  color: #fecdd3 !important;
}

:root[data-theme="dark"] #view-calendar .calendar-cell.is-selected-day {
  border-color: #60a5fa !important;
  background: #173554 !important;
  box-shadow: inset 4px 0 0 #60a5fa, 0 0 0 2px rgba(96, 165, 250, 0.24) !important;
  opacity: 1;
}

:root[data-theme="dark"] #view-calendar .calendar-cell.is-current.is-selected-day {
  border-color: #fb7185 !important;
  box-shadow: inset 4px 0 0 #fb7185, 0 0 0 2px rgba(96, 165, 250, 0.32) !important;
}

:root[data-theme="dark"] #view-calendar .calendar-chip {
  color: var(--calendar-type-fg, #ffffff) !important;
}

:root[data-theme="dark"] #view-calendar .calendar-chip-icon {
  background: rgba(2, 6, 23, 0.72) !important;
  color: inherit !important;
}

:root[data-theme="dark"] #view-calendar .calendar-legend-item,
:root[data-theme="dark"] #view-calendar .calendar-tooltip {
  border-color: var(--color-border) !important;
  background: #0b1628 !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #calendar-toolbar .secondary-action,
:root[data-theme="dark"] #view-calendar #calendar-prev,
:root[data-theme="dark"] #view-calendar #calendar-next,
:root[data-theme="dark"] #view-calendar #calendar-today,
:root[data-theme="dark"] #view-calendar #calendar-open-all-jobs {
  border-color: var(--color-border) !important;
  background: #132c44 !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #calendar-toolbar .secondary-action:hover,
:root[data-theme="dark"] #view-calendar #calendar-prev:hover,
:root[data-theme="dark"] #view-calendar #calendar-next:hover,
:root[data-theme="dark"] #view-calendar #calendar-today:hover,
:root[data-theme="dark"] #view-calendar #calendar-open-all-jobs:hover {
  border-color: var(--color-border-strong) !important;
  background: #183653 !important;
}

:root[data-theme="dark"] .mobile-ticket-panel.is-open {
  background: #132c44 !important;
}

:root[data-theme="dark"] .mobile-ticket-subpanel-head strong,
:root[data-theme="dark"] .mobile-ticket-form-grid .field-label {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] .mobile-ticket-subpanel-head p {
  color: var(--color-text-muted) !important;
}

:root[data-theme="dark"] .mobile-ticket-form-grid .search-input,
:root[data-theme="dark"] .mobile-ticket-form-grid .select-input {
  border-color: var(--color-border) !important;
  background: #0f2539 !important;
  color: var(--color-text) !important;
  -webkit-text-fill-color: var(--color-text) !important;
}

:root[data-theme="dark"] .mobile-ticket-form-grid .search-input::placeholder {
  color: var(--color-text-muted) !important;
  -webkit-text-fill-color: var(--color-text-muted) !important;
}

:root[data-theme="dark"] .mobile-ticket-form-grid .search-input:focus,
:root[data-theme="dark"] .mobile-ticket-form-grid .select-input:focus {
  border-color: var(--color-accent) !important;
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.18);
  outline: none;
}

:root[data-theme="dark"] .mobile-ticket-form-grid .primary-action {
  background: var(--color-accent) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

:root[data-theme="dark"] .mobile-permission-note {
  border-color: rgba(255, 106, 0, 0.62) !important;
  border-left-color: var(--color-accent) !important;
  background: rgba(255, 106, 0, 0.12) !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] .mobile-permission-note strong {
  color: #ffd7bd !important;
}

:root[data-theme="dark"] .mobile-permission-note p {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] .compact-role-list .object-card p,
:root[data-theme="dark"] .compact-role-list .object-card small,
:root[data-theme="dark"] #view-tickets .ticket-meta,
:root[data-theme="dark"] #view-tickets .ticket-subline,
:root[data-theme="dark"] #view-tickets .supporting-copy,
:root[data-theme="dark"] .mobile-ticket-description p,
:root[data-theme="dark"] .mobile-ticket-summary {
  color: var(--color-text-muted) !important;
}

:root[data-theme="dark"] #view-tickets .ticket-message-card,
:root[data-theme="dark"] #view-tickets .contractor-ticket-card,
:root[data-theme="dark"] #view-tickets .ticket-info-request-card,
:root[data-theme="dark"] #view-tickets .site-visit-card,
:root[data-theme="dark"] #view-tickets #ticket-calendar-card,
:root[data-theme="dark"] #view-tickets .detail-card > .detail-stack,
:root[data-theme="dark"] #view-tickets .detail-grid > div,
:root[data-theme="dark"] #view-tickets .compact-grid > div {
  border-color: var(--color-border) !important;
  background: #132c44 !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-tickets .ticket-message-card {
  border-left-color: var(--color-accent) !important;
  background:
    linear-gradient(135deg, rgba(255, 106, 0, 0.14), transparent 60%),
    #132c44 !important;
}

:root[data-theme="dark"] #view-tickets .ticket-message-card .field-label,
:root[data-theme="dark"] #view-tickets .ticket-message-text,
:root[data-theme="dark"] #view-tickets .contractor-ticket-card .field-label,
:root[data-theme="dark"] #view-tickets .contractor-ticket-card p,
:root[data-theme="dark"] #view-tickets .detail-grid dt,
:root[data-theme="dark"] #view-tickets .detail-grid dd {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-tickets .detail-grid dt,
:root[data-theme="dark"] #view-tickets .ticket-message-card .field-label,
:root[data-theme="dark"] #view-tickets .contractor-ticket-card .field-label {
  color: var(--color-label) !important;
}

:root[data-theme="dark"] #view-tickets #ticket-filters .filter-chip,
:root[data-theme="dark"] .filter-chip,
:root[data-theme="dark"] .segmented-tab {
  border-color: var(--color-border) !important;
  background: #162f48 !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-tickets #ticket-filters .filter-chip.is-active,
:root[data-theme="dark"] .filter-chip.is-active,
:root[data-theme="dark"] .segmented-tab.is-active {
  border-color: var(--color-accent) !important;
  background: rgba(255, 106, 0, 0.18) !important;
  color: #ffd7bd !important;
}

:root[data-theme="dark"] .mobile-ticket-status {
  background: rgba(30, 123, 255, 0.2) !important;
  color: #bcd9ff !important;
}

:root[data-theme="dark"] .mobile-ticket-status.is-question {
  background: rgba(239, 68, 68, 0.22) !important;
  color: #fecaca !important;
}

:root[data-theme="dark"] .mobile-ticket-status.is-progress {
  background: rgba(250, 204, 21, 0.18) !important;
  color: #fde68a !important;
}

:root[data-theme="dark"] .mobile-ticket-status.is-done {
  background: rgba(34, 197, 94, 0.18) !important;
  color: #bbf7d0 !important;
}

:root[data-theme="dark"] #view-tickets .segmented-tabs .segmented-tab {
  border-color: var(--color-border) !important;
  background: #132c44 !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-tickets .segmented-tabs .segmented-tab.is-active {
  border-color: var(--color-accent) !important;
  background: rgba(255, 106, 0, 0.22) !important;
  color: #ffffff !important;
}

:root[data-theme="dark"] #view-tickets .contractor-ticket-card .secondary-action,
:root[data-theme="dark"] #view-tickets .ticket-info-request-card .secondary-action {
  border-color: var(--color-border) !important;
  background: #162f48 !important;
  color: var(--color-text) !important;
}

/* Eye-comfort dark surfaces for dashboard, master-data lists and option grids */
:root[data-theme="dark"] .dashboard-stat-kpi,
:root[data-theme="dark"] .dashboard-line-chart,
:root[data-theme="dark"] .dashboard-stat-side,
:root[data-theme="dark"] .dashboard-quick-panel,
:root[data-theme="dark"] .quick-action-grid button,
:root[data-theme="dark"] .dashboard-ticket-row,
:root[data-theme="dark"] .dashboard-worker-card,
:root[data-theme="dark"] .dashboard-worker-visit,
:root[data-theme="dark"] .object-card,
:root[data-theme="dark"] .object-card.is-selected,
:root[data-theme="dark"] .assignment-option,
:root[data-theme="dark"] .assignment-option.is-selected,
:root[data-theme="dark"] .authorized-employee-list li,
:root[data-theme="dark"] .public-service-config,
:root[data-theme="dark"] .object-contractor-config,
:root[data-theme="dark"] .public-service-option,
:root[data-theme="dark"] .custom-service-row,
:root[data-theme="dark"] .contractor-row,
:root[data-theme="dark"] .contractor-detail,
:root[data-theme="dark"] .permission-option,
:root[data-theme="dark"] .push-debug-status div,
:root[data-theme="dark"] .recurrence-options,
:root[data-theme="dark"] .calendar-cell,
:root[data-theme="dark"] .calendar-legend-item,
:root[data-theme="dark"] .calendar-more-button,
:root[data-theme="dark"] .tasks-kpi-card,
:root[data-theme="dark"] .task-quick-filter-list button,
:root[data-theme="dark"] .employee-assignment-row,
:root[data-theme="dark"] .employee-reassign-row,
:root[data-theme="dark"] .employee-assignment-summary span {
  border-color: var(--color-border) !important;
  background-color: #132c44 !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .employee-reassign-row strong,
:root[data-theme="dark"] .employee-reassign-row span,
:root[data-theme="dark"] .employee-reassign-row p,
:root[data-theme="dark"] .employee-reassign-row .field-label {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] .employee-reassign-row p {
  color: var(--color-muted) !important;
}

:root[data-theme="dark"] .employee-reassign-row input[type="checkbox"] {
  accent-color: #ff6a00;
}

:root[data-theme="dark"] .employee-reassign-row .select-input {
  border-color: var(--color-border);
  background: #0f2940;
  color: var(--color-text);
}

:root[data-theme="dark"] .calendar-day-create {
  border-color: rgba(255, 138, 51, 0.54);
  background: #ff6a00;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(255, 106, 0, 0.28);
}

:root[data-theme="dark"] .calendar-day-create:hover,
:root[data-theme="dark"] .calendar-day-create:focus-visible {
  border-color: #ffb27a;
  background: #ff7a1a;
}

:root[data-theme="dark"] .dashboard-line-chart {
  background:
    linear-gradient(180deg, rgba(39, 68, 95, 0.34) 1px, transparent 1px) 0 0 / 100% 33.333%,
    #10263a !important;
}

:root[data-theme="dark"] .dashboard-stat-kpi,
:root[data-theme="dark"] .quick-action-grid button,
:root[data-theme="dark"] .object-card,
:root[data-theme="dark"] .assignment-option,
:root[data-theme="dark"] .public-service-option,
:root[data-theme="dark"] .contractor-row,
:root[data-theme="dark"] .permission-option {
  background-color: #173554 !important;
}

:root[data-theme="dark"] .quick-action-grid button:hover,
:root[data-theme="dark"] .object-card:hover,
:root[data-theme="dark"] .assignment-option:hover,
:root[data-theme="dark"] .public-service-option:hover,
:root[data-theme="dark"] .contractor-row:hover,
:root[data-theme="dark"] .task-quick-filter-list button:hover {
  border-color: var(--color-border-strong) !important;
  background-color: #1b3d5c !important;
}

:root[data-theme="dark"] .object-card.is-selected,
:root[data-theme="dark"] .assignment-option.is-selected,
:root[data-theme="dark"] .contractor-row.is-selected,
:root[data-theme="dark"] .tasks-kpi-card.is-active,
:root[data-theme="dark"] .task-quick-filter-list button.is-active {
  border-color: var(--color-primary) !important;
  background-color: #183d63 !important;
}

:root[data-theme="dark"] .assignment-option.is-selected,
:root[data-theme="dark"] .public-service-option:has(input:checked) {
  border-color: rgba(255, 106, 0, 0.62) !important;
  background-color: rgba(255, 106, 0, 0.12) !important;
}

:root[data-theme="dark"] .quick-action-grid span,
:root[data-theme="dark"] .quick-action-grid button strong,
:root[data-theme="dark"] .dashboard-stat-kpi strong,
:root[data-theme="dark"] .object-card h4,
:root[data-theme="dark"] .object-card strong,
:root[data-theme="dark"] .assignment-option strong,
:root[data-theme="dark"] .public-service-option span,
:root[data-theme="dark"] .contractor-row strong,
:root[data-theme="dark"] .permission-option span,
:root[data-theme="dark"] .dashboard-worker-copy strong,
:root[data-theme="dark"] .dashboard-worker-visit strong,
:root[data-theme="dark"] .tasks-kpi-card strong {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] .permission-option small {
  color: #9fb0c4;
}

:root[data-theme="dark"] .dashboard-stat-kpi span,
:root[data-theme="dark"] .dashboard-chart-legend,
:root[data-theme="dark"] .chart-day small,
:root[data-theme="dark"] .chart-bar em,
:root[data-theme="dark"] .object-card-meta,
:root[data-theme="dark"] .assignment-option small,
:root[data-theme="dark"] .contractor-row small,
:root[data-theme="dark"] .dashboard-worker-copy small,
:root[data-theme="dark"] .dashboard-worker-visit small,
:root[data-theme="dark"] .tasks-kpi-card span,
:root[data-theme="dark"] .tasks-kpi-card small {
  color: var(--color-text-muted) !important;
}

:root[data-theme="dark"] .chart-tooltip {
  border-color: var(--color-border) !important;
  background: #081827 !important;
  color: var(--color-text) !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.42) !important;
}

:root[data-theme="dark"] .chart-tooltip::after {
  border-top-color: #081827 !important;
}

:root[data-theme="dark"] .dashboard-kpi-icon,
:root[data-theme="dark"] .dashboard-kpi-icon.blue,
:root[data-theme="dark"] .dashboard-kpi-icon.sky,
:root[data-theme="dark"] .dashboard-kpi-icon.cobalt {
  background: rgba(30, 123, 255, 0.16) !important;
  color: #9ec8ff !important;
}

:root[data-theme="dark"] .dashboard-kpi-icon.orange,
:root[data-theme="dark"] .quick-action-grid span {
  background: rgba(255, 106, 0, 0.14) !important;
  color: #ffb27a !important;
}

:root[data-theme="dark"] .dashboard-kpi-icon.red {
  background: rgba(239, 68, 68, 0.16) !important;
  color: #fca5a5 !important;
}

:root[data-theme="dark"] input[type="checkbox"],
:root[data-theme="dark"] input[type="radio"] {
  accent-color: var(--color-accent);
}

:root[data-theme="dark"] .dashboard-stat-summary,
:root[data-theme="dark"] .dashboard-stat-summary div {
  border-color: var(--color-border) !important;
  background: #132c44 !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-objects .object-employee-assignment,
:root[data-theme="dark"] #view-objects .object-form-panel,
:root[data-theme="dark"] #view-objects .object-contact-panel,
:root[data-theme="dark"] #view-objects .public-service-config,
:root[data-theme="dark"] #view-objects .object-contractor-config {
  border-color: var(--color-border) !important;
  background: #10263a !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-objects .assignment-option,
:root[data-theme="dark"] #view-objects .assignment-option.is-selected {
  border-color: var(--color-border) !important;
  background: #173554 !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-objects .assignment-option.is-selected {
  border-color: rgba(255, 106, 0, 0.68) !important;
  background: rgba(255, 106, 0, 0.14) !important;
}

:root[data-theme="dark"] #view-objects .assignment-option strong,
:root[data-theme="dark"] #view-objects .assignment-option small,
:root[data-theme="dark"] #view-objects .object-employee-assignment p,
:root[data-theme="dark"] #view-objects .public-service-config p {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-objects .assignment-option small,
:root[data-theme="dark"] #view-objects .object-employee-assignment .supporting-copy,
:root[data-theme="dark"] #view-objects .public-service-config .supporting-copy {
  color: var(--color-text-muted) !important;
}

:root[data-theme="dark"] #view-objects .secondary-action,
:root[data-theme="dark"] #view-objects .public-service-config .secondary-action,
:root[data-theme="dark"] #view-objects .object-contractor-config .secondary-action {
  border-color: var(--color-border) !important;
  background: #162f48 !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-objects #object-open-qr,
:root[data-theme="dark"] #view-objects #object-open-public,
:root[data-theme="dark"] #view-objects #object-open-pdf {
  border-color: var(--foxtask-orange) !important;
  background: var(--foxtask-orange) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 26px rgba(255, 108, 0, 0.28);
}

:root[data-theme="dark"] #view-objects #object-open-qr:hover,
:root[data-theme="dark"] #view-objects #object-open-public:hover,
:root[data-theme="dark"] #view-objects #object-open-pdf:hover {
  border-color: #ff7a1a !important;
  background: #ff7a1a !important;
}

:root[data-theme="dark"] .dashboard-stat-summary h4,
:root[data-theme="dark"] .dashboard-stat-summary dd {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] .dashboard-stat-summary dt {
  color: var(--color-label) !important;
}

:root[data-theme="dark"] .dashboard-stat-frame,
:root[data-theme="dark"] .dashboard-stat-frame-toggle button {
  border-color: var(--color-border) !important;
  background: #162f48 !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] .dashboard-stat-frame.is-active,
:root[data-theme="dark"] .dashboard-stat-frame-toggle button.is-active {
  border-color: var(--color-accent) !important;
  background: rgba(255, 106, 0, 0.18) !important;
  color: #ffd7bd !important;
}

:root[data-theme="dark"] #view-customers .detail-grid > div,
:root[data-theme="dark"] #view-objects .detail-grid > div,
:root[data-theme="dark"] #view-employees .detail-grid > div,
:root[data-theme="dark"] #view-profile .detail-grid > div,
:root[data-theme="dark"] #view-tickets .detail-grid > div,
:root[data-theme="dark"] #view-objects #object-ticket-list li,
:root[data-theme="dark"] #view-objects #object-history-list li,
:root[data-theme="dark"] #view-customers #customer-object-list li,
:root[data-theme="dark"] #view-employees .employee-history-row,
:root[data-theme="dark"] #view-employees .employee-assignment-row {
  border-color: var(--color-border) !important;
  background: #132c44 !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-employees .employee-assignment-row.is-reassignment-required {
  border-color: #ff8a33 !important;
  box-shadow: inset 4px 0 0 #ff6a00;
}

:root[data-theme="dark"] #view-calendar .calendar-reassignment-panel {
  border-color: #ff8a33 !important;
  background: #132c44 !important;
  box-shadow: inset 4px 0 0 #ff6a00;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-customers .detail-grid > div *,
:root[data-theme="dark"] #view-objects .detail-grid > div *,
:root[data-theme="dark"] #view-employees .detail-grid > div *,
:root[data-theme="dark"] #view-profile .detail-grid > div *,
:root[data-theme="dark"] #view-tickets .detail-grid > div *,
:root[data-theme="dark"] #view-objects #object-ticket-list li *,
:root[data-theme="dark"] #view-objects #object-history-list li *,
:root[data-theme="dark"] #view-customers #customer-object-list li * {
  color: inherit !important;
}

:root[data-theme="dark"] #view-customers .detail-grid dt,
:root[data-theme="dark"] #view-objects .detail-grid dt,
:root[data-theme="dark"] #view-employees .detail-grid dt,
:root[data-theme="dark"] #view-profile .detail-grid dt,
:root[data-theme="dark"] #view-tickets .detail-grid dt {
  color: var(--color-label) !important;
}

:root[data-theme="dark"] #view-customers .detail-grid dd,
:root[data-theme="dark"] #view-objects .detail-grid dd,
:root[data-theme="dark"] #view-employees .detail-grid dd,
:root[data-theme="dark"] #view-profile .detail-grid dd,
:root[data-theme="dark"] #view-tickets .detail-grid dd {
  color: var(--color-text) !important;
}

/* Ticket edit controls: keep note visibility and wide actions readable in dark mode. */
:root[data-theme="dark"] #view-tickets .ticket-note-editor,
:root[data-theme="dark"] #view-tickets .site-visit-card {
  border-color: var(--color-border) !important;
  background: #10263a !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-tickets .ticket-note-visibility,
:root[data-theme="dark"] .mobile-note-visibility {
  border-color: var(--color-border) !important;
  background: #132c44 !important;
  color: var(--color-text) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}

:root[data-theme="dark"] #view-tickets .ticket-note-visibility label,
:root[data-theme="dark"] .mobile-note-visibility label {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-tickets .ticket-note-visibility input[type="radio"],
:root[data-theme="dark"] .mobile-note-visibility input[type="radio"] {
  accent-color: var(--color-accent);
}

:root[data-theme="dark"] #view-tickets #ticket-note-save,
:root[data-theme="dark"] #view-tickets #ticket-save,
:root[data-theme="dark"] #view-tickets #ticket-site-visit-toggle {
  border-color: var(--color-border) !important;
  background: #162f48 !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] #view-tickets #ticket-note-save:hover,
:root[data-theme="dark"] #view-tickets #ticket-save:hover,
:root[data-theme="dark"] #view-tickets #ticket-site-visit-toggle:hover {
  border-color: var(--color-border-strong) !important;
  background: #1b3d5c !important;
  color: #ffffff !important;
}

:root[data-theme="dark"] #view-tickets #ticket-save {
  border-color: rgba(255, 106, 0, 0.72) !important;
  background: linear-gradient(135deg, #ff6a00, #d95600) !important;
  color: #fff7ed !important;
}

:root[data-theme="dark"] #view-tickets .site-visit-status,
:root[data-theme="dark"] #view-tickets .site-visit-status strong,
:root[data-theme="dark"] #view-tickets .site-visit-status p {
  color: var(--color-text) !important;
}

/* Calendar event cards: avoid bright list rows and washed-out text in dark mode. */
:root[data-theme="dark"] #view-calendar #calendar-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

:root[data-theme="dark"] #view-calendar #calendar-list .ticket-row {
  border: 1px solid var(--color-border) !important;
  border-left: 5px solid var(--color-accent) !important;
  border-radius: 10px !important;
  background:
    linear-gradient(135deg, rgba(255, 106, 0, 0.08), transparent 48%),
    #132c44 !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] #view-calendar #calendar-list .ticket-row:hover,
:root[data-theme="dark"] #view-calendar #calendar-list .ticket-row.is-selected {
  border-color: var(--color-border-strong) !important;
  border-left-color: var(--color-primary) !important;
  background:
    linear-gradient(135deg, rgba(30, 123, 255, 0.12), transparent 52%),
    #173554 !important;
}

:root[data-theme="dark"] #view-calendar #calendar-list .ticket-top,
:root[data-theme="dark"] #view-calendar #calendar-list .ticket-top > div,
:root[data-theme="dark"] #view-calendar #calendar-list .ticket-title,
:root[data-theme="dark"] #view-calendar #calendar-list .ticket-subline,
:root[data-theme="dark"] #view-calendar #calendar-list .supporting-copy,
:root[data-theme="dark"] #view-calendar #calendar-list .ticket-meta {
  min-width: 0;
  max-width: 100%;
}

:root[data-theme="dark"] #view-calendar #calendar-list .card-label,
:root[data-theme="dark"] #view-calendar #calendar-list .ticket-subline,
:root[data-theme="dark"] #view-calendar #calendar-list .supporting-copy {
  color: var(--color-text-muted) !important;
}

:root[data-theme="dark"] #view-calendar #calendar-list .ticket-title {
  color: var(--color-text) !important;
  overflow-wrap: anywhere;
}

:root[data-theme="dark"] #view-calendar #calendar-list .ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

:root[data-theme="dark"] #view-calendar #calendar-list .ticket-meta span {
  border: 1px solid var(--color-border) !important;
  border-radius: 999px;
  background: #162f48 !important;
  color: var(--color-text-muted) !important;
  padding: 5px 9px;
  font-weight: 800;
}

:root[data-theme="dark"] #view-calendar #calendar-list .priority-chip {
  border: 1px solid var(--color-border) !important;
  background: #162f48 !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-calendar #calendar-list .priority-chip.success {
  background: rgba(34, 197, 94, 0.18) !important;
  color: #bbf7d0 !important;
}

:root[data-theme="dark"] #view-calendar #calendar-list .priority-chip.warning {
  background: rgba(250, 204, 21, 0.18) !important;
  color: #fde68a !important;
}

:root[data-theme="dark"] #view-calendar #calendar-list .priority-chip.danger,
:root[data-theme="dark"] #view-calendar #calendar-list .priority-chip.critical {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #fecaca !important;
}

:root[data-theme="dark"] #view-calendar #calendar-list .calendar-list-icon {
  color: inherit !important;
}

/* Employee map sidebar: darken active location permission cards. */
:root[data-theme="dark"] #view-employee-map .employee-map-list-card {
  border-color: var(--color-border) !important;
  background: #10263a !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-employee-map #employee-map-list {
  display: grid;
  gap: 12px;
}

:root[data-theme="dark"] #view-employee-map #employee-map-list li {
  border: 1px solid var(--color-border) !important;
  border-left: 4px solid var(--color-primary) !important;
  border-radius: 10px !important;
  background: #132c44 !important;
  color: var(--color-text) !important;
  padding: 16px !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] #view-employee-map #employee-map-list li strong {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-employee-map #employee-map-list li p {
  color: var(--color-text-muted) !important;
}

:root[data-theme="dark"] #view-employee-map #employee-map-list .button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  justify-content: stretch;
}

:root[data-theme="dark"] #view-employee-map #employee-map-list .secondary-action {
  width: 100%;
  min-width: 0;
  border-color: var(--color-border) !important;
  background: #162f48 !important;
  color: var(--color-text) !important;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow: none !important;
}

:root[data-theme="dark"] #view-employee-map #employee-map-list .secondary-action:hover {
  border-color: var(--color-border-strong) !important;
  background: #1b3d5c !important;
  color: #ffffff !important;
}

@media (max-width: 640px) {
  :root[data-theme="dark"] #view-employee-map #employee-map-list .button-row {
    grid-template-columns: 1fr;
  }
}

/* QR editor dark mode: keep the printable poster preview light, darken the workspace. */
:root[data-theme="dark"] .main-shell:has(#view-qr-posters.is-active) {
  background: var(--color-bg) !important;
}

:root[data-theme="dark"] #view-qr-posters.qr-editor-view,
:root[data-theme="dark"] #view-qr-posters .qr-editor-grid,
:root[data-theme="dark"] #view-qr-posters .qr-editor-shell {
  border-color: var(--color-border) !important;
  background: #081827 !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-qr-posters .qr-reference-sidebar {
  border-color: var(--color-border) !important;
  background: #10263a !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] #view-qr-posters .qr-sidebar-object-picker {
  border-color: var(--color-border) !important;
  background: #132c44 !important;
}

:root[data-theme="dark"] #view-qr-posters .qr-sidebar-object-picker .field-label {
  color: var(--color-label) !important;
}

:root[data-theme="dark"] #view-qr-posters .qr-editor-topbar,
:root[data-theme="dark"] #view-qr-posters .qr-editor-column,
:root[data-theme="dark"] #view-qr-posters .qr-template-region {
  border-color: var(--color-border) !important;
  background: #10263a !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-qr-posters .qr-preview-column {
  border-color: var(--color-border) !important;
  background: #0b1f33 !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-qr-posters .qr-editor-object-title,
:root[data-theme="dark"] #view-qr-posters #qr-editor-object-title,
:root[data-theme="dark"] #view-qr-posters .qr-section-card h3,
:root[data-theme="dark"] #view-qr-posters .qr-preview-card > .section-head h3,
:root[data-theme="dark"] #view-qr-posters .qr-template-card strong {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-qr-posters .card-label,
:root[data-theme="dark"] #view-qr-posters .field-label,
:root[data-theme="dark"] #view-qr-posters .supporting-copy,
:root[data-theme="dark"] #view-qr-posters .detail-copy,
:root[data-theme="dark"] #view-qr-posters .qr-template-card span {
  color: var(--color-text-muted) !important;
}

:root[data-theme="dark"] #view-qr-posters .qr-section-card,
:root[data-theme="dark"] #view-qr-posters .qr-logo-tile,
:root[data-theme="dark"] #view-qr-posters .qr-layout-option,
:root[data-theme="dark"] #view-qr-posters .qr-template-region > .qr-section-card {
  border-color: var(--color-border) !important;
  background: #132c44 !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] #view-qr-posters .qr-section-card:hover,
:root[data-theme="dark"] #view-qr-posters .qr-layout-option:hover {
  border-color: var(--color-border-strong) !important;
  background: #173554 !important;
}

:root[data-theme="dark"] #view-qr-posters .qr-editor-tabbar {
  border-bottom-color: var(--color-border) !important;
  background: #10263a !important;
}

:root[data-theme="dark"] #view-qr-posters .qr-editor-tab {
  color: var(--color-text-muted) !important;
}

:root[data-theme="dark"] #view-qr-posters .qr-editor-tab:hover,
:root[data-theme="dark"] #view-qr-posters .qr-editor-tab.is-active {
  border-bottom-color: var(--color-accent) !important;
  color: #ffd7bd !important;
}

:root[data-theme="dark"] #view-qr-posters .search-input,
:root[data-theme="dark"] #view-qr-posters .select-input,
:root[data-theme="dark"] #view-qr-posters textarea.search-input,
:root[data-theme="dark"] #view-qr-posters .qr-richtext-input {
  border-color: var(--color-border) !important;
  background: #162f48 !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] #view-qr-posters .search-input::placeholder,
:root[data-theme="dark"] #view-qr-posters textarea.search-input::placeholder,
:root[data-theme="dark"] #view-qr-posters .qr-richtext-input:empty::before {
  color: var(--color-label) !important;
}

:root[data-theme="dark"] #view-qr-posters .search-input:focus,
:root[data-theme="dark"] #view-qr-posters .select-input:focus,
:root[data-theme="dark"] #view-qr-posters textarea.search-input:focus,
:root[data-theme="dark"] #view-qr-posters .qr-richtext-input:focus {
  border-color: var(--color-accent) !important;
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.16) !important;
}

:root[data-theme="dark"] #view-qr-posters .qr-richtext-toolbar .secondary-action,
:root[data-theme="dark"] #view-qr-posters .qr-editor-actions .secondary-action,
:root[data-theme="dark"] #view-qr-posters .qr-template-region .secondary-action,
:root[data-theme="dark"] #view-qr-posters .qr-preview-card .secondary-action,
:root[data-theme="dark"] #view-qr-posters .file-action {
  border-color: var(--color-border) !important;
  background: #162f48 !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-qr-posters .qr-richtext-toolbar .secondary-action:hover,
:root[data-theme="dark"] #view-qr-posters .qr-editor-actions .secondary-action:hover,
:root[data-theme="dark"] #view-qr-posters .qr-template-region .secondary-action:hover,
:root[data-theme="dark"] #view-qr-posters .qr-preview-card .secondary-action:hover,
:root[data-theme="dark"] #view-qr-posters .file-action:hover {
  border-color: var(--color-border-strong) !important;
  background: #1b3d5c !important;
  color: #ffffff !important;
}

:root[data-theme="dark"] #view-qr-posters .qr-editor-actions .primary-action,
:root[data-theme="dark"] #view-qr-posters .qr-preview-card .primary-action,
:root[data-theme="dark"] #view-qr-posters .qr-mobile-export .primary-action {
  border-color: rgba(255, 106, 0, 0.72) !important;
  background: linear-gradient(135deg, #ff6a00, #d95600) !important;
  color: #fff7ed !important;
}

:root[data-theme="dark"] #view-qr-posters .qr-layout-option.is-active,
:root[data-theme="dark"] #view-qr-posters .qr-template-card.is-active {
  border-color: var(--color-accent) !important;
  background: rgba(255, 106, 0, 0.14) !important;
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.08) !important;
}

:root[data-theme="dark"] #view-qr-posters .qr-template-card {
  border-color: var(--color-border) !important;
  background: #132c44 !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] #view-qr-posters .qr-template-card::before {
  border-color: var(--color-border) !important;
  background-color: #f8fafc !important;
}

:root[data-theme="dark"] #view-qr-posters .qr-preview-card {
  background: transparent !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-qr-posters .qr-preview-paper {
  color: #1f2937 !important;
}

:root[data-theme="dark"] #view-qr-posters .qr-preview-paper .detail-copy,
:root[data-theme="dark"] #view-qr-posters .qr-preview-paper .supporting-copy,
:root[data-theme="dark"] #view-qr-posters .qr-preview-paper .field-label {
  color: inherit;
}

/* Settings branding and task tables: remove the remaining bright dark-mode islands. */
:root[data-theme="dark"] #view-settings [data-settings-panel="branding"] .settings-branding-layout,
:root[data-theme="dark"] #view-settings [data-settings-panel="branding"] .detail-stack,
:root[data-theme="dark"] #view-settings [data-settings-panel="branding"] .branding-preview {
  min-width: 0;
  border-color: var(--color-border) !important;
  background: #10263a !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] #view-settings [data-settings-panel="branding"] .branding-preview {
  background:
    linear-gradient(135deg, rgba(30, 123, 255, 0.08), transparent 46%),
    #132c44 !important;
}

:root[data-theme="dark"] #view-settings [data-settings-panel="branding"] .branding-preview .card-label,
:root[data-theme="dark"] #view-settings [data-settings-panel="branding"] .field-label,
:root[data-theme="dark"] #view-settings [data-settings-panel="branding"] .branding-preview > span {
  color: var(--color-label) !important;
}

:root[data-theme="dark"] #view-settings [data-settings-panel="branding"] #branding-preview-name {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-settings [data-settings-panel="branding"] #branding-logo-remove,
:root[data-theme="dark"] #view-settings [data-settings-panel="branding"] input[type="file"]::file-selector-button {
  border: 1px solid var(--color-border) !important;
  background: #162f48 !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] #view-settings [data-settings-panel="branding"] #branding-logo-remove:hover,
:root[data-theme="dark"] #view-settings [data-settings-panel="branding"] input[type="file"]::file-selector-button:hover {
  border-color: var(--color-border-strong) !important;
  background: #1b3d5c !important;
  color: #ffffff !important;
}

:root[data-theme="dark"] #view-settings [data-settings-panel="branding"] #branding-preview-button,
:root[data-theme="dark"] #view-settings [data-settings-panel="branding"] #branding-settings-save {
  border-color: rgba(255, 106, 0, 0.78) !important;
  background: linear-gradient(135deg, #ff6a00, #d95600) !important;
  color: #fff7ed !important;
}

:root[data-theme="dark"] #view-tasks .tasks-page-header h2,
:root[data-theme="dark"] #view-tasks .tasks-side-card h3,
:root[data-theme="dark"] #view-tasks .task-calendar-section h3 {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-tasks .tasks-list-panel,
:root[data-theme="dark"] #view-tasks .tasks-side-card,
:root[data-theme="dark"] #view-tasks .task-status-section,
:root[data-theme="dark"] #view-tasks .task-calendar-section {
  border-color: var(--color-border) !important;
  background: #10263a !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] #view-tasks .task-status-header,
:root[data-theme="dark"] #view-tasks .task-table-head,
:root[data-theme="dark"] #view-tasks .task-calendar-section header {
  border-color: var(--color-border) !important;
  background: #132c44 !important;
  color: var(--color-text-muted) !important;
}

:root[data-theme="dark"] #view-tasks .task-status-header h3,
:root[data-theme="dark"] #view-tasks .task-status-header strong {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-tasks .task-table-body {
  background: #0b1f33 !important;
}

:root[data-theme="dark"] #view-tasks .task-list-row,
:root[data-theme="dark"] #view-tasks .task-calendar-item {
  border-color: var(--color-border) !important;
  background: #132c44 !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] #view-tasks .task-list-row:hover,
:root[data-theme="dark"] #view-tasks .task-calendar-item:hover {
  border-color: var(--color-border-strong) !important;
  background: #173554 !important;
}

:root[data-theme="dark"] #view-tasks .task-list-row.task-status-done {
  background: rgba(34, 197, 94, 0.08) !important;
}

:root[data-theme="dark"] #view-tasks .task-list-row.task-status-archived {
  background: #10263a !important;
}

:root[data-theme="dark"] #view-tasks .task-title-cell strong,
:root[data-theme="dark"] #view-tasks .task-calendar-item strong,
:root[data-theme="dark"] #view-tasks .task-object-cell {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-tasks .task-title-cell small,
:root[data-theme="dark"] #view-tasks .task-list-row > span,
:root[data-theme="dark"] #view-tasks .task-calendar-item small,
:root[data-theme="dark"] #view-tasks .task-calendar-type,
:root[data-theme="dark"] #view-tasks .task-empty,
:root[data-theme="dark"] #view-tasks .task-object-legend li {
  color: var(--color-text-muted) !important;
}

:root[data-theme="dark"] #view-tasks .task-title-cell strong,
:root[data-theme="dark"] #view-tasks .task-title-cell small,
:root[data-theme="dark"] #view-tasks .task-calendar-item strong,
:root[data-theme="dark"] #view-tasks .task-calendar-item small,
:root[data-theme="dark"] #view-tasks .task-empty {
  overflow-wrap: anywhere;
}

:root[data-theme="dark"] #view-tasks .task-empty {
  background: #10263a !important;
}

:root[data-theme="dark"] #view-tasks .task-status-badge,
:root[data-theme="dark"] #view-tasks .task-priority-badge,
:root[data-theme="dark"] #view-tasks .priority-chip,
:root[data-theme="dark"] #view-tasks .task-calendar-section header strong {
  border: 1px solid var(--color-border) !important;
  background: #162f48 !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-tasks .task-status-open .task-status-badge {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #fecaca !important;
}

:root[data-theme="dark"] #view-tasks .task-status-progress .task-status-badge,
:root[data-theme="dark"] #view-tasks .task-status-waiting .task-status-badge,
:root[data-theme="dark"] #view-tasks .task-priority-badge.warning,
:root[data-theme="dark"] #view-tasks .priority-chip.warning {
  background: rgba(250, 204, 21, 0.18) !important;
  color: #fde68a !important;
}

:root[data-theme="dark"] #view-tasks .task-status-planned .task-status-badge {
  background: rgba(30, 123, 255, 0.2) !important;
  color: #bcd9ff !important;
}

:root[data-theme="dark"] #view-tasks .task-status-done .task-status-badge,
:root[data-theme="dark"] #view-tasks .task-priority-badge.success,
:root[data-theme="dark"] #view-tasks .priority-chip.success {
  background: rgba(34, 197, 94, 0.18) !important;
  color: #bbf7d0 !important;
}

:root[data-theme="dark"] #view-tasks .task-priority-badge.danger,
:root[data-theme="dark"] #view-tasks .priority-chip.danger,
:root[data-theme="dark"] #view-tasks .priority-chip.critical {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #fecaca !important;
}

:root[data-theme="dark"] #view-tasks .task-action-cell .secondary-action,
:root[data-theme="dark"] #view-tasks .task-calendar-item .secondary-action {
  border-color: var(--color-border) !important;
  background: #162f48 !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] #view-tasks .task-action-cell .secondary-action:hover,
:root[data-theme="dark"] #view-tasks .task-calendar-item .secondary-action:hover {
  border-color: var(--color-border-strong) !important;
  background: #1b3d5c !important;
  color: #ffffff !important;
}

:root[data-theme="dark"] #view-tasks .task-action-cell .primary-action {
  border-color: rgba(255, 106, 0, 0.78) !important;
  background: linear-gradient(135deg, #ff6a00, #d95600) !important;
  color: #fff7ed !important;
}

:root[data-theme="dark"] #view-tasks .task-group-more {
  border-top: 1px solid var(--color-border) !important;
  background: #10263a !important;
  color: #bcd9ff !important;
}

/* Profile page dark mode: permissions and location controls. */
:root[data-theme="dark"] #view-profile .detail-card,
:root[data-theme="dark"] #view-profile .profile-location-card {
  border-color: var(--color-border) !important;
  background: #10263a !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] #view-profile #profile-permissions.simple-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

:root[data-theme="dark"] #view-profile #profile-permissions.simple-list li {
  min-width: 0;
  border: 1px solid var(--color-border) !important;
  border-left: 4px solid var(--color-primary) !important;
  border-radius: 8px;
  background: #132c44 !important;
  color: var(--color-text) !important;
  padding: 14px 16px !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] #view-profile #profile-permissions.simple-list li strong {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-profile #profile-permissions.simple-list li p {
  margin: 6px 0 0;
  color: var(--color-text-muted) !important;
}

:root[data-theme="dark"] #view-profile .profile-location-toggle,
:root[data-theme="dark"] #view-profile .profile-location-toggle span,
:root[data-theme="dark"] #view-profile .profile-location-card .supporting-copy {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-profile .profile-location-card .supporting-copy {
  color: var(--color-text-muted) !important;
}

:root[data-theme="dark"] #view-profile .profile-location-card .detail-grid > div {
  border-color: var(--color-border) !important;
  background: #132c44 !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-profile #profile-location-sharing {
  accent-color: var(--color-accent);
}

:root[data-theme="dark"] #view-profile #profile-location-refresh {
  border-color: var(--color-border) !important;
  background: #162f48 !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] #view-profile #profile-location-refresh:hover:not(:disabled) {
  border-color: var(--color-border-strong) !important;
  background: #1b3d5c !important;
  color: #ffffff !important;
}

:root[data-theme="dark"] #view-profile #profile-location-refresh:disabled {
  border-color: rgba(145, 164, 184, 0.34) !important;
  background: rgba(22, 47, 72, 0.72) !important;
  color: #91a4b8 !important;
  opacity: 1 !important;
}

/* Employee cards: make the location action visible before hover. */
:root[data-theme="dark"] .worker-location-action {
  border: 1px solid #3f6384 !important;
  background:
    linear-gradient(135deg, rgba(30, 123, 255, 0.14), rgba(255, 255, 255, 0.03)),
    #173554 !important;
  color: #f4f7fb !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 10px 22px rgba(0, 0, 0, 0.16) !important;
}

:root[data-theme="dark"] .worker-location-action:hover,
:root[data-theme="dark"] .worker-location-action:focus-visible {
  border-color: #7aa4cf !important;
  background:
    linear-gradient(135deg, rgba(30, 123, 255, 0.22), rgba(255, 255, 255, 0.05)),
    #1b3d5c !important;
  color: #ffffff !important;
  box-shadow:
    0 0 0 3px rgba(30, 123, 255, 0.16),
    0 14px 28px rgba(0, 0, 0, 0.2) !important;
}

/* Dark mode refinements for ticket tabs and activity log. */
:root[data-theme="dark"] .segmented-tabs {
  border-color: var(--color-border) !important;
  background: #0f2539 !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .segmented-tab,
:root[data-theme="dark"] #view-tickets .segmented-tabs .segmented-tab {
  border-color: var(--color-border) !important;
  background: #132c44 !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .segmented-tab:hover,
:root[data-theme="dark"] #view-tickets .segmented-tabs .segmented-tab:hover {
  border-color: var(--color-border-strong) !important;
  background: #1b3d5c !important;
  color: #ffffff !important;
}

:root[data-theme="dark"] .segmented-tab.is-active,
:root[data-theme="dark"] #view-tickets .segmented-tabs .segmented-tab.is-active {
  border-color: rgba(255, 106, 0, 0.86) !important;
  background:
    linear-gradient(135deg, rgba(255, 106, 0, 0.24), rgba(255, 106, 0, 0.1)),
    #173554 !important;
  color: #ffd7bd !important;
  box-shadow: inset 0 -3px 0 var(--color-accent) !important;
}

:root[data-theme="dark"] #view-activity-log .activity-log-shell {
  border-color: var(--color-border) !important;
  background: #10263a !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] #view-activity-log .activity-timeline::before {
  background: #3f6384 !important;
}

:root[data-theme="dark"] #view-activity-log .activity-event {
  border-color: var(--color-border) !important;
  background: #132c44 !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] #view-activity-log .activity-event:hover {
  border-color: var(--color-border-strong) !important;
  background: #173554 !important;
}

:root[data-theme="dark"] #view-activity-log .activity-marker {
  border-color: #7aa4cf !important;
  background: #162f48 !important;
  color: #d7eaff !important;
  box-shadow: 0 0 0 4px rgba(30, 123, 255, 0.12) !important;
}

:root[data-theme="dark"] #view-activity-log .activity-head time {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-activity-log .activity-content strong {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-activity-log .activity-content p {
  color: var(--color-text-muted) !important;
}

:root[data-theme="dark"] #view-activity-log .activity-head span,
:root[data-theme="dark"] #view-activity-log .activity-chips span {
  border: 1px solid var(--color-border) !important;
  background: #162f48 !important;
  color: #d7eaff !important;
}

:root[data-theme="dark"] #view-activity-log .activity-info,
:root[data-theme="dark"] #view-activity-log .activity-neutral {
  border-left-color: #7aa4cf !important;
}

:root[data-theme="dark"] #view-activity-log .activity-success {
  border-left-color: #22c55e !important;
}

:root[data-theme="dark"] #view-activity-log .activity-danger {
  border-left-color: #ef4444 !important;
}

:root[data-theme="dark"] #view-activity-log #activity-log-count {
  border-color: var(--color-border) !important;
  background: #162f48 !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-activity-log #activity-filter-reset {
  border-color: var(--color-border) !important;
  background: #162f48 !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-activity-log #activity-filter-reset:hover {
  border-color: var(--color-border-strong) !important;
  background: #1b3d5c !important;
  color: #ffffff !important;
}

/* Ticket history: keep timeline cards readable in dark mode. */
:root[data-theme="dark"] #view-tickets [data-ticket-panel="history"] {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-tickets #ticket-comment-list li {
  border-color: var(--color-border) !important;
  background:
    linear-gradient(135deg, rgba(30, 123, 255, 0.08), transparent 64%),
    #132c44 !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] #view-tickets #ticket-comment-list strong,
:root[data-theme="dark"] #view-tickets #ticket-comment-list h4,
:root[data-theme="dark"] #view-tickets #ticket-comment-list p,
:root[data-theme="dark"] #view-tickets #ticket-comment-list dd {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-tickets #ticket-comment-list small,
:root[data-theme="dark"] #view-tickets #ticket-comment-list dt,
:root[data-theme="dark"] .ticket-resident-request-meta,
:root[data-theme="dark"] .ticket-resident-answer-meta,
:root[data-theme="dark"] .ticket-note-meta,
:root[data-theme="dark"] .ticket-resident-request-author,
:root[data-theme="dark"] .ticket-resident-answer-author,
:root[data-theme="dark"] .ticket-note-author {
  color: #b8c7d6 !important;
}

:root[data-theme="dark"] #view-tickets #ticket-comment-list .ticket-resident-request-item {
  border-left-color: #1e7bff !important;
  background:
    linear-gradient(135deg, rgba(30, 123, 255, 0.18), rgba(30, 123, 255, 0.07)),
    #132c44 !important;
}

:root[data-theme="dark"] #view-tickets #ticket-comment-list .ticket-resident-answer-item {
  border-left-color: #ff6a00 !important;
  background:
    linear-gradient(135deg, rgba(255, 106, 0, 0.17), rgba(255, 106, 0, 0.06)),
    #132c44 !important;
}

:root[data-theme="dark"] #view-tickets #ticket-comment-list .ticket-public-note-item {
  border-left-color: #1e7bff !important;
  background:
    linear-gradient(135deg, rgba(30, 123, 255, 0.16), rgba(30, 123, 255, 0.05)),
    #132c44 !important;
}

:root[data-theme="dark"] #view-tickets #ticket-comment-list .ticket-internal-note-item {
  border-left-color: #91a4b8 !important;
  background:
    linear-gradient(135deg, rgba(145, 164, 184, 0.14), rgba(145, 164, 184, 0.05)),
    #132c44 !important;
}

:root[data-theme="dark"] #view-tickets #ticket-comment-list .ticket-history-system-item,
:root[data-theme="dark"] .mobile-ticket-history-list .ticket-history-system-item {
  border-left-color: #1e7bff !important;
  background:
    linear-gradient(135deg, rgba(30, 123, 255, 0.15), rgba(30, 123, 255, 0.05)),
    #132c44 !important;
}

:root[data-theme="dark"] #view-tickets #ticket-comment-list .ticket-history-tone-status,
:root[data-theme="dark"] .mobile-ticket-history-list .ticket-history-tone-status {
  border-left-color: #1e7bff !important;
}

:root[data-theme="dark"] #view-tickets #ticket-comment-list .ticket-history-tone-employee,
:root[data-theme="dark"] .mobile-ticket-history-list .ticket-history-tone-employee {
  border-left-color: #22c55e !important;
}

:root[data-theme="dark"] #view-tickets #ticket-comment-list .ticket-history-tone-priority,
:root[data-theme="dark"] .mobile-ticket-history-list .ticket-history-tone-priority {
  border-left-color: #ff7a1a !important;
}

:root[data-theme="dark"] #view-tickets #ticket-comment-list .ticket-history-tone-public,
:root[data-theme="dark"] .mobile-ticket-history-list .ticket-history-tone-public {
  border-left-color: #a78bfa !important;
}

:root[data-theme="dark"] #view-tickets #ticket-comment-list .ticket-history-tone-internal,
:root[data-theme="dark"] .mobile-ticket-history-list .ticket-history-tone-internal {
  border-left-color: #cbd5e1 !important;
}

:root[data-theme="dark"] #view-tickets #ticket-comment-list .ticket-history-tone-edited,
:root[data-theme="dark"] .mobile-ticket-history-list .ticket-history-tone-edited {
  border-left-color: #facc15 !important;
}

:root[data-theme="dark"] #view-tickets #ticket-comment-list .ticket-history-tone-created,
:root[data-theme="dark"] .mobile-ticket-history-list .ticket-history-tone-created {
  border-left-color: #b45309 !important;
}

:root[data-theme="dark"] #view-tickets #ticket-comment-list .ticket-history-tone-closed,
:root[data-theme="dark"] .mobile-ticket-history-list .ticket-history-tone-closed {
  border-left-color: #ef4444 !important;
}

:root[data-theme="dark"] .ticket-history-change {
  border-color: rgba(30, 123, 255, 0.28);
  background: rgba(30, 123, 255, 0.09);
}

:root[data-theme="dark"] .ticket-history-change-label,
:root[data-theme="dark"] .ticket-history-change-old,
:root[data-theme="dark"] .ticket-history-change-arrow {
  color: #b8c7d6 !important;
}

:root[data-theme="dark"] .ticket-history-change-new {
  color: #8ec5ff !important;
}

:root[data-theme="dark"] .ticket-history-change-employee {
  border-left-color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

:root[data-theme="dark"] .ticket-history-change-employee .ticket-history-change-new {
  color: #86efac !important;
}

:root[data-theme="dark"] .ticket-history-change-priority {
  border-left-color: #ff7a1a;
  background: rgba(255, 122, 26, 0.11);
}

:root[data-theme="dark"] .ticket-history-change-priority .ticket-history-change-new {
  color: #fdba74 !important;
}

:root[data-theme="dark"] .ticket-history-badge-status {
  border-color: rgba(30, 123, 255, 0.42) !important;
  background: rgba(30, 123, 255, 0.18) !important;
  color: #d7eaff !important;
}

:root[data-theme="dark"] .ticket-history-badge-employee {
  border-color: rgba(34, 197, 94, 0.36) !important;
  background: rgba(34, 197, 94, 0.15) !important;
  color: #bbf7d0 !important;
}

:root[data-theme="dark"] .ticket-history-badge-priority {
  border-color: rgba(255, 122, 26, 0.42) !important;
  background: rgba(255, 122, 26, 0.16) !important;
  color: #fed7aa !important;
}

:root[data-theme="dark"] .ticket-history-badge-public {
  border-color: rgba(167, 139, 250, 0.4) !important;
  background: rgba(167, 139, 250, 0.15) !important;
  color: #ddd6fe !important;
}

:root[data-theme="dark"] .ticket-history-badge-internal {
  border-color: rgba(203, 213, 225, 0.32) !important;
  background: rgba(203, 213, 225, 0.12) !important;
  color: #e2e8f0 !important;
}

:root[data-theme="dark"] .ticket-history-badge-edited {
  border-color: rgba(250, 204, 21, 0.34) !important;
  background: rgba(250, 204, 21, 0.13) !important;
  color: #fde68a !important;
}

:root[data-theme="dark"] .ticket-history-badge-created {
  border-color: rgba(180, 83, 9, 0.4) !important;
  background: rgba(180, 83, 9, 0.15) !important;
  color: #fcd9a8 !important;
}

:root[data-theme="dark"] .ticket-history-badge-closed {
  border-color: rgba(239, 68, 68, 0.4) !important;
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fecaca !important;
}

:root[data-theme="dark"] .ticket-resident-request-card,
:root[data-theme="dark"] .ticket-resident-answer-card,
:root[data-theme="dark"] .ticket-note-card,
:root[data-theme="dark"] .ticket-history-card {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] .ticket-resident-request-type {
  border: 1px solid rgba(30, 123, 255, 0.38) !important;
  background: rgba(30, 123, 255, 0.18) !important;
  color: #d7eaff !important;
}

:root[data-theme="dark"] .ticket-resident-answer-type {
  border: 1px solid rgba(255, 106, 0, 0.44) !important;
  background: rgba(255, 106, 0, 0.18) !important;
  color: #ffd7bd !important;
}

:root[data-theme="dark"] .ticket-resident-answer-status {
  border: 1px solid rgba(255, 106, 0, 0.42) !important;
  background: rgba(255, 106, 0, 0.14) !important;
  color: #ffd7bd !important;
}

:root[data-theme="dark"] .ticket-resident-answer-status.is-done {
  border-color: rgba(34, 197, 94, 0.34) !important;
  background: rgba(34, 197, 94, 0.14) !important;
  color: #86efac !important;
}

:root[data-theme="dark"] #view-tickets #ticket-comment-list .ticket-resident-answer-item.is-new,
:root[data-theme="dark"] .mobile-ticket-history-list .ticket-resident-answer-item.is-new {
  border-left-color: var(--color-primary) !important;
  background:
    linear-gradient(135deg, rgba(255, 106, 0, 0.12), transparent 62%),
    #132c44 !important;
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.12) !important;
}

:root[data-theme="dark"] #view-tickets #ticket-comment-list .ticket-resident-answer-item.is-focused,
:root[data-theme="dark"] .mobile-ticket-history-list .ticket-resident-answer-item.is-focused {
  outline-color: rgba(30, 123, 255, 0.58) !important;
}

:root[data-theme="dark"] .ticket-public-note-item .ticket-note-type {
  border: 1px solid rgba(30, 123, 255, 0.38) !important;
  background: rgba(30, 123, 255, 0.18) !important;
  color: #d7eaff !important;
}

:root[data-theme="dark"] .ticket-internal-note-item .ticket-note-type {
  border: 1px solid rgba(145, 164, 184, 0.38) !important;
  background: rgba(145, 164, 184, 0.16) !important;
  color: #dbe7f3 !important;
}

:root[data-theme="dark"] .ticket-resident-request-status.is-pending {
  border: 1px solid rgba(250, 204, 21, 0.34) !important;
  background: rgba(250, 204, 21, 0.14) !important;
  color: #fde68a !important;
}

:root[data-theme="dark"] .ticket-resident-request-status.is-answered {
  border: 1px solid rgba(34, 197, 94, 0.34) !important;
  background: rgba(34, 197, 94, 0.14) !important;
  color: #86efac !important;
}

:root[data-theme="dark"] .ticket-resident-answer-attachment {
  border-color: rgba(255, 106, 0, 0.42) !important;
  background: rgba(255, 106, 0, 0.14) !important;
  color: #ffd7bd !important;
}

/* Ticket cards with new resident answers need explicit dark contrast. */
:root[data-theme="dark"] .ticket-row.has-resident-answer,
:root[data-theme="dark"] .dashboard-ticket-row.has-resident-answer,
:root[data-theme="dark"] #view-tickets .ticket-row.has-resident-answer {
  border-color: var(--color-border) !important;
  border-left-color: var(--color-primary) !important;
  background:
    linear-gradient(135deg, rgba(30, 123, 255, 0.12), transparent 58%),
    #132c44 !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .ticket-row.has-resident-answer:hover,
:root[data-theme="dark"] .dashboard-ticket-row.has-resident-answer:hover,
:root[data-theme="dark"] #view-tickets .ticket-row.has-resident-answer:hover,
:root[data-theme="dark"] #view-tickets .ticket-row.has-resident-answer.is-selected {
  border-color: var(--color-border-strong) !important;
  border-left-color: var(--color-primary) !important;
  background:
    linear-gradient(135deg, rgba(30, 123, 255, 0.18), transparent 58%),
    #173554 !important;
}

:root[data-theme="dark"] .ticket-row.has-resident-answer .ticket-title,
:root[data-theme="dark"] .dashboard-ticket-row.has-resident-answer strong,
:root[data-theme="dark"] #view-tickets .ticket-row.has-resident-answer .ticket-title {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] .ticket-row.has-resident-answer .ticket-subline,
:root[data-theme="dark"] .ticket-row.has-resident-answer .supporting-copy,
:root[data-theme="dark"] .ticket-row.has-resident-answer .ticket-meta,
:root[data-theme="dark"] .dashboard-ticket-row.has-resident-answer small,
:root[data-theme="dark"] #view-tickets .ticket-row.has-resident-answer .ticket-subline,
:root[data-theme="dark"] #view-tickets .ticket-row.has-resident-answer .supporting-copy,
:root[data-theme="dark"] #view-tickets .ticket-row.has-resident-answer .ticket-meta {
  color: #c9d8e8 !important;
}

:root[data-theme="dark"] .resident-answer-badge,
:root[data-theme="dark"] #view-tickets .resident-answer-badge,
:root[data-theme="dark"] .dashboard-ticket-row .resident-answer-badge {
  border: 1px solid rgba(255, 106, 0, 0.62) !important;
  background: rgba(255, 106, 0, 0.16) !important;
  color: #ffd7bd !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .app-tour-card {
  border-color: rgba(75, 103, 132, 0.95);
  background: #102a43;
  color: #f8fafc;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
}

:root[data-theme="dark"] .app-tour-card h3 {
  color: #ffffff;
}

:root[data-theme="dark"] .app-tour-card p {
  color: #cbd5e1;
}

:root[data-theme="dark"] .app-tour-step {
  color: #ffb26b;
}

:root[data-theme="dark"] .app-tour-focus-clone {
  color: var(--color-text);
}

:root[data-theme="dark"] .app-tour-focus-clone .search-input,
:root[data-theme="dark"] .app-tour-focus-clone .select-input,
:root[data-theme="dark"] .app-tour-focus-clone .global-search-box .search-input,
:root[data-theme="dark"] .app-tour-focus-clone textarea.search-input {
  border-color: var(--color-border) !important;
  background: #173554 !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .app-tour-focus-clone .search-input::placeholder {
  color: var(--color-label) !important;
  opacity: 1 !important;
}

:root[data-theme="dark"] .app-tour-focus-clone .surface-card,
:root[data-theme="dark"] .app-tour-focus-clone .detail-card,
:root[data-theme="dark"] .app-tour-focus-clone .employee-permissions-box,
:root[data-theme="dark"] .app-tour-focus-clone .employee-absence-box {
  border-color: var(--color-border) !important;
  background: #102a43 !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] .app-tour-focus-clone .field-label,
:root[data-theme="dark"] .app-tour-focus-clone .card-label,
:root[data-theme="dark"] .app-tour-focus-clone label {
  color: var(--color-label) !important;
}

:root[data-theme="dark"] .app-tour-focus-clone .dashboard-v2-status-card,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-v2-worker,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-v2-object,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-compact-row,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-empty,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-empty-card,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-event-row,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-timeline-corner,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-timeline-hour,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-timeline-employee,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-timeline-slot {
  border-color: var(--color-border) !important;
  background: #132c44 !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .app-tour-focus-clone .dashboard-timeline-slot.is-free {
  background: repeating-linear-gradient(135deg, #0d2033, #0d2033 8px, #132c44 8px, #132c44 16px) !important;
}

:root[data-theme="dark"] .app-tour-focus-clone .dashboard-timeline-slot.is-booked {
  background: #173554 !important;
}

:root[data-theme="dark"] .app-tour-focus-clone .dashboard-timeline-row {
  border-color: var(--color-border) !important;
  background: #10263a !important;
}

:root[data-theme="dark"] .app-tour-focus-clone .dashboard-timeline-free-slot {
  border-right-color: var(--color-border) !important;
  background:
    repeating-linear-gradient(135deg, rgba(30, 123, 255, 0.11) 0 9px, transparent 9px 18px),
    #10263a !important;
  color: #b8c7d6 !important;
}

:root[data-theme="dark"] .app-tour-focus-clone .dashboard-timeline-lead.is-confirmed {
  border-color: #22c55e;
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.34), rgba(22, 163, 74, 0.18)),
    rgba(34, 197, 94, 0.18);
  color: #dcfce7;
  box-shadow: inset 4px 0 0 #22c55e, 0 0 0 1px rgba(34, 197, 94, 0.28);
}

:root[data-theme="dark"] .app-tour-focus-clone .dashboard-timeline-lead.is-pending,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-timeline-entry {
  border-color: rgba(255, 106, 0, 0.62);
  background: rgba(255, 106, 0, 0.13);
  color: #ffd7bd;
}

:root[data-theme="dark"] .app-tour-focus-clone .dashboard-v2-status-card strong,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-v2-worker-head strong,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-v2-object strong,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-compact-row strong,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-mini-action strong,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-timeline-employee strong,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-timeline-entry strong {
  color: #f4f7fb !important;
}

:root[data-theme="dark"] .app-tour-focus-clone .dashboard-v2-status-card span,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-v2-worker-head small,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-v2-object small,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-compact-row small,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-compact-row span,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-event-group-head span,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-timeline-employee small,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-timeline-slot > span,
:root[data-theme="dark"] .app-tour-focus-clone .dashboard-timeline-entry small {
  color: #b8c7d6 !important;
}

:root[data-theme="dark"] .app-tour-focus-clone .dashboard-event-group-head strong {
  background: rgba(31, 111, 235, 0.24);
  color: #bfdbfe;
}

#view-dashboard .dashboard-kpi-grid,
#view-dashboard .dashboard-main-grid,
#view-dashboard #dashboard-stat-card {
  display: none !important;
}

#view-dashboard #dashboard-setup-assistant {
  order: 20;
}

.dashboard-v2-status-strip {
  order: 1;
}

#dashboard-v2-calendar-card {
  order: 2;
}

.dashboard-v2-grid {
  order: 3;
}

.dashboard-v2-status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  min-width: 0;
}

.dashboard-v2-status-card {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--foxtask-line);
  border-left: 4px solid #1e7bff;
  border-radius: 8px;
  background: #fff;
  color: #071d33;
  text-align: left;
  box-shadow: var(--foxtask-card-shadow);
  cursor: pointer;
}

.dashboard-v2-status-card span {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dashboard-v2-status-card strong {
  font-size: 1.75rem;
  line-height: 1;
}

.dashboard-v2-status-card.tone-danger { border-left-color: #ef4444; }
.dashboard-v2-status-card.tone-warning { border-left-color: #f59e0b; }
.dashboard-v2-status-card.tone-success { border-left-color: #22c55e; }
.dashboard-v2-status-card.tone-info { border-left-color: #1e7bff; }

.dashboard-v2-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.dashboard-v2-column {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.dashboard-v2-panel {
  min-width: 0;
  overflow: hidden;
}

.dashboard-v2-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-timeline-employee-filter {
  position: relative;
  z-index: 8;
}

.dashboard-timeline-employee-filter-toggle {
  min-height: 38px;
}

.dashboard-timeline-employee-filter-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(320px, calc(100vw - 32px));
  border: 1px solid var(--color-border, #d9e2ef);
  border-radius: 8px;
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #0f172a);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
  padding: 10px;
}

.dashboard-timeline-employee-filter-menu.is-hidden {
  display: none;
}

.dashboard-timeline-employee-filter-list {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
  padding-right: 2px;
}

.dashboard-timeline-employee-filter-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border-radius: 8px;
  padding: 8px;
  background: #f8fbff;
  cursor: pointer;
}

.dashboard-timeline-employee-filter-option input {
  accent-color: #ff6a00;
}

.dashboard-timeline-employee-filter-option span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.dashboard-timeline-employee-filter-option strong {
  color: #0f2038;
  font-size: 0.84rem;
}

.dashboard-timeline-employee-filter-option small {
  color: #64748b;
  font-size: 0.72rem;
}

.dashboard-timeline-employee-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--color-border, #d9e2ef);
  margin-top: 10px;
  padding-top: 10px;
}

.dashboard-v2-refresh-note {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
}

.dashboard-v2-card-scroll {
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.dashboard-worker-list,
.dashboard-object-grid,
.dashboard-compact-list {
  display: grid;
  gap: 12px;
}

.dashboard-worker-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.dashboard-worker-list.is-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-worker-list.is-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-worker-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -2px 0 12px;
}

.dashboard-worker-filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.dashboard-worker-view-switch span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-worker-filter-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #dbe6f2;
  border-radius: 8px;
  background: #f8fbff;
  color: #475569;
  font-weight: 900;
  cursor: pointer;
}

.dashboard-worker-filter-button.is-active {
  border-color: #ff6a00;
  background: #071d33;
  color: #ffffff;
}

.dashboard-v2-worker,
.dashboard-v2-object,
.dashboard-compact-row {
  min-width: 0;
  width: 100%;
  border: 1px solid #dbe6f2;
  border-left: 4px solid #1e7bff;
  border-radius: 8px;
  background: #f8fbff;
  color: #071d33;
  overflow-wrap: anywhere;
}

.dashboard-v2-worker,
.dashboard-v2-object {
  padding: 14px;
  cursor: pointer;
}

.dashboard-worker-tile {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.dashboard-worker-tile:hover,
.dashboard-worker-tile:focus-within {
  box-shadow: 0 12px 28px rgba(15, 32, 56, 0.1);
  transform: translateY(-1px);
}

.dashboard-v2-worker.tone-danger,
.dashboard-v2-object.tone-danger,
.dashboard-compact-row.tone-danger { border-left-color: #ef4444; }

.dashboard-v2-worker.tone-warning,
.dashboard-v2-object.tone-warning,
.dashboard-compact-row.tone-warning { border-left-color: #f59e0b; }

.dashboard-v2-worker.tone-success,
.dashboard-v2-object.tone-success { border-left-color: #22c55e; }

.dashboard-v2-worker.tone-muted,
.dashboard-v2-object.tone-muted { border-left-color: #94a3b8; }

.dashboard-v2-object.tone-info,
.dashboard-compact-row.tone-info { border-left-color: #1e7bff; }

.dashboard-v2-worker-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.dashboard-worker-name-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.dashboard-v2-worker-head strong,
.dashboard-v2-object strong,
.dashboard-compact-row strong {
  color: inherit;
}

.dashboard-v2-worker-head small,
.dashboard-v2-object small,
.dashboard-compact-row small {
  color: #64748b;
}

.dashboard-v2-worker dl,
.dashboard-v2-object dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.dashboard-v2-worker dt,
.dashboard-v2-object dt {
  margin-bottom: 2px;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-v2-worker dd,
.dashboard-v2-object dd {
  margin: 0;
  font-weight: 900;
}

.dashboard-v2-worker dd button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 28px;
  border: 1px solid #c8d8ea;
  border-radius: 8px;
  background: #ffffff;
  color: #071d33;
  font-weight: 1000;
  cursor: pointer;
}

.dashboard-v2-worker dd button:hover,
.dashboard-v2-worker dd button:focus-visible {
  border-color: #1e7bff;
  color: #1d4ed8;
  outline: none;
}

.dashboard-worker-presence {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.dashboard-worker-presence i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.dashboard-worker-presence.is-online {
  border: 1px solid rgba(34, 197, 94, 0.36);
  background: rgba(34, 197, 94, 0.13);
  color: #15803d;
}

.dashboard-worker-presence.is-online i {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.dashboard-worker-presence.is-offline {
  border: 1px solid rgba(148, 163, 184, 0.36);
  background: rgba(100, 116, 139, 0.11);
  color: #64748b;
}

.dashboard-worker-presence.is-offline i {
  background: #94a3b8;
}

.dashboard-worker-call-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  padding: 4px 5px 4px 9px;
  font-size: 0.72rem;
  font-weight: 950;
}

.dashboard-worker-call-badge.is-employee {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.dashboard-worker-call-badge button {
  min-width: 38px;
  min-height: 26px;
  border: 0;
  border-radius: 999px;
  background: #ff6a00;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 1000;
  cursor: pointer;
}

.dashboard-worker-call-badge button:hover,
.dashboard-worker-call-badge button:focus-visible {
  background: #ea580c;
  outline: 2px solid rgba(255, 106, 0, 0.3);
  outline-offset: 2px;
}

.dashboard-worker-running {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(34, 197, 94, 0.24);
  border-radius: 8px;
  background: #ecfdf5;
  color: #166534;
  padding: 8px 10px;
}

.dashboard-worker-running strong,
.dashboard-worker-running span {
  font-size: 0.78rem;
  font-weight: 950;
}

.dashboard-worker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.dashboard-worker-actions .secondary-action {
  min-height: 34px;
  padding-inline: 12px;
}

.dashboard-worker-current {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #dbe6f2;
  border-radius: 8px;
  background: #ffffff;
}

.dashboard-worker-current strong {
  color: #071d33;
}

.dashboard-worker-current span {
  color: #64748b;
  font-size: 0.86rem;
  font-weight: 800;
}

.dashboard-worker-detail-panel {
  margin-top: 14px;
}

.dashboard-worker-detail-panel:empty {
  display: none;
}

.dashboard-worker-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dbe6f2;
  border-radius: 8px 8px 0 0;
  background: #f8fbff;
}

.dashboard-worker-detail-head h4 {
  margin: 0;
  color: #071d33;
}

.dashboard-worker-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 14px;
  border-inline: 1px solid #dbe6f2;
  background: #ffffff;
}

.dashboard-worker-tabs button {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.dashboard-worker-tabs button.is-active {
  background: #fff1e8;
  color: #c2410c;
}

.dashboard-worker-detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 1px solid #dbe6f2;
  border-radius: 0 0 8px 8px;
  background: #ffffff;
}

.dashboard-worker-detail-list li {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #e3edf8;
  border-left: 4px solid #1e7bff;
  border-radius: 8px;
  background: #f8fbff;
}

.dashboard-worker-detail-action {
  display: grid;
  width: 100%;
  gap: 3px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.dashboard-worker-detail-action:hover strong,
.dashboard-worker-detail-action:focus-visible strong {
  color: #1d4ed8;
}

.dashboard-worker-detail-action:focus-visible {
  outline: 2px solid rgba(30, 123, 255, 0.45);
  outline-offset: 3px;
  border-radius: 6px;
}

.dashboard-worker-detail-list strong {
  color: #071d33;
}

.dashboard-worker-detail-list span,
.dashboard-worker-detail-list small {
  color: #64748b;
  font-weight: 800;
}

.dashboard-worker-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.dashboard-worker-history-meta span,
.dashboard-history-detail-grid span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid #d7e5f3;
  border-radius: 999px;
  background: #eef6ff;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 900;
}

.dashboard-worker-history-meta b,
.dashboard-history-detail-grid b {
  color: #0f3d66;
}

.dashboard-history-detail-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 14px;
}

.ticket-confirmation-note,
.mobile-confirmation-note {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid #fed7aa;
  border-left: 4px solid #ff6a00;
  border-radius: 8px;
  background: #fff7ed;
  color: #7c2d12;
}

.ticket-confirmation-note.is-confirmed,
.mobile-confirmation-note.is-confirmed {
  border-color: #bbf7d0;
  border-left-color: #22c55e;
  background: #f0fdf4;
  color: #166534;
}

.ticket-confirmation-note p,
.mobile-confirmation-note p {
  margin: 0;
  font-weight: 800;
}

.dashboard-v2-object p {
  margin: 12px 0;
  color: #475569;
}

.dashboard-v2-object-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-object-state,
.dashboard-object-new-badge,
.dashboard-object-action {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  margin-top: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
}

.dashboard-object-state {
  margin-top: 0;
  background: #edf4ff;
  color: #1d4ed8;
}

.dashboard-object-state.needs-action,
.dashboard-object-new-badge {
  background: #fff1e8;
  color: #c2410c;
}

.dashboard-object-alarm-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  margin-top: 8px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 1000;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dashboard-object-state.is-calm {
  background: #e9f9ef;
  color: #15803d;
}

.dashboard-object-action {
  background: #ffecec;
  color: #b91c1c;
}

.dashboard-object-latest {
  padding: 10px 12px;
  border-radius: 8px;
  background: #eef6ff;
  color: #1e3a5f !important;
  font-weight: 800;
}

.dashboard-v2-object.has-new-activity {
  border-left-color: #ff6a00;
  animation: dashboard-object-flash 1.4s ease-out;
}

.dashboard-v2-object.has-ticket-alarm {
  border-color: #fecaca;
  border-left-color: #ef4444;
  background:
    linear-gradient(135deg, rgba(239, 68, 68, 0.09), transparent 58%),
    #fffafa;
  animation: dashboard-ticket-alarm-pulse 1.9s ease-in-out infinite;
}

.dashboard-v2-object.has-ticket-alarm .dashboard-object-state.needs-action {
  background: #fee2e2;
  color: #b91c1c;
}

.dashboard-object-seen-action {
  margin-right: 8px;
}

#dashboard-v2-object-list {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

#view-dashboard .dashboard-object-grid {
  gap: 22px;
}

#view-dashboard .dashboard-object-dashboard {
  display: grid;
  gap: 22px;
  padding: 26px;
  cursor: default;
}

#view-dashboard .dashboard-object-hero {
  display: grid;
  grid-template-columns: 58px 148px minmax(0, 1fr) minmax(180px, 240px) auto;
  gap: 22px;
  align-items: center;
}

#view-dashboard .dashboard-object-hero-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 16px;
  background: rgba(30, 123, 255, 0.14);
  color: #dbeafe;
}

#view-dashboard .dashboard-object-hero-icon .ui-icon {
  width: 30px;
  height: 30px;
}

#view-dashboard .dashboard-object-photo {
  width: 148px;
  aspect-ratio: 1.24;
  border: 1px solid rgba(55, 91, 126, 0.84);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(8, 31, 50, 0.78);
}

#view-dashboard .dashboard-object-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#view-dashboard .dashboard-object-photo.is-placeholder {
  display: grid;
  place-items: center;
  color: #7fb4ff;
}

#view-dashboard .dashboard-object-photo.is-placeholder .ui-icon {
  width: 54px;
  height: 54px;
}

#view-dashboard .dashboard-object-identity {
  display: grid;
  gap: 10px;
  min-width: 0;
}

#view-dashboard .dashboard-object-identity h3 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.15;
}

#view-dashboard .dashboard-object-identity p {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: #b8c7d6;
  font-weight: 800;
}

#view-dashboard .dashboard-object-identity p .ui-icon {
  width: 22px;
  height: 22px;
  color: #9ec5ff;
  flex: 0 0 auto;
}

#view-dashboard .dashboard-object-status-panel {
  display: grid;
  gap: 5px;
  min-height: 72px;
  align-content: center;
  padding: 14px 18px;
  border: 1px solid rgba(55, 91, 126, 0.74);
  border-radius: 18px;
  background: rgba(8, 31, 50, 0.62);
}

#view-dashboard .dashboard-object-status-panel small {
  color: #93a9bd;
  font-size: 0.84rem;
  font-weight: 850;
}

#view-dashboard .dashboard-object-state {
  gap: 9px;
  margin: 0;
  padding: 0;
  background: transparent !important;
  color: #f4f7fb !important;
  font-size: 1rem;
}

#view-dashboard .dashboard-object-state i {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 7px rgba(34, 197, 94, 0.14);
}

#view-dashboard .dashboard-object-state.needs-action i {
  background: #ff6a00;
  box-shadow: 0 0 0 7px rgba(255, 106, 0, 0.14);
}

#view-dashboard .dashboard-object-details-action {
  min-height: 56px;
  padding-inline: 24px;
  border-color: rgba(30, 123, 255, 0.58);
  background: rgba(30, 123, 255, 0.08);
  color: #7fb4ff;
}

#view-dashboard .dashboard-object-action {
  margin: 0;
  padding: 8px 13px;
  border: 1px solid rgba(248, 113, 113, 0.28);
  background: rgba(127, 29, 29, 0.34);
  color: #fecaca;
}

#view-dashboard .dashboard-object-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

#view-dashboard .dashboard-object-metric-tile {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 4px 14px;
  align-items: center;
  min-height: 104px;
  padding: 16px;
  border: 1px solid rgba(55, 91, 126, 0.76);
  border-radius: 16px;
  background: rgba(8, 31, 50, 0.62);
  color: #f4f7fb;
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

#view-dashboard .dashboard-object-metric-tile:disabled {
  cursor: default;
}

#view-dashboard .dashboard-object-metric-tile.is-actionable {
  cursor: pointer;
}

#view-dashboard .dashboard-object-metric-tile.is-actionable:hover,
#view-dashboard .dashboard-object-metric-tile.is-actionable:focus-visible {
  border-color: rgba(30, 123, 255, 0.72);
  background: rgba(13, 43, 68, 0.88);
  transform: translateY(-1px);
  outline: none;
}

#view-dashboard .dashboard-object-metric-tile span {
  grid-row: 1 / span 2;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 18px;
  background: rgba(30, 123, 255, 0.14);
}

#view-dashboard .dashboard-object-metric-tile small {
  color: #d8e4ef;
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#view-dashboard .dashboard-object-metric-tile strong {
  color: #ffffff;
  font-size: 1.55rem;
  line-height: 1;
}

#view-dashboard .dashboard-object-info-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding-top: 18px;
  border-top: 1px solid rgba(55, 91, 126, 0.72);
}

#view-dashboard .dashboard-object-info-list p {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 4px 14px;
  align-items: center;
  margin: 0;
  padding: 8px 18px 8px 0;
  color: #f4f7fb;
}

#view-dashboard .dashboard-object-info-list p + p {
  border-left: 1px solid rgba(55, 91, 126, 0.72);
  padding-left: 24px;
}

#view-dashboard .dashboard-object-info-list span {
  grid-row: 1 / span 2;
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 999px;
  background: rgba(30, 123, 255, 0.12);
  color: #dbeafe;
}

#view-dashboard .dashboard-object-info-list small {
  color: #93a9bd;
  font-size: 0.88rem;
  font-weight: 850;
}

#view-dashboard .dashboard-object-info-list strong {
  color: #ffffff;
  font-size: 1.08rem;
}

#view-dashboard .dashboard-object-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

#view-dashboard .dashboard-object-detail-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 260px;
  padding: 20px;
  border: 1px solid rgba(55, 91, 126, 0.78);
  border-radius: 18px;
  background: rgba(6, 26, 43, 0.44);
}

#view-dashboard .dashboard-object-detail-card header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #7fb4ff;
}

#view-dashboard .dashboard-object-detail-card h4 {
  margin: 0;
  color: #d8e4ef;
  font-size: 0.96rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#view-dashboard .dashboard-object-detail-card > strong {
  color: #ffffff;
  font-size: 1.28rem;
}

#view-dashboard .dashboard-object-detail-card p {
  margin: 0;
  color: #d8e4ef;
  font-weight: 800;
}

#view-dashboard .dashboard-object-link {
  justify-self: start;
  margin-top: auto;
  border: 0;
  background: transparent;
  color: #1e7bff;
  padding: 0;
  font-weight: 950;
  cursor: pointer;
}

#view-dashboard .dashboard-object-ticket-list {
  display: grid;
  gap: 8px;
}

#view-dashboard .dashboard-object-ticket-row {
  display: grid;
  grid-template-columns: minmax(92px, auto) minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid rgba(55, 91, 126, 0.58);
  background: transparent;
  color: #f4f7fb;
  text-align: left;
  cursor: pointer;
}

#view-dashboard .dashboard-object-ticket-row strong {
  color: #f4f7fb;
}

#view-dashboard .dashboard-object-ticket-row span,
#view-dashboard .dashboard-object-ticket-row time {
  color: #b8c7d6;
  font-weight: 850;
}

#view-dashboard .dashboard-object-status-badge {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(148, 163, 184, 0.16);
  color: #d8e4ef;
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 900;
}

#view-dashboard .dashboard-object-status-badge.tone-danger { background: rgba(239, 68, 68, 0.18); color: #fecaca; }
#view-dashboard .dashboard-object-status-badge.tone-warning { background: rgba(245, 158, 11, 0.18); color: #fde68a; }
#view-dashboard .dashboard-object-status-badge.tone-progress,
#view-dashboard .dashboard-object-status-badge.tone-info { background: rgba(30, 123, 255, 0.18); color: #bfdbfe; }
#view-dashboard .dashboard-object-status-badge.tone-review { background: rgba(20, 184, 166, 0.18); color: #99f6e4; }

#view-dashboard .dashboard-object-info-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

#view-dashboard .dashboard-object-info-card dt {
  color: #93a9bd;
  font-size: 0.82rem;
  font-weight: 850;
}

#view-dashboard .dashboard-object-info-card dd {
  margin: 2px 0 0;
  color: #ffffff;
  font-weight: 900;
}

#view-dashboard .dashboard-object-map-preview {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 122px;
  border: 1px solid rgba(55, 91, 126, 0.72);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.05) 25%, transparent 25%) 0 0 / 28px 28px,
    rgba(241, 245, 249, 0.08);
  color: #dbeafe;
  text-align: center;
  padding: 14px;
}

#view-dashboard .dashboard-object-map-preview .ui-icon {
  width: 34px;
  height: 34px;
  color: #1e7bff;
}

@media (max-width: 1180px) {
  #view-dashboard .dashboard-object-hero {
    grid-template-columns: 52px 128px minmax(0, 1fr);
  }

  #view-dashboard .dashboard-object-status-panel,
  #view-dashboard .dashboard-object-details-action {
    grid-column: 3;
  }

  #view-dashboard .dashboard-object-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-dashboard .dashboard-object-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  #view-dashboard .dashboard-object-dashboard {
    padding: 16px;
    gap: 16px;
  }

  #view-dashboard .dashboard-object-hero {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
  }

  #view-dashboard .dashboard-object-photo {
    grid-column: 1 / -1;
    width: 100%;
    max-height: 180px;
  }

  #view-dashboard .dashboard-object-identity,
  #view-dashboard .dashboard-object-status-panel,
  #view-dashboard .dashboard-object-details-action {
    grid-column: 1 / -1;
  }

  #view-dashboard .dashboard-object-identity h3 {
    font-size: 1.35rem;
  }

  #view-dashboard .dashboard-object-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  #view-dashboard .dashboard-object-metric-tile {
    grid-template-columns: 42px minmax(0, 1fr);
    min-height: 92px;
    padding: 12px;
  }

  #view-dashboard .dashboard-object-metric-tile span {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  #view-dashboard .dashboard-object-metric-tile .metric-icon {
    width: 22px;
    height: 22px;
  }

  #view-dashboard .dashboard-object-metric-tile small {
    font-size: 0.74rem;
  }

  #view-dashboard .dashboard-object-metric-tile strong {
    font-size: 1.3rem;
  }

  #view-dashboard .dashboard-object-info-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #view-dashboard .dashboard-object-info-list p,
  #view-dashboard .dashboard-object-info-list p + p {
    border-left: 0;
    padding: 10px 0;
  }

  #view-dashboard .dashboard-object-ticket-row {
    grid-template-columns: 1fr auto;
    gap: 5px 10px;
  }

  #view-dashboard .dashboard-object-ticket-row strong {
    grid-column: 1 / -1;
  }

  #view-dashboard .dashboard-object-ticket-row time {
    grid-column: 1 / -1;
  }
}

.dashboard-event-center {
  display: grid;
  gap: 14px;
}

.dashboard-event-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-event-group {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.dashboard-event-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
}

.dashboard-event-group-head span {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dashboard-event-group-head strong {
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1d4ed8;
  text-align: center;
  font-size: 0.78rem;
}

.dashboard-event-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: stretch;
  gap: 6px;
  min-height: 62px;
  padding: 0;
  border: 1px solid #d8e4f2;
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  background: #f8fbff;
  color: #0f2038;
}

.dashboard-event-group.is-managing .dashboard-event-row {
  grid-template-columns: auto minmax(0, 1fr) 34px;
}

.dashboard-event-bulkbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.06);
}

.dashboard-event-select-all,
.dashboard-event-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #1f3b57;
  font-weight: 900;
}

.dashboard-event-select-all input,
.dashboard-event-check input {
  width: 18px;
  height: 18px;
  accent-color: #ff6a00;
}

.dashboard-event-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-event-check {
  align-self: start;
  padding: 12px 0 0 10px;
}

.dashboard-event-open {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 10px 8px 10px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.dashboard-event-type {
  color: #2563eb;
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dashboard-event-open strong {
  overflow: hidden;
  color: #0f2038;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-event-open .dashboard-event-ticket-number {
  color: #0f2038;
  font-size: 1.08rem;
  font-weight: 950;
  line-height: 1.1;
}

.dashboard-event-review-time {
  color: #92400e;
  font-size: 0.78rem;
  font-weight: 900;
}

.dashboard-event-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
  margin: 0;
}

.dashboard-event-meta div {
  min-width: 0;
}

.dashboard-event-meta dt {
  color: #64748b;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-event-meta dd {
  overflow: hidden;
  margin: 0;
  color: #1f3148;
  font-size: 0.72rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-event-open small {
  color: #64748b;
  font-size: 0.76rem;
  line-height: 1.35;
}

.dashboard-event-dismiss {
  align-self: start;
  justify-self: end;
  width: 28px;
  height: 28px;
  margin: 8px 8px 0 0;
  border: 1px solid rgba(239, 68, 68, 0.36);
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  font-size: 1rem;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
}

.dashboard-event-dismiss:hover {
  background: #dc2626;
  color: #ffffff;
}

.dashboard-event-show-all {
  min-height: 34px;
  border: 1px solid #c9d8eb;
  border-radius: 8px;
  background: #eef6ff;
  color: #1d4ed8;
  font-weight: 900;
  cursor: pointer;
}

.dashboard-event-row.tone-review { border-left-color: #facc15; }
.dashboard-event-row.tone-question { border-left-color: #f97316; }
.dashboard-event-row.tone-resident { border-left-color: #7c3aed; }
.dashboard-event-row.tone-event { border-left-color: #2563eb; }

.ticket-history-system-item.is-focused,
.ticket-resident-answer-item.is-focused {
  outline: 2px solid #ff6a00;
  outline-offset: 3px;
}

@keyframes dashboard-object-flash {
  0% { box-shadow: 0 0 0 0 rgba(255, 106, 0, 0.34); }
  50% { box-shadow: 0 0 0 8px rgba(255, 106, 0, 0.08); }
  100% { box-shadow: none; }
}

@keyframes dashboard-ticket-alarm-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.22); }
  50% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0.08); }
}

.dashboard-compact-row {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
}

.dashboard-compact-row span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.object-ticket-summary {
  display: grid;
  gap: 10px;
  cursor: pointer;
}

.object-ticket-summary-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.object-ticket-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 0;
}

.object-ticket-summary-grid div {
  min-width: 0;
}

.object-ticket-summary-grid dt {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.object-ticket-summary-grid dd {
  margin: 2px 0 0;
  color: #0f2038;
  font-weight: 800;
}

.object-ticket-summary p {
  margin: 0;
  color: #64748b;
  font-size: 0.84rem;
  line-height: 1.4;
}

.object-list-more {
  cursor: default;
}

.dashboard-empty,
.dashboard-empty-card {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--foxtask-line);
  border-radius: 8px;
  color: #64748b;
  background: #f8fbff;
}

.dashboard-calendar-compact .dashboard-mini-list {
  max-height: 300px;
  overflow: auto;
}

.dashboard-timeline-frame-toggle {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--foxtask-line);
  border-radius: 8px;
  background: #f6f8fb;
}

.dashboard-timeline-frame {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  background: transparent;
  color: #475569;
  font-weight: 900;
  cursor: pointer;
}

.dashboard-timeline-frame.is-active {
  background: #071d33;
  color: #fff;
}

.dashboard-timeline {
  min-width: 0;
  overflow: auto;
}

.dashboard-timeline-grid {
  min-width: 1800px;
  display: grid;
  grid-template-columns: minmax(168px, 0.9fr) repeat(var(--timeline-columns), minmax(96px, 1fr));
  border: 1px solid #dbe6f2;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  position: relative;
}

.dashboard-timeline-corner,
.dashboard-timeline-hour,
.dashboard-timeline-employee,
.dashboard-timeline-slot {
  min-width: 0;
  padding: 10px;
  border-right: 1px solid #e6edf5;
  border-bottom: 1px solid #e6edf5;
}

.dashboard-timeline-corner,
.dashboard-timeline-hour {
  background: #f3f7fc;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-timeline-hour.is-new-day {
  color: #ff6a00;
  background: #fff7ed;
}

.dashboard-timeline-hour.is-now-hour {
  color: #15803d;
  background: #dcfce7;
}

.dashboard-timeline-hour small {
  display: block;
  margin-top: 2px;
  font-size: 0.64rem;
  color: inherit;
}

.dashboard-timeline-employee {
  display: grid;
  align-content: start;
  gap: 3px;
  background: #f8fbff;
}

.dashboard-timeline-status-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  margin-bottom: 3px;
  border: 1px solid rgba(239, 68, 68, 0.28);
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.dashboard-timeline-status-badge.is-urlaub {
  border-color: rgba(37, 99, 235, 0.28);
  background: #dbeafe;
  color: #1d4ed8;
}

.dashboard-timeline-employee strong {
  color: #071d33;
}

.dashboard-timeline-employee small,
.dashboard-timeline-slot > span {
  color: #64748b;
}

.dashboard-timeline-slot {
  min-height: 96px;
  position: relative;
  background: #fbfdff;
}

.dashboard-timeline-slot.is-free {
  background: repeating-linear-gradient(135deg, #f8fbff, #f8fbff 8px, #eef5fd 8px, #eef5fd 16px);
  color: #64748b;
}

.dashboard-timeline-slot.is-booked {
  background: #f1f7ff;
}

.dashboard-timeline-entry {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #1e7bff;
  border-radius: 8px;
  background: #eff6ff;
  color: #0f2038;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.dashboard-timeline-entry + .dashboard-timeline-entry {
  margin-top: 6px;
}

.dashboard-timeline-entry strong {
  color: inherit;
  font-size: 0.82rem;
}

.dashboard-timeline-entry small {
  color: #475569;
}

.dashboard-timeline-entry em {
  width: max-content;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fff;
  color: #1e3a5f;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
}

.dashboard-timeline-entry.priority-hoch,
.dashboard-timeline-entry.priority-kritisch {
  border-left-color: #ef4444;
  background: #fff1f1;
}

.dashboard-timeline-entry.priority-mittel {
  border-left-color: #ff6a00;
}

.dashboard-timeline-entry.is-confirmed {
  border-color: rgba(22, 163, 74, 0.46);
  border-left-color: #16a34a;
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(22, 163, 74, 0.08)),
    #ecfdf3;
}

.dashboard-timeline-entry.is-confirmed .task-confirmation-badge.is-confirmed {
  background: #16a34a;
  border-color: #15803d;
  color: #ffffff;
}

.dashboard-timeline-entry.is-past {
  opacity: 0.66;
  filter: grayscale(0.55);
}

.dashboard-timeline-entry.is-past:hover,
.dashboard-timeline-entry.is-past:focus-visible {
  opacity: 0.88;
  filter: grayscale(0.18);
}

.dashboard-timeline-week {
  grid-template-columns: minmax(150px, 0.9fr) repeat(var(--timeline-columns), minmax(138px, 1fr));
}

.dashboard-timeline-planner {
  grid-template-columns: minmax(168px, 0.9fr) repeat(var(--timeline-columns), minmax(96px, 1fr));
}

.dashboard-timeline-planner .dashboard-timeline-row {
  min-width: 0;
  position: relative;
  grid-column: 2 / -1;
  min-height: calc(128px + (var(--timeline-lanes, 1) - 1) * 108px);
  border-left: 1px solid #dbe6f2;
  border-top: 1px solid #dbe6f2;
  overflow: hidden;
  background: #f8fbff;
}

.dashboard-timeline-free-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--timeline-columns), minmax(96px, 1fr));
}

.dashboard-timeline-free-slot {
  min-width: 0;
  min-height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 10px;
  border-right: 1px solid #dbe6f2;
  background:
    repeating-linear-gradient(135deg, rgba(30, 123, 255, 0.06) 0 9px, transparent 9px 18px),
    #f8fbff;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.dashboard-timeline-free-slot i {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(255, 106, 0, 0.18);
  border-radius: 999px;
  background: rgba(255, 106, 0, 0.08);
  color: rgba(255, 106, 0, 0.72);
  font-style: normal;
  font-size: 0.95rem;
  font-weight: 1000;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.dashboard-timeline-free-slot:hover,
.dashboard-timeline-free-slot:focus-visible {
  background:
    repeating-linear-gradient(135deg, rgba(255, 106, 0, 0.07) 0 9px, transparent 9px 18px),
    #fff7ed;
  color: #c2410c;
  outline: none;
}

.dashboard-timeline-free-slot:hover i,
.dashboard-timeline-free-slot:focus-visible i {
  opacity: 1;
  background: #ff6a00;
  color: #ffffff;
  transform: translateY(-1px);
}

.dashboard-timeline-free-slot.is-disabled,
.dashboard-timeline-free-slot:disabled {
  cursor: not-allowed;
  border-color: #e5e7eb;
  background:
    repeating-linear-gradient(135deg, rgba(100, 116, 139, 0.09) 0 9px, transparent 9px 18px),
    #f1f5f9;
  color: #94a3b8;
}

.dashboard-timeline-free-slot.is-disabled i,
.dashboard-timeline-free-slot:disabled i {
  border-color: rgba(100, 116, 139, 0.24);
  background: rgba(100, 116, 139, 0.12);
  color: #94a3b8;
  opacity: 0.75;
  transform: none;
}

.dashboard-timeline-free-slot.is-disabled:hover,
.dashboard-timeline-free-slot.is-disabled:focus-visible,
.dashboard-timeline-free-slot:disabled:hover,
.dashboard-timeline-free-slot:disabled:focus-visible {
  background:
    repeating-linear-gradient(135deg, rgba(100, 116, 139, 0.09) 0 9px, transparent 9px 18px),
    #f1f5f9;
  color: #94a3b8;
}

.dashboard-timeline-week .dashboard-timeline-free-slot.is-week-slot {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  width: auto;
  min-height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  justify-content: flex-end;
}

.dashboard-timeline-week .dashboard-timeline-free-slot.is-week-slot span {
  display: none;
}

.dashboard-timeline-week .dashboard-timeline-free-slot.is-week-slot i {
  width: 24px;
  height: 24px;
}

.dashboard-timeline-week .dashboard-timeline-free-slot.is-week-slot + .dashboard-timeline-entry {
  margin-top: 28px;
}

.dashboard-timeline-bar {
  position: absolute;
  z-index: 2;
  min-width: 104px;
  min-height: 92px;
  height: auto;
  margin: 0;
  padding-left: 18px;
  align-content: start;
  overflow: visible;
}

.dashboard-timeline-lead {
  position: absolute;
  z-index: 4;
  height: 92px;
  min-width: 40px;
  border: 2px dashed rgba(239, 68, 68, 0.72);
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.08);
  cursor: pointer;
  padding: 8px;
  appearance: none;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 6px;
  color: #991b1b;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-timeline-lead:hover,
.dashboard-timeline-lead:focus-visible {
  border-color: #ff6a00;
  background: rgba(255, 106, 0, 0.16);
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.16);
  outline: none;
}

.dashboard-timeline-lead.is-confirmed {
  border-color: #16a34a;
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.36), rgba(22, 163, 74, 0.18)),
    rgba(34, 197, 94, 0.22);
  color: #166534;
  box-shadow: inset 4px 0 0 #16a34a, 0 0 0 1px rgba(22, 163, 74, 0.2);
}

.dashboard-timeline-lead.is-past {
  opacity: 0.72;
  filter: grayscale(0.45);
}

.dashboard-timeline-lead .timeline-lead-bell {
  position: absolute;
  top: -12px;
  right: -12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 1000;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.34);
}

.dashboard-timeline-lead strong {
  align-self: flex-end;
  margin-left: auto;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.86);
  color: inherit;
  font-size: 0.68rem;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dashboard-timeline-lead.is-confirmed .timeline-lead-bell {
  background: #16a34a;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.42);
}

.dashboard-timeline-lead.is-confirmed strong {
  background: #16a34a;
  color: #ffffff;
}

.dashboard-timeline-bar .task-confirmation-badge {
  max-width: 100%;
  min-height: 24px;
  padding: 3px 8px;
  font-size: 0.68rem;
  line-height: 1.1;
}

.dashboard-timeline-bar > .task-work-status-badge.is-icon-only {
  position: absolute;
  top: 14px;
  left: -13px;
  z-index: 4;
  display: inline-grid;
  width: 30px;
  height: 30px;
  min-height: 30px;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  font-size: 0.98rem;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.24);
}

.dashboard-timeline-bar > .task-work-status-badge.is-progress.is-icon-only,
.dashboard-timeline-entry.is-confirmed .dashboard-timeline-bar > .task-work-status-badge.is-progress.is-icon-only {
  background: #ef4444 !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.24), 0 8px 18px rgba(127, 29, 29, 0.34) !important;
}

.dashboard-timeline-bar > .task-work-status-badge.is-done.is-icon-only,
.dashboard-timeline-entry.is-confirmed .dashboard-timeline-bar > .task-work-status-badge.is-done.is-icon-only {
  background: #22c55e !important;
  border-color: #16a34a !important;
  color: #052e16 !important;
}

.dashboard-timeline-bar > .task-work-status-badge.is-icon-only span {
  display: inline-block;
  transform: translateY(-1px);
}

.dashboard-timeline-bar .task-status-stack,
.calendar-chip .task-status-stack {
  max-width: 100%;
  gap: 3px;
}

.calendar-chip .task-confirmation-badge,
.calendar-chip .task-work-status-badge {
  max-width: 100%;
  min-height: 22px;
  padding: 3px 8px;
  font-size: 0.66rem;
  line-height: 1.1;
}

.dashboard-timeline-bar .reassignment-required-badge {
  max-width: 100%;
  margin-top: 0;
  padding: 3px 8px;
  font-size: 0.68rem;
  line-height: 1.1;
  white-space: nowrap;
}

.dashboard-timeline-bar .task-status-stack + .reassignment-required-badge,
.dashboard-timeline-bar .task-confirmation-badge + .reassignment-required-badge {
  margin-top: 1px;
}

.dashboard-now-line {
  z-index: 3;
  width: 0;
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 3px solid #22c55e;
  pointer-events: none;
}

.dashboard-day-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 0;
  border-left: 2px dashed rgba(255, 106, 0, 0.82);
  pointer-events: none;
}

.dashboard-day-marker span {
  position: absolute;
  top: 8px;
  left: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
}

.dashboard-now-line span {
  position: sticky;
  top: 4px;
  display: inline-block;
  transform: translateX(-50%);
  padding: 2px 7px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 0.72rem;
  font-weight: 1000;
}

:root[data-theme="dark"] #view-dashboard .dashboard-v2-status-card,
:root[data-theme="dark"] #view-dashboard .dashboard-v2-worker,
:root[data-theme="dark"] #view-dashboard .dashboard-v2-object,
:root[data-theme="dark"] #view-dashboard .dashboard-compact-row,
:root[data-theme="dark"] #view-dashboard .dashboard-empty,
:root[data-theme="dark"] #view-dashboard .dashboard-empty-card {
  border-color: var(--color-border) !important;
  background: #132c44 !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-v2-status-card:hover,
:root[data-theme="dark"] #view-dashboard .dashboard-v2-worker:hover,
:root[data-theme="dark"] #view-dashboard .dashboard-v2-object:hover,
:root[data-theme="dark"] #view-dashboard .dashboard-compact-row:hover {
  background: #183855 !important;
  border-color: var(--color-border-strong) !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-v2-status-card span,
:root[data-theme="dark"] #view-dashboard .dashboard-v2-worker-head small,
:root[data-theme="dark"] #view-dashboard .dashboard-v2-object small,
:root[data-theme="dark"] #view-dashboard .dashboard-compact-row small,
:root[data-theme="dark"] #view-dashboard .dashboard-compact-row span,
:root[data-theme="dark"] #view-dashboard .dashboard-v2-worker dt,
:root[data-theme="dark"] #view-dashboard .dashboard-v2-object dt,
:root[data-theme="dark"] #view-dashboard .dashboard-v2-object p,
:root[data-theme="dark"] #view-dashboard .dashboard-mini-action small,
:root[data-theme="dark"] #view-dashboard .dashboard-v2-refresh-note {
  color: #b8c7d6 !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-worker-view-switch span {
  color: #91a4b8 !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-v2-status-card strong,
:root[data-theme="dark"] #view-dashboard .dashboard-v2-worker-head strong,
:root[data-theme="dark"] #view-dashboard .dashboard-v2-object strong,
:root[data-theme="dark"] #view-dashboard .dashboard-compact-row strong,
:root[data-theme="dark"] #view-dashboard .dashboard-mini-action strong {
  color: #f4f7fb !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-mini-action {
  color: #f4f7fb !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-worker-call-badge {
  border-color: rgba(239, 68, 68, 0.42);
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

:root[data-theme="dark"] #view-dashboard .dashboard-worker-call-badge.is-employee {
  border-color: rgba(255, 106, 0, 0.42);
  background: rgba(255, 106, 0, 0.18);
  color: #ffd7bd;
}

:root[data-theme="dark"] #view-dashboard .dashboard-worker-call-badge button {
  background: #ff6a00;
  color: #ffffff;
}

:root[data-theme="dark"] #view-dashboard .dashboard-worker-presence.is-online {
  border-color: rgba(34, 197, 94, 0.44);
  background: rgba(34, 197, 94, 0.17);
  color: #bbf7d0;
}

:root[data-theme="dark"] #view-dashboard .dashboard-worker-presence.is-offline {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
}

:root[data-theme="dark"] #view-dashboard .dashboard-worker-running {
  border-color: rgba(34, 197, 94, 0.38);
  background: rgba(34, 197, 94, 0.14);
  color: #bbf7d0;
}

:root[data-theme="dark"] #view-dashboard .dashboard-object-latest {
  background: #173554 !important;
  color: #d8e8fb !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-object-state {
  background: rgba(30, 123, 255, 0.16);
  color: #c7ddff;
}

:root[data-theme="dark"] #view-dashboard .dashboard-object-state.needs-action,
:root[data-theme="dark"] #view-dashboard .dashboard-object-new-badge,
:root[data-theme="dark"] #view-dashboard .dashboard-object-alarm-badge {
  background: rgba(255, 106, 0, 0.16);
  color: #ffd7bd;
}

:root[data-theme="dark"] #view-dashboard .dashboard-v2-object.has-ticket-alarm {
  border-color: rgba(239, 68, 68, 0.42) !important;
  border-left-color: #ef4444 !important;
  background:
    linear-gradient(135deg, rgba(239, 68, 68, 0.14), transparent 58%),
    #132c44 !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-object-alarm-badge {
  background: #ef4444 !important;
  color: #ffffff !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-object-action {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}

:root[data-theme="dark"] #view-dashboard .dashboard-object-state.is-calm {
  background: rgba(34, 197, 94, 0.14);
  color: #bbf7d0;
}

:root[data-theme="dark"] #view-dashboard .dashboard-event-row {
  border-color: var(--color-border);
  background: #132c44;
  color: var(--color-text);
}

:root[data-theme="dark"] #view-dashboard .dashboard-event-bulkbar {
  border-color: var(--color-border);
  background: #0b1f33;
}

:root[data-theme="dark"] #view-dashboard .dashboard-event-select-all,
:root[data-theme="dark"] #view-dashboard .dashboard-event-check {
  color: var(--color-text);
}

:root[data-theme="dark"] #view-dashboard .dashboard-event-row.tone-review { border-left-color: #facc15; }
:root[data-theme="dark"] #view-dashboard .dashboard-event-row.tone-question { border-left-color: #f97316; }
:root[data-theme="dark"] #view-dashboard .dashboard-event-row.tone-resident { border-left-color: #a78bfa; }
:root[data-theme="dark"] #view-dashboard .dashboard-event-row.tone-event { border-left-color: #60a5fa; }

:root[data-theme="dark"] #view-dashboard .dashboard-event-open strong,
:root[data-theme="dark"] #view-dashboard .dashboard-event-meta dd {
  color: var(--color-text);
}

:root[data-theme="dark"] #view-dashboard .dashboard-event-open .dashboard-event-ticket-number {
  color: #ffffff;
}

:root[data-theme="dark"] #view-dashboard .dashboard-event-review-time {
  color: #fde68a;
}

:root[data-theme="dark"] #view-dashboard .dashboard-event-open small,
:root[data-theme="dark"] #view-dashboard .dashboard-event-meta dt,
:root[data-theme="dark"] #view-dashboard .dashboard-event-group-head span {
  color: var(--color-muted);
}

:root[data-theme="dark"] #view-dashboard .dashboard-event-type {
  color: #93c5fd;
}

:root[data-theme="dark"] #view-dashboard .dashboard-event-group-head strong {
  background: rgba(31, 111, 235, 0.24);
  color: #bfdbfe;
}

:root[data-theme="dark"] #view-dashboard .dashboard-event-dismiss {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
}

:root[data-theme="dark"] #view-dashboard .dashboard-event-dismiss:hover {
  background: #dc2626;
  color: #ffffff;
}

:root[data-theme="dark"] #view-dashboard .dashboard-event-show-all {
  border-color: var(--color-border);
  background: #162f48;
  color: #bfdbfe;
}

:root[data-theme="dark"] #view-dashboard .dashboard-worker-filter-button,
:root[data-theme="dark"] #view-dashboard .dashboard-v2-worker dd button {
  border-color: var(--color-border) !important;
  background: #162f48 !important;
  color: #f4f7fb !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-worker-filter-button.is-active {
  border-color: #ff6a00 !important;
  background: #ff6a00 !important;
  color: #ffffff !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-worker-current,
:root[data-theme="dark"] #view-dashboard .dashboard-worker-detail-head,
:root[data-theme="dark"] #view-dashboard .dashboard-worker-tabs,
:root[data-theme="dark"] #view-dashboard .dashboard-worker-detail-list,
:root[data-theme="dark"] #view-dashboard .dashboard-worker-detail-list li {
  border-color: var(--color-border) !important;
  background: #132c44 !important;
  color: #f4f7fb !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-worker-current strong,
:root[data-theme="dark"] #view-dashboard .dashboard-worker-detail-head h4,
:root[data-theme="dark"] #view-dashboard .dashboard-worker-detail-list strong {
  color: #f4f7fb !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-worker-current span,
:root[data-theme="dark"] #view-dashboard .dashboard-worker-tabs button,
:root[data-theme="dark"] #view-dashboard .dashboard-worker-detail-list span,
:root[data-theme="dark"] #view-dashboard .dashboard-worker-detail-list small {
  color: #b8c7d6 !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-worker-history-meta span,
:root[data-theme="dark"] .dashboard-history-detail-grid span {
  border-color: #27445f !important;
  background: #0f2235 !important;
  color: #d8e6f5 !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-worker-history-meta b,
:root[data-theme="dark"] .dashboard-history-detail-grid b {
  color: #ffd7bd !important;
}

:root[data-theme="dark"] .ticket-confirmation-note,
:root[data-theme="dark"] .mobile-confirmation-note {
  border-color: rgba(255, 106, 0, 0.52);
  border-left-color: #ff6a00;
  background: rgba(255, 106, 0, 0.12);
  color: #ffd7bd;
}

:root[data-theme="dark"] .ticket-confirmation-note.is-confirmed,
:root[data-theme="dark"] .mobile-confirmation-note.is-confirmed {
  border-color: rgba(34, 197, 94, 0.45);
  border-left-color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
}

:root[data-theme="dark"] #view-dashboard .dashboard-worker-tabs button.is-active {
  background: rgba(255, 106, 0, 0.16) !important;
  color: #ffd7bd !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-frame-toggle,
:root[data-theme="dark"] #view-dashboard .dashboard-timeline-grid {
  border-color: var(--color-border) !important;
  background: #10263a !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-frame {
  color: #b8c7d6 !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-frame.is-active {
  background: #ff6a00 !important;
  color: #ffffff !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-employee-filter-menu {
  border-color: var(--color-border) !important;
  background: #10263a !important;
  color: #f4f7fb !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-employee-filter-option {
  background: #132c44;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-employee-filter-option strong {
  color: #f4f7fb;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-employee-filter-option small {
  color: #b8c7d6;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-employee-filter-actions {
  border-color: var(--color-border);
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-corner,
:root[data-theme="dark"] #view-dashboard .dashboard-timeline-hour,
:root[data-theme="dark"] #view-dashboard .dashboard-timeline-employee,
:root[data-theme="dark"] #view-dashboard .dashboard-timeline-slot {
  border-color: var(--color-border) !important;
  background: #132c44 !important;
  color: #f4f7fb !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-hour.is-new-day {
  background: rgba(255, 106, 0, 0.15) !important;
  color: #ffd7bd !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-slot.is-free {
  background: repeating-linear-gradient(135deg, #0d2033, #0d2033 8px, #132c44 8px, #132c44 16px) !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-slot.is-booked {
  background: #173554 !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-planner .dashboard-timeline-row {
  border-color: var(--color-border) !important;
  background: #10263a !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-free-slot {
  border-right-color: var(--color-border) !important;
  background:
    repeating-linear-gradient(135deg, rgba(30, 123, 255, 0.11) 0 9px, transparent 9px 18px),
    #10263a !important;
  color: #b8c7d6 !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-free-slot i {
  border-color: rgba(255, 138, 51, 0.34);
  background: rgba(255, 106, 0, 0.12);
  color: #ffd7bd;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-free-slot:hover,
:root[data-theme="dark"] #view-dashboard .dashboard-timeline-free-slot:focus-visible {
  background:
    repeating-linear-gradient(135deg, rgba(255, 106, 0, 0.12) 0 9px, transparent 9px 18px),
    #1a3147 !important;
  color: #ffd7bd !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-lead.is-pending {
  border-color: rgba(255, 106, 0, 0.74);
  background: rgba(255, 106, 0, 0.13);
  color: #ffd7bd;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-lead.is-confirmed {
  border-color: #22c55e;
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.34), rgba(22, 163, 74, 0.18)),
    rgba(34, 197, 94, 0.18);
  color: #dcfce7;
  box-shadow: inset 4px 0 0 #22c55e, 0 0 0 1px rgba(34, 197, 94, 0.28);
}

:root[data-theme="dark"] #view-dashboard .dashboard-day-marker {
  border-left-color: rgba(255, 138, 51, 0.84);
}

:root[data-theme="dark"] #view-dashboard .dashboard-day-marker span {
  background: #3b2417;
  color: #ffd7bd;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-entry.is-past {
  opacity: 0.5;
  filter: grayscale(0.7);
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-lead {
  border-color: rgba(239, 68, 68, 0.78);
  background: rgba(239, 68, 68, 0.13);
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-lead strong {
  background: rgba(8, 24, 39, 0.86);
  color: inherit;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-employee strong,
:root[data-theme="dark"] #view-dashboard .dashboard-timeline-entry strong {
  color: #f4f7fb !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-employee small,
:root[data-theme="dark"] #view-dashboard .dashboard-timeline-slot > span,
:root[data-theme="dark"] #view-dashboard .dashboard-timeline-entry small {
  color: #b8c7d6 !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-status-badge {
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-status-badge.is-urlaub {
  border-color: rgba(96, 165, 250, 0.42);
  background: rgba(37, 99, 235, 0.2);
  color: #bfdbfe;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-free-slot.is-disabled,
:root[data-theme="dark"] #view-dashboard .dashboard-timeline-free-slot:disabled {
  background:
    repeating-linear-gradient(135deg, rgba(148, 163, 184, 0.08) 0 9px, transparent 9px 18px),
    #102235 !important;
  color: #71869b !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-free-slot.is-disabled i,
:root[data-theme="dark"] #view-dashboard .dashboard-timeline-free-slot:disabled i {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(148, 163, 184, 0.1);
  color: #71869b;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-employee.is-krank,
:root[data-theme="dark"] #view-dashboard .dashboard-timeline-row.is-krank {
  background: rgba(239, 68, 68, 0.1) !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-employee.is-urlaub,
:root[data-theme="dark"] #view-dashboard .dashboard-timeline-row.is-urlaub {
  background: rgba(37, 99, 235, 0.12) !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-entry {
  border-color: var(--color-border) !important;
  border-left-color: #1e7bff !important;
  background: #173554 !important;
  color: #f4f7fb !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-entry.priority-hoch,
:root[data-theme="dark"] #view-dashboard .dashboard-timeline-entry.priority-kritisch {
  border-left-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.14) !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-entry.priority-mittel {
  border-left-color: #ff6a00 !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-entry.is-confirmed {
  border-color: rgba(34, 197, 94, 0.52) !important;
  border-left-color: #22c55e !important;
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.26), rgba(22, 163, 74, 0.12)),
    #133b2c !important;
  color: #f4f7fb !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-entry.is-confirmed .task-confirmation-badge.is-confirmed,
:root[data-theme="dark"] #view-dashboard .dashboard-timeline-lead.is-confirmed strong,
:root[data-theme="dark"] #view-dashboard .dashboard-timeline-lead.is-confirmed .timeline-lead-bell {
  background: #22c55e !important;
  border-color: #16a34a !important;
  color: #052e16 !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-entry.is-confirmed .task-work-status-badge.is-progress,
:root[data-theme="dark"] #view-dashboard .dashboard-timeline-bar > .task-work-status-badge.is-progress.is-icon-only {
  background: #ef4444 !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.26), 0 8px 18px rgba(127, 29, 29, 0.38) !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-entry.is-confirmed .task-work-status-badge.is-done,
:root[data-theme="dark"] #view-dashboard .dashboard-timeline-bar > .task-work-status-badge.is-done.is-icon-only {
  background: #22c55e !important;
  border-color: #16a34a !important;
  color: #052e16 !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-timeline-entry em {
  background: #10263a !important;
  color: #f4f7fb !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-now-line {
  border-left-color: #22c55e !important;
}

:root[data-theme="dark"] #view-dashboard .dashboard-now-line span {
  background: rgba(34, 197, 94, 0.16) !important;
  color: #bbf7d0 !important;
}

@media (max-width: 1120px) {
  .dashboard-v2-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-event-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-tour-card {
    left: 14px !important;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    top: auto !important;
    width: auto;
    max-height: min(78dvh, 520px);
    overflow-y: auto;
  }

  .app-tour-card.is-centered {
    transform: none;
  }

  .app-tour-actions {
    justify-content: stretch;
  }

  .app-tour-dismiss-actions {
    justify-content: stretch;
  }

  .app-tour-nav-actions {
    justify-content: stretch;
  }

  .app-tour-actions .secondary-action,
  .app-tour-actions .primary-action {
    flex: 1 1 auto;
  }

  .dashboard-worker-list.is-grid-2,
  .dashboard-worker-list.is-grid-3 {
    grid-template-columns: 1fr;
  }

  .dashboard-worker-filter {
    justify-content: flex-start;
  }

  .dashboard-v2-status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-event-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-event-bulkbar,
  .dashboard-event-bulk-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-event-group.is-managing .dashboard-event-row {
    grid-template-columns: auto minmax(0, 1fr) 34px;
  }

  .dashboard-v2-card-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .dashboard-v2-card-scroll > * {
    flex: 0 0 min(86vw, 340px);
  }

  .dashboard-v2-worker dl,
  .dashboard-v2-object dl {
    grid-template-columns: 1fr;
  }

  .dashboard-mini-action {
    grid-template-columns: 1fr;
  }

  .dashboard-mini-action small {
    grid-column: auto;
  }

  .dashboard-v2-head-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .dashboard-timeline {
    margin-right: -2px;
  }

  .dashboard-timeline-grid {
    min-width: 1640px;
  }
}

@media (max-width: 760px) {
  :root[data-theme="dark"] #view-profile #profile-permissions.simple-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  #view-dashboard {
    padding-bottom: calc(var(--mobile-nav-height, 88px) + 28px + env(safe-area-inset-bottom, 0px));
  }

  #view-dashboard .dashboard-v2-column,
  #view-dashboard .dashboard-v2-panel,
  #view-dashboard #dashboard-v2-worker-card,
  #view-dashboard #dashboard-v2-objects-card {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  #view-dashboard #dashboard-v2-worker-card,
  #view-dashboard #dashboard-v2-objects-card {
    border-radius: 18px;
    border: 1px solid rgba(55, 91, 126, 0.9);
    background:
      radial-gradient(circle at 18% 0%, rgba(30, 123, 255, 0.12), transparent 32%),
      linear-gradient(145deg, rgba(11, 35, 55, 0.98), rgba(5, 21, 35, 0.98));
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
    overflow: visible;
  }

  #view-dashboard #dashboard-v2-worker-card .dashboard-panel-head,
  #view-dashboard #dashboard-v2-objects-card .dashboard-panel-head {
    align-items: flex-start;
    gap: 14px;
  }

  #view-dashboard #dashboard-v2-objects-card .dashboard-panel-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #view-dashboard #dashboard-v2-objects-card .dashboard-panel-head > div:first-child {
    position: relative;
    padding-left: 58px;
  }

  #view-dashboard #dashboard-v2-objects-card .dashboard-panel-head > div:first-child::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.18);
    box-shadow:
      inset 15px 13px 0 -11px #38bdf8,
      inset -15px 13px 0 -11px #38bdf8,
      inset 15px -13px 0 -11px #38bdf8,
      inset -15px -13px 0 -11px #38bdf8;
  }

  #view-dashboard #dashboard-v2-objects-card .dashboard-v2-head-actions {
    display: grid;
    justify-items: end;
    gap: 12px;
    width: auto;
  }

  #view-dashboard #dashboard-v2-objects-refresh {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    border-radius: 12px;
    padding-inline: 14px;
    background: rgba(20, 47, 75, 0.92);
    color: #f4f7fb;
  }

  #view-dashboard #dashboard-v2-objects-refresh .ui-icon {
    width: 20px;
    height: 20px;
  }

  #view-dashboard #dashboard-v2-objects-card .dashboard-panel-head h3 {
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    hyphens: none;
  }

  #view-dashboard .dashboard-v2-refresh-note {
    margin-top: 6px;
    color: #b8c7d6;
    font-size: 0.95rem;
    letter-spacing: 0;
    text-transform: none;
  }

  #view-dashboard #dashboard-v2-worker-list,
  #view-dashboard #dashboard-v2-object-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  #view-dashboard #dashboard-v2-worker-list > *,
  #view-dashboard #dashboard-v2-object-list > * {
    flex: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  #view-dashboard .dashboard-worker-filter {
    display: grid;
    gap: 12px;
  }

  #view-dashboard .dashboard-worker-filter-group,
  #view-dashboard .dashboard-worker-view-switch {
    display: flex;
    width: 100%;
    gap: 8px;
  }

  #view-dashboard .dashboard-worker-filter-button,
  #view-dashboard .dashboard-timeline-employee-filter-toggle {
    min-height: 44px;
    border-radius: 12px;
    font-size: 0.92rem;
  }

  #view-dashboard .dashboard-worker-view-switch span {
    align-self: center;
    min-width: max-content;
    color: #b8c7d6;
    font-size: 0.82rem;
  }

  #view-dashboard .dashboard-v2-worker,
  #view-dashboard .dashboard-v2-object {
    border-radius: 16px;
    border: 1px solid rgba(55, 91, 126, 0.92);
    background:
      radial-gradient(circle at 10% 0%, rgba(30, 123, 255, 0.14), transparent 38%),
      rgba(8, 28, 45, 0.96);
    color: #f4f7fb;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02), 0 16px 34px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.25;
  }

  #view-dashboard .dashboard-v2-worker *,
  #view-dashboard .dashboard-v2-object * {
    box-sizing: border-box;
  }

  #view-dashboard .dashboard-panel-head h3,
  #view-dashboard .dashboard-v2-worker-head strong,
  #view-dashboard .dashboard-v2-object-title strong,
  #view-dashboard .dashboard-worker-metrics dt,
  #view-dashboard .dashboard-object-metrics dt,
  #view-dashboard .dashboard-worker-info-grid small,
  #view-dashboard .dashboard-object-info-list small,
  #view-dashboard .dashboard-worker-status,
  #view-dashboard .dashboard-object-state,
  #view-dashboard .dashboard-worker-filter-button,
  #view-dashboard .dashboard-v2-object .secondary-action {
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: normal;
    hyphens: none;
    line-height: 1.25;
  }

  #view-dashboard .dashboard-v2-worker {
    gap: 14px;
    padding: 18px;
  }

  #view-dashboard .dashboard-v2-worker-head {
    grid-template-columns: auto minmax(0, 1fr) max-content;
    gap: 14px;
  }

  #view-dashboard .dashboard-v2-worker .worker-avatar {
    width: 64px;
    height: 64px;
    background: #ffe9d5;
    color: #c2410c;
    font-size: 1.2rem;
    box-shadow: 0 10px 24px rgba(255, 106, 0, 0.18);
  }

  #view-dashboard .dashboard-v2-worker-head strong,
  #view-dashboard .dashboard-v2-object-title strong {
    color: #ffffff;
    font-size: 1.12rem;
    line-height: 1.18;
  }

  #view-dashboard .dashboard-v2-worker-head small,
  #view-dashboard .dashboard-v2-object-title small {
    color: #b8c7d6;
    font-size: 0.94rem;
  }

  #view-dashboard .dashboard-worker-name-line .dashboard-worker-presence {
    display: none;
  }

  #view-dashboard .dashboard-worker-status {
    border: 0;
    background: transparent !important;
    color: #f4f7fb !important;
    padding: 0;
    font-size: 0.95rem;
    min-width: max-content;
  }

  #view-dashboard .dashboard-worker-status::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 7px;
    border-radius: 999px;
    background: #22c55e;
  }

  #view-dashboard .dashboard-worker-status.offline::before,
  #view-dashboard .dashboard-worker-status.inactive::before {
    background: #94a3b8;
  }

  #view-dashboard .dashboard-worker-current {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    margin: 8px 0 0;
    padding: 18px;
    border: 1px solid rgba(55, 91, 126, 0.86);
    border-radius: 14px;
    background: rgba(8, 31, 50, 0.78);
  }

  #view-dashboard .dashboard-worker-current-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
  }

  #view-dashboard .dashboard-worker-current-icon .ui-icon {
    width: 24px;
    height: 24px;
  }

  #view-dashboard .dashboard-worker-current-icon::before {
    content: none;
  }

  #view-dashboard .dashboard-worker-current small {
    color: #b8c7d6;
    font-size: 0.9rem;
  }

  #view-dashboard .dashboard-worker-current strong {
    display: block;
    margin-top: 3px;
    color: #4ade80;
    font-size: 1.16rem;
  }

  #view-dashboard .dashboard-worker-current span {
    display: block;
    margin-top: 8px;
    color: #d8e4ef;
    font-size: 0.96rem;
  }

  #view-dashboard .dashboard-worker-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 10px 0 0;
    border: 1px solid rgba(55, 91, 126, 0.86);
    border-radius: 14px;
    overflow: hidden;
  }

  #view-dashboard .dashboard-worker-metrics > div {
    display: grid;
    gap: 8px;
    min-height: 96px;
    padding: 16px;
    border-right: 1px solid rgba(55, 91, 126, 0.62);
    border-bottom: 1px solid rgba(55, 91, 126, 0.62);
    background: rgba(6, 26, 43, 0.42);
    min-width: 0;
  }

  #view-dashboard .dashboard-worker-metrics > div:nth-child(2n) {
    border-right: 0;
  }

  #view-dashboard .dashboard-worker-metrics > div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  #view-dashboard .dashboard-worker-metrics dt,
  #view-dashboard .dashboard-object-metrics dt {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #d8e4ef;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
    min-width: 0;
  }

  #view-dashboard .dashboard-worker-metrics dt::before,
  #view-dashboard .dashboard-object-metrics dt::before {
    content: none;
  }

  #view-dashboard .metric-icon {
    width: 24px;
    height: 24px;
    color: #ff6a00;
  }

  #view-dashboard [data-worker-metric="tasks"] .metric-icon { color: #3b82f6; }
  #view-dashboard [data-worker-metric="overdue"] .metric-icon { color: #ef4444; }
  #view-dashboard [data-worker-metric="progress"] .metric-icon { color: #1e7bff; }
  #view-dashboard [data-worker-metric="today"] .metric-icon { color: #8b5cf6; }
  #view-dashboard [data-worker-metric="week"] .metric-icon { color: #38bdf8; }

  #view-dashboard .dashboard-worker-metrics dd,
  #view-dashboard .dashboard-worker-metrics dd button {
    margin: 0;
    border: 0;
    background: transparent;
    color: #ffffff;
    padding: 0;
    min-width: 0;
    min-height: 0;
    font-size: 1.3rem;
    font-weight: 1000;
    text-align: left;
  }

  #view-dashboard .dashboard-worker-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  #view-dashboard .dashboard-worker-info-grid > div {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 10px;
    padding: 14px;
    border: 1px solid rgba(55, 91, 126, 0.74);
    border-radius: 12px;
    background: rgba(8, 31, 50, 0.62);
    min-width: 0;
  }

  #view-dashboard .dashboard-worker-info-grid span {
    display: grid;
    place-items: center;
    grid-row: span 2;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 2px solid #22c55e;
    color: #22c55e;
  }

  #view-dashboard .dashboard-worker-info-grid .ui-icon {
    width: 18px;
    height: 18px;
  }

  #view-dashboard [data-worker-info="time"] span {
    border-color: #38bdf8;
  }

  #view-dashboard .dashboard-worker-info-grid small {
    color: #b8c7d6;
    font-size: 0.9rem;
  }

  #view-dashboard .dashboard-worker-info-grid strong {
    color: #ffffff;
    font-size: 1rem;
  }

  #view-dashboard .dashboard-worker-actions {
    display: none;
  }

  #view-dashboard .dashboard-v2-object {
    display: grid;
    gap: 14px;
    padding: 18px;
  }

  #view-dashboard .dashboard-v2-object-title {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) max-content;
    gap: 12px;
    align-items: start;
  }

  #view-dashboard .dashboard-object-mobile-icon {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 12px;
    color: #f4f7fb;
    background: rgba(255, 255, 255, 0.08);
  }

  #view-dashboard .dashboard-object-mobile-icon .ui-icon {
    width: 25px;
    height: 25px;
  }

  #view-dashboard .dashboard-object-state {
    margin: 0;
    border-radius: 10px;
    background: rgba(34, 197, 94, 0.16);
    color: #bbf7d0;
    font-size: 0.82rem;
    min-width: max-content;
  }

  #view-dashboard .dashboard-object-state.needs-action {
    background: rgba(239, 68, 68, 0.22);
    color: #fecaca;
  }

  #view-dashboard .dashboard-object-action,
  #view-dashboard .dashboard-object-new-badge,
  #view-dashboard .dashboard-object-alarm-badge,
  #view-dashboard .dashboard-object-latest {
    display: none;
  }

  #view-dashboard .dashboard-object-metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin: 0;
    border: 1px solid rgba(55, 91, 126, 0.78);
    border-radius: 12px;
    overflow: hidden;
  }

  #view-dashboard .dashboard-object-metrics > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 0 12px;
    border-bottom: 1px solid rgba(55, 91, 126, 0.62);
    min-width: 0;
  }

  #view-dashboard .dashboard-object-metrics > div:last-child {
    border-bottom: 0;
  }

  #view-dashboard .dashboard-object-metrics dd {
    margin: 0;
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 1000;
  }

  #view-dashboard [data-object-metric="progress"] .metric-icon { color: #1e7bff; }
  #view-dashboard [data-object-metric="review"] .metric-icon { color: #8b5cf6; }
  #view-dashboard [data-object-metric="questions"] .metric-icon { color: #f59e0b; }
  #view-dashboard [data-object-metric="resident"] .metric-icon { color: #22d3ee; }
  #view-dashboard [data-object-metric="tasks"] .metric-icon { color: #38bdf8; }
  #view-dashboard [data-object-metric="tasks-today"] .metric-icon { color: #facc15; }

  #view-dashboard .dashboard-object-info-list {
    display: grid;
    gap: 0;
  }

  #view-dashboard .dashboard-object-info-list p {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2px 12px;
    margin: 0;
    padding: 13px 0;
    border-bottom: 1px solid rgba(55, 91, 126, 0.54);
    color: #d8e4ef;
  }

  #view-dashboard .dashboard-object-info-list p:last-child {
    border-bottom: 0;
  }

  #view-dashboard .dashboard-object-info-list span {
    display: grid;
    place-items: center;
    grid-row: span 2;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.12);
    color: #93c5fd;
  }

  #view-dashboard .dashboard-object-info-list .ui-icon {
    width: 20px;
    height: 20px;
  }

  #view-dashboard .dashboard-object-info-list small {
    color: #b8c7d6;
    font-size: 0.92rem;
  }

  #view-dashboard .dashboard-object-info-list strong {
    color: #ffffff;
    font-size: 1rem;
  }

  #view-dashboard .dashboard-v2-object .secondary-action[data-dashboard-object-open] {
    justify-content: space-between;
    min-height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(30, 123, 255, 0.3), rgba(14, 43, 68, 0.92));
    color: #ffffff;
    font-size: 1rem;
    white-space: normal;
    min-width: 0;
  }

  #view-dashboard .dashboard-v2-object .secondary-action[data-dashboard-object-open]::after {
    content: ">";
    font-size: 1.3rem;
  }

  .bottom-nav {
    border: 1px solid rgba(55, 91, 126, 0.88);
    background: rgba(8, 24, 39, 0.96);
    backdrop-filter: blur(18px);
  }

  .bottom-nav .nav-icon {
    color: #b8c7d6;
  }

  .bottom-nav .nav-icon .ui-icon {
    width: 22px;
    height: 22px;
  }

  .bottom-nav .nav-item.is-active .nav-icon {
    color: #ff6a00;
  }

  .bottom-nav .nav-label {
    white-space: normal;
    word-break: keep-all;
    hyphens: none;
    line-height: 1.15;
  }
}

:root[data-theme="dark"] .completion-submit-box,
:root[data-theme="dark"] .completion-review-box {
  background: #10263a;
  border-color: #27445f;
  color: #f4f7fb;
}

:root[data-theme="dark"] .completion-submit-box .supporting-copy,
:root[data-theme="dark"] .completion-review-box .supporting-copy {
  color: #b8c7d6;
}

:root[data-theme="dark"] .task-review-note {
  background: rgba(255, 106, 0, 0.22);
  color: #ffd8bf;
}

.employee-absence-box {
  border: 1px solid var(--color-border, #d9e2ef);
  border-radius: 8px;
  padding: 16px;
  background: var(--color-surface-soft, #f7faff);
}

.employee-absence-info {
  display: grid;
  gap: 3px;
  margin: 10px 0 0;
  border-left: 3px solid var(--color-accent, #ff6b00);
  border-radius: 6px;
  padding: 8px 10px;
  background: rgba(255, 106, 0, 0.1);
  color: var(--color-text, #12233a);
  font-weight: 800;
}

.employee-absence-info span {
  color: var(--color-muted, #718096);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.employee-absence-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.employee-absence-result {
  margin-top: 10px;
}

.employee-absence-result strong {
  color: var(--color-accent, #ff6b00);
}

.absence-grid {
  display: grid;
  grid-template-columns: minmax(140px, 0.35fr) minmax(0, 1fr);
  gap: 10px 14px;
  align-items: center;
}

.reassignment-required-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  margin-top: 8px;
  background: #fff1e7;
  color: #c2410c;
  border: 1px solid #fed7aa;
  font-size: 0.78rem;
  font-weight: 800;
}

.is-reassignment-required {
  border-color: #f97316 !important;
  box-shadow: inset 4px 0 0 #ef4444, 0 0 0 1px rgba(249, 115, 22, 0.28);
}

.calendar-chip.is-reassignment-required,
.dashboard-timeline-entry.is-reassignment-required {
  outline: 2px solid rgba(239, 68, 68, 0.72);
  outline-offset: 2px;
}

.dashboard-timeline-employee.is-sick,
.dashboard-timeline-row.is-sick,
.dashboard-timeline-employee.is-krank,
.dashboard-timeline-row.is-krank {
  background: rgba(239, 68, 68, 0.08);
}

.dashboard-timeline-employee.is-urlaub,
.dashboard-timeline-row.is-urlaub {
  background: rgba(37, 99, 235, 0.08);
}

.task-reassignment-modal {
  z-index: 1200;
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 8, 23, 0.36);
}

.task-reassignment-modal.is-hidden {
  display: none;
}

.task-reassignment-modal.is-anchored {
  display: block;
  padding: 0;
  background: transparent;
}

.task-reassignment-modal.is-anchored::before {
  content: "";
  position: fixed;
  inset: 0;
}

.task-reassignment-modal.is-anchored .task-reassignment-card {
  position: absolute;
  left: var(--task-reassignment-left);
  top: var(--task-reassignment-top);
}

.task-reassignment-card {
  width: min(620px, calc(100vw - 32px));
  max-height: min(82vh, 720px);
  overflow: auto;
  position: relative;
  z-index: 1;
}

.task-reminder-modal {
  z-index: 1285;
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 8, 23, 0.46);
}

.task-reminder-card {
  width: min(560px, calc(100vw - 32px));
  max-height: min(86vh, 680px);
  overflow: auto;
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--color-border, #d9e2ef);
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #0f172a);
  padding: 22px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.task-schedule-modal {
  z-index: 1285;
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 8, 23, 0.46);
}

.task-schedule-modal.is-hidden {
  display: none;
}

.task-schedule-card {
  width: min(560px, calc(100vw - 32px));
  max-height: min(86vh, 680px);
  overflow: auto;
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--color-border, #d9e2ef);
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #0f172a);
  padding: 22px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.reassignment-warning {
  border: 1px solid #fed7aa;
  border-left: 4px solid #f97316;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 14px 0;
  background: #fff7ed;
  color: #7c2d12;
}

.reassignment-warning p {
  margin: 4px 0 0;
}

.task-detail-reassignment-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.task-detail-reassignment-warning > div {
  min-width: 0;
}

.task-detail-reassignment-warning .primary-action {
  flex: 0 0 auto;
  min-height: 42px;
  padding-inline: 18px;
  white-space: nowrap;
}

.task-location-warning {
  border: 1px solid rgba(250, 204, 21, 0.55);
  border-left: 4px solid #facc15;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 14px 0;
  background: rgba(250, 204, 21, 0.12);
  color: var(--text);
}

.task-location-warning strong {
  display: block;
  margin-bottom: 4px;
}

.task-location-warning p {
  margin: 0 0 12px;
  color: var(--muted);
}

.employee-permissions-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
}

.employee-permissions-box .field-label {
  margin-bottom: 8px;
}

:root[data-theme="dark"] .employee-absence-box,
:root[data-theme="dark"] .task-reassignment-card,
:root[data-theme="dark"] .task-reminder-card,
:root[data-theme="dark"] .task-schedule-card {
  background: #10263a;
  border-color: #27445f;
  color: #f4f7fb;
}

:root[data-theme="dark"] .employee-absence-info {
  background: rgba(255, 106, 0, 0.18);
  color: #f8fafc;
}

:root[data-theme="dark"] .employee-absence-info span {
  color: #ffd8bf;
}

:root[data-theme="dark"] .task-reassignment-modal {
  background: rgba(2, 8, 23, 0.54);
}

:root[data-theme="dark"] .task-reassignment-modal.is-anchored {
  background: transparent;
}

:root[data-theme="dark"] .task-reassignment-card {
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

:root[data-theme="dark"] .task-reassignment-card .section-head {
  border-color: #27445f;
}

:root[data-theme="dark"] .task-reassignment-card .card-label,
:root[data-theme="dark"] .task-reassignment-card .field-label {
  color: #91a4b8;
}

:root[data-theme="dark"] .task-reassignment-card h3,
:root[data-theme="dark"] .task-reassignment-card strong,
:root[data-theme="dark"] .task-reassignment-card dd {
  color: #f4f7fb;
}

:root[data-theme="dark"] .task-reassignment-card .detail-grid > div {
  border-color: #27445f;
  background: #132c44;
  color: #f4f7fb;
}

:root[data-theme="dark"] .task-reassignment-card .detail-grid dt {
  color: #91a4b8;
}

:root[data-theme="dark"] .task-reassignment-card .select-input {
  border-color: #27445f;
  background: #162f48;
  color: #f4f7fb;
}

:root[data-theme="dark"] .task-reassignment-card .checkbox-line {
  color: #b8c7d6;
}

:root[data-theme="dark"] .task-reassignment-card .checkbox-line input {
  accent-color: #ff6a00;
}

:root[data-theme="dark"] .task-reassignment-card .icon-action {
  border-color: #27445f;
  background: #173554;
  color: #f4f7fb;
}

:root[data-theme="dark"] .task-reassignment-card .icon-action:hover,
:root[data-theme="dark"] .task-reassignment-card .icon-action:focus-visible {
  border-color: #ff6a00;
  background: #1c4163;
}

:root[data-theme="dark"] .reassignment-required-badge {
  background: rgba(249, 115, 22, 0.18);
  border-color: rgba(249, 115, 22, 0.42);
  color: #fed7aa;
}

:root[data-theme="dark"] .is-reassignment-required {
  border-color: #fb923c !important;
  box-shadow: inset 4px 0 0 #ef4444, 0 0 0 1px rgba(251, 146, 60, 0.34);
}

:root[data-theme="dark"] .reassignment-warning {
  background: rgba(249, 115, 22, 0.14);
  border-color: rgba(249, 115, 22, 0.42);
  border-left-color: #fb923c;
  color: #fed7aa;
}

@media (max-width: 760px) {
  .task-reassignment-modal,
  .task-reassignment-modal.is-anchored {
    display: grid;
    place-items: end center;
    padding: 12px;
    background: rgba(2, 8, 23, 0.42);
  }

  .task-reassignment-modal.is-hidden {
    display: none;
  }

  .task-reassignment-modal.is-anchored .task-reassignment-card {
    position: relative;
    left: auto;
    top: auto;
    width: min(100%, 520px);
    max-height: min(78vh, 680px);
  }

  .absence-grid {
    grid-template-columns: 1fr;
  }
}

.task-confirmation-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 850;
  border: 1px solid transparent;
  white-space: nowrap;
}

.task-status-stack {
  display: inline-flex;
  width: fit-content;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.task-work-status-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 850;
  border: 1px solid transparent;
  white-space: nowrap;
}

.task-confirmation-badge.is-pending,
.task-confirmation-dot.is-pending {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.task-confirmation-badge.is-confirmed,
.task-confirmation-dot.is-confirmed {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.task-work-status-badge.is-progress {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.task-work-status-badge.is-done {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.task-confirmation-dot {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  border: 1px solid transparent;
}

.unconfirmed-task-panel {
  margin-top: 18px;
  border-top: 1px solid var(--color-border, #d9e2ef);
  padding-top: 16px;
}

.unconfirmed-task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0;
}

.unconfirmed-task-open {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.unconfirmed-dismiss-button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  margin-right: 12px;
  place-items: center;
  border: 1px solid rgba(239, 68, 68, 0.42);
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.16);
  color: #ef4444;
  font-size: 1rem;
  font-weight: 1000;
  line-height: 1;
  cursor: pointer;
}

.unconfirmed-dismiss-button:hover,
.unconfirmed-dismiss-button:focus-visible {
  background: #ef4444;
  color: #ffffff;
  outline: none;
}

.timeline-task-create-modal {
  z-index: 1240;
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 8, 23, 0.38);
}

.timeline-task-create-modal.is-hidden {
  display: none;
}

.object-create-modal,
.customer-create-modal {
  z-index: 1240;
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 8, 23, 0.42);
}

.object-create-modal.is-hidden,
.customer-create-modal.is-hidden {
  display: none;
}

.object-create-card,
.customer-create-card {
  width: min(760px, calc(100vw - 28px));
  max-height: min(88vh, 820px);
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--color-border, #d9e2ef);
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #0f172a);
  padding: 22px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
}

.object-create-grid,
.customer-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.customer-service-field {
  display: grid;
  gap: 10px;
}

.customer-service-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.customer-service-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--color-border, #d9e2ef);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--color-text, #0f172a);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.customer-service-option input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  accent-color: #f97316;
}

.customer-service-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.object-create-wide,
.object-create-geocode,
.customer-create-wide {
  grid-column: 1 / -1;
}

.object-create-color,
.object-create-geocode {
  display: grid;
  gap: 8px;
}

.object-create-color .search-input {
  min-height: 44px;
  padding: 4px;
}

.object-create-actions,
.customer-create-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.object-create-save,
.customer-create-save {
  background: #f97316;
  border-color: #f97316;
  color: #ffffff;
}

.object-create-save:hover,
.object-create-save:focus-visible,
.customer-create-save:hover,
.customer-create-save:focus-visible {
  background: #ea580c;
  border-color: #ea580c;
  color: #ffffff;
}

.timeline-task-create-card {
  width: min(680px, calc(100vw - 28px));
  max-height: min(86vh, 760px);
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--color-border, #d9e2ef);
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #0f172a);
  padding: 22px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
}

.modal-backdrop.is-dashboard-draggable {
  display: block;
  padding: 0;
  background: rgba(2, 8, 23, 0.3);
}

.modal-backdrop.is-dashboard-draggable .task-detail-card,
.modal-backdrop.is-dashboard-draggable .task-reminder-card,
.modal-backdrop.is-dashboard-draggable .task-reassignment-card,
.modal-backdrop.is-dashboard-draggable .timeline-task-create-card,
.modal-backdrop.is-dashboard-draggable .employee-map-assignment-card {
  position: fixed;
  margin: 0;
  max-height: calc(100vh - 20px);
  overflow: auto;
  padding-top: 0;
}

.dashboard-draggable-card.is-dragging {
  user-select: none;
  cursor: grabbing;
}

.dashboard-modal-drag-handle {
  cursor: move;
  touch-action: none;
}

.dashboard-modal-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin: 0 -22px 18px;
  padding: 0 10px 0 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px 16px 0 0;
  background: #071b2b;
  color: #d8e6f5;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}

.dashboard-modal-titlebar-grip {
  order: 0;
  width: 28px;
  height: 4px;
  border-radius: 999px;
  background: rgba(216, 230, 245, 0.58);
  box-shadow: 0 7px 0 rgba(216, 230, 245, 0.22), 0 -7px 0 rgba(216, 230, 245, 0.22);
}

.dashboard-modal-titlebar-label {
  order: 1;
  flex: 1 1 auto;
  min-width: 0;
  color: rgba(216, 230, 245, 0.72);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-modal-window-actions {
  order: 2;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.dashboard-modal-window-actions .secondary-action {
  min-height: 30px;
  padding: 0 9px;
  font-size: 0.72rem;
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(18, 49, 76, 0.92);
  color: #f4f7fb;
}

.dashboard-modal-titlebar .modal-close,
.dashboard-modal-titlebar .icon-action,
.dashboard-modal-titlebar-close {
  order: 3;
  flex: 0 0 auto;
  min-width: 30px;
  width: 30px;
  height: 28px;
  min-height: 28px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(248, 113, 113, 0.46);
  border-radius: 6px;
  background: rgba(127, 29, 29, 0.78);
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.dashboard-modal-titlebar .modal-close:hover,
.dashboard-modal-titlebar .icon-action:hover,
.dashboard-modal-titlebar-close:hover {
  background: #dc2626;
  border-color: #ef4444;
}

.modal-backdrop.is-dashboard-maximized .task-detail-card,
.modal-backdrop.is-dashboard-maximized .task-reminder-card,
.modal-backdrop.is-dashboard-maximized .task-reassignment-card,
.modal-backdrop.is-dashboard-maximized .timeline-task-create-card {
  border-radius: 12px;
}

.timeline-task-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.timeline-task-create-wide {
  grid-column: 1 / -1;
}

:root[data-theme="dark"] .timeline-task-create-modal,
:root[data-theme="dark"] .object-create-modal,
:root[data-theme="dark"] .customer-create-modal {
  background: rgba(2, 8, 23, 0.54);
}

:root[data-theme="dark"] .timeline-task-create-card,
:root[data-theme="dark"] .object-create-card,
:root[data-theme="dark"] .customer-create-card {
  background: #10263a;
  border-color: #27445f;
  color: #f4f7fb;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

:root[data-theme="dark"] .timeline-task-create-card .section-head,
:root[data-theme="dark"] .object-create-card .section-head,
:root[data-theme="dark"] .customer-create-card .section-head {
  border-color: #27445f;
}

:root[data-theme="dark"] .timeline-task-create-card h3,
:root[data-theme="dark"] .timeline-task-create-card strong,
:root[data-theme="dark"] .object-create-card h3,
:root[data-theme="dark"] .object-create-card strong,
:root[data-theme="dark"] .customer-create-card h3,
:root[data-theme="dark"] .customer-create-card strong {
  color: #f4f7fb;
}

:root[data-theme="dark"] .timeline-task-create-card .field-label,
:root[data-theme="dark"] .timeline-task-create-card .card-label,
:root[data-theme="dark"] .object-create-card .field-label,
:root[data-theme="dark"] .object-create-card .card-label,
:root[data-theme="dark"] .customer-create-card .field-label,
:root[data-theme="dark"] .customer-create-card .card-label {
  color: #91a4b8;
}

:root[data-theme="dark"] .timeline-task-create-card .search-input,
:root[data-theme="dark"] .timeline-task-create-card .select-input,
:root[data-theme="dark"] .object-create-card .search-input,
:root[data-theme="dark"] .object-create-card .select-input,
:root[data-theme="dark"] .customer-create-card .search-input,
:root[data-theme="dark"] .customer-create-card .select-input {
  border-color: #27445f;
  background: #162f48;
  color: #f4f7fb;
}

:root[data-theme="dark"] .customer-service-option {
  border-color: #27445f;
  background: rgba(22, 47, 72, 0.84);
  color: #f4f7fb;
}

:root[data-theme="dark"] .timeline-task-create-card .icon-action,
:root[data-theme="dark"] .object-create-card .icon-action,
:root[data-theme="dark"] .customer-create-card .icon-action {
  border-color: #27445f;
  background: #173554;
  color: #f4f7fb;
}

:root[data-theme="dark"] .timeline-task-create-card .icon-action:hover,
:root[data-theme="dark"] .timeline-task-create-card .icon-action:focus-visible,
:root[data-theme="dark"] .object-create-card .icon-action:hover,
:root[data-theme="dark"] .object-create-card .icon-action:focus-visible,
:root[data-theme="dark"] .customer-create-card .icon-action:hover,
:root[data-theme="dark"] .customer-create-card .icon-action:focus-visible {
  border-color: #ff6a00;
  background: #1c4163;
}

@media (max-width: 760px) {
  .timeline-task-create-modal,
  .object-create-modal,
  .customer-create-modal {
    place-items: end center;
    padding: 12px;
  }

  .modal-backdrop.is-dashboard-draggable {
    display: grid;
    place-items: end center;
    padding: 12px;
  }

  .task-schedule-modal {
    place-items: center;
    padding: 14px;
  }

  .task-schedule-card {
    width: min(100%, 520px);
    max-height: min(86vh, 680px);
    border-radius: 16px;
  }

  .modal-backdrop.is-dashboard-draggable .task-detail-card,
  .modal-backdrop.is-dashboard-draggable .task-reminder-card,
  .modal-backdrop.is-dashboard-draggable .task-reassignment-card,
  .modal-backdrop.is-dashboard-draggable .timeline-task-create-card,
  .modal-backdrop.is-dashboard-draggable .employee-map-assignment-card {
    position: relative;
    left: auto !important;
    top: auto !important;
    width: min(100%, 520px) !important;
    max-height: min(84vh, 720px);
    border-radius: 16px 16px 0 0;
  }

  .dashboard-modal-drag-handle {
    cursor: default;
    touch-action: auto;
  }

  .dashboard-modal-titlebar {
    display: none;
  }

  .dashboard-modal-window-actions {
    display: none;
  }

  .timeline-task-create-card,
  .object-create-card,
  .customer-create-card {
    width: min(100%, 520px);
    max-height: min(82vh, 720px);
    border-radius: 16px 16px 0 0;
  }

  .timeline-task-create-grid,
  .object-create-grid,
  .customer-create-grid {
    grid-template-columns: 1fr;
  }

  .customer-service-options {
    grid-template-columns: 1fr;
  }
}

.task-detail-modal {
  z-index: 1250;
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 8, 23, 0.36);
}

.overdue-task-confirm-modal {
  z-index: 1280;
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 8, 23, 0.48);
}

.overdue-task-confirm-card {
  width: min(560px, calc(100vw - 28px));
}

.navigation-confirm-modal {
  z-index: 2147483646;
  position: fixed !important;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 8, 23, 0.52);
  isolation: isolate;
}

.modal-backdrop.app-modal-critical,
.navigation-confirm-modal.app-modal-critical {
  z-index: 2147483646 !important;
}

.navigation-confirm-modal.is-hidden {
  display: none;
}

.navigation-confirm-card {
  position: relative;
  z-index: 2147483647;
  display: grid;
  gap: 16px;
  width: min(460px, calc(100vw - 28px));
  border: 1px solid var(--color-border, #d9e2ef);
  border-radius: 14px;
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #0f172a);
  padding: 20px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.navigation-confirm-card h3,
.navigation-confirm-target p {
  margin: 0;
}

.navigation-confirm-target {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--color-border, #d9e2ef);
  border-radius: 10px;
  background: var(--color-surface-soft, #f7faff);
}

.navigation-confirm-card .button-row > button {
  min-height: 52px;
}

.employee-work-actions .navigation-action,
.employee-current-actions .navigation-action,
.mobile-ticket-action.navigation-action {
  min-height: 56px;
}

.site-visit-retry-modal {
  z-index: 2700;
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 8, 23, 0.58);
}

.site-visit-retry-modal.is-hidden {
  display: none;
}

.site-visit-retry-card {
  display: grid;
  gap: 14px;
  width: min(440px, calc(100vw - 28px));
  border: 1px solid var(--color-border, #d9e2ef);
  border-radius: 12px;
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #0f172a);
  padding: 18px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.32);
}

.site-visit-retry-card strong,
.site-visit-retry-card p {
  margin: 0;
}

:root[data-theme="dark"] .site-visit-retry-card {
  border-color: #27445f;
  background: #10263a;
  color: #f4f7fb;
}

:root[data-theme="dark"] .navigation-confirm-card {
  border-color: #27445f;
  background: #10263a;
  color: #f4f7fb;
}

:root[data-theme="dark"] .navigation-confirm-target {
  border-color: #27445f;
  background: #132c44;
}

.task-detail-modal.is-hidden {
  display: none;
}

.task-detail-modal.is-anchored {
  display: block;
  padding: 0;
  background: transparent;
  pointer-events: auto;
}

.task-detail-modal.is-anchored::before {
  content: "";
  position: fixed;
  inset: 0;
}

.task-detail-modal.is-anchored .task-detail-card {
  position: absolute;
  left: var(--task-detail-left);
  top: var(--task-detail-top);
}

.task-detail-card {
  width: min(720px, calc(100vw - 28px));
  max-height: min(82vh, 760px);
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--color-border, #d9e2ef);
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #0f172a);
  padding: 22px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
  position: relative;
  z-index: 1;
}

.task-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.task-detail-grid > div,
.task-detail-grid > label {
  border: 1px solid var(--color-border, #d9e2ef);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--color-surface-soft, #f7faff);
}

.task-detail-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--color-text-muted, #64748b);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.task-detail-wide {
  grid-column: 1 / -1;
}

.dashboard-quick-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.dashboard-quick-columns h4 {
  margin: 0 0 8px;
}

.task-detail-description {
  border-radius: 8px;
  background: var(--color-surface-soft, #f7faff);
  padding: 14px;
  color: var(--color-text, #0f172a);
  line-height: 1.55;
}

.task-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.task-no-reminder-action {
  border-color: #94a3b8;
  color: #334155;
}

:root[data-theme="dark"] .task-no-reminder-action {
  border-color: #3c5871 !important;
  background: #10263a !important;
  color: #dbe7f3 !important;
}

:root[data-theme="dark"] .task-confirmation-badge.is-pending,
:root[data-theme="dark"] .task-confirmation-dot.is-pending {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.42);
  color: #fecaca;
}

:root[data-theme="dark"] .task-confirmation-badge.is-confirmed,
:root[data-theme="dark"] .task-confirmation-dot.is-confirmed {
  background: rgba(34, 197, 94, 0.17);
  border-color: rgba(34, 197, 94, 0.42);
  color: #bbf7d0;
}

:root[data-theme="dark"] .task-work-status-badge.is-progress {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.42);
  color: #fecaca;
}

:root[data-theme="dark"] .task-work-status-badge.is-done {
  background: rgba(34, 197, 94, 0.17);
  border-color: rgba(34, 197, 94, 0.42);
  color: #bbf7d0;
}

:root[data-theme="dark"] .ticket-status-badge.ticket-status-new { background: #2563eb !important; border-color: #60a5fa !important; color: #fff !important; }
:root[data-theme="dark"] .ticket-status-badge.ticket-status-assigned { background: #f97316 !important; border-color: #fb923c !important; color: #fff !important; }
:root[data-theme="dark"] .ticket-status-badge.ticket-status-progress { background: #dc2626 !important; border-color: #fb7185 !important; color: #fff !important; }
:root[data-theme="dark"] .ticket-status-badge.ticket-status-review { background: #facc15 !important; border-color: #fde047 !important; color: #3f2d00 !important; }
:root[data-theme="dark"] .ticket-status-badge.ticket-status-done { background: #16a34a !important; border-color: #4ade80 !important; color: #fff !important; }
:root[data-theme="dark"] .ticket-status-badge.ticket-status-waiting { background: #6b7280 !important; border-color: #a78bfa !important; color: #fff !important; }
:root[data-theme="dark"] .ticket-status-badge.ticket-status-question { background: #7c3aed !important; border-color: #a78bfa !important; color: #fff !important; }
:root[data-theme="dark"] .ticket-status-badge.ticket-status-neutral { background: #64748b !important; border-color: #94a3b8 !important; color: #fff !important; }

:root[data-theme="dark"] #view-objects .object-ticket-summary-grid dt {
  color: var(--color-label) !important;
}

:root[data-theme="dark"] #view-objects .object-ticket-summary-grid dd,
:root[data-theme="dark"] #view-objects .object-ticket-summary-head strong {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-objects .object-ticket-summary p {
  color: var(--color-muted) !important;
}

:root[data-theme="dark"] .task-detail-card {
  background: #10263a;
  border-color: #27445f;
  color: #f4f7fb;
}

:root[data-theme="dark"] .task-detail-grid > div,
:root[data-theme="dark"] .task-detail-grid > label,
:root[data-theme="dark"] .task-detail-description {
  background: #132c44;
  border-color: #27445f;
  color: #f4f7fb;
}

:root[data-theme="dark"] .task-detail-grid span {
  color: #91a4b8;
}

@media (max-width: 900px) {
  :root[data-theme="dark"] #view-tasks .tasks-kpi-grid {
    background: transparent;
  }

  :root[data-theme="dark"] #view-tasks .tasks-kpi-card {
    border-color: var(--color-border) !important;
    background: #132c44 !important;
    color: var(--color-text) !important;
    box-shadow: none !important;
  }

  :root[data-theme="dark"] #view-tasks .tasks-kpi-card.is-active {
    border-color: var(--color-accent) !important;
    background: linear-gradient(135deg, rgba(255, 106, 0, 0.2), rgba(30, 123, 255, 0.12)), #173554 !important;
    box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.16) !important;
  }

  :root[data-theme="dark"] #view-tasks .tasks-kpi-card .task-kpi-short,
  :root[data-theme="dark"] #view-tasks .tasks-kpi-card strong {
    color: var(--color-text) !important;
  }
}

@media (max-width: 900px) {
  :root[data-theme="dark"] #view-dashboard #employee-dashboard-card.employee-dashboard-card,
  :root[data-theme="dark"] #view-dashboard #employee-dashboard-card .employee-work-section,
  :root[data-theme="dark"] #view-dashboard #employee-dashboard-card .employee-own-tasks {
    border-color: #27445f !important;
    background: #132c44 !important;
    color: #f4f7fb !important;
    box-shadow: none;
  }

  :root[data-theme="dark"] #view-dashboard #employee-dashboard-card .employee-own-tasks .employee-section-title {
    margin: 0;
    padding: 14px 14px 10px;
    border-bottom: 1px solid #27445f;
    border-radius: 12px 12px 0 0;
    background: #132c44 !important;
    color: #f4f7fb !important;
  }

  :root[data-theme="dark"] #view-dashboard #employee-dashboard-card .employee-section-title h4,
  :root[data-theme="dark"] #view-dashboard #employee-dashboard-card .employee-section-title strong,
  :root[data-theme="dark"] #view-dashboard #employee-dashboard-card .employee-work-item-compact .employee-work-main strong {
    color: #f4f7fb !important;
  }

  :root[data-theme="dark"] #view-dashboard #employee-dashboard-card .employee-section-title strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    border: 1px solid #27445f;
    border-radius: 999px;
    background: #173554 !important;
  }

  :root[data-theme="dark"] #view-dashboard #employee-dashboard-card .employee-own-tasks .employee-work-list {
    padding: 12px;
    border-radius: 0 0 12px 12px;
    background: #132c44 !important;
  }

  :root[data-theme="dark"] #view-dashboard #employee-dashboard-card .employee-work-item-compact {
    border-color: #27445f !important;
    background: #10263a !important;
    color: #f4f7fb !important;
  }

  :root[data-theme="dark"] #view-dashboard #employee-dashboard-card .employee-work-item-compact .employee-work-main p,
  :root[data-theme="dark"] #view-dashboard #employee-dashboard-card .employee-work-item-compact .employee-work-main small,
  :root[data-theme="dark"] #view-dashboard #employee-dashboard-card .employee-work-item-compact .employee-work-type {
    color: #b8c7d6 !important;
  }
}

@media (max-width: 760px) {
  .navigation-confirm-modal {
    align-items: end;
    place-items: end center;
    padding: 12px 12px max(12px, env(safe-area-inset-bottom));
  }

  .navigation-confirm-card {
    width: min(100%, 520px);
    border-radius: 16px 16px 0 0;
  }

  .navigation-confirm-card .button-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .task-detail-modal,
  .task-detail-modal.is-anchored {
    z-index: 2500;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    inset: 0;
    padding: 12px 12px max(12px, env(safe-area-inset-bottom));
    background: rgba(2, 8, 23, 0.5);
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  .task-detail-modal.is-hidden {
    display: none;
  }

  .task-detail-modal.is-anchored .task-detail-card {
    position: relative;
    left: auto;
    top: auto;
  }

  .task-detail-modal .task-detail-card {
    width: min(100%, 560px);
    max-height: min(86dvh, 760px);
    border-radius: 16px 16px 0 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  :root[data-theme="dark"] .task-detail-modal {
    background: rgba(2, 8, 23, 0.68);
  }

  :root[data-theme="dark"] .task-detail-modal .task-detail-card {
    background: #10263a;
    border-color: #27445f;
    color: #f4f7fb;
  }

  .task-detail-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-quick-columns {
    grid-template-columns: 1fr;
  }

  .task-detail-actions > * {
    width: 100%;
  }

  .task-detail-reassignment-warning {
    align-items: stretch;
    flex-direction: column;
  }

  .task-detail-reassignment-warning .primary-action {
    width: 100%;
  }
}

/* Mobile calendar dark-mode completion */
:root {
  --calendar-card-bg: var(--color-surface-solid);
  --calendar-panel-bg: var(--color-surface);
  --calendar-day-bg: var(--color-surface-soft);
  --calendar-day-muted-bg: var(--color-surface-soft);
  --calendar-detail-bg: var(--color-surface-solid);
  --calendar-task-bg: var(--color-surface-soft);
  --calendar-action-bg: var(--color-field);
  --calendar-action-text: var(--color-text);
  --calendar-active-bg: var(--color-sidebar);
  --calendar-active-text: #ffffff;
  --calendar-today-border: var(--color-accent);
  --calendar-selected-border: var(--color-primary);
}

:root[data-theme="dark"] {
  --calendar-card-bg: var(--color-surface);
  --calendar-panel-bg: var(--color-surface-soft);
  --calendar-day-bg: color-mix(in srgb, var(--color-field) 82%, var(--color-primary));
  --calendar-day-muted-bg: color-mix(in srgb, var(--color-surface) 86%, var(--color-sidebar));
  --calendar-detail-bg: var(--color-surface);
  --calendar-task-bg: var(--color-field);
  --calendar-action-bg: var(--color-field);
  --calendar-action-text: var(--color-text);
  --calendar-active-bg: var(--color-sidebar);
  --calendar-active-text: var(--color-text);
  --calendar-today-border: var(--color-accent);
  --calendar-selected-border: var(--color-primary);
}

:root[data-theme="dark"] #view-calendar {
  color: var(--color-text);
}

:root[data-theme="dark"] #view-calendar .employee-calendar-overview {
  color: var(--color-text);
}

:root[data-theme="dark"] #view-calendar .employee-month-card {
  border-color: var(--color-border);
  background: var(--calendar-card-bg) !important;
  color: var(--color-text) !important;
  box-shadow: none;
}

:root[data-theme="dark"] #view-calendar .employee-month-header {
  border-bottom-color: var(--color-border) !important;
  background: var(--calendar-panel-bg) !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-calendar .employee-month-header h3,
:root[data-theme="dark"] #view-calendar .employee-calendar-details h4,
:root[data-theme="dark"] #view-calendar .employee-calendar-item .employee-work-main strong {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-calendar .employee-month-header .card-label,
:root[data-theme="dark"] #view-calendar .employee-month-weekdays,
:root[data-theme="dark"] #view-calendar .employee-calendar-details .card-label,
:root[data-theme="dark"] #view-calendar .employee-calendar-item .employee-work-type,
:root[data-theme="dark"] #view-calendar .employee-calendar-item .employee-work-main p,
:root[data-theme="dark"] #view-calendar .employee-calendar-item .employee-work-main small,
:root[data-theme="dark"] #view-calendar .employee-calendar-item .employee-work-meta {
  color: var(--color-text-muted) !important;
}

:root[data-theme="dark"] #view-calendar .employee-month-grid {
  background: var(--calendar-card-bg) !important;
}

:root[data-theme="dark"] #view-calendar .employee-month-day {
  border-color: transparent;
  background: var(--calendar-day-bg) !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-calendar .employee-month-day.is-muted {
  background: var(--calendar-day-muted-bg) !important;
  color: var(--color-label) !important;
}

:root[data-theme="dark"] #view-calendar .employee-month-day.has-items:not(.is-selected) {
  background: color-mix(in srgb, var(--calendar-day-bg) 78%, var(--color-accent));
  border-color: rgba(255, 106, 0, 0.28);
}

:root[data-theme="dark"] #view-calendar .employee-month-day.is-today {
  border-color: var(--calendar-today-border);
  box-shadow: inset 0 0 0 1px rgba(255, 106, 0, 0.42), 0 0 0 2px rgba(255, 106, 0, 0.12);
}

:root[data-theme="dark"] #view-calendar .employee-month-day.is-selected {
  border-color: var(--calendar-selected-border);
  background: var(--calendar-active-bg);
  color: var(--calendar-active-text);
  box-shadow: inset 0 -4px 0 var(--color-primary), 0 0 0 2px rgba(30, 123, 255, 0.16);
}

:root[data-theme="dark"] #view-calendar .employee-month-day.is-selected.is-today {
  border-color: var(--color-accent);
  box-shadow: inset 0 -4px 0 var(--color-primary), 0 0 0 2px rgba(255, 106, 0, 0.22);
}

:root[data-theme="dark"] #view-calendar .employee-calendar-details {
  border-color: var(--color-border);
  background: var(--calendar-detail-bg) !important;
  color: var(--color-text) !important;
  box-shadow: none;
  overflow: hidden;
}

:root[data-theme="dark"] #view-calendar .employee-calendar-details > header,
:root[data-theme="dark"] #view-calendar .employee-calendar-details .employee-section-title {
  margin: 0;
  padding: 14px;
  border-bottom: 1px solid var(--color-border) !important;
  border-radius: 0;
  background: var(--calendar-panel-bg) !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-calendar .employee-calendar-details > header h4 {
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-calendar .employee-calendar-details > header strong,
:root[data-theme="dark"] #view-calendar .employee-calendar-details .employee-section-title strong {
  border-color: rgba(30, 123, 255, 0.38);
  background: rgba(30, 123, 255, 0.16);
  color: var(--color-text) !important;
}

:root[data-theme="dark"] #view-calendar .employee-calendar-details .employee-work-list {
  padding: 14px;
  background: transparent !important;
}

:root[data-theme="dark"] #view-calendar .employee-calendar-item {
  border-color: var(--color-border);
  background: var(--calendar-task-bg) !important;
  color: var(--color-text) !important;
  box-shadow: none;
}

:root[data-theme="dark"] #view-calendar .employee-calendar-item .secondary-action {
  border-color: var(--color-border) !important;
  background: var(--calendar-action-bg) !important;
  color: var(--calendar-action-text) !important;
}

:root[data-theme="dark"] #view-calendar .employee-month-header .secondary-action,
:root[data-theme="dark"] #view-calendar #calendar-prev,
:root[data-theme="dark"] #view-calendar #calendar-next {
  border-color: var(--color-border);
  background: var(--color-field);
  color: var(--color-text);
}

:root[data-theme="dark"] #view-calendar .employee-calendar-fab {
  border: 1px solid rgba(255, 190, 138, 0.45);
  background: var(--color-accent);
  color: var(--color-text);
  box-shadow: 0 18px 34px rgba(255, 106, 0, 0.34), 0 0 0 6px rgba(255, 106, 0, 0.08);
}

@media (max-width: 900px) {
  :root[data-theme="dark"] #view-calendar .surface-card,
  :root[data-theme="dark"] #view-calendar .detail-card {
    border-color: var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
  }

  :root[data-theme="dark"] #view-calendar .bottom-nav {
    border-color: rgba(39, 68, 95, 0.9);
    background: rgba(8, 24, 39, 0.96);
  }
}

.runtime-debug-panel {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 1800;
  display: grid;
  gap: 8px;
  max-width: min(380px, calc(100vw - 24px));
  padding: 9px;
  border: 1px solid rgba(30, 123, 255, 0.38);
  border-radius: 8px;
  background: rgba(3, 12, 23, 0.92);
  color: #eaf3ff;
  box-shadow: 0 16px 38px rgba(2, 8, 23, 0.34);
  font-size: 0.68rem;
  line-height: 1.22;
  pointer-events: auto;
}

.runtime-debug-panel.is-collapsed {
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.runtime-debug-panel strong {
  color: #ffb26b;
  font-size: 0.72rem;
}

.runtime-debug-toggle,
.runtime-debug-actions button {
  min-height: 34px;
  border: 1px solid rgba(30, 123, 255, 0.42);
  border-radius: 999px;
  background: rgba(8, 24, 39, 0.94);
  color: #eaf3ff;
  padding: 0 12px;
  font-size: 0.72rem;
  font-weight: 850;
  cursor: pointer;
}

.runtime-debug-toggle:hover,
.runtime-debug-toggle:focus-visible,
.runtime-debug-actions button:hover,
.runtime-debug-actions button:focus-visible {
  border-color: rgba(255, 106, 0, 0.72);
  outline: none;
}

.runtime-debug-content {
  display: grid;
  gap: 7px;
}

.runtime-debug-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.runtime-debug-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.runtime-debug-actions button {
  min-height: 28px;
  border-radius: 7px;
  padding: 0 8px;
}

.runtime-debug-lines {
  display: grid;
  gap: 2px;
  max-height: min(56vh, 520px);
  overflow: auto;
}

.runtime-debug-lines span {
  overflow-wrap: anywhere;
}

.runtime-debug-lines b {
  color: #b8c7d6;
}

@media (max-width: 760px) {
  .global-search-box {
    width: 100%;
  }

  .global-search-results {
    position: fixed;
    top: calc(72px + env(safe-area-inset-top, 0px));
    left: 12px;
    right: 12px;
    max-height: calc(100dvh - var(--mobile-nav-height, 88px) - 104px - env(safe-area-inset-bottom, 0px));
  }

  .runtime-debug-panel {
    left: auto;
    right: 12px;
    bottom: calc(var(--mobile-nav-height, 88px) + 18px);
    width: min(360px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    font-size: 0.62rem;
  }

  .runtime-debug-panel.is-collapsed {
    width: auto;
  }

  .runtime-debug-toggle {
    min-width: 58px;
    min-height: 40px;
    box-shadow: 0 10px 24px rgba(2, 8, 23, 0.34);
  }

  .runtime-debug-head {
    align-items: flex-start;
  }

  .runtime-debug-lines {
    max-height: min(48vh, 440px);
  }
}

/* Object overview dashboard: keep redesigned object cards page-scrolled, never horizontally scrolled. */
#view-dashboard #dashboard-v2-object-list.dashboard-object-grid {
  display: grid;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

#view-dashboard .dashboard-object-dashboard .dashboard-object-metrics {
  display: grid;
}

@media (max-width: 760px) {
  #view-dashboard #dashboard-v2-object-list.dashboard-v2-card-scroll,
  #view-dashboard #dashboard-v2-object-list.dashboard-object-grid {
    display: grid;
    overflow: visible;
    padding-bottom: 0;
  }

  #view-dashboard #dashboard-v2-object-list.dashboard-v2-card-scroll > *,
  #view-dashboard #dashboard-v2-object-list.dashboard-object-grid > * {
    flex: none;
    width: 100%;
  }
}

/* Pixel pass for the approved object overview mock-up. */
#view-dashboard #dashboard-v2-objects-card {
  border-color: rgba(37, 99, 235, 0.42);
  background:
    radial-gradient(circle at 48% 22%, rgba(30, 123, 255, 0.24), transparent 42%),
    linear-gradient(145deg, #082039 0%, #06182a 100%);
}

#view-dashboard #dashboard-v2-objects-card .dashboard-panel-head {
  margin-bottom: 18px;
}

#view-dashboard #dashboard-v2-objects-card .dashboard-panel-head h3 {
  font-size: 1.55rem;
}

#view-dashboard #dashboard-v2-objects-card .dashboard-v2-refresh-note {
  color: #c8d7e6;
  font-size: 0.92rem;
}

#view-dashboard #dashboard-v2-objects-card .dashboard-v2-head-actions .secondary-action,
#view-dashboard #dashboard-v2-objects-refresh {
  min-height: 52px;
  border-radius: 16px;
  padding-inline: 22px;
  background: rgba(18, 52, 82, 0.86);
  border-color: rgba(55, 91, 126, 0.82);
  color: #f4f7fb;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

#view-dashboard #dashboard-v2-object-list.dashboard-object-grid {
  gap: 18px;
  width: 100%;
  min-width: 0;
}

#view-dashboard .dashboard-object-dashboard {
  width: 100%;
  min-width: 0;
  overflow-x: clip;
  overflow-y: visible;
  gap: 20px;
  padding: 24px 28px 28px;
  border-radius: 18px;
  border-color: rgba(30, 123, 255, 0.36);
  background:
    radial-gradient(circle at 50% 28%, rgba(30, 123, 255, 0.26), transparent 36%),
    linear-gradient(145deg, rgba(8, 36, 63, 0.98), rgba(6, 25, 43, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(125, 178, 255, 0.04),
    0 22px 46px rgba(0, 0, 0, 0.25);
}

#view-dashboard .dashboard-object-hero {
  grid-template-columns: 52px 150px minmax(0, 1fr) minmax(176px, 220px) minmax(148px, 176px);
  gap: 18px;
  align-items: center;
  min-width: 0;
}

#view-dashboard .dashboard-object-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(145deg, #1e7bff, #0758d7);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(30, 123, 255, 0.24);
}

#view-dashboard .dashboard-object-hero-icon .ui-icon {
  width: 25px;
  height: 25px;
}

#view-dashboard .dashboard-object-photo {
  position: relative;
  display: grid;
  place-items: stretch;
  width: 150px;
  aspect-ratio: 1.35;
  padding: 0;
  border-radius: 16px;
  border: 1px solid rgba(80, 144, 220, 0.7);
  border-color: rgba(80, 144, 220, 0.7);
  background:
    linear-gradient(135deg, rgba(30, 123, 255, 0.18), rgba(7, 88, 215, 0.08)),
    #092844;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 170ms ease, box-shadow 170ms ease, transform 170ms ease;
}

#view-dashboard .dashboard-object-photo:hover,
#view-dashboard .dashboard-object-photo:focus-visible {
  border-color: rgba(126, 184, 255, 0.88);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05), 0 12px 24px rgba(0, 0, 0, 0.18);
  outline: none;
  transform: translateY(-1px);
}

#view-dashboard .dashboard-object-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 24, 42, 0.08), rgba(6, 24, 42, 0.38));
  pointer-events: none;
}

#view-dashboard .dashboard-object-photo.is-placeholder {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.06) 25%, transparent 25%) 0 0 / 28px 28px,
    radial-gradient(circle at 50% 45%, rgba(112, 189, 255, 0.18), transparent 42%),
    #092844;
}

#view-dashboard .dashboard-object-photo.is-placeholder .ui-icon {
  width: 54px;
  height: 54px;
  color: #b9e8ff;
}

#view-dashboard .dashboard-object-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#view-dashboard .dashboard-object-identity {
  min-width: 0;
}

#view-dashboard .dashboard-object-identity h3 {
  max-width: 460px;
  color: #ffffff;
  font-size: clamp(1.65rem, 2vw, 2.1rem);
  font-weight: 1000;
  letter-spacing: 0;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

#view-dashboard .dashboard-object-identity p {
  color: #d4e2f1;
  font-size: 0.98rem;
}

#view-dashboard .dashboard-object-identity p .ui-icon {
  width: 20px;
  height: 20px;
  color: #d4e2f1;
}

#view-dashboard .dashboard-object-identity .dashboard-object-action {
  justify-self: start;
  margin-top: 6px;
}

#view-dashboard .dashboard-object-action {
  min-height: 30px;
  padding: 6px 13px;
  border-color: rgba(255, 184, 213, 0.36);
  background: rgba(145, 78, 120, 0.7);
  color: #ffd6df;
  font-size: 0.82rem;
  font-weight: 950;
}

#view-dashboard .dashboard-object-status-panel {
  display: grid;
  align-content: center;
  gap: 4px;
  text-align: left;
  cursor: pointer;
  min-height: 76px;
  width: 100%;
  min-width: 0;
  padding: 16px 18px;
  border-radius: 16px;
  border-color: rgba(80, 144, 220, 0.68);
  background: rgba(10, 41, 70, 0.78);
  color: inherit;
}

#view-dashboard .dashboard-object-status-panel .dashboard-object-state {
  font-size: 0.96rem;
  font-weight: 1000;
}

#view-dashboard .dashboard-object-status-panel small {
  color: #e1ecf8;
  font-size: 0.82rem;
  font-weight: 900;
}

#view-dashboard .dashboard-object-state i {
  width: 14px;
  height: 14px;
  background: #ffb045;
  box-shadow: 0 0 0 5px rgba(255, 176, 69, 0.16);
}

#view-dashboard .dashboard-object-state.is-calm i {
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.16);
}

#view-dashboard .dashboard-object-details-action {
  justify-self: end;
  grid-column: 5;
  min-width: 0;
  min-height: 50px;
  width: 100%;
  border-radius: 14px;
  border-color: rgba(30, 123, 255, 0.58);
  background: rgba(8, 32, 56, 0.68);
  color: #dbeafe;
  font-size: 0.94rem;
  font-weight: 1000;
  box-shadow: none;
}

#view-dashboard .dashboard-object-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

#view-dashboard .dashboard-object-metric-tile {
  grid-template-columns: 56px minmax(0, 1fr);
  min-width: 0;
  min-height: 94px;
  padding: 16px;
  border-radius: 16px;
  border-color: rgba(80, 144, 220, 0.55);
  background: rgba(8, 35, 60, 0.74);
}

#view-dashboard .dashboard-object-metric-tile span {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(30, 123, 255, 0.96), rgba(7, 88, 215, 0.82));
}

#view-dashboard .dashboard-object-metric-tile .metric-icon {
  width: 24px;
  height: 24px;
  color: #ffffff;
}

#view-dashboard .dashboard-object-metric-tile small {
  color: #e1ecf8;
  font-size: 0.78rem;
  font-weight: 1000;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

#view-dashboard .dashboard-object-metric-tile strong {
  font-size: 1.45rem;
  font-weight: 1000;
}

#view-dashboard .dashboard-object-metric-tile.is-actionable:hover,
#view-dashboard .dashboard-object-metric-tile.is-actionable:focus-visible {
  border-color: rgba(126, 184, 255, 0.88);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}

#view-dashboard .dashboard-object-info-list {
  padding-top: 18px;
  border-top-color: rgba(80, 144, 220, 0.44);
}

#view-dashboard .dashboard-object-info-list p {
  grid-template-columns: 54px minmax(0, 1fr);
  min-width: 0;
  padding-block: 8px;
}

#view-dashboard .dashboard-object-info-list span {
  width: 46px;
  height: 46px;
  background: rgba(30, 123, 255, 0.2);
}

#view-dashboard .dashboard-object-info-list .ui-icon {
  width: 22px;
  height: 22px;
}

#view-dashboard .dashboard-object-info-list small {
  color: #d4e2f1;
  font-size: 0.82rem;
}

#view-dashboard .dashboard-object-info-list strong {
  font-size: 1rem;
  overflow-wrap: anywhere;
}

#view-dashboard .dashboard-object-detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

#view-dashboard .dashboard-object-detail-card {
  position: relative;
  min-width: 0;
  min-height: 220px;
  padding: 18px;
  border-radius: 16px;
  border-color: rgba(80, 144, 220, 0.55);
  background: rgba(7, 29, 50, 0.64);
}

#view-dashboard .dashboard-object-next-card {
  overflow: visible;
}

#view-dashboard .dashboard-object-detail-card h4 {
  color: #dbeafe;
  font-size: 0.86rem;
  font-weight: 1000;
}

#view-dashboard .dashboard-object-detail-card > strong {
  font-size: 1.22rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

#view-dashboard .dashboard-object-next-title {
  position: relative;
  z-index: 1;
  max-width: min(100%, 260px);
  padding: 0;
  border: 0;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  font: inherit;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.22;
  cursor: pointer;
  overflow-wrap: anywhere;
  transition: color 170ms ease, transform 170ms ease;
}

#view-dashboard .dashboard-object-next-title:hover,
#view-dashboard .dashboard-object-next-title:focus-visible {
  color: #ffffff;
  outline: none;
  transform: translateY(-1px);
}

#view-dashboard .dashboard-object-hover-card {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 40;
  display: grid;
  gap: 5px;
  width: min(300px, calc(100vw - 48px));
  padding: 12px;
  border: 1px solid rgba(126, 184, 255, 0.58);
  border-radius: 14px;
  background: rgba(4, 18, 32, 0.97);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.34);
  color: #eaf3ff;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 170ms ease, transform 170ms ease;
}

#view-dashboard .dashboard-object-next-title:hover .dashboard-object-hover-card,
#view-dashboard .dashboard-object-next-title:focus-visible .dashboard-object-hover-card {
  opacity: 1;
  transform: translateY(0);
}

#view-dashboard .dashboard-object-hover-card span {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 7px;
}

#view-dashboard .dashboard-object-hover-card small {
  color: #93a9bf;
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

#view-dashboard .dashboard-object-hover-card strong {
  color: #f8fafc;
  font-size: 0.7rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

#view-dashboard .dashboard-object-hover-card em {
  margin-top: 4px;
  color: #cbd5e1;
  font-size: 0.7rem;
  font-style: normal;
  line-height: 1.35;
}

#view-dashboard .dashboard-object-next-visual {
  position: absolute;
  right: 18px;
  bottom: 24px;
  color: rgba(113, 148, 255, 0.82);
}

#view-dashboard .dashboard-object-next-visual .ui-icon {
  width: 86px;
  height: 86px;
  stroke-width: 1.6;
}

#view-dashboard .dashboard-object-ticket-list .dashboard-empty {
  display: grid;
  place-items: center;
  min-height: 46px;
  border-radius: 10px;
  background: rgba(30, 123, 255, 0.14);
  color: #dbeafe;
  font-weight: 900;
}

#view-dashboard .dashboard-object-ticket-row,
#view-dashboard .dashboard-object-link,
#view-dashboard .dashboard-object-info-card .secondary-action,
#view-dashboard .dashboard-object-status-panel,
#view-dashboard .dashboard-object-metric-tile {
  transition: border-color 170ms ease, box-shadow 170ms ease, transform 170ms ease, background-color 170ms ease;
}

#view-dashboard .dashboard-object-ticket-row:hover,
#view-dashboard .dashboard-object-ticket-row:focus-visible,
#view-dashboard .dashboard-object-link:hover,
#view-dashboard .dashboard-object-link:focus-visible,
#view-dashboard .dashboard-object-info-card .secondary-action:hover,
#view-dashboard .dashboard-object-info-card .secondary-action:focus-visible,
#view-dashboard .dashboard-object-status-panel:hover {
  border-color: rgba(126, 184, 255, 0.86);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
  outline: none;
  transform: translateY(-1px);
}

#view-dashboard .dashboard-object-info-card dl {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#view-dashboard .dashboard-object-map-preview {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 94px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.05) 25%, transparent 25%) 0 0 / 24px 24px,
    rgba(30, 123, 255, 0.14);
}

#view-dashboard .dashboard-object-map-preview iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  filter: saturate(0.8) contrast(0.92) brightness(0.88);
  pointer-events: none;
}

#view-dashboard .dashboard-object-map-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 24, 42, 0.1), rgba(6, 24, 42, 0.32));
  pointer-events: none;
}

#view-dashboard .dashboard-object-map-preview .ui-icon {
  width: 34px;
  height: 34px;
}

#view-dashboard .dashboard-object-map-preview span,
#view-dashboard .dashboard-object-map-preview strong {
  position: relative;
  z-index: 1;
}

@media (min-width: 761px) {
  #view-dashboard #dashboard-v2-worker-card {
    border-color: rgba(37, 99, 235, 0.42);
    background:
      radial-gradient(circle at 50% 22%, rgba(30, 123, 255, 0.16), transparent 42%),
      linear-gradient(145deg, #082039 0%, #06182a 100%);
  }

  #view-dashboard #dashboard-v2-worker-card .dashboard-panel-head {
    align-items: start;
    margin-bottom: 18px;
  }

  #view-dashboard #dashboard-v2-worker-card .dashboard-panel-head h3 {
    color: #f8fafc;
    font-size: 1.42rem;
    font-weight: 1000;
  }

  #view-dashboard #dashboard-v2-workers-last-updated {
    color: #b8c7d6;
    font-size: 0.92rem;
    letter-spacing: 0;
    text-transform: none;
  }

  #view-dashboard #dashboard-v2-workers-last-updated::first-letter {
    color: inherit;
  }

  #view-dashboard .dashboard-worker-filter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    margin: 0 0 18px;
  }

  #view-dashboard .dashboard-worker-filter-group {
    gap: 10px;
  }

  #view-dashboard .dashboard-worker-filter-button,
  #view-dashboard .dashboard-timeline-employee-filter-toggle {
    min-height: 42px;
    border-radius: 10px;
    border-color: rgba(55, 91, 126, 0.86);
    background: rgba(11, 40, 66, 0.72);
    color: #e2edf7;
    padding-inline: 16px;
    font-size: 0.92rem;
    box-shadow: none;
  }

  #view-dashboard .dashboard-worker-filter-button.is-active {
    border-color: rgba(255, 106, 0, 0.72);
    background: linear-gradient(180deg, #ff7a1a, #ff6400);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(255, 106, 0, 0.22);
  }

  #view-dashboard .dashboard-worker-view-switch {
    justify-self: end;
  }

  #view-dashboard .dashboard-worker-view-switch span {
    color: #9fb2c5;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  #view-dashboard #dashboard-v2-worker-list.dashboard-worker-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  #view-dashboard #dashboard-v2-worker-list.dashboard-v2-card-scroll {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  #view-dashboard .dashboard-worker-table-head,
  #view-dashboard .dashboard-worker-row-card {
    display: grid;
    grid-template-columns: minmax(210px, 1.35fr) minmax(170px, 0.95fr) repeat(6, minmax(86px, 0.58fr)) minmax(150px, 0.8fr);
    gap: 12px;
    align-items: center;
  }

  #view-dashboard .dashboard-worker-table-head {
    min-height: 70px;
    padding: 0 22px;
    border: 1px solid rgba(55, 91, 126, 0.58);
    border-radius: 10px;
    background: rgba(6, 24, 42, 0.34);
    color: #9fb2c5;
    font-size: 0.76rem;
    font-weight: 1000;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  #view-dashboard .dashboard-worker-table-head span:nth-child(n+3):nth-child(-n+8) {
    text-align: center;
  }

  #view-dashboard .dashboard-worker-row-card {
    min-height: 156px;
    padding: 22px;
    border: 1px solid rgba(55, 91, 126, 0.62);
    border-radius: 10px;
    background:
      radial-gradient(circle at 0% 50%, rgba(30, 123, 255, 0.1), transparent 38%),
      rgba(7, 29, 50, 0.66);
    color: #eaf3ff;
    cursor: pointer;
    transition: border-color 170ms ease, box-shadow 170ms ease, transform 170ms ease;
  }

  #view-dashboard .dashboard-worker-row-card:hover,
  #view-dashboard .dashboard-worker-row-card:focus-within {
    border-color: rgba(126, 184, 255, 0.76);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
  }

  #view-dashboard .dashboard-worker-person-cell {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    min-width: 0;
  }

  #view-dashboard .dashboard-worker-person-cell .worker-avatar {
    width: 76px;
    height: 76px;
    border-radius: 999px;
    background: linear-gradient(145deg, #fff4e8, #fdd7b2);
    color: #c2410c;
    font-size: 1.35rem;
    font-weight: 1000;
    box-shadow: 0 14px 30px rgba(255, 106, 0, 0.16);
  }

  #view-dashboard .dashboard-worker-person-copy {
    display: grid;
    gap: 6px;
    min-width: 0;
  }

  #view-dashboard .dashboard-worker-person-copy > strong {
    color: #ffffff;
    font-size: 1.08rem;
    font-weight: 1000;
  }

  #view-dashboard .dashboard-worker-person-copy > small {
    color: #b8c7d6;
    font-size: 0.9rem;
    font-weight: 850;
  }

  #view-dashboard .dashboard-worker-row-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
  }

  #view-dashboard .dashboard-worker-row-actions button {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(55, 91, 126, 0.74);
    border-radius: 10px;
    background: rgba(8, 32, 56, 0.66);
    color: #c7d8ea;
    cursor: pointer;
    transition: border-color 170ms ease, color 170ms ease, transform 170ms ease;
  }

  #view-dashboard .dashboard-worker-row-actions button:hover,
  #view-dashboard .dashboard-worker-row-actions button:focus-visible {
    border-color: rgba(126, 184, 255, 0.76);
    color: #ffffff;
    outline: none;
    transform: translateY(-1px);
  }

  #view-dashboard .dashboard-worker-row-actions .ui-icon {
    width: 19px;
    height: 19px;
  }

  #view-dashboard .dashboard-worker-status-cell {
    display: grid;
    gap: 8px;
    align-content: center;
    min-width: 0;
  }

  #view-dashboard .dashboard-worker-status-cell .dashboard-worker-presence,
  #view-dashboard .dashboard-worker-status {
    width: fit-content;
  }

  #view-dashboard .dashboard-worker-status {
    border: 0;
    background: rgba(30, 123, 255, 0.16);
    color: #7db8ff;
    padding: 5px 12px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 1000;
  }

  #view-dashboard .dashboard-worker-status-cell small {
    color: #d0deeb;
    font-size: 0.82rem;
    font-weight: 850;
    line-height: 1.25;
  }

  #view-dashboard .dashboard-worker-call-badge {
    max-width: 100%;
    border-color: rgba(255, 177, 94, 0.42);
    background: rgba(255, 106, 0, 0.14);
    color: #fed7aa;
  }

  #view-dashboard .dashboard-worker-row-metrics {
    display: contents;
  }

  #view-dashboard .dashboard-worker-row-metrics button {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 5px;
    min-height: 104px;
    padding: 10px 8px;
    border: 1px solid rgba(55, 91, 126, 0.62);
    border-radius: 10px;
    background: rgba(6, 26, 43, 0.38);
    color: #f8fafc;
    cursor: pointer;
    transition: border-color 170ms ease, box-shadow 170ms ease, transform 170ms ease;
  }

  #view-dashboard .dashboard-worker-row-metrics button:hover,
  #view-dashboard .dashboard-worker-row-metrics button:focus-visible {
    border-color: rgba(126, 184, 255, 0.76);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
    outline: none;
    transform: translateY(-1px);
  }

  #view-dashboard .dashboard-worker-row-metrics button > span {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 999px;
    background: rgba(30, 123, 255, 0.18);
    color: #78a7ff;
  }

  #view-dashboard .dashboard-worker-row-metrics [data-worker-metric="tasks"] > span { background: rgba(34, 197, 94, 0.16); color: #86efac; }
  #view-dashboard .dashboard-worker-row-metrics [data-worker-metric="progress"] > span { background: rgba(79, 70, 229, 0.2); color: #a5b4fc; }
  #view-dashboard .dashboard-worker-row-metrics [data-worker-metric="overdue"] > span { background: rgba(244, 63, 94, 0.18); color: #fda4af; }
  #view-dashboard .dashboard-worker-row-metrics [data-worker-metric="today"] > span { background: rgba(20, 184, 166, 0.18); color: #5eead4; }
  #view-dashboard .dashboard-worker-row-metrics [data-worker-metric="week"] > span { background: rgba(168, 85, 247, 0.18); color: #d8b4fe; }

  #view-dashboard .dashboard-worker-row-metrics .metric-icon {
    width: 23px;
    height: 23px;
  }

  #view-dashboard .dashboard-worker-row-metrics small {
    color: #8fa4b8;
    font-size: 0.58rem;
    font-weight: 1000;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  #view-dashboard .dashboard-worker-row-metrics strong {
    color: #ffffff;
    font-size: 1.36rem;
    font-weight: 1000;
    line-height: 1;
  }

  #view-dashboard .dashboard-worker-last-cell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    color: #d8e4ef;
    min-width: 0;
  }

  #view-dashboard .dashboard-worker-last-cell > span {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    color: #d8e4ef;
  }

  #view-dashboard .dashboard-worker-last-cell .ui-icon {
    width: 24px;
    height: 24px;
  }

  #view-dashboard .dashboard-worker-last-cell strong {
    display: block;
    color: #d8e4ef;
    font-size: 0.88rem;
    font-weight: 950;
    line-height: 1.25;
  }

  #view-dashboard .dashboard-worker-last-cell i {
    color: #1e7bff;
    font-size: 2rem;
    font-style: normal;
    line-height: 1;
  }

  #view-dashboard #dashboard-v2-worker-list::after {
    content: "1";
    justify-self: center;
    display: grid;
    width: 42px;
    height: 42px;
    margin-top: 18px;
    place-items: center;
    border: 1px solid rgba(30, 123, 255, 0.78);
    border-radius: 10px;
    color: #ffffff;
    font-weight: 1000;
    box-shadow: 0 0 0 4px rgba(30, 123, 255, 0.12);
  }

  #view-dashboard #dashboard-v2-worker-list::before {
    content: "";
    display: none;
  }
}

@media (max-width: 1540px) {
  #view-dashboard .dashboard-object-hero {
    grid-template-columns: 48px 132px minmax(0, 1fr) minmax(150px, 184px) minmax(132px, 156px);
    gap: 14px;
  }

  #view-dashboard .dashboard-object-details-action {
    grid-column: 5;
  }

  #view-dashboard .dashboard-object-metric-tile {
    grid-template-columns: 48px minmax(0, 1fr);
    padding: 13px;
  }

  #view-dashboard .dashboard-object-metric-tile span {
    width: 48px;
    height: 48px;
    border-radius: 15px;
  }
}

@media (max-width: 1320px) {
  #view-dashboard .dashboard-object-hero {
    grid-template-columns: 48px minmax(0, 1fr) minmax(150px, 190px);
  }

  #view-dashboard .dashboard-object-photo {
    display: none;
  }

  #view-dashboard .dashboard-object-status-panel,
  #view-dashboard .dashboard-object-details-action {
    grid-column: 3;
  }

  #view-dashboard .dashboard-object-details-action {
    grid-row: 2;
  }

  #view-dashboard .dashboard-object-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  #view-dashboard .dashboard-object-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-dashboard .dashboard-object-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  #view-dashboard .dashboard-object-dashboard {
    padding: 18px;
  }

  #view-dashboard .dashboard-object-hero {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  #view-dashboard .dashboard-object-photo,
  #view-dashboard .dashboard-object-status-panel,
  #view-dashboard .dashboard-object-details-action,
  #view-dashboard .dashboard-object-identity {
    grid-column: 1 / -1;
  }

  #view-dashboard .dashboard-object-photo {
    display: grid;
    width: 100%;
  }

  #view-dashboard .dashboard-object-status-panel {
    width: auto;
  }

  #view-dashboard .dashboard-object-metric-tile {
    grid-template-columns: 54px minmax(0, 1fr);
    min-height: 104px;
    padding: 14px;
  }

  #view-dashboard .dashboard-object-metric-tile span {
    width: 54px;
    height: 54px;
    border-radius: 18px;
  }

  #view-dashboard .dashboard-object-metric-tile small {
    font-size: 0.78rem;
  }
}
.demo-mode-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
  padding: 14px 18px;
  border: 1px solid rgba(96, 165, 250, 0.32);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(15, 76, 129, 0.92), rgba(9, 31, 53, 0.96));
  color: #eaf4ff;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.18);
}

.demo-mode-banner strong {
  display: block;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.demo-mode-banner span {
  color: rgba(226, 239, 255, 0.82);
  font-size: 0.95rem;
}

.demo-mode-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.demo-role-button {
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 999px;
  background: rgba(12, 43, 71, 0.84);
  color: #cfe1f5;
  font: inherit;
  font-weight: 800;
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.demo-role-button:hover,
.demo-role-button.is-active {
  border-color: rgba(255, 108, 0, 0.84);
  background: rgba(255, 108, 0, 0.18);
  color: #ffffff;
  transform: translateY(-1px);
}

.demo-signup-link {
  text-decoration: none;
  white-space: nowrap;
}

.demo-readonly-dialog {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
}

.demo-readonly-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 18, 0.72);
  backdrop-filter: blur(8px);
}

.demo-readonly-panel {
  position: relative;
  width: min(440px, calc(100vw - 32px));
  border: 1px solid rgba(96, 165, 250, 0.34);
  border-radius: 18px;
  background: #0b2036;
  color: #f8fbff;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.42);
  padding: 24px;
}

.demo-readonly-panel h3 {
  margin: 6px 0 10px;
  font-size: 1.35rem;
}

.demo-readonly-panel p:not(.eyebrow) {
  color: #c9d8e8;
  line-height: 1.5;
}

.demo-readonly-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.demo-readonly-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.demo-readonly-dialog.is-hidden,
.demo-mode-banner.is-hidden {
  display: none;
}

@media (max-width: 780px) {
  .demo-mode-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .demo-mode-actions {
    justify-content: flex-start;
  }
}

/* Dashboard object card formatting fixes. Keep this near the end to override older object-dashboard rules. */
#view-dashboard .dashboard-object-identity h3 {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

#view-dashboard .dashboard-object-ticket-row {
  grid-template-columns: minmax(64px, max-content) minmax(0, 1fr) max-content;
  gap: 12px;
  align-items: start;
  padding: 10px 0;
  min-width: 0;
}

#view-dashboard .dashboard-object-ticket-id {
  align-self: center;
  white-space: nowrap;
}

#view-dashboard .dashboard-object-ticket-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

#view-dashboard .dashboard-object-ticket-main strong {
  min-width: 0;
  flex: 1 1 180px;
  max-width: 100%;
  line-height: 1.22;
  overflow-wrap: break-word;
  word-break: normal;
}

#view-dashboard .dashboard-object-ticket-row time {
  justify-self: end;
  min-width: 70px;
  max-width: 92px;
  text-align: right;
  line-height: 1.2;
  overflow-wrap: normal;
  word-break: normal;
}

#view-dashboard .dashboard-object-status-badge {
  max-width: 100%;
  white-space: normal;
  line-height: 1.15;
}

@media (max-width: 1180px) {
  #view-dashboard .dashboard-object-ticket-row {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-dashboard .dashboard-object-ticket-row time {
    justify-self: start;
    max-width: none;
    text-align: left;
  }
}
