@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700&family=Nunito:wght@700;800&display=swap");

:root {
  color-scheme: dark;
  --bg: #0b0e12;
  --bg-panel: #101722;
  --bg-card: #151e2b;
  --accent: #ff7a00;
  --accent-dark: #ff9f3b;
  --text: #f6f7fb;
  --muted: #9aa6b2;
  --border: #2a3446;
  --btn-inline-gap: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(255, 122, 0, 0.18), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(255, 180, 84, 0.14), transparent 60%),
    linear-gradient(160deg, #0b0e12, #111826);
  min-height: 100vh;
}

.auth-body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
}

.auth-theme-floating {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 30;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.auth-card h1 {
  margin-top: 0;
}

.alert {
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fecaca;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Nunito", sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

h1 {
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  box-shadow: 0 6px 14px rgba(255, 122, 0, 0.25);
}

nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link {
  text-decoration: none;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.nav-link:hover {
  background: rgba(255, 122, 0, 0.16);
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(255, 122, 0, 0.28), rgba(255, 159, 59, 0.22));
  border: 1px solid rgba(255, 159, 59, 0.55);
  color: #ffe1bf;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-badge {
  font-size: 14px;
  color: var(--muted);
}

.logout {
  color: var(--accent-dark);
  text-decoration: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-page-title {
  font-family: "Nunito", sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: var(--text);
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: var(--btn-inline-gap);
}

.topbar.topbar-with-search {
  justify-content: flex-start;
  align-items: flex-start;
  gap: 12px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.topbar.topbar-with-search .topbar-left {
  flex-shrink: 0;
  padding-top: 14px;
}

.top-actions.has-top-search {
  margin-left: 24px;
  flex: 1;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-start;
}

.top-actions-right {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--btn-inline-gap);
  flex-wrap: nowrap;
  padding-top: 14px;
}

.top-search-wrap {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 0;
  padding-bottom: 2px;
}

.top-search-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
}

.top-search-form {
  display: inline-flex;
  align-items: center;
  gap: var(--btn-inline-gap);
  flex-wrap: nowrap;
  position: relative;
  top: 10px;
}

.top-search-form input,
.top-search-form select {
  min-height: 34px;
  padding: 7px 10px;
}

.top-search-form input[name="fio"] {
  width: 180px;
}

.top-search-form input[name="phone"] {
  width: 150px;
}

.top-search-form input[name="boss"] {
  width: 190px;
}

.top-search-form select[name="sort"] {
  width: 185px;
}

.top-search-form .btn {
  min-height: 34px;
  padding: 6px 12px;
}

.top-actions-right .btn,
.top-actions-right .top-counter {
  min-height: 38px;
  padding-top: 0;
  padding-bottom: 0;
  display: inline-flex;
  align-items: center;
}

body.employees-layout {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.bosses-layout {
  margin: 0;
  height: 100vh;
  overflow: hidden;
}

body.bosses-layout .layout {
  height: 100vh;
  overflow: hidden;
}

body.bosses-layout .sidebar {
  min-height: 0;
  overflow-y: auto;
}

body.bosses-layout .content {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.bosses-layout .page-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

body.bosses-layout .bosses-add-card {
  flex-shrink: 0;
  margin-bottom: 0;
}

body.bosses-layout .bosses-list-card {
  flex: 1;
  min-height: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

body.bosses-layout .bosses-table-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

body.bosses-layout .bosses-table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  min-width: 980px;
}

body.bosses-layout .bosses-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-card);
  box-shadow: inset 0 -1px 0 var(--border);
}

body.audit-layout {
  margin: 0;
  height: 100vh;
  overflow: hidden;
}

body.audit-layout .layout {
  height: 100vh;
  overflow: hidden;
}

body.audit-layout .sidebar {
  min-height: 0;
  overflow-y: auto;
}

body.audit-layout .content {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.audit-layout .page-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.audit-layout .audit-card {
  flex: 1;
  min-height: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

body.audit-layout .audit-table-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

body.audit-layout .audit-table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  min-width: 980px;
}

body.audit-layout .audit-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-card);
  box-shadow: inset 0 -1px 0 var(--border);
}

.employees-layout .topbar {
  position: relative;
  top: auto;
  flex-shrink: 0;
}

.employees-layout .content-min {
  flex: 1;
  min-height: 0;
  padding-top: 12px;
  padding-bottom: 12px;
  overflow: hidden;
}

.employees-layout .page-body {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.employees-layout .table-scroll {
  flex: 1;
  min-height: 0;
  padding: 0 16px 16px;
  position: relative;
  overflow: auto;
}

.top-counter {
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
}

.theme-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.theme-btn:active {
  transform: scale(0.95);
}

.theme-btn.active {
  color: #1a1206;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 8px 18px rgba(255, 122, 0, 0.28);
}

.content-min {
  padding-top: 24px;
}

.content {
  padding: 32px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

h1 {
  margin: 0;
  font-size: 28px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.card-title {
  color: var(--muted);
  font-size: 14px;
}

.card-value {
  font-size: 28px;
  margin-top: 8px;
}

.info-block {
  background: rgba(255, 122, 0, 0.1);
  border: 1px solid rgba(255, 159, 59, 0.3);
  border-radius: 16px;
  padding: 16px;
}

.form {
  display: grid;
  gap: 12px;
}

.form.inline {
  display: flex;
  gap: var(--btn-inline-gap);
  flex-wrap: wrap;
}

.inline {
  display: inline-flex;
  align-items: center;
  gap: var(--btn-inline-gap);
  flex-wrap: wrap;
  vertical-align: middle;
}

.inline + .inline {
  margin-left: var(--btn-inline-gap);
}

.actions-cell {
  white-space: nowrap;
  vertical-align: middle;
}

.actions-cell .inline {
  flex-wrap: nowrap;
}

.actions-cell .inline + .inline {
  margin-left: var(--btn-inline-gap);
}

.role-switch {
  gap: 8px;
}

.role-switch .btn {
  min-width: 78px;
  justify-content: center;
  text-transform: lowercase;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.check-inline input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

.groups-table td {
  vertical-align: top;
}

.groups-table th:nth-child(5),
.groups-table td:nth-child(5) {
  width: 260px;
}

.groups-table th:nth-child(6),
.groups-table td:nth-child(6) {
  width: 120px;
}

.groups-table th:nth-child(7),
.groups-table td:nth-child(7) {
  width: 320px;
}

.groups-table .actions-cell {
  text-align: right;
  white-space: nowrap;
}

.field-with-toggle {
  display: grid;
  grid-template-rows: minmax(40px, auto) 20px;
  row-gap: 6px;
  align-content: start;
  min-width: 0;
}

.field-with-toggle > input,
.field-with-toggle > select,
.field-with-toggle > textarea {
  width: 100%;
}

.field-with-toggle .check-inline {
  min-height: 20px;
}

.channel-input.is-muted {
  opacity: 0.55;
  color: var(--muted);
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(11, 16, 24, 0.58);
}

.groups-table .field-with-toggle {
  min-width: 220px;
}

.form.inline .field-with-toggle.add-field {
  min-width: 240px;
}

input, select, textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0b1018;
  color: var(--text);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.2);
}

textarea {
  resize: vertical;
  min-height: 44px;
  font-family: inherit;
}

.btn {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.btn.small {
  padding: 6px 10px;
  font-size: 12px;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: var(--accent-dark);
  color: #1a1206;
  font-weight: 700;
}

.btn.ghost {
  background: transparent;
  color: var(--accent-dark);
  border-color: rgba(255, 122, 0, 0.45);
}

.btn.ghost.danger {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.35);
}

.btn.ghost.danger:hover {
  background: rgba(248, 113, 113, 0.08);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--btn-inline-gap);
  flex-wrap: wrap;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.mail-settings-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 760px;
}

.mail-settings-grid > label {
  width: 100%;
}

.mail-test-status {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 14px;
}

.mail-test-status.ok {
  border-color: rgba(34, 197, 94, 0.45);
  color: #86efac;
  background: rgba(34, 197, 94, 0.1);
}

.mail-test-status.error {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.1);
}

.mail-test-block {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.mail-test-form {
  align-items: flex-end;
}

.mail-test-form input {
  min-width: 320px;
}

.mail-test-inline {
  font-size: 13px;
  margin-left: 6px;
}

.mail-test-inline.ok {
  color: #86efac;
}

.mail-test-inline.error {
  color: #fca5a5;
}

.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
}

.table-card-filter {
  padding: 10px 12px;
  margin-bottom: 14px;
}

.table-card-filter .table-header {
  margin-bottom: 8px;
  font-size: 14px;
}

.sticky-employees-filter {
  position: sticky;
  top: 74px;
  z-index: 9;
  background: var(--bg-card);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.employees-filter-form {
  gap: var(--btn-inline-gap);
}

.employees-filter-form input {
  min-height: 36px;
  padding: 8px 10px;
}

.employees-filter-form select {
  min-height: 36px;
  padding: 8px 10px;
}

.employees-filter-form .btn {
  min-height: 36px;
  padding: 7px 12px;
}

.table-header {
  font-weight: 600;
  margin-bottom: 12px;
}

.hint-text {
  color: var(--muted);
  font-size: 13px;
  margin: -4px 0 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

table th,
table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.order-col {
  width: 78px;
}

.order-cell {
  text-align: center;
}

.drag-handle {
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  cursor: grab;
  font-size: 16px;
  line-height: 1;
}

.drag-handle:active {
  cursor: grabbing;
}

.boss-row.dragging {
  opacity: 0.5;
}

.boss-row.drop-before td {
  border-top: 2px solid var(--accent);
}

.boss-row.drop-after td {
  border-bottom: 2px solid var(--accent);
}

.cell-pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  color: inherit;
}

.photo-thumb {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0b1018;
}

.photo-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  position: relative;
  overflow: visible;
}

.photo-thumb-wrap {
  position: relative;
  display: inline-flex;
}

.photo-zoom-preview {
  position: absolute;
  left: calc(100% + 12px);
  top: -8px;
  width: 260px;
  height: 260px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px) scale(0.98);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  pointer-events: none;
  z-index: 30;
}

.photo-zoom-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

@media (hover: hover) and (pointer: fine) {
  .photo-thumb-wrap .photo-thumb {
    cursor: zoom-in;
  }
  .photo-cell:hover .photo-zoom-preview,
  .photo-cell:focus-within .photo-zoom-preview {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
  }
}

.updated-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-form {
  display: grid;
  gap: 8px;
  width: 100%;
}

.comment-textarea {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  max-height: 260px;
  resize: none;
  overflow-y: hidden;
  line-height: 1.3;
  box-sizing: border-box;
}

.comment-form .btn.small {
  align-self: stretch;
}

.comment-readonly {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}

.table-scroll {
  overflow-x: auto;
}

.employees-table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  min-width: 1300px;
  font-size: 13px;
  line-height: 1.25;
}

.employees-table th,
.employees-table td {
  padding: 8px 10px;
  vertical-align: middle;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.employees-layout .employees-table thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--bg-card);
  box-shadow: inset 0 -1px 0 var(--border), 0 6px 10px -10px rgba(0, 0, 0, 0.5);
}

.employees-table th:nth-child(1),
.employees-table th:nth-child(4),
.employees-table th:nth-child(5),
.employees-table th:nth-child(6),
.employees-table td:nth-child(1),
.employees-table td:nth-child(4),
.employees-table td:nth-child(5),
.employees-table td:nth-child(6) {
  white-space: nowrap;
}

.employees-table th:nth-child(2),
.employees-table td:nth-child(2),
.employees-table th:nth-child(7),
.employees-table td:nth-child(7) {
  white-space: normal;
  overflow-wrap: break-word;
}

.employees-table .num-col {
  width: 56px;
  min-width: 56px;
  text-align: center;
  white-space: nowrap;
}

.employees-table .office-col {
  max-width: 150px;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.employees-table .comment-col {
  min-width: 210px;
  white-space: normal;
}

.employees-table .cars-col {
  min-width: 260px;
  white-space: normal;
}

.employees-table .photo-thumb {
  width: 96px;
  height: 96px;
}

.employees-table .updated-cell {
  gap: 6px;
}

.employees-table .updated-date {
  font-size: 12px;
  white-space: normal;
  line-height: 1.3;
}

.employees-table .date-label {
  color: var(--muted);
  font-weight: 600;
}

.employees-table .btn.small {
  padding: 5px 10px;
  font-size: 12px;
}

.employees-table .cell-pre {
  font-size: 12px;
  line-height: 1.25;
}

.offices-table th,
.offices-table td {
  vertical-align: middle;
}

.offices-table .office-final-message-cell {
  min-width: 0;
}

.offices-table .office-final-message-input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  resize: none;
  overflow: hidden;
  line-height: 1.35;
}

.offices-table .office-final-message-readonly {
  margin: 0;
  min-height: 44px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.offices-table .actions-cell {
  vertical-align: middle;
}

.comment-readonly-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.updated-date {
  font-size: 13px;
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 640px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-weight: 600;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
}

.modal-body {
  padding: 16px 20px 20px;
}

.export-modal-content {
  max-width: 760px;
}

.export-form {
  display: grid;
  gap: 14px;
}

.export-date-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}

.export-date-row label {
  font-size: 13px;
  color: var(--muted);
}

.export-fio-row label {
  font-size: 13px;
  color: var(--muted);
}

.export-columns-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.export-columns-actions {
  display: flex;
  align-items: center;
  gap: var(--btn-inline-gap);
}

.export-columns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.export-col-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.35);
  font-size: 13px;
  color: var(--text);
}

.export-col-option input {
  margin: 0;
}

.modal-loading,
.modal-empty {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 12px;
  display: none;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.4);
}

.history-meta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.history-changes {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.pagination {
  margin-top: 12px;
  display: flex;
  gap: var(--btn-inline-gap);
  align-items: center;
  flex-wrap: wrap;
}

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.pill.active {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.pill.inactive {
  background: rgba(248, 113, 113, 0.2);
  color: #fecaca;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #e9eff7;
    --bg-panel: #e4ebf4;
    --bg-card: #f8fbff;
    --accent: #e37a1f;
    --accent-dark: #e69a54;
    --text: #202c3f;
    --muted: #66758e;
    --border: #ccd7e8;
  }

  body {
    background:
      radial-gradient(1200px 500px at 10% -10%, rgba(227, 122, 31, 0.08), transparent 62%),
      radial-gradient(900px 500px at 90% 0%, rgba(230, 154, 84, 0.06), transparent 62%),
      linear-gradient(160deg, var(--bg), #e2e9f3);
  }

  .topbar {
    background: rgba(228, 235, 244, 0.92);
  }

  input, select, textarea {
    background: #f3f7fc;
    color: var(--text);
  }

  .nav-link:hover {
    background: rgba(227, 122, 31, 0.08);
  }

  .nav-link.active {
    background: linear-gradient(135deg, rgba(227, 122, 31, 0.16), rgba(230, 154, 84, 0.12));
    color: #6e3f14;
  }

  .modal {
    background: rgba(28, 39, 57, 0.2);
  }

  .history-item {
    background: #f3f7fc;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0e12;
  --bg-panel: #101722;
  --bg-card: #151e2b;
  --accent: #ff7a00;
  --accent-dark: #ff9f3b;
  --text: #f6f7fb;
  --muted: #9aa6b2;
  --border: #2a3446;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e9eff7;
  --bg-panel: #e4ebf4;
  --bg-card: #f8fbff;
  --accent: #e37a1f;
  --accent-dark: #e69a54;
  --text: #202c3f;
  --muted: #66758e;
  --border: #ccd7e8;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(255, 122, 0, 0.18), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(255, 180, 84, 0.14), transparent 60%),
    linear-gradient(160deg, #0b0e12, #111826);
}

:root[data-theme="light"] body {
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(227, 122, 31, 0.08), transparent 62%),
    radial-gradient(900px 500px at 90% 0%, rgba(230, 154, 84, 0.06), transparent 62%),
    linear-gradient(160deg, var(--bg), #e2e9f3);
}

:root[data-theme="dark"] .topbar {
  background: var(--bg-panel);
}

:root[data-theme="light"] .topbar {
  background: rgba(228, 235, 244, 0.92);
  backdrop-filter: blur(6px);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  background: #0b1018;
  color: var(--text);
}

:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
  background: #f3f7fc;
  color: var(--text);
}

:root[data-theme="light"] input:focus,
:root[data-theme="light"] select:focus,
:root[data-theme="light"] textarea:focus {
  border-color: rgba(227, 122, 31, 0.65);
  box-shadow: 0 0 0 3px rgba(227, 122, 31, 0.14);
}

:root[data-theme="dark"] .nav-link:hover {
  background: rgba(255, 122, 0, 0.16);
}

:root[data-theme="light"] .nav-link:hover {
  background: rgba(227, 122, 31, 0.08);
}

:root[data-theme="dark"] .nav-link.active {
  background: linear-gradient(135deg, rgba(255, 122, 0, 0.28), rgba(255, 159, 59, 0.22));
  border: 1px solid rgba(255, 159, 59, 0.55);
  color: #ffe1bf;
}

:root[data-theme="light"] .nav-link.active {
  background: linear-gradient(135deg, rgba(227, 122, 31, 0.16), rgba(230, 154, 84, 0.12));
  color: #6e3f14;
}

:root[data-theme="dark"] .modal {
  background: rgba(15, 23, 42, 0.75);
}

:root[data-theme="light"] .modal {
  background: rgba(28, 39, 57, 0.2);
}

:root[data-theme="dark"] .history-item {
  background: rgba(15, 23, 42, 0.4);
}

:root[data-theme="light"] .history-item {
  background: #f3f7fc;
}

:root[data-theme="light"] .theme-toggle {
  background: rgba(213, 223, 238, 0.8);
}

:root[data-theme="light"] .theme-btn.active {
  box-shadow: 0 4px 10px rgba(227, 122, 31, 0.18);
}

:root[data-theme="light"] .btn.primary {
  box-shadow: 0 4px 10px rgba(227, 122, 31, 0.18);
}

:root[data-theme="light"] .btn.ghost {
  border-color: rgba(227, 122, 31, 0.32);
}

:root[data-theme="light"] .auth-card,
:root[data-theme="light"] .modal-content,
:root[data-theme="light"] .photo-zoom-preview {
  box-shadow: 0 12px 28px rgba(31, 46, 72, 0.14);
}

:root[data-theme="light"] .employees-layout .employees-table thead th {
  box-shadow: inset 0 -1px 0 var(--border), 0 4px 8px -8px rgba(31, 46, 72, 0.2);
}

:root[data-theme="light"] .channel-input.is-muted {
  background: rgba(208, 218, 234, 0.48);
  border-color: rgba(148, 163, 184, 0.45);
  color: #7b8799;
  opacity: 0.75;
}
