:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --line: #dde3ea;
  --line-strong: #c7d0da;
  --text: #17202a;
  --muted: #667486;
  --nav: #121922;
  --nav-soft: #1b2633;
  --accent: #d9862e;
  --accent-strong: #b8671f;
  --accent-soft: #fff3e7;
  --accent-line: #efc08f;
  --blue: #2563eb;
  --danger: #b42318;
  --warning: #c27803;
  --success: #11885b;
  --shadow: 0 12px 28px rgba(20, 32, 44, 0.08);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

.app {
  display: grid;
  grid-template-columns: 252px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--nav);
  color: #eff5f6;
  display: flex;
  flex-direction: column;
  padding: 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.company-logo {
  background: transparent;
  border-radius: 0;
  padding: 4px 8px 10px;
  margin-bottom: 8px;
  overflow: hidden;
}

.company-logo img {
  display: block;
  width: 100%;
  max-height: 46px;
  object-fit: contain;
  object-position: left center;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 4px 8px 24px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--accent);
  border-radius: var(--radius);
  color: #ffffff;
  font-weight: 800;
}

.brand span,
.sidebar-footer div {
  display: block;
  color: #9fb0c2;
  font-size: 12px;
  margin-top: 2px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  border: 0;
  color: #d8e0e7;
  background: transparent;
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border-radius: var(--radius);
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: var(--nav-soft);
  color: #ffffff;
}

.nav-item.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-toggle {
  margin-left: auto;
  color: #9fb0c2;
  font-weight: 900;
}

.nav-sub {
  display: none;
  gap: 4px;
  margin: -2px 0 8px 42px;
}

.nav-sub.open {
  display: grid;
}

.nav-sub-item {
  border: 0;
  background: transparent;
  color: #9fb0c2;
  min-height: 32px;
  border-radius: 6px;
  padding: 0 10px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}

.nav-sub-item:hover,
.nav-sub-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-icon {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #b8c7d6;
  font-weight: 700;
  font-size: 12px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.main {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 20px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 28px;
  margin-bottom: 0;
}

h2 {
  font-size: 18px;
  margin-bottom: 0;
}

h3 {
  font-size: 15px;
  margin-bottom: 6px;
}

.top-actions,
.panel-head,
.planning-toolbar,
.date-tools,
.detail-head,
.list-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-actions,
.panel-head,
.planning-toolbar,
.detail-head {
  justify-content: space-between;
}

.role-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.role-switcher span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.role-switcher select {
  min-height: 32px;
  border: 0;
  padding: 0 4px;
  font-weight: 800;
}

.role-rights-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.role-rights-switcher label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.role-note {
  max-width: 780px;
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.primary-btn,
.ghost-btn,
.icon-btn,
.text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 0 14px;
}

.primary-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.primary-btn:hover {
  background: var(--accent-strong);
}

.ghost-btn:hover,
.icon-btn:hover {
  background: var(--surface-soft);
}

.icon-btn {
  width: 38px;
  padding: 0;
}

.icon-action {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--accent-strong);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.icon-action:hover {
  border-color: var(--accent);
  background: var(--surface-soft);
}

.text-btn {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
  min-height: auto;
  font-weight: 700;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: var(--radius);
  min-height: 40px;
  padding: 0 12px;
  color: var(--text);
}

input[type="search"] {
  width: 100%;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric,
.panel,
.job-list-panel,
.job-detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric-link {
  cursor: pointer;
}

.metric-link:hover {
  border-color: var(--accent);
}

.metric span,
.muted,
.feed-meta,
.file-row small {
  color: var(--muted);
}

.metric strong {
  display: block;
  font-size: 28px;
  margin: 8px 0 4px;
}

.metric small {
  display: block;
  line-height: 1.45;
  color: var(--accent);
  white-space: pre-line;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
  gap: 16px;
}

.panel {
  padding: 18px;
}

.feed {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.feed-item {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.feed-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
}

.feed-title {
  margin: 0 0 3px;
  font-weight: 700;
}

.feed-meta {
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.pill.danger {
  background: #fdebea;
  color: var(--danger);
}

.live-pill {
  background: #e8f0ff;
  color: #1d4ed8;
}

.todo-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.todo-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--surface-soft);
  border-radius: var(--radius);
}

.dashboard-permits-panel {
  margin-top: 16px;
}

.dashboard-doc-panel,
.dashboard-push-panel,
.dashboard-day-panel,
.dashboard-orders-panel {
  margin-bottom: 16px;
}

.permit-groups,
.critical-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.permit-group {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.permit-group > div:first-child {
  display: grid;
  gap: 4px;
  align-content: start;
}

.permit-group > div:first-child span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.dashboard-job-link,
.critical-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.dashboard-job-link {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
}

.dashboard-job-link span,
.critical-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.critical-item {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  background: #fffafa;
}

.critical-item span {
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
}

.doc-waiting-item span {
  color: #111827;
}

.doc-push-summary {
  background: #fff7ed;
}

.doc-push-summary span {
  color: #c2410c;
}

.order-dashboard-item.old {
  background: #fff7ed;
}

.order-dashboard-item.old span {
  color: #c2410c;
}

.dashboard-job-link:hover,
.critical-item:hover {
  border-color: var(--accent);
}

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

.status-person-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-weight: 700;
}

.jobs-layout {
  display: grid;
  grid-template-columns: auto 10px minmax(0, 1fr);
  gap: 8px;
  min-height: calc(100vh - 150px);
  min-width: 0;
}

.job-list-panel {
  width: var(--job-list-width, clamp(540px, 38vw, 720px));
  max-width: min(780px, 56vw);
  min-width: 460px;
  padding: 14px;
  overflow: hidden;
}

.job-list-resizer {
  width: 10px;
  min-height: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: col-resize;
  position: relative;
}

.job-list-resizer::before {
  content: "";
  position: absolute;
  inset: 8px 3px;
  border-radius: 999px;
  background: #d6dde6;
}

.job-list-resizer:hover::before,
.jobs-layout.resizing .job-list-resizer::before {
  background: var(--accent);
}

.is-column-resizing,
.is-column-resizing * {
  cursor: col-resize !important;
  user-select: none;
}

.list-toolbar {
  align-items: stretch;
  margin-bottom: 14px;
}

.job-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 210px);
  overflow: auto;
  padding-right: 4px;
}

.job-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 9px 10px;
  display: grid;
  gap: 5px;
  font-size: 12px;
  min-width: 0;
  text-align: left;
}

.job-card.active,
.job-card:hover {
  border-color: var(--accent);
}

.job-top {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-width: 0;
}

.status-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border-radius: 50%;
  margin-top: 4px;
}

.job-title-line {
  display: flex;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.job-title-line strong {
  font-size: 12px;
  line-height: 1.22;
  min-width: 0;
}

.job-title-line strong,
.appointment-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-number {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  flex: 0 0 76px;
  text-align: right;
}

.job-detail {
  padding: 16px;
  font-size: 13px;
  min-width: 0;
}

.job-detail h2,
#detail-title {
  font-size: 15px;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

#detail-address {
  font-size: 12px;
  line-height: 1.25;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin: 14px 0 12px;
}

.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0;
  border-bottom: 1px solid var(--line);
}

.subtab {
  min-height: 38px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-weight: 800;
}

.subtab.active {
  color: var(--accent);
  border-color: var(--accent);
}

.tab {
  border: 0;
  background: transparent;
  padding: 9px 8px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: 12px;
}

.tab.active {
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 800;
}

.tab-panel {
  display: none;
}

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

.documentation-panel {
  display: grid;
  gap: 14px;
}

.documentation-scroll {
  min-height: 220px;
}

.doc-day-group {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.doc-day-group h3 {
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.doc-day-list {
  display: grid;
}

.doc-entry {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) 78px;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.doc-entry-marker {
  width: 4px;
  min-height: 100%;
  border-radius: 999px;
  background: #94a3b8;
}

.doc-entry-permit .doc-entry-marker {
  background: #c86f2d;
}

.doc-entry-file .doc-entry-marker,
.doc-entry-template .doc-entry-marker {
  background: #2563eb;
}

.doc-entry-status .doc-entry-marker,
.doc-entry-live .doc-entry-marker {
  background: #16a34a;
}

.doc-entry-access .doc-entry-marker {
  background: #7c3aed;
}

.doc-entry-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.doc-entry-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.doc-entry-type {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.doc-entry-user {
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
}

.doc-entry-content {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.doc-entry-body p {
  margin: 0;
  white-space: pre-wrap;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.36;
}

.doc-entry-body small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.doc-edit-meta {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.doc-entry time {
  justify-self: end;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.documentation-composer {
  position: sticky;
  bottom: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.94), #ffffff 18px);
}

.documentation-composer textarea {
  min-height: 84px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.45;
}

.documentation-composer-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.compact-doc-dropzone {
  grid-column: 1 / -1;
  min-height: 70px;
  padding: 10px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.description-box {
  white-space: pre-wrap;
  line-height: 1.45;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.file-row,
.doc-row,
.appointment-row,
.staff-row,
.time-row,
.status-row {
  display: grid;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
  font-size: 12px;
  line-height: 1.28;
}

.file-row,
.appointment-row,
.staff-row,
.time-row,
.status-row {
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.appointment-row.next {
  background: #fbfcfd;
}

.next-appointment-badge {
  display: inline-flex;
  width: max-content;
  margin-top: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #27364a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.file-row.upload-open {
  cursor: pointer;
}

.file-row.upload-open:hover {
  background: var(--surface-soft);
}

.file-row-actions,
.doc-entry-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.file-row-actions {
  min-width: 118px;
}

.doc-entry-actions {
  align-content: start;
}

.doc-entry-actions time {
  width: 100%;
  text-align: right;
}

.danger-link {
  color: var(--danger) !important;
}

.permit-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  margin-top: 8px;
}

.permit-meta-locked {
  align-items: center;
}

.permit-meta label {
  display: grid;
  gap: 3px;
  min-width: 120px;
}

.permit-meta label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.permit-meta input,
.permit-meta select {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 12px;
}

.permit-readonly-field {
  display: inline-grid;
  gap: 3px;
  min-height: 32px;
  min-width: 112px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.permit-readonly-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.permit-readonly-field strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.permit-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #eef2ff;
  color: #27364a;
  font-size: 12px;
  font-weight: 900;
}

.permit-chip.open {
  background: #fff7ed;
  color: #c2410c;
}

.permit-chip.paid {
  background: #ecfdf3;
  color: #047857;
}

.permit-chip.saved {
  background: #ecfdf5;
  color: #047857;
}

.permit-save-btn {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}

.permit-warning {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 12px;
}

.permit-warning.danger {
  background: #dc2626;
  color: #ffffff;
}

.doc-text-strong {
  color: #111827;
}

.doc-text-warning {
  color: #92400e;
}

.doc-text-danger {
  color: #b91c1c;
}

.template-toolbar {
  margin-bottom: 14px;
}

.template-groups {
  display: grid;
  gap: 18px;
}

.template-group {
  display: grid;
  gap: 8px;
}

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

.template-list.compact {
  gap: 6px;
}

.template-admin-note {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(217, 134, 46, 0.24);
  border-radius: 8px;
  background: #fff8ed;
}

.template-admin-note span {
  color: var(--muted);
  font-size: 13px;
}

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

.template-row small {
  color: var(--muted);
}

.template-prefill-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.template-prefill-preview span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(217, 134, 46, 0.1);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
}

.template-prefill-preview strong {
  margin-left: 3px;
  color: var(--ink);
}

.file-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.doc-row {
  grid-template-columns: 120px 1fr;
  align-items: start;
}

.doc-time {
  color: var(--muted);
  font-size: 13px;
}

.planning-toolbar {
  margin-bottom: 14px;
}

.hidden {
  display: none !important;
}

#planning {
  position: relative;
}

.planning-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.planning-job-pool {
  display: none;
}

.planning-job-pool.open {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 170px);
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

#planning.planning-editing .planning-workbench {
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
}

.planning-map-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.planning-map-panel.collapsed {
  padding: 12px 14px;
}

.mobile-planning-list {
  display: none;
  margin-bottom: 14px;
}

.mobile-plan-items {
  display: grid;
  gap: 8px;
}

.mobile-plan-item {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
}

.mobile-plan-item span {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
}

.mobile-plan-item strong {
  font-size: 13px;
  line-height: 1.22;
}

.mobile-plan-item small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.planning-map-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.planning-map-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.planning-map-controls {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.planning-map-controls label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.planning-map-controls select {
  min-width: 150px;
}

.planning-map-route-filter {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.planning-map-filter-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.planning-map-filter-head > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.planning-map-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.planning-map-buttons .icon-action {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
}

.planning-map-buttons .ghost-btn {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.planning-map-person-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.planning-map-route-filter label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.planning-map-route-filter input {
  min-height: auto;
  width: 14px;
  height: 14px;
  padding: 0;
}

.route-color-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.planning-map-canvas {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(31deg, transparent 0 42%, rgba(255,255,255,0.78) 42% 44%, transparent 44%),
    linear-gradient(145deg, transparent 0 36%, rgba(255,255,255,0.62) 36% 38%, transparent 38%),
    linear-gradient(90deg, rgba(154, 180, 153, 0.22), rgba(210, 220, 187, 0.22)),
    #e8efe2;
}

.planning-map-zoom-layer {
  position: absolute;
  inset: 0;
  transform-origin: center;
}

.map-river {
  position: absolute;
  left: 58%;
  top: -8%;
  width: 60px;
  height: 116%;
  transform: rotate(17deg);
  border-radius: 999px;
  background: rgba(83, 146, 182, 0.22);
}

.map-road {
  position: absolute;
  height: 8px;
  border-radius: 999px;
  background: rgba(102, 116, 134, 0.22);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.48);
}

.road-a {
  left: 4%;
  right: 8%;
  top: 54%;
  transform: rotate(-14deg);
}

.road-b {
  left: 10%;
  right: 16%;
  top: 35%;
  transform: rotate(22deg);
}

.map-city {
  position: absolute;
  z-index: 1;
  color: rgba(46, 62, 79, 0.55);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.city-bonn {
  left: 20%;
  top: 14%;
}

.city-koblenz {
  right: 12%;
  bottom: 13%;
}

.map-route-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-route-line {
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 2.5 1.2;
  opacity: 0.82;
}

.map-marker {
  position: absolute;
  z-index: 6;
  transform: translate(-50%, -50%);
}

.map-plan-stop {
  position: absolute;
  z-index: 9;
  transform: translate(-50%, -50%);
}

.map-dot {
  width: 18px;
  height: 18px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 5px 11px rgba(20, 32, 44, 0.22);
  cursor: pointer;
}

.map-cluster {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  background: #182532;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
}

.map-plan-bubble {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(20, 32, 44, 0.28);
  cursor: pointer;
}

.map-tooltip {
  position: absolute;
  left: 50%;
  z-index: 20;
  width: min(290px, 72vw);
  display: none;
  transform: translateX(-50%);
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 36px rgba(20, 32, 44, 0.2);
}

.tooltip-above .map-tooltip {
  bottom: calc(100% + 10px);
}

.tooltip-below .map-tooltip {
  top: calc(100% + 10px);
}

.map-marker:hover,
.map-marker:focus-within,
.map-plan-stop:hover,
.map-plan-stop:focus-within {
  z-index: 30;
}

.map-marker:hover .map-tooltip,
.map-marker:focus-within .map-tooltip,
.map-plan-stop:hover .map-tooltip,
.map-plan-stop:focus-within .map-tooltip {
  display: grid;
}

.map-tooltip strong,
.map-tooltip span,
.map-tooltip small {
  display: block;
  line-height: 1.35;
}

.map-tooltip strong {
  font-size: 13px;
}

.map-tooltip span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.map-tooltip small {
  color: var(--muted);
}

.map-tooltip-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.map-tooltip-actions .primary-btn,
.map-tooltip-actions .text-btn {
  min-height: 30px;
  padding: 6px 9px;
}

.cluster-tooltip {
  width: min(310px, 76vw);
}

.cluster-job {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.cluster-job:last-of-type {
  border-bottom: 0;
}

.map-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.planning-map-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.planning-pool-head {
  display: grid;
  gap: 10px;
}

.planning-pool-head div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.planning-pool-head span,
.planning-job-card small {
  color: var(--muted);
  font-size: 12px;
}

.planning-job-list {
  display: grid;
  gap: 10px;
}

.planning-job-card {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: grab;
}

.planning-job-card:active {
  cursor: grabbing;
}

.planning-job-overlay {
  position: fixed;
  left: 18px;
  top: 86px;
  bottom: 24px;
  z-index: 45;
  width: min(340px, calc(100vw - 36px));
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 22px 48px rgba(20, 32, 44, 0.24);
  font-size: 11px;
  overflow: hidden;
}

.planning-job-overlay-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.planning-job-overlay-head span {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.planning-job-overlay-head h3 {
  margin: 1px 0 3px;
  font-size: 12px;
  line-height: 1.15;
}

.planning-job-overlay-head p {
  margin: 1px 0 0;
  font-size: 10px;
  line-height: 1.2;
}

.planning-job-overlay-head .text-btn {
  font-size: 11px;
}

.planning-job-overlay-body {
  display: grid;
  gap: 6px;
  overflow: auto;
  padding: 8px 12px 12px;
}

.planning-job-overlay-body section {
  display: grid;
  gap: 3px;
}

.planning-job-overlay-body section > strong {
  font-size: 10px;
  line-height: 1.2;
}

.planning-job-overlay-body p {
  margin: 0;
  white-space: pre-wrap;
  font-size: 11px;
  line-height: 1.28;
}

.overlay-row,
.overlay-file-row {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 6px;
  padding: 4px 0;
  border-top: 1px solid var(--line);
  font-size: 10px;
  line-height: 1.2;
}

.overlay-row small,
.overlay-file-row small {
  font-size: 9px;
  line-height: 1.18;
}

.overlay-file-row {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.planning-job-overlay .file-preview.small {
  width: 34px;
  height: 34px;
  font-size: 9px;
}

.planning-job-card strong,
.planning-job-card small {
  display: block;
}

.planning-job-card strong {
  margin-bottom: 4px;
  font-size: 13px;
  line-height: 1.3;
}

.planner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
  box-shadow: var(--shadow);
}

.planner-grid {
  display: grid;
  grid-template-columns: 220px repeat(28, 61px);
  grid-template-rows: 64px repeat(8, 64px);
  min-width: 1928px;
  position: relative;
  grid-auto-flow: row;
}

.planner-time.hour {
  grid-column: span 2;
}

.planner-cell,
.planner-name,
.planner-time {
  min-height: 64px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px;
}

.planner-name,
.planner-time {
  background: var(--surface-soft);
  font-weight: 800;
}

.planner-grid > .planner-time:first-child,
.planner-name {
  position: sticky;
  left: 0;
  z-index: 4;
  box-shadow: 1px 0 0 var(--line);
}

.planner-grid > .planner-time:first-child {
  z-index: 5;
}

.planner-row-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.team-name {
  color: var(--muted);
  font-size: 12px;
}

.planner-cell {
  position: relative;
  background-image: linear-gradient(90deg, transparent calc(100% - 1px), var(--line) 100%);
}

.planner-cell.drop-target {
  cursor: pointer;
}

.planner.editing .planner-cell.drop-target:hover {
  background: #e9f5f3;
}

.planner-events {
  position: absolute;
  left: 220px;
  top: 64px;
  width: 1708px;
  height: 512px;
  pointer-events: none;
}

.current-time-line {
  position: absolute;
  top: -30px;
  bottom: 0;
  width: 2px;
  background: #d33f49;
  pointer-events: none;
  z-index: 3;
}

.current-time-line span {
  position: absolute;
  top: -14px;
  left: -18px;
  padding: 2px 5px;
  border-radius: 5px;
  background: #d33f49;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
}

.appointment {
  position: absolute;
  height: 46px;
  border-radius: 7px;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  box-shadow: 0 5px 12px rgba(20, 32, 44, 0.12);
  border-left: 5px solid var(--accent);
  padding: 6px 8px;
  overflow: hidden;
  min-width: 84px;
  cursor: default;
  pointer-events: auto;
}

.resize-handle {
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: ew-resize;
  z-index: 2;
}

.resize-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  transform: translateY(-50%);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.resize-handle.left {
  left: 0;
}

.resize-handle.left::after {
  left: 1px;
  border-right: 6px solid #475569;
}

.resize-handle.right {
  right: 0;
}

.resize-handle.right::after {
  right: 1px;
  border-left: 6px solid #475569;
}

.planner.editing .appointment:hover .resize-handle,
.planner.editing .appointment.selected .resize-handle {
  display: block;
}

.planner.editing .planner-cell {
  background-color: #fbfcfd;
}

.planner.editing .appointment {
  cursor: grab;
}

.planner.editing .appointment:active {
  cursor: grabbing;
}

.appointment.selected {
  outline: 3px solid rgba(19, 122, 114, 0.32);
  outline-offset: 2px;
}

.appointment.conflict {
  border-color: rgba(185, 28, 28, 0.55);
  background: #fff7ed;
}

.appointment.dragging {
  opacity: 0.6;
}

.move-scope-dialog {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.42);
  z-index: 50;
}

.move-scope-card {
  display: grid;
  gap: 12px;
  width: min(520px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 22px 48px rgba(20, 32, 44, 0.28);
}

.move-scope-card h3,
.move-scope-card p {
  margin: 0;
}

.move-scope-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.appointment-time {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}

.appointment-title {
  font-size: 12px;
  font-weight: 800;
}

.plan-remove-btn {
  position: absolute;
  top: 3px;
  right: 4px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(153, 27, 27, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #991b1b;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.planner-detail {
  display: none;
  position: absolute;
  top: 86px;
  right: 16px;
  width: min(360px, calc(100vw - 48px));
  max-height: calc(100vh - 155px);
  overflow: auto;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 22px 48px rgba(20, 32, 44, 0.22);
  padding: 18px;
  z-index: 12;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.planner-detail.open {
  display: block;
}

.planner-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.detail-list {
  display: grid;
  gap: 12px;
}

.detail-list div {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.detail-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-action {
  width: 100%;
  margin-top: 16px;
}

.access-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.job-edit-form {
  display: grid;
  gap: 16px;
}

.description-edit {
  width: 100%;
  min-height: 180px;
  padding: 12px;
  line-height: 1.45;
}

.access-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.7fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #ffffff;
}

.access-editor section {
  min-width: 0;
  padding: 12px;
}

.access-editor section + section {
  border-left: 1px solid var(--line);
  background: var(--surface-soft);
}

.access-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.access-group {
  display: grid;
  gap: 7px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.access-group:first-child {
  border-top: 0;
}

.access-group label,
.access-person {
  display: flex;
  align-items: center;
  gap: 8px;
}

.access-person {
  padding-left: 22px;
  color: var(--text);
}

.access-person small {
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
}

.access-summary {
  display: grid;
  gap: 8px;
}

.access-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.absence {
  background: #dcefe1;
  border-left-color: #35a86b;
}

.staff-list,
.time-table,
.status-list {
  margin-top: 14px;
}

.time-dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.time-month-card {
  display: grid;
  gap: 8px;
  min-height: 126px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
}

.time-month-card:hover {
  border-color: var(--accent);
  background: var(--surface-soft);
}

.time-month-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.time-month-card strong {
  font-size: 30px;
}

.time-month-card small {
  color: var(--accent-strong);
  font-weight: 800;
}

.punch-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0;
}

.punch-copy {
  display: grid;
  gap: 4px;
}

.punch-copy span,
.punch-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.punch-copy strong {
  font-size: 22px;
}

.punch-location.saved {
  color: var(--success);
}

.punch-location.denied {
  color: var(--danger);
}

.punch-location.not_found,
.punch-location.unavailable,
.punch-location.timeout {
  color: var(--muted);
}

.punch-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.time-row {
  grid-template-columns: minmax(180px, 1fr) 95px 115px 95px 110px 105px 170px 36px;
}

.time-row-compact {
  grid-template-columns: minmax(190px, 0.8fr) minmax(270px, 1.1fr) minmax(280px, 1.2fr) 36px;
}

.time-row-simple {
  grid-template-columns: minmax(170px, 1fr) 95px 95px 95px 150px 36px;
}

.staff-row {
  grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1.4fr) 110px;
}

.staff-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 6px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(217, 134, 46, 0.09);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.staff-section-label.secondary {
  background: rgba(20, 28, 42, 0.05);
  color: var(--muted);
}

.staff-row-button {
  width: 100%;
  border: 0;
  background: #ffffff;
  color: inherit;
  text-align: left;
  border-radius: 8px;
  margin-bottom: 4px;
}

.staff-row-button:hover {
  background: var(--surface-soft);
}

.staff-row strong,
.staff-row span {
  min-width: 0;
}

.staff-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 600;
}

.staff-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.staff-chip-list em {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(217, 134, 46, 0.1);
  color: var(--accent-strong);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.staff-edit-hint {
  justify-self: end;
  color: var(--accent-strong);
  font-weight: 800;
  font-size: 13px;
}

.time-row-button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}

.time-row-button:hover,
.time-row-button.selected {
  background: var(--surface-soft);
}

.time-toggle {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(217, 134, 46, 0.12);
  color: var(--accent-strong);
  font-size: 20px;
  line-height: 1;
}

.time-row small {
  color: var(--muted);
}

.time-detail {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.time-inline-detail {
  margin: 0 0 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: rgba(255, 255, 255, 0.78);
}

.profile-note {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
}

.profile-note strong {
  color: var(--ink);
}

.day-table {
  display: grid;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.day-row {
  display: grid;
  grid-template-columns: 150px 130px 80px 80px 80px 80px 90px 80px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.day-row-simple {
  grid-template-columns: 140px 130px 90px 90px 90px 1fr;
}

.day-row-button {
  width: 100%;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  background: #ffffff;
  cursor: pointer;
}

.day-row-button:hover,
.day-row-button.editing {
  background: #fff7ed;
}

.time-summary {
  display: grid;
  grid-template-columns: minmax(190px, 1.15fr) repeat(3, minmax(150px, 1fr));
  gap: 10px;
  margin: 12px 0 14px;
}

.time-summary article {
  min-height: 88px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.time-summary-main {
  border-color: rgba(217, 134, 46, 0.35);
  background: #fff8ed;
}

.time-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.time-summary strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
}

.time-summary small {
  display: block;
  margin-top: 5px;
  color: var(--accent-strong);
  font-size: 11px;
  line-height: 1.25;
}

.time-summary-sub {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.time-summary-sub span {
  display: inline-flex;
  gap: 5px;
  align-items: baseline;
  color: var(--muted);
  font-size: 12px;
}

.time-summary-sub strong {
  margin: 0;
  font-size: 12px;
}

.day-edit-inline {
  grid-column: 1 / -1;
  padding: 10px 12px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  background: #fff8ed;
}

.day-edit-inline .time-edit-panel {
  margin: 0;
  box-shadow: none;
}

.compact-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 14px 0;
}

.time-metrics {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.compact-metrics .metric {
  box-shadow: none;
}

.compact-metrics .metric strong {
  font-size: 18px;
}

.day-row:last-child {
  border-bottom: 0;
}

.day-row.header {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.day-row.holiday {
  background: #fef6e7;
}

.day-row.needs-check {
  background: #fff8ed;
  box-shadow: inset 4px 0 0 #d97706;
}

.day-row.needs-check span:last-child {
  color: #9a3412;
  font-weight: 800;
}

.time-edit-panel {
  display: grid;
  grid-template-columns: minmax(150px, 1.3fr) 150px 120px 120px minmax(180px, 1.2fr) auto;
  gap: 10px;
  align-items: end;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid rgba(217, 134, 46, 0.35);
  border-radius: var(--radius);
  background: #fff8ed;
}

.time-edit-panel label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.time-edit-panel input,
.time-edit-panel select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.time-edit-actions {
  display: flex;
  gap: 8px;
}

.time-block-form {
  display: grid;
  grid-template-columns: minmax(210px, 1.2fr) repeat(5, minmax(120px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid rgba(217, 134, 46, 0.35);
  border-radius: var(--radius);
  background: #fff8ed;
}

.time-block-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.time-block-form input,
.time-block-form select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.time-block-note {
  grid-column: span 2;
}

.time-block-list {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fffaf3;
}

.time-block-entry {
  display: grid;
  grid-template-columns: 140px minmax(120px, 0.5fr) minmax(220px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(217, 134, 46, 0.24);
  border-radius: 7px;
  background: #ffffff;
}

.time-block-entry span,
.time-block-entry small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.time-block-entry strong {
  color: var(--ink);
  font-size: 13px;
}

.storage-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.storage-status i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #94a3b8;
}

.storage-status[data-status="online"] i {
  background: #16a34a;
}

.storage-status[data-status="saving"] i {
  background: #2563eb;
}

.storage-status[data-status="local"] i {
  background: #f97316;
}

.storage-status[data-status="error"] i {
  background: #dc2626;
}

.storage-status-fixed {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 35;
  min-height: 40px;
  padding: 0 14px;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
}

.staff-row.header,
.time-row.header {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.status-row {
  grid-template-columns: 28px 1fr auto;
}

.status-group-head {
  display: grid;
  grid-template-columns: auto minmax(220px, 360px) auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.status-group-head input {
  min-height: 38px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-group-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-collapse-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
}

.status-order-actions,
.status-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: end;
  gap: 6px;
}

.status-order-actions .icon-btn,
.status-row-actions .icon-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 7px;
}

.status-order-actions .icon-btn:disabled,
.status-row-actions .icon-btn:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.status-group-body {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.status-empty-note {
  padding: 8px 12px;
}

.status-admin-row {
  grid-template-columns: 44px minmax(220px, 1fr) minmax(180px, 240px) minmax(150px, 220px) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.status-admin-row input,
.status-admin-row select {
  width: 100%;
}

.status-color-input {
  min-height: 36px;
  width: 42px !important;
  padding: 3px;
}

.status-name-input {
  font-weight: 800;
}

.status-current {
  min-height: 42px;
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  text-align: left;
}

.status-current small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.live-current.active {
  border-color: #9bbcff;
  background: #f4f8ff;
}

.billing-panel {
  display: grid;
  gap: 16px;
}

.billing-upload-panel,
.billing-history {
  display: grid;
  gap: 10px;
}

.billing-note-field {
  display: grid;
  gap: 6px;
}

.billing-note-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.billing-note-field textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.billing-file-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.permit-payment-panel {
  display: grid;
  gap: 14px;
}

.permit-payment-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.permit-payment-toolbar .active {
  border-color: var(--accent);
  color: var(--accent);
  background: #fff7ed;
}

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

.permit-payment-warning {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #f59e0b;
  border-radius: 7px;
  background: #fffbeb;
}

.permit-payment-warning > strong {
  color: #92400e;
  font-size: 13px;
}

.permit-payment-warning > span {
  color: #78350f;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.permit-payment-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.permit-payment-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.permit-payment-main strong,
.permit-payment-main span,
.permit-payment-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permit-payment-main span,
.permit-payment-main small {
  color: var(--muted);
}

.permit-chip.sent {
  background: #eff6ff;
  color: #1d4ed8;
}

.file-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.status-picker {
  position: fixed;
  right: 28px;
  top: 96px;
  width: min(520px, calc(100vw - 48px));
  max-height: calc(100vh - 130px);
  overflow: auto;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 22px 48px rgba(20, 32, 44, 0.22);
  padding: 18px;
  z-index: 20;
}

.status-picker-group,
.status-admin-group {
  margin-top: 16px;
}

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

.status-choice {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: var(--radius);
  min-height: 56px;
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  text-align: left;
}

.status-choice.active,
.status-choice:hover {
  border-color: var(--accent);
  background: #f3fbfa;
}

.status-choice small {
  color: var(--muted);
}

.status-admin-group h3,
.status-picker-group h3 {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.drag-handle {
  color: var(--muted);
  font-weight: 800;
}

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

.permit-settings-panel {
  margin-top: 16px;
}

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

.permit-lead-help {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.permit-lead-row {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.permit-lead-row span {
  font-weight: 900;
}

.permit-lead-row small {
  color: var(--muted);
  font-weight: 800;
}

.settings-page {
  display: none;
}

.settings-page.active {
  display: block;
}

.settings-menu-panel {
  margin-bottom: 16px;
}

.settings-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.settings-tab {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 9px 13px;
  font-weight: 800;
  color: var(--muted);
}

.settings-tab.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: var(--accent-line);
}

.rights-list,
.rights-accordion {
  display: grid;
  gap: 8px;
}

.rights-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.rights-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 900;
  list-style: none;
}

.rights-item summary::-webkit-details-marker {
  display: none;
}

.rights-item summary strong {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--accent-strong);
}

.rights-item[open] summary strong {
  transform: rotate(45deg);
}

.rights-item .rights-chips {
  padding: 0 14px 12px;
}

.rights-chips span {
  display: inline-flex;
  margin: 0 6px 6px 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 46px 24px;
  background: rgba(18, 25, 34, 0.34);
}

.modal-backdrop.open {
  display: flex;
}

.modal-panel {
  width: min(1120px, calc(100vw - 48px));
  max-height: calc(100vh - 92px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 28px 72px rgba(20, 32, 44, 0.24);
}

.staff-modal-panel {
  padding: 22px;
}

.access-admin-note {
  display: grid;
  gap: 4px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.access-admin-note span,
.access-limits p {
  color: var(--muted);
}

.user-create-btn {
  margin-bottom: 12px;
}

.modal-head,
.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.modal-head {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.modal-actions {
  position: sticky;
  bottom: -22px;
  align-items: center;
  justify-content: flex-end;
  margin: 22px -22px -22px;
  padding: 16px 22px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
}

.staff-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.editor-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 16px;
}

.editor-section h3 {
  margin-bottom: 10px;
}

.editor-section > p.muted {
  margin: -2px 0 10px;
  max-width: 820px;
  color: #7f8a97;
  font-size: 12px;
  line-height: 1.3;
}

.profile-wide {
  grid-column: 1 / -1;
}

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

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

.rights-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
}

.profile-form,
.profile-summary {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.profile-form label {
  display: grid;
  gap: 6px;
}

.profile-form label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.profile-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 10px;
}

.profile-summary span {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-soft);
}

.profile-summary strong {
  font-size: 12px;
  color: var(--muted);
}

.profile-summary em {
  font-style: normal;
}

#staff-profile-note {
  margin: 4px 0 0;
  color: #7f8a97;
  font-size: 12px;
  line-height: 1.3;
}

.rules {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.rules label {
  display: grid;
  grid-template-columns: 1fr 90px;
  align-items: center;
  gap: 10px;
}

.break-rules,
.break-profile,
.workday-profile {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.break-profile {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.break-rule,
.break-profile label,
.workday-profile label {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.break-rule {
  grid-template-columns: 1fr 110px;
  background: transparent;
}

.break-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.compact-form {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  margin-bottom: 12px;
}

.file-action {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.file-action input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-dropzone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 92px;
  margin: 0 0 14px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.upload-dropzone strong {
  color: var(--text);
}

.upload-dropzone span {
  font-size: 13px;
}

.upload-dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-dropzone.drag-over {
  border-color: var(--accent);
  background: #fff7ef;
  color: var(--text);
}

.time-import-dropzone {
  margin-top: 12px;
}

.file-preview {
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--text);
  border-radius: 7px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
  font-weight: 800;
  cursor: pointer;
}

.file-preview:hover {
  border-color: var(--accent);
}

.file-preview.small {
  width: 50px;
  height: 50px;
  font-size: 11px;
}

.file-preview.large {
  width: min(100%, 420px);
  height: 230px;
  margin-top: 10px;
  font-size: 16px;
}

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

.file-preview.pdf-thumb {
  position: relative;
  background: #f8fafc;
}

.file-preview.pdf-thumb iframe {
  width: 220%;
  height: 220%;
  border: 0;
  transform: scale(0.46);
  transform-origin: top left;
  pointer-events: none;
  background: #ffffff;
}

.doc-file-preview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(100%, 360px);
}

.doc-file-preview .file-preview.small {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  font-size: 10px;
}

.doc-file-preview span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.72);
}

.file-preview-modal {
  width: min(1100px, calc(100vw - 48px));
  height: min(820px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 28px 72px rgba(15, 23, 42, 0.34);
}

.file-preview-modal header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.file-preview-modal header div {
  display: grid;
  gap: 3px;
}

.file-preview-modal header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.file-preview-modal main {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: #111827;
}

.file-preview-modal iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.file-preview-modal img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #ffffff;
}

.file-preview-placeholder {
  display: grid;
  gap: 8px;
  max-width: 420px;
  padding: 28px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  text-align: center;
}

.time-import-preview {
  margin-top: 12px;
}

.import-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--muted);
}

.import-card strong {
  color: var(--ink);
}

.import-card small {
  color: #9a3412;
  line-height: 1.5;
}

.import-warning {
  border-color: rgba(220, 38, 38, 0.25);
  background: #fff7f7;
}

.import-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 72px;
  background: #182532;
  color: #ffffff;
  border-radius: var(--radius);
  padding: 13px 16px;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  max-width: 360px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .metrics,
  .time-summary,
  .time-block-form,
  .split,
  .jobs-layout,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .job-list-resizer {
    display: none;
  }

  .topbar,
  .punch-panel,
  .planning-map-head,
  .planning-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .planning-map-controls {
    width: 100%;
  }

  .planning-map-controls label,
  .planning-map-controls select {
    width: 100%;
  }

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

  .time-block-entry {
    grid-template-columns: 1fr;
  }

  .job-list {
    max-height: none;
  }

  .main {
    padding: 18px;
    min-width: 0;
    overflow-x: hidden;
  }
}

@media (max-width: 620px) {
  .nav {
    grid-template-columns: 1fr 1fr;
  }

  .top-actions,
  .date-tools,
  .list-toolbar,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .info-grid,
  .billing-grid,
  .staff-row,
  .time-row {
    grid-template-columns: 1fr;
  }

  .role-switcher {
    justify-content: space-between;
  }

  #dashboard.active {
    display: flex;
    flex-direction: column;
  }

  #dashboard .metrics {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .punch-panel {
    order: -3;
    align-items: stretch;
    flex-direction: column;
    padding: 16px;
  }

  .dashboard-doc-panel,
  .dashboard-push-panel {
    order: -2;
  }

  .dashboard-day-panel {
    order: 1;
  }

  .planning-workbench {
    display: none;
  }

  .mobile-planning-list {
    display: grid;
  }

  .planning-map-panel {
    display: none;
  }

  .planner-detail {
    position: fixed;
    inset: 96px 12px 22px;
    width: auto;
    max-height: none;
    z-index: 80;
    padding: 14px 14px calc(16px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
  }

  .planner-detail-head {
    position: sticky;
    top: -14px;
    z-index: 2;
    margin: -14px -14px 10px;
    padding: 12px 14px 10px;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--line);
  }

  .planner-detail-head h2 {
    font-size: 18px;
    line-height: 1.15;
  }

  .detail-list {
    gap: 8px;
  }

  .detail-list div {
    gap: 2px;
    padding-bottom: 8px;
  }

  .detail-action {
    position: sticky;
    bottom: 0;
    margin-top: 12px;
    box-shadow: 0 -10px 22px rgba(255, 255, 255, 0.9);
  }

  .job-detail {
    padding: 14px;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  .detail-head {
    flex-direction: row;
    align-items: center;
  }

  .tabs {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 8px 9px;
  }

  .info-grid,
  .file-row,
  .appointment-row,
  .billing-file-row {
    grid-template-columns: 1fr;
  }

  .jobs-layout,
  .job-list-panel,
  .job-list,
  .job-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .job-list-panel {
    padding: 10px;
    resize: none;
  }

  .job-card {
    overflow: hidden;
  }

  .job-card > .muted {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .job-title-line strong {
    font-size: 13px;
  }

  #detail-title {
    font-size: 20px;
    line-height: 1.15;
  }

  .file-row-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .modal-panel {
    width: 100%;
    max-height: calc(100vh - 24px);
  }

  .staff-editor-grid,
  .two-columns,
  .rights-checks,
  .profile-summary,
  .workday-profile,
  .break-profile {
    grid-template-columns: 1fr;
  }

  .modal-head,
  .modal-actions {
    flex-direction: column;
  }

  .modal-actions {
    align-items: stretch;
  }

  .planning-map-canvas {
    min-height: 270px;
  }

  .planning-map-footer {
    flex-direction: column;
  }
}
