:root {
  --bg: #ffffff;
  --text: #111111;
  --hint: #6b7280;
  --link: #2481cc;
  --button: #2481cc;
  --button-text: #ffffff;
  --secondary-bg: #ffffff;
  --input-bg: #ffffff;
  --border: rgba(0, 0, 0, 0.14);
  --group-border: rgba(0, 0, 0, 0.72);
  --danger: #ff3b30;
  --success: #34c759;
  --warning: #ff9500;
  --sparkline: #2481cc;
  --z-modal: 400;
  --z-toast: 550;
  --z-confirm: 650;
  --z-photo-viewer: 700;
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #000000;
  --text: #ffffff;
  --hint: #a1a1aa;
  --link: #6eb6ff;
  --button: #2481cc;
  --button-text: #ffffff;
  --secondary-bg: #141414;
  --input-bg: #1f1f1f;
  --border: rgba(255, 255, 255, 0.16);
  --group-border: rgba(255, 255, 255, 0.42);
  --sparkline: #6eb6ff;
  color-scheme: dark;
}

html[data-theme="dark"] .theme-toggle {
  background: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: -webkit-fill-available;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
}

#app.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

.ios-install-modal__title {
  margin: 0 0 8px;
  font-size: 18px;
}

.ios-install-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.ios-install-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.45;
}

.ios-install-step__num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ios-share-icon {
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  vertical-align: middle;
}

.ios-install-other {
  margin: 12px 0;
}

.ios-install-other .btn {
  width: 100%;
  margin-top: 8px;
}

.header {
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  background: var(--secondary-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header__user {
  font-size: 14px;
  color: var(--hint);
  min-width: 0;
  flex: 1;
}

.header__tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.profile-menu {
  position: relative;
}

.profile-menu__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--secondary-bg);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}

.profile-menu__btn:hover,
.profile-menu__btn[aria-expanded="true"] {
  border-color: var(--button);
}

.profile-menu__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  border-radius: 50%;
  background: var(--button);
  color: var(--button-text);
}

.profile-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 120;
  width: min(320px, calc(100vw - 24px));
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--secondary-bg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}

.profile-menu__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.profile-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.profile-menu__name {
  font-size: 15px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  line-height: 1.4;
}

.profile-menu__row > span:first-child {
  color: var(--hint);
  flex-shrink: 0;
}

.profile-menu__row > span:last-child {
  text-align: right;
  min-width: 0;
  word-break: break-word;
}

.profile-menu__notice {
  font-size: 13px;
  color: var(--warning);
  line-height: 1.4;
}

.profile-menu__section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

.profile-menu__section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-menu__theme {
  width: 100%;
  height: auto;
  min-height: 36px;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  justify-content: center;
  gap: 6px;
}

.profile-menu__panel > .btn {
  width: 100%;
  margin-top: 8px;
}

.theme-toggle {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--secondary-bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.theme-toggle--floating {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 130;
}

.theme-toggle.login-only {
  display: none;
}

body.login-visible .theme-toggle.login-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.content {
  flex: 1;
  padding: 16px;
}

.tab {
  display: none;
}

.tab.active {
  display: block;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.section-header__subtitle {
  flex: 1 1 100%;
  margin: -8px 0 0;
  font-size: 13px;
  color: var(--hint);
}

.work-view-switch {
  display: flex;
  gap: 8px;
  margin: -4px 0 12px;
}

.work-view-switch__btn {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--secondary-bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.work-view-switch__btn:hover {
  border-color: var(--link);
}

.work-view-switch__btn.active {
  background: var(--link);
  border-color: var(--link);
  color: #fff;
}

.work-view-switch {
  flex-wrap: wrap;
}

.work-view-switch__btn {
  min-width: calc(50% - 4px);
}

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

.offline-indicator {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
}

.offline-indicator--offline {
  background: #dc2626;
}

.offline-indicator--syncing {
  background: #d97706;
}

.badge--compact {
  font-size: 11px;
  padding: 2px 8px;
  flex-shrink: 0;
}

.card--compact__indicators {
  display: inline-flex;
  gap: 4px;
  flex-shrink: 0;
}

.card--compact__indicator {
  font-size: 12px;
  line-height: 1;
}

.card--compact__indicator--new {
  color: #ef4444;
  font-size: 14px;
}

.card--compact__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.card--compact__action {
  flex: 1 1 auto;
}

.statistics-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.statistics-report-card__label {
  font-size: 12px;
  color: var(--hint);
  margin-bottom: 6px;
}

.statistics-report-card__value {
  font-size: 20px;
  font-weight: 700;
}

.section-header h3 {
  font-size: 16px;
  margin: 16px 0 12px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.filters--inline {
  flex-wrap: nowrap;
  gap: 4px;
  margin-bottom: 12px;
}

.filters--inline .input {
  flex: 1 1 0;
  min-width: 0;
  font-size: 12px;
  padding: 6px 4px;
  line-height: 1.2;
}

.push-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  margin: 0;
  padding: 10px 16px;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--card-bg, #f4f8ff);
}

.push-banner.hidden {
  display: none !important;
}

.push-banner__text {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  flex: 1 1 180px;
}

.push-banner__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.app-update-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

html[data-theme="dark"] .app-update-banner {
  background: #422006;
  color: #fde68a;
  border-bottom-color: #b45309;
}

.app-update-banner.hidden {
  display: none !important;
}

.app-update-banner__title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
}

.app-update-banner__text,
.app-update-banner__hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.app-update-banner__hint {
  margin-top: 6px;
  font-weight: 600;
}

.app-update-banner__content {
  flex: 1 1 220px;
}

.app-update-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.push-quiet-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.push-quiet-form__row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.push-quiet-form__row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  flex: 1 1 120px;
}

.card__map-link {
  margin-left: 8px;
  font-size: 13px;
  color: var(--link);
  text-decoration: none;
}

.phone-link {
  color: var(--link);
  text-decoration: underline;
  font-weight: 500;
}

.salary-rates-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--hint);
}

.salary-rates-form label .input {
  margin-top: 0;
}

.input--readonly,
.input:disabled {
  opacity: 0.75;
  background: var(--bg);
}

.salary-rates-form .btn {
  margin-top: 8px;
  width: 100%;
}

.salary-rate-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: end;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.salary-rate-row:last-of-type {
  border-bottom: none;
}

.salary-rate-row__title {
  font-weight: 600;
  color: var(--text);
}

.salary-rate-row__amount {
  min-width: 120px;
}

.salary-rate-add-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.salary-rate-add-form__row {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

@media (min-width: 720px) {
  .salary-rate-add-form__row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.filters .input {
  flex: 1;
  min-width: 120px;
}

.filters__search {
  flex: 1 1 100%;
  min-width: 0;
}

#tab-settings .settings-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(100%, 720px);
  max-width: 720px;
  margin: 0 auto;
}

.settings-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  margin: 0 auto 4px;
  width: min(100%, 720px);
  max-width: 720px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.settings-chips::-webkit-scrollbar {
  display: none;
}

.settings-chip {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--secondary-bg);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.settings-chip--active {
  background: rgba(36, 129, 204, 0.14);
  border-color: var(--link);
  color: var(--link);
}

.settings-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-subcard + .settings-subcard {
  margin-top: 0;
}

.settings-subcard .card__subtitle {
  font-size: 14px;
  font-weight: 600;
  margin: 12px 0 6px;
}

.notifications-subsection {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.notifications-subsection .card__subtitle {
  font-size: 14px;
  font-weight: 600;
  margin: 12px 0 6px;
}

.notifications-subsection .btn {
  width: 100%;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  box-sizing: border-box;
}

.btn__icon {
  font-size: 1.1em;
  line-height: 1;
  flex-shrink: 0;
}

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

.settings-tab {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

.settings-tab--active {
  border-color: var(--link);
  color: var(--link);
  background: rgba(36, 129, 204, 0.1);
}

.logs-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
}

.logs-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--hint);
}

.profile-card--enhanced .profile-card__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.profile-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--link);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-card__name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.role-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}

.role-badge--super_admin { background: #ede9fe; color: #5b21b6; }
.role-badge--dispatcher { background: #dbeafe; color: #1d4ed8; }
.role-badge--technician { background: #dcfce7; color: #15803d; }
.role-badge--salesperson { background: #ffedd5; color: #c2410c; }
.role-badge--none { background: var(--border); color: var(--hint); }

[data-theme="dark"] .role-badge--super_admin { background: #3b2d6b; color: #ddd6fe; }
[data-theme="dark"] .role-badge--dispatcher { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .role-badge--technician { background: #14532d; color: #86efac; }
[data-theme="dark"] .role-badge--salesperson { background: #7c2d12; color: #fdba74; }

.team-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.team-user-card {
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.team-user-card:hover {
  border-color: var(--link);
}

.team-user-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.team-user-card__name {
  font-weight: 600;
}

.modal__content--wide {
  max-width: 560px;
  width: calc(100% - 24px);
}

.modal__header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.user-editor-panel label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
}

.user-editor-guest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.modal__actions--danger {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.dancer-sync-badge {
  margin: 8px 0;
}

.status-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.status-badge--ok { background: #dcfce7; color: #166534; }
.status-badge--warn { background: #fef3c7; color: #92400e; }
.status-badge--error { background: #fee2e2; color: #991b1b; }
.status-badge--muted { background: var(--border); color: var(--hint); }

.dancer-metrics-list {
  margin-bottom: 12px;
}

.dancer-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.dancer-metric-add-form__row {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

@media (min-width: 600px) {
  .dancer-metric-add-form__row {
    grid-template-columns: 1fr 1fr;
  }
}

.settings-advanced {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.settings-advanced summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 10px;
}

.form-sticky-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 0 4px;
  margin-top: 12px;
  background: linear-gradient(to top, var(--secondary-bg) 70%, transparent);
  z-index: 2;
}

.form-dirty-indicator {
  font-size: 12px;
  color: #c2410c;
  font-weight: 600;
}

.form--dirty .form-sticky-actions .btn--primary {
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.35);
}

#tab-settings .settings-layout > .card,
#tab-settings .settings-layout > .profile-card,
#tab-settings .settings-layout > .settings-section,
#tab-settings .settings-layout > .notice,
#tab-settings .settings-layout > #admin-panel,
#tab-settings .settings-layout > .btn {
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

#tab-settings .settings-layout > .card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

#tab-settings .settings-layout > .card > .btn,
#tab-settings .settings-layout .settings-section__body > .btn {
  width: 100%;
  margin-top: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  box-sizing: border-box;
}

#tab-settings .settings-layout .web-only {
  margin: 0;
}

#admin-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

#admin-panel > .settings-section {
  width: 100%;
  margin: 0;
}

#btn-web-logout {
  display: block;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--secondary-bg);
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--border);
}

.card__title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.card__meta {
  font-size: 13px;
  color: var(--hint);
  margin-bottom: 4px;
}

.card__address {
  font-size: 14px;
  margin-bottom: 8px;
}

.card__desc {
  font-size: 14px;
  color: var(--hint);
  margin-bottom: 10px;
}

.badge {
  display: inline-block;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.badge--pending { background: #fff3cd; color: #856404; }
.badge--in_progress { background: #cce5ff; color: #004085; }
.badge--awaiting_confirmation { background: #fff3e0; color: #e65100; }
.badge--confirmed { background: #d4edda; color: #155724; }
.badge--completed { background: #fff3e0; color: #e65100; }

.card__response {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

.card__actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn:active { opacity: 0.7; }

.btn--primary {
  background: var(--button);
  color: var(--button-text);
}

.btn--secondary {
  background: var(--secondary-bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--small {
  padding: 6px 12px;
  font-size: 13px;
}

.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  background: var(--input-bg);
  color: var(--text);
  margin-top: 4px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--hint);
  margin-bottom: 12px;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 2px;
  background: var(--secondary-bg);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  z-index: 100;
}

.bottom-nav:has(.nav-group--open) {
  z-index: 260;
}

.nav-group--bottom {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.nav-group--bottom .nav-btn--parent {
  flex: 1;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border: none;
  background: none;
  color: var(--hint);
  font-size: 11px;
  cursor: pointer;
  min-width: 0;
  overflow: visible;
  text-decoration: none;
}

a.work-view-switch__btn {
  text-decoration: none;
  color: inherit;
}

.nav-btn .nav-label {
  max-width: 100%;
  text-align: center;
  line-height: 1.15;
}

.nav-label--short {
  display: none;
}

.nav-btn.active {
  color: var(--link);
}

.nav-group {
  position: relative;
}

.nav-group.hidden {
  display: none !important;
}

.nav-btn--parent {
  width: 100%;
}

.nav-btn__caret {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.7;
}

.nav-submenu {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 220;
  background: var(--secondary-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  padding: 6px;
  min-width: 220px;
}

.nav-submenu--dropup {
  top: auto;
  bottom: calc(100% + 8px);
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  min-width: 220px;
  max-width: min(92vw, 280px);
}

.nav-group--open .nav-submenu {
  display: block;
}

.nav-group--bottom.nav-group--open .nav-submenu--dropup {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(68px + env(safe-area-inset-bottom, 8px));
  transform: none;
  width: auto;
  max-width: none;
  z-index: 270;
  max-height: min(50vh, 360px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-submenu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .nav-submenu-backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.nav-submenu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.nav-submenu__item:hover,
.nav-submenu__item.active {
  background: rgba(36, 129, 204, 0.12);
  color: var(--link);
}

.nav-submenu__icon {
  font-size: 18px;
  line-height: 1;
}

.nav-icon {
  font-size: 20px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: var(--z-modal);
}

#confirm-dialog {
  z-index: var(--z-confirm);
  background: rgba(0, 0, 0, 0.62);
}

.modal__content {
  background: var(--secondary-bg);
  width: 100%;
  max-width: 560px;
  max-height: min(90vh, calc(100vh - 32px));
  overflow-y: auto;
  border-radius: 16px;
  padding: 20px 16px;
}

.modal__subtitle {
  font-size: 14px;
  color: var(--hint);
  margin-bottom: 16px;
}

.modal__actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.modal__actions .btn {
  flex: 1;
}

.salary-summary {
  background: var(--button);
  color: var(--button-text);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.salary-summary__total {
  font-size: 28px;
  font-weight: 700;
}

.salary-summary__detail {
  font-size: 14px;
  opacity: 0.85;
  margin-top: 4px;
}

.salary-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.salary-breakdown {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  display: grid;
  gap: 6px;
}

.salary-breakdown__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.salary-breakdown__label {
  opacity: 0.9;
}

.salary-breakdown__value {
  font-weight: 600;
  white-space: nowrap;
}

.salary-comparison {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
}

.salary-comparison--up {
  color: #b8f5c3;
}

.salary-comparison--down {
  color: #ffd0d0;
}

.salary-banners {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.salary-banner {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}

.salary-banner--warning {
  background: rgba(255, 193, 7, 0.15);
  border: 1px solid rgba(255, 193, 7, 0.35);
  color: var(--text);
}

.salary-banner--info {
  background: rgba(33, 150, 243, 0.12);
  border: 1px solid rgba(33, 150, 243, 0.25);
  color: var(--text);
}

.salary-banner__link {
  color: var(--accent, #2196f3);
  text-decoration: underline;
  margin-left: 6px;
}

.salary-tech-strip {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--secondary-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.salary-tech-strip__label {
  font-size: 13px;
  color: var(--muted);
}

.salary-tech-strip__amount {
  font-size: 22px;
  font-weight: 700;
}

.salary-tech-strip__hours {
  font-size: 13px;
  color: var(--muted);
}

.salary-group-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin: 14px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.salary-group-header:first-child {
  margin-top: 0;
}

.salary-group-header__count {
  opacity: 0.7;
  font-weight: 600;
}

.salary-export-log {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--secondary-bg);
}

.salary-export-log__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.salary-export-log__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.salary-export-log__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--text);
}

.salary-card--warning {
  border-color: rgba(255, 193, 7, 0.45);
}

.salary-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.salary-card__meta-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
}

.salary-card__hours,
.salary-card__rate {
  white-space: nowrap;
}

.salary-card__rate--zero {
  color: #e65100;
  font-weight: 600;
}

.salary-card__work {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.35;
}

.salary-card__warning {
  margin-top: 8px;
  font-size: 12px;
  color: #e65100;
  line-height: 1.3;
}

.today-summary {
  background: var(--secondary-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}

.today-summary__total {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}

.today-summary__amount-block {
  margin-bottom: 4px;
}

.today-summary__pending {
  font-size: 13px;
  color: var(--hint);
  margin-top: 4px;
}

.today-summary__amount-col {
  text-align: right;
}

.today-summary__amount-col .today-summary__amount {
  font-size: 16px;
  font-weight: 600;
  color: var(--link);
}

.today-summary__amount-col .today-summary__pending {
  margin-top: 2px;
}

.today-summary__detail,
.today-summary__empty {
  font-size: 14px;
  color: var(--hint);
  margin-top: 8px;
}

.today-summary__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.today-summary__item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.today-summary__item:first-child {
  border-top: none;
  padding-top: 0;
}

.today-summary__name {
  font-size: 15px;
  font-weight: 500;
}

.today-summary__amount {
  font-size: 16px;
  font-weight: 600;
  color: var(--link);
}

.today-summary__meta {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--hint);
}

.card--compact {
  padding: 12px 14px;
  border-width: 2px;
}

.card--status-pending {
  border-color: #e6b800;
}

.card--status-in_progress {
  border-color: #2481cc;
}

.card--status-awaiting_confirmation,
.card--status-completed {
  border-color: #e65100;
}

.card--status-confirmed {
  border-color: #34c759;
}

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

.card--compact__main {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  flex: 1;
  font-size: 14px;
  line-height: 1.3;
}

.card--compact__body {
  min-width: 0;
  flex: 1;
}

.card--compact__headline {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.card--compact__status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

.card--compact__time {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.card--compact__sep {
  color: var(--hint);
  flex-shrink: 0;
}

.card--compact__address {
  min-width: 0;
  flex: 1;
  font-size: 13px;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: break-word;
}

.card--compact__date {
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--hint);
  font-size: 13px;
}

.card--schedule {
  padding: 8px 10px;
  border-width: 1.5px;
  border-radius: 10px;
}

#schedule-list.card-list {
  gap: 8px;
}

.card--schedule__head {
  align-items: flex-start;
  gap: 6px;
}

.card--schedule__when {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  min-width: 0;
  flex: 1;
}

.card--schedule__when .card--compact__time {
  font-size: 13px;
  line-height: 1.2;
}

.card--schedule__when .card--compact__date {
  font-size: 11px;
}

.card--schedule__when .card--compact__date::before {
  content: "·";
  margin-right: 6px;
  color: var(--hint);
}

.card--schedule__status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.card--schedule__status .badge--compact {
  font-size: 10px;
  padding: 1px 6px;
}

.card--schedule__address {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.25;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card--schedule__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 5px;
  min-width: 0;
}

.card--schedule__tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.card--schedule__tags .tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  line-height: 1.3;
}

.card--schedule__tech {
  font-size: 11px;
  line-height: 1.2;
  color: var(--hint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card--schedule__response {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--hint);
  white-space: pre-wrap;
  word-break: break-word;
}

.card--schedule .card--compact__actions {
  margin-top: 5px;
  gap: 4px;
}

.card--schedule .card--compact__action {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 11px;
}

.card--clickable {
  cursor: pointer;
}

.card--clickable:active {
  opacity: 0.92;
}

.card--compact__hint {
  font-size: 12px;
  color: var(--hint);
  margin-top: 8px;
}

.modal__content--wide .card {
  border: none;
  padding: 0;
  margin: 0;
}

.modal__content--wide {
  max-width: 760px;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: visible;
}

.modal__content--wide .card__menu-dropdown {
  z-index: 200;
}

.profile-card {
  background: var(--secondary-bg);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--border);
}

.profile-card__row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.profile-card__row:last-child {
  border-bottom: none;
}

.admin-users-list {
  gap: 10px;
}

.admin-users-divider {
  margin: 16px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.admin-user {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.admin-user__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.admin-user__delete {
  flex-shrink: 0;
}

.admin-user__controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-user__controls select,
.admin-user__controls input {
  flex: 1;
  min-width: 100px;
}

.admin-user__web-auth {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.admin-user__web-auth-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--hint);
}

.backup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 16px;
}

.backup-list__item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 13px;
}

.backup-list__item span:last-child {
  color: var(--hint);
  text-align: right;
  white-space: nowrap;
}

.backup-list__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.diag-reports-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 16px;
}

.diag-reports-list__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 13px;
}

.diag-reports-list__title {
  font-weight: 600;
}

.audit-log-filters {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.audit-log-filters .input {
  flex: 1;
}

.audit-log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
}

.audit-log-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 13px;
}

.audit-log-item__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.audit-log-item__action {
  font-weight: 600;
}

.audit-log-item__time {
  color: var(--hint);
  white-space: nowrap;
}

.audit-log-item__actor {
  color: var(--hint);
}

.audit-log-item__meta {
  margin-top: 4px;
  color: var(--text);
}

.settings-section {
  padding: 0;
}

.settings-section__title {
  list-style: none;
  cursor: pointer;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.settings-section__title::-webkit-details-marker {
  display: none;
}

.settings-section__title::after {
  content: "›";
  font-size: 20px;
  line-height: 1;
  color: var(--hint);
  transform: rotate(90deg);
  transition: transform 0.15s ease;
}

.settings-section[open] > .settings-section__title::after {
  transform: rotate(-90deg);
}

.settings-section__body {
  padding: 0 14px 14px;
}

.settings-section__body .card__meta:first-child {
  margin-top: 0;
}

.timezone-info {
  font-size: 14px;
  color: var(--hint);
  margin: 8px 0 12px;
  line-height: 1.5;
}

.timezone-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-assign__form,
.admin-maps-city__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.notice {
  background: #fff3cd;
  color: #856404;
  padding: 14px;
  border-radius: 10px;
  font-size: 14px;
  text-align: center;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--hint);
  font-size: 15px;
}

.toast {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 12px 20px;
  border-radius: 20px;
  font-size: 14px;
  z-index: var(--z-toast);
  max-width: calc(100vw - 32px);
  text-align: center;
  word-break: break-word;
  transition: opacity 0.3s;
}

body.login-visible #app.app-shell {
  display: none !important;
}

.hidden { display: none !important; }

.time-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.address-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.address-row .input {
  margin-top: 0;
  margin-bottom: 0;
}

.address-row select.input {
  flex: 2;
  min-width: 0;
}

.address-row #ticket-address-house {
  flex: 1;
  min-width: 56px;
  max-width: 88px;
}

.address-row #ticket-address-apartment {
  flex: 1;
  min-width: 56px;
  max-width: 88px;
}

.time-range .input {
  flex: 1;
}

.photo-paste-zone {
  flex: 1;
  border: 2px dashed var(--border, #d0d5dd);
  border-radius: 10px;
  padding: 14px 12px;
  text-align: center;
  cursor: text;
  background: rgba(0, 0, 0, 0.02);
  outline: none;
}

.photo-paste-zone:focus {
  border-color: var(--link);
}

.photo-paste-zone__hint {
  display: block;
  font-size: 13px;
  color: var(--text-muted, #667085);
  line-height: 1.4;
  pointer-events: none;
}

.photo-upload-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 8px;
}

.photo-upload-row__btn {
  flex-shrink: 0;
  align-self: center;
  min-width: 72px;
}

.photo-preview__item {
  position: relative;
  width: 80px;
  height: 80px;
}

.photo-preview__item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.photo-preview__remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: var(--danger, #dc3545);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.confirm-dialog__text {
  white-space: pre-line;
  margin: 0 0 16px;
  line-height: 1.45;
}

.modal__content--compact {
  max-width: 340px;
}

.photo-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.photo-gallery img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.photo-thumb {
  border: none;
  padding: 0;
  background: none;
  cursor: zoom-in;
  line-height: 0;
}

.photo-thumb img {
  display: block;
}

.card__photo.photo-thumb,
.card__photo .photo-thumb {
  width: 100%;
}

.card__photo.photo-thumb img,
.card__photo .photo-thumb img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 10px;
}

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: var(--z-photo-viewer);
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  flex-direction: column;
}

.photo-viewer__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.photo-viewer__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.photo-viewer__nav--prev { left: 10px; }
.photo-viewer__nav--next { right: 10px; }

.photo-viewer__stage {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 12px 12px;
  touch-action: none;
}

.photo-viewer__canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  will-change: transform;
}

.photo-viewer__canvas img {
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 140px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.photo-viewer__bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 16px 20px;
  flex-wrap: wrap;
}

.photo-viewer__hint {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  text-align: center;
}

.photo-viewer__counter {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.card__header .card__tags {
  margin-bottom: 0;
  flex: 1;
}

.card__header .card__title {
  margin-bottom: 0;
  flex: 1;
}

.card__menu {
  position: relative;
}

.card__menu-btn {
  border: none;
  background: none;
  color: var(--hint);
  font-size: 20px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
}

.card__menu-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--secondary-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  min-width: 150px;
  z-index: 20;
  overflow: hidden;
}

.card__menu-dropdown button {
  display: block;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.card__menu-dropdown button:active {
  background: rgba(0, 0, 0, 0.05);
}

.card__menu-dropdown button.danger {
  color: var(--danger);
}

.card__time {
  font-size: 14px;
  font-weight: 600;
  color: var(--link);
  margin-bottom: 6px;
}

.photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

#ticket-existing-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.photo-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.card__photo {
  margin: 10px 0;
}

.card__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.tag {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(36, 129, 204, 0.12);
  color: var(--link);
}

.salary-item__amount {
  font-weight: 600;
  color: var(--success);
}

.salary-card__amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--success);
  margin-bottom: 10px;
}

.card__response-amount {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--success);
}

.salary-card .card__header {
  margin-bottom: 4px;
}

.card__return-comment {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(230, 81, 0, 0.08);
  border: 1px solid rgba(230, 81, 0, 0.2);
  font-size: 14px;
}

.user-features-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.user-feature-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 14px;
}

.user-features-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-access-editor {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 12px 0;
  max-height: min(58vh, 520px);
  overflow-y: auto;
}

.user-access-intro {
  margin: 0 0 4px;
}

.user-access-group__title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.user-access-group__items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-access-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 14px;
}

.user-access-row__check {
  padding-top: 2px;
}

.user-access-row__title {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-weight: 500;
}

.user-access-row__hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--hint);
  line-height: 1.35;
}

.user-access-row__expires {
  display: block;
  margin-top: 8px;
}

.user-access-row__expires-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--hint);
}

.access-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.access-badge--role {
  background: rgba(36, 129, 204, 0.12);
  color: var(--link);
}

.nav-group.hidden {
  display: none;
}

.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(circle at top right, rgba(36, 129, 204, 0.12), transparent 40%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--secondary-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.login-card__logo {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.login-card__subtitle {
  color: var(--hint);
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  margin-bottom: 16px;
}

.login-form label {
  margin-bottom: 0;
}

.login-form .btn {
  width: 100%;
  margin-top: 4px;
}

.login-card__hint {
  color: var(--hint);
  font-size: 13px;
  line-height: 1.5;
}

.login-card__diag {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
}

.login-card__diag a {
  color: var(--link);
  text-decoration: none;
}

.login-card__diag a:hover {
  text-decoration: underline;
}

.ios-http-hint {
  color: var(--hint);
}

.ios-help-banner {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  text-align: left;
  font-size: 13px;
  line-height: 1.45;
}

html[data-theme="dark"] .ios-help-banner {
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(217, 119, 6, 0.35);
}

.ios-help-banner__title {
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.ios-help-banner__text {
  margin: 0 0 8px;
  color: var(--hint);
}

.ios-help-banner__text code {
  font-size: 12px;
}

.ios-help-banner__link {
  display: block;
  margin: 0 0 8px;
  font-weight: 600;
  word-break: break-all;
  color: var(--link);
  text-decoration: none;
}

.ios-help-banner__list {
  margin: 0;
  padding-left: 18px;
  color: var(--hint);
}

.ios-help-banner__list a {
  color: var(--link);
}

.app-boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

html[data-theme="dark"] .app-boot-overlay {
  background: rgba(0, 0, 0, 0.88);
}

.app-boot-overlay__card {
  max-width: 320px;
  text-align: center;
}

.app-boot-overlay__title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
}

.app-boot-overlay__hint {
  color: var(--hint);
  font-size: 14px;
  margin: 0 0 12px;
}

.app-boot-overlay__link {
  color: var(--link);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
}

.login-card__error {
  margin-top: 16px;
  color: var(--danger);
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.login-card__boot-status {
  color: var(--hint);
  font-size: 14px;
  margin-bottom: 12px;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
}

.sidebar-nav {
  display: none;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
  display: flex;
  flex-direction: column;
}

.web-only {
  width: 100%;
  margin: 0 0 16px;
}

.web-mode .web-only.hidden {
  display: none !important;
}

.reporting-empty {
  padding: 8px 0 24px;
}

.reporting-empty h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.reporting-empty__hint {
  margin-bottom: 16px;
}

.reporting-dashboard {
  display: grid;
  gap: 16px;
}

.reporting-dashboard-card {
  width: 100%;
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--group-border);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.reporting-dashboard-card:hover {
  border-color: var(--link);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.reporting-dashboard-card__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.reporting-dashboard-card__icon {
  font-size: 32px;
  line-height: 1;
}

.reporting-dashboard-card__title {
  font-size: 18px;
  font-weight: 700;
}

.reporting-form-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reporting-form-header h2 {
  margin: 0;
}

.reporting-intro {
  margin-bottom: 12px;
}

.reporting-group {
  border: 1px solid var(--group-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--secondary-bg);
}

.reporting-group + .reporting-group {
  margin-top: 12px;
}

.reporting-group__title {
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}

.reporting-group__body {
  display: flex;
  flex-direction: column;
}

.reporting-group__body > :last-child {
  border-bottom: none;
}

.reporting-subheader {
  padding: 10px 14px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hint);
}

.reporting-filters {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.reporting-summary {
  background: rgba(36, 129, 204, 0.1);
  color: var(--link);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
}

.reporting-sheet {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.reporting-row--indent {
  margin-left: 16px;
}

.reporting-row--indent .reporting-row__label,
.reporting-row--indent .reporting-field__label {
  font-size: 12px;
}

.reporting-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.reporting-section__body.reporting-content {
  gap: 12px;
  margin-bottom: 0;
  padding: 12px;
}

.reporting-section--collapsed {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--group-border);
  border-radius: 12px;
  background: var(--secondary-bg);
}

.reporting-section--collapsed .reporting-section__title {
  cursor: pointer;
  font-weight: 600;
  padding: 14px 16px;
  list-style: none;
  user-select: none;
}

.reporting-section--collapsed .reporting-section__title::-webkit-details-marker {
  display: none;
}

.reporting-section--collapsed .reporting-section__title::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s ease;
}

.reporting-section--collapsed[open] .reporting-section__title::before {
  transform: rotate(90deg);
}

.reporting-section--collapsed .reporting-section__body {
  padding: 0 12px 12px;
  border-top: 1px solid var(--border);
}

.reporting-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.reporting-legend__item {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--hint);
}

.reporting-legend__item--input,
.reporting-legend__item--readonly,
.reporting-legend__item--header {
  background: transparent;
  color: var(--hint);
}

.reporting-row {
  border-radius: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.reporting-row--header {
  display: none;
}

.reporting-row--readonly {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
}

.reporting-row__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.reporting-row--input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
}

.reporting-row__main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.reporting-row__label {
  font-size: 13px;
  color: var(--hint);
  line-height: 1.35;
}

.reporting-row__value {
  font-size: 16px;
  font-weight: 600;
}

.reporting-row__badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--hint);
}

.reporting-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reporting-field__control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reporting-field__control .input {
  flex: 1;
  min-width: 0;
}

.reporting-sparkline {
  flex-shrink: 0;
  color: var(--sparkline);
  opacity: 0.9;
}

.reporting-sparkline--empty {
  width: 56px;
  flex-shrink: 0;
}

.reporting-chart {
  padding: 16px;
  margin-bottom: 16px;
}

.reporting-chart__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.reporting-chart__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.reporting-chart__latest {
  font-size: 13px;
  color: var(--hint);
  text-align: right;
}

.reporting-chart__canvas-wrap {
  overflow-x: auto;
}

.reporting-chart__canvas {
  width: 100%;
  min-width: 320px;
  height: auto;
  display: block;
}

.reporting-chart__axis {
  stroke: var(--border);
  stroke-width: 1;
}

.reporting-chart__line {
  fill: none;
  stroke: var(--sparkline);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.reporting-chart__dot {
  fill: var(--sparkline);
}

.reporting-chart__range {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: var(--hint);
}

.reporting-field__status {
  flex-shrink: 0;
  width: 22px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--hint);
}

.reporting-field__status--pending {
  color: var(--hint);
}

.reporting-field__status--saving {
  color: var(--link);
  animation: reporting-spin 0.8s linear infinite;
}

.reporting-field__status--saved {
  color: #248a3d;
}

.reporting-field__status--error {
  color: var(--danger, #ff3b30);
}

@keyframes reporting-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.reporting-field__label {
  font-size: 13px;
  color: var(--hint);
  line-height: 1.35;
}

.reporting-search {
  margin-bottom: 12px;
}

@media (min-width: 900px) {
  body.web-mode {
    overflow: auto;
  }

  body.web-mode #app.app-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    min-height: 100vh;
    padding-bottom: 0;
  }

  body.web-mode .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px 12px;
    background: var(--secondary-bg);
    border-right: 1px solid var(--border);
  }

  body.web-mode .app-main {
    grid-column: 2;
    grid-row: 1;
    min-height: 100vh;
  }

  body.web-mode .bottom-nav {
    display: none;
  }

  .sidebar-nav__brand {
    font-size: 18px;
    font-weight: 700;
    padding: 8px 12px 20px;
  }

  .sidebar-nav .nav-btn {
    flex: 0;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
  }

  .sidebar-nav .nav-group {
    width: 100%;
  }

  .sidebar-nav .nav-btn--parent {
    justify-content: flex-start;
  }

  .sidebar-nav .nav-group:hover .nav-submenu,
  .sidebar-nav .nav-group:focus-within .nav-submenu {
    display: block;
  }

  .sidebar-nav .nav-group--open .nav-submenu {
    display: block;
  }

  .sidebar-nav .nav-submenu {
    left: calc(100% + 4px);
    right: auto;
    top: 0;
    min-width: 240px;
  }

  .sidebar-nav .nav-submenu::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 0;
    width: 6px;
    height: 100%;
  }

  .sidebar-nav .nav-btn.active {
    background: rgba(36, 129, 204, 0.12);
  }

  .content {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
  }

  .header {
    padding: 16px 24px;
  }

  .section-header h2 {
    font-size: 24px;
  }

  .filters {
    gap: 12px;
  }

  .filters .input {
    min-width: 140px;
  }

  .card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
  }

  .card-list.admin-users-list,
  #schedule-list.card-list,
  #today-list.card-list {
    display: flex;
    flex-direction: column;
  }

  .modal {
    padding: 24px;
  }

  .modal__content {
    max-height: calc(100vh - 48px);
  }

  .address-row {
    grid-template-columns: 1.4fr 0.8fr 0.8fr;
  }

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

  .reporting-filters {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .admin-user__controls {
    max-width: 420px;
  }

  .settings-section {
    max-width: 720px;
  }

  .profile-card,
  .home-screen-panel,
  #btn-web-logout,
  #web-push-panel,
  #admin-panel {
    max-width: 720px;
  }
}

@media (min-width: 1200px) {
  .content {
    max-width: 1200px;
  }
}

/* --- Mobile: bottom nav + work cards --- */
@media (max-width: 520px) and (min-width: 421px) {
  .bottom-nav .nav-label--full {
    display: none;
  }

  .bottom-nav .nav-label--short {
    display: block;
    font-size: 10px;
  }

  .bottom-nav .nav-btn {
    padding: 6px 2px;
  }
}

@media (max-width: 420px) {
  .bottom-nav .nav-label--full,
  .bottom-nav .nav-label--short {
    display: none;
  }

  .bottom-nav .nav-btn {
    padding: 8px 2px;
    gap: 0;
  }

  .bottom-nav .nav-icon {
    font-size: 22px;
  }

  #app.app-shell {
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 720px) {
  .card--compact__time,
  .card--compact__address {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .content {
    padding: 12px;
  }

  .card--compact {
    padding: 10px 12px;
  }

  .card--compact__row {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .card--compact__status {
    margin-left: 0;
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .card--schedule__head {
    align-items: stretch;
  }

  .card--schedule__when {
    min-width: 0;
  }

  .card--schedule__status {
    align-self: flex-end;
  }

  .badge--compact {
    font-size: 10px;
    padding: 2px 6px;
  }

  .card--compact__action {
    flex: 1 1 calc(50% - 3px);
    min-width: 0;
  }

  .filters:not(.filters--inline) .input {
    flex: 1 1 100%;
    min-width: 0;
  }

  .filters--inline .input {
    flex: 1 1 0;
    min-width: 0;
    font-size: 11px;
    padding: 5px 3px;
  }

  .filters__search {
    flex: 1 1 100%;
  }

  .section-header h2 {
    font-size: 18px;
  }
}

@media (max-width: 360px) {
  .card--compact__main {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .card--compact__sep {
    display: none;
  }

  .card--compact__address {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
  }

  .card--schedule__address {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
  }
}

.ticket-timeline-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.ticket-timeline-section__title {
  margin: 0 0 10px;
  font-size: 15px;
}

.ticket-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.timeline-item {
  background: var(--secondary-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.timeline-item__meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.timeline-item__title {
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-item__summary,
.timeline-item__body {
  font-size: 14px;
  white-space: pre-wrap;
}

.timeline-item--comment {
  border-left: 3px solid var(--accent, #2563eb);
}

.ticket-comment-form textarea {
  width: 100%;
  margin-top: 4px;
}

.ticket-comment-form__photos {
  display: block;
  margin: 8px 0;
}

.tab-placeholder {
  text-align: center;
  padding: 56px 24px;
  margin-top: 8px;
  background: var(--secondary-bg);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

.tab-placeholder__title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.tab-placeholder__hint {
  margin: 0;
  font-size: 14px;
  color: var(--hint);
}

