:root {
  color-scheme: light;
  --bg: #f3f5f9;
  --bg-grad: #f3f5f9;
  --surface: #ffffff;
  --surface-soft: #f7f8fb;
  --surface-inset: #eef1f6;
  --text: #1f2937;
  --text-secondary: #4b5563;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;

  --primary: #1576d1;
  --primary-dark: #0d5fa8;
  --primary-soft: #e6f0fb;

  --accent: #f97316;
  --accent-soft: #fff1e6;
  --accent-bright: #fb923c;

  --ok-bg: #ecfdf5;
  --ok-text: #047857;
  --warn-bg: #fef3c7;
  --warn-text: #92400e;
  --danger: #dc2626;

  --shadow-sm: 0 1px 0 rgba(20, 30, 50, 0.04), 0 2px 4px rgba(20, 30, 50, 0.06);
  --shadow-md: 0 8px 28px -4px rgba(20, 30, 50, 0.12);
  --shadow-lg: 0 24px 60px -12px rgba(20, 30, 50, 0.2);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  --font-display: "Manrope", "PT Sans", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-body: "Manrope", "PT Sans", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  font-family: var(--font-body);
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}

html {
  overflow-x: clip;
}
html[data-theme="dark"] {
  --bg: #0a1018;
  --bg-grad:
    radial-gradient(1200px 600px at 80% -10%, #1a2942 0%, transparent 55%),
    radial-gradient(900px 500px at -10% 110%, #122035 0%, transparent 55%), #0a1018;
  --surface: #1a2434;
  --surface-soft: #232f43;
  --text: #f1f5fb;
  --muted: #a8b6cc;
  --line: #2d3c54;
  --line-strong: #45597a;
  --primary: #6090ff;
  --primary-dark: #3a78ff;
  --primary-soft: #1f2e4d;
  --accent: #ff8157;
  --ok-bg: #16432e;
  --ok-text: #8eebbb;
  --warn-bg: #4a2b15;
  --warn-text: #ffba88;
  --danger: #ff5e54;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] body {
  color: var(--text);
  background: var(--bg-grad);
}
html[data-theme="dark"] .topbar {
  background: rgba(20, 30, 42, 0.85);
}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: var(--surface-soft);
  color: var(--text);
  border-color: var(--line);
}
html[data-theme="dark"] input:-webkit-autofill,
html[data-theme="dark"] input:-webkit-autofill:hover,
html[data-theme="dark"] input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 30px var(--surface-soft) inset !important;
  caret-color: var(--text);
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: var(--muted);
  opacity: 0.6;
}
html[data-theme="dark"] .secondary-button {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line-strong);
}
html[data-theme="dark"] .summary-card:not(.summary-card--accent),
html[data-theme="dark"] .card,
html[data-theme="dark"] .login-panel,
html[data-theme="dark"] .worker-main,
html[data-theme="dark"] .side-panel {
  background: var(--surface);
  border-color: var(--line);
}
html[data-theme="dark"] .summary-card--accent {
  background: linear-gradient(135deg, #2f6df6, #6fa1ff);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 18px rgba(47, 109, 246, 0.35);
}
html[data-theme="dark"] .summary-card--accent span {
  color: rgba(255, 255, 255, 0.85);
}
html[data-theme="dark"] th {
  background: var(--surface-soft);
}
html[data-theme="dark"] tbody tr:hover {
  background: var(--surface-soft);
}
html[data-theme="dark"] code {
  background: var(--surface-soft);
  color: var(--text);
}
html[data-theme="dark"] .nav-toggle {
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--text);
}
html[data-theme="dark"] .topnav a {
  color: var(--muted);
}
html[data-theme="dark"] .topnav a:hover {
  background: var(--surface-soft);
  color: var(--text);
}
html[data-theme="dark"] .site-footer {
  background: rgba(20, 30, 42, 0.5);
}

/* Chat */
.chat-window {
  display: flex;
  flex-direction: column;
  min-height: 400px;
}
.chat-thread {
  flex: 1;
  overflow-y: auto;
  max-height: 60vh;
  padding: 14px;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 14px;
  position: relative;
}
.chat-msg--mine {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg--theirs {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.chat-msg__body {
  font-size: 14px;
  word-wrap: break-word;
}
.chat-msg__time {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 4px;
}
.chat-form {
  display: flex;
  gap: 8px;
}
.chat-form input {
  flex: 1;
}
.chat-msg__author {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.85;
  margin-bottom: 3px;
  color: var(--primary);
}
.chat-msg--mine .chat-msg__author {
  color: rgba(255, 255, 255, 0.9);
}

/* Chat list — editorial/refined */
.chat-list-card {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.chat-list-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 200px at 0% 0%, rgba(21, 118, 209, 0.06), transparent 70%),
    radial-gradient(400px 200px at 100% 100%, rgba(249, 115, 22, 0.05), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.chat-list-card > * {
  position: relative;
  z-index: 1;
}

.chat-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 14px;
  border-radius: 12px;
  text-decoration: none !important;
  color: var(--text) !important;
  position: relative;
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.chat-row:hover {
  background: var(--surface-soft);
  transform: translateX(2px);
}
.chat-row + .chat-row {
  border-top: 1px solid transparent;
}

/* Hero "Общий чат" */
.chat-row--room {
  background:
    linear-gradient(135deg, rgba(21, 118, 209, 0.12) 0%, rgba(249, 115, 22, 0.08) 100%), var(--surface);
  border: 1px solid rgba(21, 118, 209, 0.25);
  padding: 18px 18px;
  margin-bottom: 8px;
  box-shadow:
    0 1px 0 rgba(21, 118, 209, 0.05),
    0 8px 24px -16px rgba(21, 118, 209, 0.4);
  overflow: hidden;
}
.chat-row--room::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(21, 118, 209, 0.18), transparent 60%);
  pointer-events: none;
  filter: blur(20px);
}
.chat-row--room:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(21, 118, 209, 0.05),
    0 18px 36px -18px rgba(21, 118, 209, 0.5);
}

.chat-row__avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--avatar-bg, linear-gradient(135deg, #1576d1, #4ea0e8));
  color: #fff;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  letter-spacing: 0.4px;
  box-shadow:
    0 4px 12px -4px rgba(21, 118, 209, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
}
.chat-row__avatar--room {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #1576d1 0%, #f97316 100%);
  font-family: "Fraunces", serif;
  font-size: 26px;
  font-weight: 600;
  font-style: italic;
  box-shadow:
    0 6px 18px -4px rgba(21, 118, 209, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.chat-row__avatar--room::after {
  content: "";
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #10b981;
  border: 2px solid var(--surface);
  border-radius: 50%;
  animation: chat-pulse 2.4s ease-in-out infinite;
}
@keyframes chat-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
}

.chat-row__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.chat-row__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.chat-row__top strong {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-row--room .chat-row__top strong {
  font-family: "Fraunces", serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.chat-row__time {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.chat-row__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.chat-row__preview {
  font-size: 13px;
  color: var(--text-secondary, var(--muted));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}
.chat-row__preview .muted {
  color: var(--muted);
  font-weight: 500;
}
.chat-row--unread .chat-row__preview {
  color: var(--text);
  font-weight: 500;
}
.chat-row--unread .chat-row__top strong::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  transform: translateY(-2px);
}

.chat-badge {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 6px -1px rgba(21, 118, 209, 0.4);
}
.chat-row--room .chat-badge {
  background: var(--accent);
  box-shadow: 0 2px 6px -1px rgba(249, 115, 22, 0.5);
}

.chat-list-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 14px 8px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.chat-list-divider span {
  flex-shrink: 0;
}
.chat-list-divider::before,
.chat-list-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

/* Avatar tints — varied palette so the list feels alive */
.chat-row__avatar[data-tint="0"] {
  background: linear-gradient(135deg, #1576d1, #4ea0e8);
  box-shadow:
    0 4px 12px -4px rgba(21, 118, 209, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.chat-row__avatar[data-tint="1"] {
  background: linear-gradient(135deg, #f97316, #fbbf3a);
  box-shadow:
    0 4px 12px -4px rgba(249, 115, 22, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.chat-row__avatar[data-tint="2"] {
  background: linear-gradient(135deg, #0d9488, #34d399);
  box-shadow:
    0 4px 12px -4px rgba(13, 148, 136, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.chat-row__avatar[data-tint="3"] {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  box-shadow:
    0 4px 12px -4px rgba(124, 58, 237, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.chat-row__avatar[data-tint="4"] {
  background: linear-gradient(135deg, #db2777, #f472b6);
  box-shadow:
    0 4px 12px -4px rgba(219, 39, 119, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.chat-row__avatar[data-tint="5"] {
  background: linear-gradient(135deg, #475569, #94a3b8);
  box-shadow:
    0 4px 12px -4px rgba(71, 85, 105, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.chat-row__avatar[data-tint="6"] {
  background: linear-gradient(135deg, #0891b2, #22d3ee);
  box-shadow:
    0 4px 12px -4px rgba(8, 145, 178, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.chat-row__avatar[data-tint="7"] {
  background: linear-gradient(135deg, #ca8a04, #facc15);
  box-shadow:
    0 4px 12px -4px rgba(202, 138, 4, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Heading — back button + serif title */
.chat-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}
.chat-heading h1 {
  font-family: "Fraunces", serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.chat-back {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.chat-back:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateX(-2px);
}

/* Page-heading tweak for chat list */
.section-heading h1 + p,
.section-heading p {
  font-family: var(--font-display);
}
.admin-layout .section-heading h1 {
  font-family: "Fraunces", serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

@media (max-width: 600px) {
  .chat-row {
    padding: 12px 10px;
    gap: 12px;
  }
  .chat-row--room {
    padding: 14px 12px;
  }
  .chat-row__avatar {
    width: 42px;
    height: 42px;
    font-size: 14px;
  }
  .chat-row__avatar--room {
    width: 50px;
    height: 50px;
    font-size: 22px;
  }
  .chat-row__top strong {
    font-size: 14px;
  }
  .chat-row--room .chat-row__top strong {
    font-size: 16px;
  }
}

/* Settings controls in nav */
.topnav__settings {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  padding: 4px 8px;
}
.topnav__inline {
  margin: 0;
}
.topnav__inline button,
.topnav__inline select {
  padding: 6px 10px;
  font-size: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
}

/* Panic button */
.panic-button {
  width: 36px;
  height: 36px;
  border: 0;
  background: var(--warn-bg);
  color: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  transition: transform 0.1s;
}
.panic-button:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.05);
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-grad);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  font-size: 13.5px;
  line-height: 1.5;
}
.page {
  position: relative;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-body);
  letter-spacing: -0.01em;
  line-height: 1.25;
  font-weight: 700;
}
h1 {
  font-size: 22px;
}
h2 {
  font-size: 17px;
}
h3 {
  font-size: 15px;
}

.section-heading p,
.section-eyebrow {
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}
.section-heading h1 {
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

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

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

/* ======== APPBAR — light blue МойСклад-style ======== */
.appbar {
  display: flex;
  align-items: stretch;
  background: #1576d1;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  min-height: 64px;
}
.appbar__brand {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: #fff;
}
.appbar__brand img {
  height: 36px;
  width: auto;
  display: block;
}
.appbar__nav {
  display: flex;
  flex: 1;
  align-items: stretch;
  padding-left: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  order: 1;
}
.appbar__nav::-webkit-scrollbar {
  display: none;
}
.appbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 14px 6px;
  min-width: 76px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition:
    background 0.15s,
    color 0.15s;
  position: relative;
  white-space: nowrap;
}
.appbar__item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.appbar__item.is-active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-bottom-color: #fff;
  font-weight: 600;
}
.appbar__icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
}
.appbar__icon svg {
  width: 20px;
  height: 20px;
}
.appbar__icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
}
.appbar__icon svg {
  width: 22px;
  height: 22px;
}
.appbar__label {
  font-size: 11.5px;
  letter-spacing: 0.01em;
}
.appbar__badge {
  position: absolute;
  top: 6px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  background: #ff6347;
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

/* Правый блок */
.appbar__user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  order: 4;
}
.appbar__btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.appbar__btn:hover {
  background: rgba(255, 255, 255, 0.25);
}
.appbar__btn--logout {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.4);
  font-size: 18px;
}
.appbar__inline {
  display: inline-flex;
  margin: 0;
}
.lang-switch {
  margin-left: auto;
  margin-right: 12px;
  align-self: center;
  order: 5; /* sit after nav (order:1 below) and user (order:4) — i.e. far right */
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.lang-switch__btn {
  font:
    700 12px/1 "Manrope",
    sans-serif;
  letter-spacing: 0.08em;
  padding: 7px 12px;
  min-width: 38px;
  border: 0;
  background: transparent;
  color: #fff;
  border-radius: 7px;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.1s ease;
}
.lang-switch__btn:hover {
  background: rgba(255, 255, 255, 0.18);
}
.lang-switch__btn:active {
  transform: scale(0.96);
}
.lang-switch__btn.is-active {
  background: var(--accent, #f5a524);
  color: #1a2540;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
/* When user is logged in, language switcher sits next to user controls (not auto-pushed) */
.appbar__nav ~ .lang-switch {
  margin-left: 8px;
}
@media (max-width: 880px) {
  /* Compact lang switcher on mobile — minimal letters, no heavy pill */
  .lang-switch {
    margin-right: 4px !important;
    padding: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    gap: 1px;
    order: 5;
  }
  .lang-switch__btn {
    padding: 6px 8px;
    min-width: 30px;
    font-size: 11px;
    letter-spacing: 0.06em;
    border-radius: 6px;
  }
}
.appbar__profile {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 0 10px;
  line-height: 1.2;
  max-width: 180px;
}
.appbar__name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.appbar__role {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
}
.appbar__toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  margin-right: 8px;
}

/* Subnav — спокойная редакторская строка */
.subnav {
  display: flex;
  gap: 0;
  padding: 0 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: 64px;
  z-index: 15;
}
.subnav::-webkit-scrollbar {
  display: none;
}
.subnav a {
  padding: 12px 16px 10px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition:
    color 0.15s,
    border-color 0.15s;
  white-space: nowrap;
}
.subnav a:hover {
  color: var(--text);
}
.subnav a.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

@media (max-width: 880px) {
  .appbar {
    min-height: 60px;
  }
  .appbar__brand {
    padding: 0 12px;
  }
  .appbar__brand img {
    height: 36px;
  }
  .appbar__toggle {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin: 6px 8px 6px 4px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    order: 10;
  }
  .appbar__toggle svg {
    width: 26px;
    height: 26px;
    stroke-width: 2.6;
  }
  .appbar__toggle:active {
    transform: scale(0.96);
  }
  /* Compact user controls on mobile — keep theme/logout small but tappable */
  .appbar__user {
    border-left: 0;
    padding: 0 2px;
    margin-left: auto;
    gap: 4px;
    order: 4;
  }
  .appbar__user .appbar__btn {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }
  .appbar__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #2d77f5, #2562d9);
    flex-direction: column;
    padding: 8px 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  }
  .appbar__nav.is-open {
    display: flex;
  }
  .appbar__item {
    flex-direction: row;
    justify-content: flex-start;
    min-width: 0;
    padding: 12px 14px;
    border-bottom: 0;
    border-radius: 8px;
  }
  .appbar__item.is-active {
    border-bottom: 0;
    background: rgba(255, 255, 255, 0.2);
  }
  .appbar__label {
    font-size: 14px;
  }
  .appbar__user {
    padding: 0 8px;
    gap: 4px;
  }
  .appbar__profile {
    display: none;
  }
  .subnav {
    padding: 0 12px;
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), #6fa1ff);
  color: #fff;
  font-size: 16px;
  box-shadow: var(--shadow-sm);
}
.brand__logo {
  height: 40px;
  width: auto;
  display: block;
}
.brand__text {
  font-size: 16px;
}

.login-logo {
  display: block;
  margin: 0 auto 18px;
  max-width: 220px;
  height: auto;
}

.topnav {
  display: flex;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
}
.topnav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition:
    background 0.15s,
    color 0.15s;
}
.topnav a:hover {
  background: var(--surface-soft);
  color: var(--text);
}
.topnav a.is-active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow: inset 0 -2px 0 var(--primary);
}

/* Dropdown "Ещё" */
.topnav__more {
  position: relative;
}
.topnav__more-btn {
  padding: 8px 14px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.topnav__more-btn:hover {
  background: var(--surface-soft);
  color: var(--text);
}
.topnav__more-btn.is-active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow: inset 0 -2px 0 var(--primary);
}
.topnav__more:hover .topnav__menu,
.topnav__more:focus-within .topnav__menu {
  display: block;
}
.topnav__menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 8px;
  z-index: 100;
}
.topnav__menu-group {
  padding: 4px 0;
}
.topnav__menu-group + .topnav__menu-group {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 8px;
}
.topnav__menu-label {
  display: block;
  padding: 4px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 800;
}
.topnav__menu a {
  display: block !important;
  padding: 8px 10px !important;
  border-radius: 8px !important;
  color: var(--text) !important;
  font-weight: 500 !important;
  font-size: 14px !important;
  white-space: nowrap;
}
.topnav__menu a:hover {
  background: var(--surface-soft) !important;
}
.topnav__menu a.is-active {
  background: var(--primary-soft) !important;
  color: var(--primary-dark) !important;
  box-shadow: none !important;
}
.badge-pill {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: 4px;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  padding: 0;
}
.nav-toggle:hover {
  background: var(--line);
}

.topnav__logout {
  display: none;
  margin: 0;
}
.topnav__logout button {
  display: block;
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-weight: 700;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}
.topnav__logout button:hover {
  background: var(--warn-bg);
}
.nav-toggle .nav-toggle__open {
  display: block;
}
.nav-toggle .nav-toggle__close {
  display: none;
}
.topbar.is-open .nav-toggle .nav-toggle__open {
  display: none;
}
.topbar.is-open .nav-toggle .nav-toggle__close {
  display: block;
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 600;
}
.topbar__name {
  font-size: 14px;
}
.logout-button {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

/* Page */
.page {
  width: min(1300px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 40px;
}

.section-heading {
  margin-bottom: 14px;
}
.section-heading p {
  margin: 0 0 4px;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
}
.section-heading h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

/* Cards */
.card,
.worker-main,
.side-panel {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.card h2 {
  margin: 0 0 12px;
  font-weight: 600;
  font-size: 16px;
}
.card h3 {
  margin: 14px 0 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

/* Login */
.login-shell {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
}
.login-panel {
  width: min(420px, 100%);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.login-panel h1 {
  margin: 0 0 18px;
  font-size: 26px;
}

/* Forms */
label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(31, 58, 95, 0.1);
}

.form-grid {
  display: grid;
  gap: 4px;
}
.form-grid--cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 14px;
}
.form-grid--cols .form-actions {
  grid-column: 1 / -1;
}
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.form-inline {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.form-inline input {
  flex: 1;
}

/* Buttons */
.primary-button,
.secondary-button,
.icon-button,
.link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s,
    transform 0.05s,
    box-shadow 0.15s;
}
.primary-button,
.secondary-button,
.icon-button {
  min-height: 42px;
  border-radius: var(--radius-sm);
}
.primary-button {
  padding: 0 22px;
  background: var(--primary);
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 4px 14px rgba(20, 38, 64, 0.25);
  letter-spacing: 0.005em;
}
.primary-button:hover {
  background: var(--primary-dark);
}
.primary-button.btn--accent {
  background: var(--accent);
  box-shadow: 0 4px 14px rgba(194, 94, 29, 0.3);
}
.primary-button.btn--accent:hover {
  background: #a44a14;
}
.primary-button:active {
  transform: translateY(1px);
}
.secondary-button {
  padding: 0 16px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.secondary-button:hover {
  background: var(--surface-soft);
}
.icon-button {
  width: 38px;
  background: var(--surface-soft);
  color: var(--text);
}
.icon-button:hover {
  background: var(--line);
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.link {
  background: transparent;
  padding: 4px 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}
.link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}
.link--danger {
  color: var(--danger);
}

/* Worker layout */
.worker-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.camera-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  background: #0f1521;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.camera-frame video,
.photo-preview,
.camera-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.camera-frame video,
.photo-preview {
  object-fit: cover;
}
.camera-fallback {
  display: grid;
  place-items: center;
  color: #fff;
}

.action-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.action-row--compact {
  margin-top: 12px;
}

.confirm-panel {
  margin-top: 14px;
  padding: 14px;
  background: var(--primary-soft);
  border: 1px solid #cfddfb;
  border-radius: var(--radius-sm);
}
.confirm-panel p {
  margin: 0;
  font-weight: 700;
  color: var(--primary-dark);
}

.geo-status {
  margin: 12px 0 0;
  padding: 9px 12px;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.geo-status--ok {
  background: var(--ok-bg);
  color: var(--ok-text);
}
.geo-status--err {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.pill {
  display: inline-block;
  padding: 6px 12px;
  margin: 0 0 12px;
  border-radius: 999px;
  background: var(--surface-soft);
  font-weight: 700;
  font-size: 13px;
}
.pill--accent {
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.pill--warn {
  background: var(--warn-bg);
  color: var(--warn-text);
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.status-message,
.alert {
  margin: 14px 0 0;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--ok-bg);
  color: var(--ok-text);
  font-size: 14px;
  font-weight: 600;
}
.status-message:empty {
  display: none;
}
.status-message--error,
.alert {
  background: var(--warn-bg);
  color: var(--warn-text);
}
.alert--ok {
  background: var(--ok-bg);
  color: var(--ok-text);
}

/* Detail list */
.detail-list {
  display: grid;
  gap: 14px;
  margin: 0;
}
.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}
.detail-list dt {
  color: var(--muted);
}
.detail-list dd {
  margin: 0;
  font-weight: 700;
}
.muted {
  color: var(--muted);
}

/* Admin */
.admin-layout {
  display: grid;
  gap: 20px;
}
.filter-bar {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}
.filter-bar label {
  width: 200px;
  margin: 0;
}
.filter-bar--compact {
  margin: 0;
}
.filter-bar--compact label {
  width: 180px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.summary-grid--compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 14px 0;
}
.summary-grid--compact .summary-card {
  padding: 12px 14px;
}
.summary-grid--compact .summary-card strong {
  font-size: 22px;
  margin-top: 4px;
}
.summary-card {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s;
  position: relative;
  overflow: hidden;
}
.summary-card:hover {
  box-shadow: var(--shadow-md);
}
.summary-card span {
  display: block;
  color: var(--muted);
  font-weight: 500;
  font-size: 11.5px;
}
.summary-card strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}
.summary-card__sub {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
}
.summary-card__sub.is-up {
  color: var(--ok-text);
}
.summary-card__sub.is-down {
  color: var(--danger);
}
.summary-card--accent {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}
.summary-card--accent span,
.summary-card--accent .summary-card__sub {
  color: rgba(255, 255, 255, 0.85);
}
.summary-card--accent strong {
  color: #fff;
}
.summary-card--clickable {
  text-decoration: none;
  color: inherit;
  display: block;
}
.summary-card--clickable:hover {
  transform: translateY(-1px);
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 20px;
  align-items: start;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
}
table {
  font-size: 13.5px;
}
@media (min-width: 901px) {
  /* На десктопе компактнее, чтобы влезало без скролла */
  th,
  td {
    padding: 9px 7px;
  }
}
.worker-log {
  margin-top: 20px;
}
.table-section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.table-section__head h2 {
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}
th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}
tbody tr {
  transition: background 0.15s;
}
th:first-child {
  border-top-left-radius: 8px;
}
th:last-child {
  border-top-right-radius: 8px;
}
tbody tr:hover {
  background: var(--surface-soft);
}
td strong {
  display: block;
  font-weight: 700;
}
td .muted {
  display: block;
  font-size: 12px;
}
.row-muted {
  opacity: 0.6;
}
.row-short td {
  background: rgba(239, 108, 74, 0.05);
}
.row-actions {
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.badge-in {
  background: var(--ok-bg);
  color: var(--ok-text);
}
.badge-out {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.photo-link {
  color: var(--primary);
  font-weight: 700;
}
.photo-link:hover {
  color: var(--primary-dark);
}

.empty {
  color: var(--muted);
  text-align: center;
}

.onsite-list {
  display: grid;
  gap: 10px;
}
.onsite-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.onsite-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  color: var(--muted);
}

/* Object cards — refined */
.objects-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.objects-toolbar__count {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.objects-toolbar__count b {
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  margin-right: 4px;
}

.object-add {
  border: 1px dashed var(--line-strong);
  background: transparent;
  border-radius: var(--radius);
  overflow: hidden;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.object-add[open] {
  border-style: solid;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.object-add > summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--primary);
  user-select: none;
}
.object-add > summary::-webkit-details-marker {
  display: none;
}
.object-add > summary::before {
  content: "+";
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}
.object-add[open] > summary::before {
  transform: rotate(45deg);
  background: var(--primary);
  color: #fff;
}
.object-add__body {
  padding: 0 20px 20px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 18px;
}

.object-card {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 24px;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  transition:
    box-shadow 0.18s ease,
    transform 0.18s ease,
    border-color 0.18s ease;
}
.object-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}
.object-card__main {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.object-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.object-card__title {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
  margin: 0;
}
.object-card__address {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.object-card__address::before {
  content: "";
  width: 12px;
  height: 12px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/><circle cx='12' cy='10' r='3'/></svg>")
    center/contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/><circle cx='12' cy='10' r='3'/></svg>")
    center/contain no-repeat;
  flex-shrink: 0;
}
.object-card__address--empty {
  color: var(--line-strong);
  font-style: italic;
}

.object-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.object-pill--ok {
  background: var(--ok-bg);
  color: var(--ok-text);
}
.object-pill--off {
  background: var(--surface-inset);
  color: var(--muted);
}
.object-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.object-pill--ok::before {
  box-shadow: 0 0 0 0 currentColor;
  animation: object-pulse 2.4s ease-in-out infinite;
}
@keyframes object-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(4, 120, 87, 0.5);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(4, 120, 87, 0);
  }
}

.object-card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.object-stat {
  display: inline-flex;
  flex-direction: column;
  padding: 8px 12px;
  background: var(--surface-soft);
  border-radius: 8px;
  min-width: 0;
}
.object-stat__label {
  font-family: var(--font-display);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
}
.object-stat__value {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.object-stat__value--muted {
  color: var(--muted);
  font-weight: 500;
}

.object-card__link {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  min-width: 0;
}
.object-card__link span {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 700;
  flex-shrink: 0;
}
.object-card__link code {
  background: transparent;
  padding: 0;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--text);
}
.copy-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--font-display);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.copy-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.copy-btn.is-copied {
  background: var(--ok-bg);
  color: var(--ok-text);
  border-color: var(--ok-text);
}

.object-card__actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  flex-wrap: wrap;
}
.object-card__edit {
  margin-top: 0;
}
.object-card__edit > summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  user-select: none;
  transition: all 0.15s ease;
}
.object-card__edit > summary::-webkit-details-marker {
  display: none;
}
.object-card__edit > summary::before {
  content: "✎";
  font-size: 12px;
  opacity: 0.7;
}
.object-card__edit > summary:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.object-card__edit[open] > summary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.object-card__edit[open] > summary::before {
  content: "−";
}
.object-card__edit-body {
  margin-top: 14px;
  padding: 16px;
  background: var(--surface-soft);
  border-radius: 10px;
  border: 1px solid var(--line);
}

.object-card__delete {
  border: 1px solid transparent;
  background: transparent;
  color: var(--danger);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.object-card__delete:hover {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.25);
}

.object-card__qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(21, 118, 209, 0.04) 0%, rgba(249, 115, 22, 0.04) 100%), var(--surface-soft);
  border-left: 1px solid var(--line);
  position: relative;
}
.object-card__qr::before {
  content: "QR";
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.object-card__qr img {
  background: #fff;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  width: 150px;
  height: 150px;
}
.object-card__qr .secondary-button {
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 8px;
}

@media (max-width: 720px) {
  .object-card {
    grid-template-columns: 1fr;
  }
  .object-card__qr {
    border-left: none;
    border-top: 1px solid var(--line);
    flex-direction: row;
    padding: 14px;
  }
  .object-card__qr img {
    width: 110px;
    height: 110px;
  }
  .object-card__qr::before {
    display: none;
  }
}

/* Map picker */
.map-picker {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
.map-picker__header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.map-picker__coords {
  flex: 1;
  min-width: 160px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.map-picker__coords.is-empty {
  color: var(--muted);
  font-family: var(--font-display);
}
.map-picker__coords b {
  font-weight: 600;
}
.map-picker__pin {
  font-size: 14px;
}
.map-picker__btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.map-picker__btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.map-picker__btn--primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.map-picker__btn--primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}
.map-picker__btn--ghost {
  background: transparent;
}
.map-picker__btn--danger {
  color: var(--danger);
}
.map-picker__btn--danger:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(220, 38, 38, 0.05);
}

.map-picker__map {
  width: 100%;
  height: 320px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #e9eef4;
  z-index: 0;
}
.map-picker__hint {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.map-picker__status {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--muted);
  min-height: 18px;
}
.map-picker__status[data-kind="ok"] {
  color: var(--ok-text);
}
.map-picker__status[data-kind="warn"] {
  color: var(--warn-text);
}
.map-picker__status[data-kind="err"] {
  color: var(--danger);
}

/* Leaflet popup/marker tweaks for dark theme */
html[data-theme="dark"] .map-picker__map {
  filter: brightness(0.92) contrast(1.05);
}

/* ==== Objects page — master/detail ==== */
.objects-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}
.objects-page__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.objects-page__head .section-heading {
  margin: 0;
}
.objects-page__head .section-heading h1 {
  font-family: "Fraunces", serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 32px;
  margin: 4px 0 0;
}
.objects-page__head .section-heading p {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--primary);
  font-weight: 700;
}
.objects-page__add-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 22px -8px rgba(21, 118, 209, 0.55);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.objects-page__add-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -8px rgba(21, 118, 209, 0.65);
}
.objects-page__add-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}

.objects-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
  align-items: start;
}

/* Sidebar rail */
.objects-rail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 110px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.objects-rail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 4px;
}
.objects-rail__title {
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: var(--muted);
}
.objects-rail__count {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-weight: 600;
  font-size: 16px;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.objects-rail__empty {
  text-align: center;
  padding: 24px 12px;
  font-family: "Fraunces", serif;
  font-style: italic;
  color: var(--muted);
}
.objects-rail__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.objects-rail__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition:
    background 0.15s ease,
    transform 0.15s ease;
  position: relative;
  border-left: 3px solid transparent;
}
.objects-rail__item:hover {
  background: var(--surface-soft);
  transform: translateX(2px);
}
.objects-rail__item.is-active {
  background: var(--primary-soft);
  border-left-color: var(--primary);
}
.objects-rail__item.is-active .objects-rail__name strong {
  color: var(--primary);
}
.objects-rail__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}
.objects-rail__dot.is-on {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}
.objects-rail__dot.is-off {
  background: var(--line-strong);
}
.objects-rail__name {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.objects-rail__name strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.objects-rail__name em {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.objects-rail__chev {
  color: var(--muted);
  font-size: 18px;
  font-family: "Fraunces", serif;
  font-weight: 300;
  transition:
    transform 0.15s ease,
    color 0.15s ease;
}
.objects-rail__item.is-active .objects-rail__chev,
.objects-rail__item:hover .objects-rail__chev {
  color: var(--primary);
  transform: translateX(3px);
}

/* Stage */
.objects-stage {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

/* Panel */
.objects-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
  position: relative;
  overflow: hidden;
  animation: panel-in 0.35s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.objects-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}
@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.objects-panel--add::before {
  background: linear-gradient(180deg, var(--accent), #fbbf3a);
}
.objects-panel--empty {
  text-align: center;
  padding: 72px 32px;
  color: var(--muted);
}
.objects-panel--empty::before {
  display: none;
}
.objects-panel__empty-art {
  margin: 0 auto 18px;
  width: 96px;
  height: 96px;
  color: var(--primary);
  opacity: 0.6;
}
.objects-panel--empty h2 {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 6px;
}
.objects-panel--empty p {
  margin: 0 0 18px;
}

.objects-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.objects-panel__eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  margin: 0;
}
.objects-panel__title {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 30px;
  letter-spacing: -0.02em;
  margin: 6px 0 4px;
  line-height: 1.1;
}
.objects-panel__sub {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-secondary, #4b5563);
  margin: 0;
}
.objects-panel__sub.is-muted {
  color: var(--muted);
  font-style: italic;
}
.objects-panel__qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(21, 118, 209, 0.06), rgba(249, 115, 22, 0.06));
  border-radius: 14px;
  border: 1px solid var(--line);
}
.objects-panel__qr img {
  background: #fff;
  padding: 8px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

/* Stats grid in detail */
.object-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.object-stat__link {
  text-decoration: none;
  color: var(--primary) !important;
  transition: color 0.15s ease;
}
.object-stat__link:hover {
  color: var(--primary-dark) !important;
  text-decoration: underline;
}

/* Form */
.object-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.object-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.object-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.object-form .field > span {
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 700;
}
.object-form .field input,
.object-form .field select {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.object-form .field input:focus,
.object-form .field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 118, 209, 0.15);
}
.object-form__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.object-form__actions--split {
  justify-content: space-between;
}

.ghost-button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ghost-button:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.object-delete-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Mobile: rail becomes top strip */
@media (max-width: 900px) {
  .objects-shell {
    grid-template-columns: 1fr;
  }
  .objects-rail {
    position: static;
    max-height: none;
    flex-direction: column;
  }
  .objects-rail__list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
  }
  .objects-rail__item {
    flex: 0 0 auto;
    min-width: 0;
    width: 100%;
    padding: 10px 10px;
  }
  .objects-rail__name strong {
    font-size: 13px;
  }
  .objects-rail__name em {
    font-size: 11px;
  }
  .objects-panel {
    padding: 16px 14px 18px 18px;
  }
  .objects-panel::before {
    width: 3px;
  }
  .objects-panel__head {
    flex-direction: column-reverse;
  }
  .objects-panel__qr {
    align-self: flex-start;
  }
  .objects-panel__title {
    font-size: 22px;
  }
  .object-form {
    gap: 12px;
  }
  .object-form__row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .object-form .field {
    gap: 4px;
  }
  .object-form .field input,
  .object-form .field select {
    padding: 10px 12px;
    font-size: 15px; /* avoid iOS input zoom (>=16 prevents auto-zoom; 15 is acceptable on Android) */
  }
  .object-form__actions {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 8px;
  }
  .object-form__actions .primary-button,
  .object-form__actions .ghost-button {
    width: 100%;
    justify-content: center;
  }
  .objects-page {
    padding: 14px 12px 40px;
    gap: 12px;
  }
  .objects-page__head .section-heading h1 {
    font-size: 24px;
  }
}

/* ==== Users page — list + detail ==== */
.users-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.users-list-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.users-list-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.users-list-card__title {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.users-list-card__count {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-weight: 600;
  font-size: 18px;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.users-empty {
  padding: 30px 24px;
  text-align: center;
  margin: 0;
  font-family: "Fraunces", serif;
  font-style: italic;
  color: var(--muted);
}

.users-table-wrap {
  overflow-x: auto;
}
.users-table {
  width: 100%;
  border-collapse: collapse;
}
.users-table thead th {
  font-family: var(--font-display);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--muted);
  text-align: left;
  padding: 12px 16px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.users-table thead th:last-child {
  text-align: right;
}
.users-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.users-table tbody tr:last-child td {
  border-bottom: none;
}

.users-row {
  transition: background 0.12s ease;
}
.users-row:hover {
  background: var(--surface-soft);
}
.users-row.is-active {
  background: var(--primary-soft);
}
.users-row.is-active .users-row__nameblock strong {
  color: var(--primary);
}
.users-row.is-inactive {
  opacity: 0.55;
}

.users-row__name-cell {
  padding: 10px 16px !important;
  min-width: 220px;
}
.users-row__name-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  width: 100%;
}
.users-row__avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #1576d1, #4ea0e8);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  letter-spacing: 0.4px;
  box-shadow:
    0 3px 8px -2px rgba(21, 118, 209, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.users-row__avatar[data-tint="1"] {
  background: linear-gradient(135deg, #f97316, #fbbf3a);
}
.users-row__avatar[data-tint="2"] {
  background: linear-gradient(135deg, #0d9488, #34d399);
}
.users-row__avatar[data-tint="3"] {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
}
.users-row__avatar[data-tint="4"] {
  background: linear-gradient(135deg, #db2777, #f472b6);
}
.users-row__avatar[data-tint="5"] {
  background: linear-gradient(135deg, #475569, #94a3b8);
}
.users-row__avatar[data-tint="6"] {
  background: linear-gradient(135deg, #0891b2, #22d3ee);
}
.users-row__avatar[data-tint="7"] {
  background: linear-gradient(135deg, #ca8a04, #facc15);
}

.users-row__nameblock {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.users-row__nameblock strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.users-row__nameblock em {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.users-row__name-link:hover .users-row__nameblock strong {
  color: var(--primary);
}

.users-row__pos {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text);
}
.users-row__obj {
  font-size: 13px;
}
.users-row__obj-name {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
}
.users-row__obj-when {
  display: block;
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.users-row__actions {
  text-align: right;
  white-space: nowrap;
}
.users-row__actions .ghost-button {
  padding: 6px 12px;
  font-size: 12px;
}
.users-row__actions .ghost-button + .ghost-button {
  margin-left: 6px;
}

/* Status dot — dot-only by default, with optional label inside .status-pill */
.status-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--line-strong);
  flex-shrink: 0;
  position: relative;
  vertical-align: middle;
}
.status-dot--on_shift {
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: status-dot-pulse 1.6s ease-in-out infinite;
}
@keyframes status-dot-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    transform: scale(1.08);
  }
}
.status-dot--off {
  background: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}
.status-dot--on_leave {
  background: #f59e0b !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
}
.status-dot--on_sick {
  background: #f97316 !important;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.22);
}
.status-dot--fired {
  background: #94a3b8 !important;
  opacity: 0.7;
}
.status-dot--all {
  background: var(--text);
}

/* Inline status (dot + label) for the table column */
.status-inline {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.status-inline .status-dot {
  width: 11px;
  height: 11px;
}
.status-inline--off {
  color: #dc2626;
}
.status-inline--on_shift {
  color: #047857;
}
.status-inline--on_leave {
  color: #b45309;
}
.status-inline--on_sick {
  color: #c2410c;
}
.status-inline--fired {
  color: var(--muted);
}

/* Filter bar — colored pills */
.users-filter {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(21, 118, 209, 0.04), transparent), var(--surface);
}
.users-filter__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}
.users-filter__btn .status-dot {
  width: 10px;
  height: 10px;
}
.users-filter__btn:hover {
  transform: translateY(-1px);
}
.users-filter__count {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  min-width: 22px;
  text-align: center;
  background: var(--surface-inset);
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* Inactive state — colored border + subtle tint */
.users-filter__btn[data-filter="all"] {
  border-color: var(--line-strong);
}
.users-filter__btn[data-filter="all"]:hover {
  border-color: var(--text);
  color: var(--text);
  background: var(--surface-soft);
}
.users-filter__btn[data-filter="on_shift"] {
  border-color: rgba(16, 185, 129, 0.45);
  color: #047857;
  background: rgba(16, 185, 129, 0.06);
}
.users-filter__btn[data-filter="on_shift"]:hover {
  background: rgba(16, 185, 129, 0.14);
}
.users-filter__btn[data-filter="off"] {
  border-color: rgba(220, 38, 38, 0.45);
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.06);
}
.users-filter__btn[data-filter="off"]:hover {
  background: rgba(239, 68, 68, 0.14);
}
.users-filter__btn[data-filter="on_leave"] {
  border-color: rgba(245, 158, 11, 0.5);
  color: #b45309;
  background: rgba(245, 158, 11, 0.07);
}
.users-filter__btn[data-filter="on_leave"]:hover {
  background: rgba(245, 158, 11, 0.16);
}
.users-filter__btn[data-filter="on_sick"] {
  border-color: rgba(249, 115, 22, 0.5);
  color: #c2410c;
  background: rgba(249, 115, 22, 0.07);
}
.users-filter__btn[data-filter="on_sick"]:hover {
  background: rgba(249, 115, 22, 0.16);
}
.users-filter__btn[data-filter="fired"] {
  border-color: var(--line-strong);
  color: var(--muted);
  background: var(--surface-soft);
}
.users-filter__btn[data-filter="fired"]:hover {
  background: var(--surface-inset);
}

/* Active state — saturated colored background */
.users-filter__btn.is-active {
  transform: translateY(-1px);
  color: #fff !important;
}
.users-filter__btn.is-active .users-filter__count {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}
.users-filter__btn.is-active .status-dot {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
}
.users-filter__btn[data-filter="all"].is-active {
  background: linear-gradient(135deg, var(--primary), #4ea0e8);
  border-color: var(--primary);
  box-shadow: 0 6px 16px -6px rgba(21, 118, 209, 0.55);
}
.users-filter__btn[data-filter="on_shift"].is-active {
  background: linear-gradient(135deg, #10b981, #34d399);
  border-color: #10b981;
  box-shadow: 0 6px 16px -6px rgba(16, 185, 129, 0.55);
}
.users-filter__btn[data-filter="off"].is-active {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  border-color: #dc2626;
  box-shadow: 0 6px 16px -6px rgba(220, 38, 38, 0.55);
}
.users-filter__btn[data-filter="on_leave"].is-active {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  border-color: #d97706;
  box-shadow: 0 6px 16px -6px rgba(217, 119, 6, 0.55);
}
.users-filter__btn[data-filter="on_sick"].is-active {
  background: linear-gradient(135deg, #ea580c, #f97316);
  border-color: #ea580c;
  box-shadow: 0 6px 16px -6px rgba(234, 88, 12, 0.55);
}
.users-filter__btn[data-filter="fired"].is-active {
  background: linear-gradient(135deg, #475569, #94a3b8);
  border-color: #475569;
  box-shadow: 0 6px 16px -6px rgba(71, 85, 105, 0.45);
}

/* Company settings (Реквизиты) */
.company-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.company-form__hint {
  margin: 12px 0 0;
  padding: 10px 14px;
  background: rgba(245, 165, 36, 0.1);
  border-left: 3px solid var(--accent, #f5a524);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}
.company-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.company-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  opacity: 0.5;
}
.company-card__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}
.company-card__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-soft), rgba(249, 115, 22, 0.12));
  color: var(--primary);
  flex-shrink: 0;
}
.company-card__head h2 {
  font-family: "Fraunces", serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 18px;
  margin: 0;
  line-height: 1.1;
}
.company-card__head p {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--muted);
}
.company-card .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.company-card .field > span {
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 700;
}
.company-card .field input,
.company-card .field select {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.company-card .field input:focus,
.company-card .field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 118, 209, 0.15);
}
.company-form__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: flex-end;
  padding: 4px 4px 12px;
}
.company-form__actions .small {
  font-size: 11px;
}

/* Status actions inside user detail panel */
.status-actions {
  margin-top: 4px;
  padding: 12px 14px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.status-actions__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
}
.status-action,
.status-action__inline {
  display: inline-block;
}
.status-action__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  background: var(--surface);
  transition: all 0.15s ease;
  list-style: none;
}
.status-action__btn::-webkit-details-marker {
  display: none;
}
.status-action__btn:hover {
  transform: translateY(-1px);
}
.status-action__btn--leave {
  border-color: rgba(245, 158, 11, 0.45);
  color: #b45309;
  background: rgba(245, 158, 11, 0.08);
}
.status-action__btn--leave:hover {
  background: rgba(245, 158, 11, 0.18);
}
.status-action__btn--sick {
  border-color: rgba(249, 115, 22, 0.5);
  color: #c2410c;
  background: rgba(249, 115, 22, 0.08);
}
.status-action__btn--sick:hover {
  background: rgba(249, 115, 22, 0.18);
}
.status-action__btn--fire {
  border-color: rgba(220, 38, 38, 0.45);
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.06);
}
.status-action__btn--fire:hover {
  background: rgba(239, 68, 68, 0.16);
}
.status-action__btn--restore {
  border-color: rgba(16, 185, 129, 0.5);
  color: #047857;
  background: rgba(16, 185, 129, 0.08);
}
.status-action__btn--restore:hover {
  background: rgba(16, 185, 129, 0.18);
}
.status-action[open] .status-action__btn {
  background: var(--surface);
  border-color: var(--line-strong);
}
.status-action__form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-top: 8px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.status-action__form .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}
.status-action__form .field > span {
  font-family: var(--font-display);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--muted);
}
.status-action__form input[type="date"] {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text);
}
.status-action__form input[type="date"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 118, 209, 0.15);
}
.status-action__form .primary-button {
  padding: 8px 18px;
  font-size: 13px;
}

/* Wide 4-column form row */
.object-form__row--four {
  grid-template-columns: repeat(4, 1fr) !important;
}
@media (max-width: 1100px) {
  .object-form__row--four {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 600px) {
  .object-form__row--four {
    grid-template-columns: 1fr !important;
  }
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
}
.status-pill__text {
  line-height: 1;
}

/* Status chips (legacy, kept for other pages) */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.status-chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.status-chip--on {
  background: var(--ok-bg);
  color: var(--ok-text);
}
.status-chip--on .status-chip__dot {
  animation: status-pulse 2s ease-in-out infinite;
}
@keyframes status-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 currentColor;
  }
  50% {
    box-shadow: 0 0 0 5px transparent;
  }
}
.status-chip--away {
  background: var(--warn-bg);
  color: var(--warn-text);
}
.status-chip--idle {
  background: var(--surface-inset);
  color: var(--muted);
}
.status-chip--off {
  background: var(--surface-inset);
  color: var(--muted);
  opacity: 0.7;
}

.user-panel__last {
  font-size: 12px !important;
  margin-top: 4px !important;
}
.user-panel__last strong {
  color: var(--primary);
}

/* Inline detail row inside the users table */
.users-detail-row[hidden] {
  display: none;
}
.users-detail-row > .users-detail-row__cell {
  padding: 0 !important;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line) !important;
  border-top: none !important;
}
.users-detail-row .user-panel {
  margin: 0;
  padding: 16px 20px 18px;
  background: var(--surface);
  border-left: 4px solid var(--primary);
  border-radius: 0;
  box-shadow: inset 0 12px 18px -16px rgba(21, 118, 209, 0.25);
  animation: detail-in 0.28s cubic-bezier(0.2, 0.8, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@keyframes detail-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.users-detail-row .user-panel__head {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0;
  flex-wrap: wrap;
}
.users-detail-row .user-panel__hero {
  gap: 14px;
}
.users-detail-row .user-panel__avatar {
  width: 52px;
  height: 52px;
  font-size: 18px;
}
.users-detail-row .objects-panel__title {
  font-size: 22px;
  margin: 2px 0 2px;
  line-height: 1.15;
}
.users-detail-row .objects-panel__sub {
  font-size: 12px;
}
.users-detail-row .objects-panel__eyebrow {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.users-detail-row .object-stats {
  margin: 0;
  grid-template-columns: repeat(4, 1fr);
}
.users-detail-row .object-stat {
  padding: 6px 10px;
}
.users-detail-row .object-stat__label {
  font-size: 9px;
}
.users-detail-row .object-stat__value {
  font-size: 13px;
  margin-top: 1px;
}
.users-detail-row .object-form,
.users-detail-row .user-pwd,
.users-detail-row .object-delete-form {
  margin: 0;
}
.users-detail-row .object-form {
  gap: 10px;
}
.users-detail-row .object-form > .object-form__row {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.users-detail-row .users-rates .object-form__row {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.users-detail-row .users-rates {
  padding: 10px 12px 12px;
  gap: 8px;
}
.users-detail-row .users-rates__title {
  font-size: 12px;
}
.users-detail-row .object-form .field input,
.users-detail-row .object-form .field select,
.users-detail-row .user-pwd__form input {
  padding: 8px 12px;
  font-size: 13px;
}
.users-detail-row .object-form .field > span {
  font-size: 10px;
}
.users-detail-row .object-form__actions {
  justify-content: flex-end;
}
.users-detail-row .user-pwd {
  padding-top: 10px;
  gap: 6px;
}
.users-detail-row .object-delete-form {
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.users-detail-row .user-panel__actions {
  gap: 6px;
}
.users-detail-row .user-panel__actions .ghost-button {
  padding: 6px 12px;
  font-size: 12px;
}

/* Override generic td[data-label] rule for users-table */
.users-table td::before {
  content: none !important;
}
.users-table td {
  display: table-cell;
}

/* Mobile: stacked cards instead of table */
@media (max-width: 760px) {
  .users-table-wrap {
    padding: 8px;
    overflow: visible;
  }
  .users-table thead {
    display: none;
  }
  .users-table,
  .users-table tbody,
  .users-table tr,
  .users-table td {
    display: block;
    width: 100%;
  }
  .users-table td::before {
    content: none !important;
    display: none !important;
  }

  .users-table tbody tr.users-row {
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name   status"
      "meta   meta"
      "actions actions";
    column-gap: 10px;
    row-gap: 8px;
    align-items: start;
  }
  .users-table tbody tr.users-row.is-active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(21, 118, 209, 0.12);
  }
  .users-table tbody td {
    border: none !important;
    padding: 0;
    text-align: left;
  }

  .users-row__name-cell {
    grid-area: name;
    padding: 0 !important;
    min-width: 0;
  }
  .users-row__name-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .users-row__nameblock {
    flex: 1;
    min-width: 0;
  }
  .users-row__avatar {
    width: 40px;
    height: 40px;
    font-size: 13px;
  }
  .users-row__nameblock strong {
    font-size: 14px;
  }
  .users-row__nameblock em {
    font-size: 11px;
  }

  .users-row__status {
    grid-area: status;
    align-self: start;
    justify-self: end;
  }

  .users-row__pos {
    grid-area: meta;
    font-size: 11px;
    color: var(--muted);
    font-family: var(--font-display);
  }
  .users-row__pos:empty,
  .users-row__pos:not(:has(*:not(:empty))) {
    display: none;
  }
  .users-row__pos::before {
    content: "Должность · ";
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 9px;
    font-weight: 700;
    color: var(--muted);
    margin-right: 2px;
  }
  /* Hide object column on mobile (info available in detail) */
  .users-row__obj {
    display: none !important;
  }

  .users-row__actions {
    grid-area: actions;
    display: flex;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--line);
    margin-top: 2px;
  }
  .users-row__actions .ghost-button {
    flex: 1;
    text-align: center;
    padding: 7px 10px;
    font-size: 12px;
    margin: 0 !important;
  }

  /* Detail row inline on mobile */
  .users-detail-row {
    display: none;
  }
  .users-detail-row:not([hidden]) {
    display: block;
    margin-top: -6px;
    margin-bottom: 10px;
  }
  .users-detail-row > .users-detail-row__cell {
    padding: 0 !important;
    background: transparent;
    border: none !important;
  }
  .users-detail-row .user-panel {
    padding: 14px;
    border-left: 0;
    border: 1px solid var(--primary);
    border-radius: 14px;
    box-shadow: 0 8px 24px -12px rgba(21, 118, 209, 0.4);
  }
  .users-detail-row .user-panel__head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .users-detail-row .user-panel__avatar {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }
  .users-detail-row .objects-panel__title {
    font-size: 20px;
  }
  .users-detail-row .user-panel__actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .users-detail-row .user-panel__actions .ghost-button {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    text-align: center;
    padding: 7px 8px;
    font-size: 11px;
  }
  .users-detail-row .object-form__row {
    grid-template-columns: 1fr;
  }
  .users-detail-row .object-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.users-rail__item.is-inactive {
  opacity: 0.55;
}
.users-rail__avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1576d1, #4ea0e8);
  color: #fff;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.4px;
  flex-shrink: 0;
  box-shadow:
    0 3px 8px -2px rgba(21, 118, 209, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.users-rail__avatar[data-tint="0"] {
  background: linear-gradient(135deg, #1576d1, #4ea0e8);
}
.users-rail__avatar[data-tint="1"] {
  background: linear-gradient(135deg, #f97316, #fbbf3a);
}
.users-rail__avatar[data-tint="2"] {
  background: linear-gradient(135deg, #0d9488, #34d399);
}
.users-rail__avatar[data-tint="3"] {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
}
.users-rail__avatar[data-tint="4"] {
  background: linear-gradient(135deg, #db2777, #f472b6);
}
.users-rail__avatar[data-tint="5"] {
  background: linear-gradient(135deg, #475569, #94a3b8);
}
.users-rail__avatar[data-tint="6"] {
  background: linear-gradient(135deg, #0891b2, #22d3ee);
}
.users-rail__avatar[data-tint="7"] {
  background: linear-gradient(135deg, #ca8a04, #facc15);
}
.users-rail__badge {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ok-bg);
  color: var(--ok-text);
  font-family: "Fraunces", serif;
  font-style: italic;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}
.users-rail__badge--admin {
  background: linear-gradient(135deg, var(--primary-soft), rgba(249, 115, 22, 0.15));
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(21, 118, 209, 0.25);
}

.user-panel__head {
  flex-direction: row;
  align-items: flex-start;
  gap: 24px;
}
.user-panel__hero {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.user-panel__avatar {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #1576d1, #4ea0e8);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  box-shadow:
    0 12px 30px -10px rgba(21, 118, 209, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.user-panel__avatar[data-tint="0"] {
  background: linear-gradient(135deg, #1576d1, #4ea0e8);
}
.user-panel__avatar[data-tint="1"] {
  background: linear-gradient(135deg, #f97316, #fbbf3a);
}
.user-panel__avatar[data-tint="2"] {
  background: linear-gradient(135deg, #0d9488, #34d399);
}
.user-panel__avatar[data-tint="3"] {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
}
.user-panel__avatar[data-tint="4"] {
  background: linear-gradient(135deg, #db2777, #f472b6);
}
.user-panel__avatar[data-tint="5"] {
  background: linear-gradient(135deg, #475569, #94a3b8);
}
.user-panel__avatar[data-tint="6"] {
  background: linear-gradient(135deg, #0891b2, #22d3ee);
}
.user-panel__avatar[data-tint="7"] {
  background: linear-gradient(135deg, #ca8a04, #facc15);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  margin-left: 6px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--surface-inset);
  color: var(--muted);
}
.user-pill--admin {
  background: linear-gradient(135deg, var(--primary-soft), rgba(249, 115, 22, 0.15));
  color: var(--primary);
}
.user-phone {
  color: var(--primary);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.user-phone:hover {
  text-decoration: underline;
}

.user-panel__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.user-panel__actions .ghost-button {
  white-space: nowrap;
}

.users-rates {
  margin-top: 4px;
  padding: 14px 16px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.users-rates__title {
  margin: 0;
  font-family: "Fraunces", serif;
  font-style: italic;
  font-weight: 600;
  font-size: 14px;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.user-pwd {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.user-pwd__form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.user-pwd__form input {
  flex: 1;
  min-width: 200px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-family: var(--font-display);
  font-size: 14px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.user-pwd__form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 118, 209, 0.15);
}

@media (max-width: 720px) {
  .user-panel__head {
    flex-direction: column;
  }
  .user-panel__avatar {
    width: 60px;
    height: 60px;
    font-size: 22px;
  }
  .user-panel__actions {
    width: 100%;
  }
  .user-panel__actions .ghost-button {
    flex: 1;
    text-align: center;
  }
}

/* Inline coord chip on object card (read-only view) */
.object-coord-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  transition: background 0.15s ease;
}
.object-coord-chip:hover {
  background: var(--primary);
  color: #fff;
}

code {
  background: var(--surface-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* ===== Dashboard ===== */
.dashboard__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}
.dashboard__head .section-title {
  margin: 0;
}
.dash-date input {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 13px;
  max-width: 160px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.kpi-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  transition:
    box-shadow 0.15s,
    transform 0.15s;
  position: relative;
  overflow: hidden;
}
a.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.kpi-card__label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}
.kpi-card__value {
  font-size: 24px;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.kpi-card__sub {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 4px;
}
.kpi-card--accent {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}
.kpi-card--accent .kpi-card__label,
.kpi-card--accent .kpi-card__sub {
  color: rgba(255, 255, 255, 0.85);
}
.kpi-card--money .kpi-card__value {
  color: var(--primary);
}
.kpi-card--warn {
  border-left: 3px solid var(--accent);
}
.kpi-card--alert {
  border-left: 3px solid var(--danger);
}
.kpi-card--alert .kpi-card__value {
  color: var(--danger);
}

.dash-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.dash-row > .dash-card {
  min-height: 240px;
}
.dash-card {
  display: flex;
  flex-direction: column;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}
.card-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

/* Sparkline (bar chart) */
.sparkline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 180px;
  padding: 0 4px;
  gap: 8px;
}
.sparkline__bar {
  flex: 1;
  min-width: 0;
  background: linear-gradient(180deg, var(--primary), #60a5fa);
  border-radius: 4px 4px 0 0;
  position: relative;
  transition: opacity 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 4px;
}
.sparkline__bar:hover {
  opacity: 0.85;
}
.sparkline__val {
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}
.sparkline__lbl {
  position: absolute;
  bottom: -18px;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
}

/* Feed (последние события) */
.feed {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feed__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 12.5px;
  border-bottom: 1px solid var(--line);
}
.feed__item:last-child {
  border-bottom: 0;
}
.feed__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.feed__dot--in {
  background: #16a34a;
}
.feed__dot--out {
  background: #dc2626;
}
.feed__time {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--muted);
  width: 50px;
  font-size: 12px;
}
.feed__name {
  flex: 1;
}

/* On-site list — компактный */
.onsite-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.onsite-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface-soft);
  border-radius: 6px;
  font-size: 13px;
}
.onsite-item__avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.onsite-item__name {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.onsite-item__name strong {
  font-size: 13px;
  font-weight: 600;
}
.onsite-item__name .muted {
  font-size: 11px;
}
.onsite-item__meta {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Payroll grid */
.payroll-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.payroll-cell {
  background: var(--surface-soft);
  border-radius: 6px;
  padding: 10px 12px;
}
.payroll-cell__label {
  font-size: 11px;
  color: var(--muted);
}
.payroll-cell__value {
  font-size: 18px;
  font-weight: 700;
  margin-top: 2px;
  letter-spacing: -0.01em;
}
.payroll-cell--ok {
  background: var(--ok-bg);
}
.payroll-cell--ok .payroll-cell__value {
  color: var(--ok-text);
}
.payroll-cell--accent {
  background: var(--primary-soft);
}
.payroll-cell--accent .payroll-cell__value {
  color: var(--primary);
}

/* Progress bar */
.progress-bar {
  position: relative;
  width: 100%;
  height: 24px;
  background: var(--surface-soft);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  transition: width 0.3s;
}
.progress-bar__label {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 880px) {
  .dash-row {
    grid-template-columns: 1fr;
  }
  .payroll-grid {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile event cards */
.events-mobile {
  display: none;
  gap: 10px;
}
.event-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.event-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.event-card__time {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.event-card__name {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}
.event-card__meta {
  font-size: 13px;
}
.event-card__actions {
  display: flex;
  gap: 14px;
  margin-top: 4px;
}

/* Footer */
.site-footer {
  margin-top: 48px;
  padding: 28px 28px 24px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: saturate(140%) blur(6px);
  color: var(--muted);
  font-size: 13px;
}
.site-footer__inner {
  width: min(1200px, 100%);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}
.site-footer__brand {
  display: grid;
  gap: 4px;
}
.site-footer__title {
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.005em;
}
.site-footer__copy {
  font-size: 12px;
}
.site-footer__dev {
  display: grid;
  gap: 4px;
  text-align: right;
}
.site-footer__label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-footer__name {
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
}
.site-footer__contacts {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: 13px;
}
.site-footer__sep {
  color: var(--line-strong);
}
.site-footer a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}
.site-footer a:hover {
  color: var(--primary-dark);
}

@media (max-width: 600px) {
  .site-footer {
    padding: 22px 16px;
    margin-top: 32px;
  }
  .site-footer__inner {
    flex-direction: column;
    gap: 14px;
  }
  .site-footer__dev {
    text-align: left;
  }
  .site-footer__contacts {
    justify-content: flex-start;
  }
}

/* Status dot */
.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 3px rgba(107, 120, 134, 0.15);
}
.status-dot--in {
  background: #1aa468;
  box-shadow: 0 0 0 3px rgba(26, 164, 104, 0.2);
}
.status-dot--out {
  background: #b8654c;
  box-shadow: 0 0 0 3px rgba(184, 101, 76, 0.2);
}

/* Schedule */
.schedule-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.schedule-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.schedule-week-label {
  font-size: 16px;
}
.payout-total {
  font-size: 15px;
  color: var(--primary-dark);
}
.payout-paid {
  font-size: 15px;
  color: var(--ok-text);
}
.payout-totals {
  display: inline-flex;
  gap: 16px;
  flex-wrap: wrap;
}
.row-paid td {
  background: rgba(26, 164, 104, 0.05);
}
.primary-button.small,
.secondary-button.small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}
.link.small {
  font-size: 12px;
}

.schedule-grid-wrap {
  overflow-x: auto;
}
.schedule-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 760px;
}
.schedule-grid th,
.schedule-grid td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 10px;
  vertical-align: top;
  text-align: left;
}
.schedule-grid th:last-child,
.schedule-grid td:last-child {
  border-right: 0;
}
.schedule-grid th {
  background: var(--surface-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.schedule-grid__name {
  width: 200px;
  min-width: 180px;
  background: var(--surface-soft);
}
.schedule-grid tbody tr:hover {
  background: transparent;
}
.schedule-day {
  display: block;
  font-weight: 800;
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}
.schedule-date {
  display: block;
  font-size: 11px;
}

.sh-cell {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  background: var(--primary-soft);
  border-left: 3px solid var(--primary);
  border-radius: 6px;
  font-size: 13px;
}
.sh-cell strong {
  font-size: 14px;
}
.sh-actual {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.sh-late {
  color: var(--warn-text);
  font-weight: 700;
  margin-left: 4px;
}
.sh-early {
  color: var(--ok-text);
  font-weight: 700;
  margin-left: 4px;
}
.sh-ontime {
  color: var(--ok-text);
  font-weight: 700;
  margin-left: 4px;
}
.sh-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  align-items: center;
}
.sh-actions form {
  display: inline;
}

.my-schedule-list {
  display: grid;
  gap: 12px;
}
.my-schedule-day {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
}
.my-schedule-day.is-empty {
  opacity: 0.55;
}
.my-schedule-day__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.my-schedule-item {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* Hero — компактный */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 18px;
  padding: 18px 22px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #1576d1 0%, #2596e6 100%);
  color: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 200px at 100% 0%, rgba(255, 255, 255, 0.18), transparent 60%);
  pointer-events: none;
}
.hero__main {
  position: relative;
}
.hero__eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}
.hero__title {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.015em;
  font-weight: 700;
}
.hero__sub {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
}
.hero__eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.hero__stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
}
.stat {
  display: grid;
  gap: 4px;
  min-width: 130px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  border-radius: 10px;
}
.stat__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.75);
}
.stat__value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.stat__value--ok {
  color: #b6f5d3;
}
.stat__value--muted {
  color: rgba(255, 255, 255, 0.85);
}

/* Card head */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-head h2 {
  margin: 0;
}

/* Callout */
.callout {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--primary);
  background: var(--primary-soft);
}
.callout strong {
  font-size: 15px;
}
.callout span {
  color: var(--muted);
  font-size: 14px;
}
.callout--warn {
  background: var(--warn-bg);
  border-left-color: var(--accent);
}
.callout--warn strong {
  color: var(--warn-text);
}
.callout--info strong {
  color: var(--primary-dark);
}

/* Buttons large */
.btn--lg {
  min-height: 52px;
  padding: 0 22px;
  font-size: 16px;
  flex: 1;
}
.btn--danger {
  background: var(--accent) !important;
  box-shadow: 0 4px 12px rgba(239, 108, 74, 0.3) !important;
}
.btn--danger:hover {
  background: #d65a3a !important;
}
.btn__ic {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}

/* Last event */
.last-event {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.last-event__time strong {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.last-event__time span {
  display: block;
  font-size: 12px;
}
.badge--lg {
  padding: 8px 14px;
  font-size: 13px;
}
.small {
  font-size: 12px;
}

/* Timeline */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.timeline__item {
  display: grid;
  grid-template-columns: 14px 56px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.timeline__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}
.timeline__dot--in {
  background: #1aa468;
}
.timeline__dot--out {
  background: #b8654c;
}
.timeline__time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.timeline__label {
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 880px) {
  .topbar {
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 10px;
    min-height: auto;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .topnav {
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    padding: 0;
  }
  .topbar.is-open .topnav {
    max-height: 480px;
    padding: 6px 0 4px;
  }
  .topnav a {
    display: block;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: var(--surface-soft);
  }
  .topnav a.is-active {
    background: var(--primary-soft);
  }
  .worker-layout,
  .summary-grid,
  .grid-2,
  .form-grid--cols {
    grid-template-columns: 1fr;
  }
  .summary-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .object-card {
    grid-template-columns: 1fr;
  }
  .filter-bar,
  .action-row,
  .table-section__head {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-bar label {
    width: 100%;
  }
  .section-heading h1 {
    font-size: 24px;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 15px;
  }
  .page {
    width: calc(100% - 20px);
    padding: 16px 0 40px;
  }
  .brand__text {
    display: none;
  }
  .brand__logo {
    height: 44px;
  }
  .topbar {
    min-height: 64px;
  }
  .brand {
    order: 1;
  }
  .nav-toggle {
    order: 99;
    margin-left: auto;
    width: 48px;
    height: 48px;
  }
  .nav-toggle svg {
    width: 26px;
    height: 26px;
  }
  .topbar__user {
    display: none;
  }
  .topnav {
    order: 4;
  }
  .topnav__logout {
    display: block;
    margin-top: 8px;
    border-top: 1px solid var(--line);
    padding-top: 8px;
  }

  .events-desktop {
    display: none;
  }
  .events-mobile {
    display: grid;
  }

  /* Schedule на мобиле: компактнее */
  .schedule-toolbar {
    gap: 12px;
  }
  .schedule-nav {
    width: 100%;
    gap: 8px;
    justify-content: space-between;
  }
  .schedule-nav .secondary-button {
    padding: 0 12px;
    min-height: 38px;
    font-size: 12px;
    flex: 0 0 auto;
  }
  .schedule-week-label {
    font-size: 14px;
    flex: 1;
    text-align: center;
  }
  .schedule-grid {
    min-width: 0;
  }
  .schedule-grid,
  .schedule-grid thead,
  .schedule-grid tbody,
  .schedule-grid tr,
  .schedule-grid th,
  .schedule-grid td {
    display: block;
  }
  .schedule-grid thead {
    display: none;
  }
  .schedule-grid tbody tr {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
  }
  .schedule-grid td {
    border: 0;
    padding: 4px 0;
  }
  .schedule-grid__name {
    background: transparent !important;
    width: auto !important;
    padding-bottom: 8px !important;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--line);
  }
  .schedule-grid td:not(.schedule-grid__name)::before {
    content: attr(data-day);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 2px;
  }

  .hero {
    padding: 18px 18px;
    gap: 14px;
    border-radius: 14px;
  }
  .hero__title {
    font-size: 22px;
  }
  .hero__sub {
    font-size: 13px;
  }
  .hero__stats {
    width: 100%;
    gap: 8px;
  }
  .stat {
    min-width: 0;
    flex: 1 1 calc(50% - 4px);
    padding: 10px 12px;
  }
  .stat__value {
    font-size: 18px;
  }

  .section-heading h1 {
    font-size: 20px;
    margin-bottom: 16px;
  }
  .card,
  .worker-main,
  .side-panel,
  .login-panel {
    padding: 16px;
    border-radius: 12px;
  }
  .login-panel {
    padding: 22px 18px;
  }
  .login-logo {
    max-width: 180px;
  }

  .summary-grid {
    gap: 10px;
  }
  .summary-card {
    padding: 14px;
  }
  .summary-card strong {
    font-size: 24px;
  }

  .form-grid--cols {
    gap: 0;
  }
  .form-actions {
    flex-direction: column;
  }
  .form-actions .primary-button,
  .form-actions .secondary-button {
    width: 100%;
  }
  .form-inline {
    flex-direction: column;
  }

  .btn--lg {
    min-height: 48px;
    font-size: 15px;
  }
  .action-row {
    gap: 10px;
  }

  .camera-frame {
    aspect-ratio: 4 / 5;
  }

  /* Tables become cards on mobile */
  .table-wrap {
    overflow-x: visible;
  }
  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
  }
  thead {
    display: none;
  }
  tbody tr {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    margin-bottom: 10px;
    padding: 6px 12px;
  }
  tbody tr:hover {
    background: var(--surface);
  }
  td {
    border-bottom: 1px dashed var(--line);
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    text-align: right;
  }
  td:last-child {
    border-bottom: 0;
  }
  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    flex: 0 0 auto;
  }
  td.row-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
  }

  .timeline__item {
    grid-template-columns: 12px 50px 1fr;
    font-size: 12px;
  }
  .last-event__time strong {
    font-size: 18px;
  }
}
