:root {
  color-scheme: light;
  --primary-dark: #850b5a;
  --primary: #cc1e8e;
  --primary-light: #e653b2;
  --accent: #850b5a;
  --finance: #276fb4;
  --success: #0e704d;
  --warning: #d69b2d;
  --danger: #e56a54;
  --bg: #faf7fa;
  --surface: #ffffff;
  --surface-2: #f5eff4;
  --text: #1f1720;
  --muted: #766a75;
  --border: #e7dce5;
  --shadow: 0 18px 48px rgba(57, 19, 48, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Notification scenario builder */
.settings-eyebrow {
  display: block;
  margin-bottom: 6px;
  color: #9a0062;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

.notification-panel-actions,
.notification-scenario-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notification-panel-actions button,
.notification-scenario-actions button,
.notification-editor-modal button,
.notification-history-modal button,
.dashboard-notification-modal button {
  border: 1px solid #eadbe5;
  border-radius: 12px;
  background: #fff;
  color: #8f0058;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.notification-panel-actions button:last-child,
.notification-editor-modal footer button:last-child,
.dashboard-notification-modal > button {
  border-color: #97005e;
  background: #97005e;
  color: #fff;
}

.notification-approval-setting {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  padding: 16px 18px;
  border: 1px solid #eadde6;
  border-radius: 16px;
  background: #fbf7fa;
}

.notification-approval-setting input,
.notification-toggle-grid input {
  width: 20px;
  height: 20px;
  accent-color: #97005e;
}

.notification-approval-setting span,
.notification-toggle-grid span {
  display: grid;
  gap: 3px;
}

.notification-approval-setting small,
.notification-toggle-grid small {
  color: #817680;
  font-size: 13px;
  line-height: 1.35;
}

.notification-approval-setting button {
  min-height: 42px;
  padding: 0 18px;
}

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

.notification-scenario-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid #eadde6;
  border-radius: 18px;
  background: #fff;
}

.notification-scenario-card.is-archived {
  opacity: .64;
  background: #f6f3f5;
}

.notification-scenario-card.is-pending_approval {
  border-color: #efc472;
  background: #fffaf0;
}

.notification-scenario-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  background: #fae6f2;
  color: #97005e;
  font-size: 22px;
  font-weight: 900;
}

.notification-scenario-main {
  min-width: 0;
}

.notification-scenario-main > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.notification-scenario-main strong {
  font-size: 17px;
}

.notification-scenario-main p {
  margin: 5px 0;
  color: #655a63;
}

.notification-scenario-main small {
  color: #8e838c;
}

.notification-status,
.notification-required,
.notification-delivery-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #e8f8f1;
  color: #147554;
  font-size: 12px;
  font-weight: 800;
}

.notification-required {
  background: #fae6f2;
  color: #97005e;
}

.notification-scenario-actions {
  justify-content: flex-end;
  max-width: 310px;
}

.notification-scenario-actions button {
  min-height: 36px;
  padding: 0 12px;
}

.notification-scenario-actions button.is-danger {
  color: #b62935;
}

.notification-empty {
  padding: 30px;
  border: 1px dashed #ddc7d5;
  border-radius: 18px;
  text-align: center;
}

.notification-editor-backdrop,
.dashboard-notification-backdrop {
  position: fixed;
  z-index: 3000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(31, 20, 28, .48);
  backdrop-filter: blur(4px);
}

.notification-editor-modal,
.notification-history-modal {
  display: flex;
  width: min(1120px, 96vw);
  max-height: 94vh;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(56, 19, 44, .2);
}

.notification-editor-modal header,
.notification-history-modal header,
.notification-editor-modal footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 26px;
  border-bottom: 1px solid #eee2e9;
}

.notification-editor-modal header span,
.notification-history-modal header span {
  color: #97005e;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .09em;
}

.notification-editor-modal h2,
.notification-history-modal h2 {
  margin: 4px 0;
  font-size: 28px;
}

.notification-editor-modal header p,
.notification-history-modal header p {
  margin: 0;
  color: #7d727b;
}

.notification-editor-modal header button,
.notification-history-modal header button,
.notification-editor-modal footer button {
  min-height: 42px;
  padding: 0 18px;
}

.notification-editor-body {
  display: grid;
  gap: 18px;
  overflow: auto;
  padding: 24px 26px 30px;
}

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

.notification-editor-grid .is-wide {
  grid-column: 1 / -1;
}

.notification-editor-grid label,
.notification-editor-section > label,
.notification-schedule-row label,
.notification-recipient-select {
  display: grid;
  gap: 7px;
  color: #635861;
  font-weight: 700;
}

.notification-editor-grid input,
.notification-editor-grid select,
.notification-editor-section textarea,
.notification-schedule-row input,
.notification-schedule-row select {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #e4d4df;
  border-radius: 12px;
  background: #fff;
  color: #271f25;
  font: inherit;
}

.notification-recipient-select select[multiple] {
  min-height: 150px;
}

.notification-editor-section {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid #eee3ea;
  border-radius: 18px;
  background: #fcfafb;
}

.notification-editor-section h3 {
  margin: 0;
  font-size: 18px;
}

.notification-schedule-row {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 18px;
}

.notification-schedule-row > div {
  display: grid;
  gap: 7px;
  color: #635861;
  font-weight: 700;
}

.notification-weekdays {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.notification-weekdays label input {
  position: absolute;
  opacity: 0;
}

.notification-weekdays label span {
  display: grid;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
  border: 1px solid #e2d2dd;
  border-radius: 12px;
  background: #fff;
}

.notification-weekdays label input:checked + span {
  border-color: #97005e;
  background: #97005e;
  color: #fff;
}

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

.notification-toggle-grid > label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 13px;
  border: 1px solid #eadde6;
  border-radius: 13px;
  background: #fff;
}

.notification-editor-section textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.5;
}

.notification-variables {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: #7e727b;
  font-size: 13px;
}

.notification-variables button {
  min-height: 30px;
  padding: 0 9px;
  border-radius: 8px;
  background: #f8edf4;
  font-size: 12px;
}

.notification-editor-modal footer {
  border-top: 1px solid #eee2e9;
  border-bottom: 0;
}

.notification-editor-modal footer > div {
  display: flex;
  gap: 10px;
}

.notification-history-modal {
  width: min(1480px, 97vw);
}

.notification-history-scroll {
  overflow: auto;
  padding: 0 22px 24px;
}

.notification-history-scroll table {
  min-width: 1180px;
  width: 100%;
  border-collapse: collapse;
}

.notification-history-scroll th,
.notification-history-scroll td {
  padding: 12px;
  border-bottom: 1px solid #eee3ea;
  text-align: left;
  vertical-align: top;
}

.notification-history-scroll td:last-child {
  max-width: 420px;
  white-space: pre-wrap;
}

.notification-history-scroll td small {
  display: block;
  margin-top: 5px;
  color: #b62935;
}

.dashboard-notification-backdrop {
  z-index: 5000;
}

.dashboard-notification-modal {
  position: relative;
  display: grid;
  width: min(590px, 94vw);
  gap: 14px;
  padding: 30px;
  border: 1px solid #efdbe8;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(46, 14, 35, .28);
}

.dashboard-notification-counter {
  color: #97005e;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.dashboard-notification-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(145deg, #a40068, #d41980);
  color: #fff;
  font-size: 32px;
  font-weight: 900;
}

.dashboard-notification-modal h2 {
  margin: 0;
  font-size: 27px;
}

.dashboard-notification-message {
  max-height: 42vh;
  overflow: auto;
  padding: 16px;
  border-radius: 16px;
  background: #faf4f8;
  color: #312830;
  font-size: 17px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.dashboard-notification-modal small,
.dashboard-notification-modal p {
  color: #817680;
}

.dashboard-notification-modal > button {
  min-height: 52px;
  font-size: 17px;
}

@media (max-width: 820px) {
  .notification-scenario-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }
  .notification-scenario-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    max-width: none;
  }
  .notification-editor-grid,
  .notification-toggle-grid,
  .notification-schedule-row {
    grid-template-columns: 1fr;
  }
  .notification-approval-setting {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .notification-approval-setting button {
    grid-column: 1 / -1;
  }
  .notification-editor-backdrop {
    padding: 0;
  }
  .notification-editor-modal,
  .notification-history-modal {
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }
  .notification-editor-modal header,
  .notification-history-modal header,
  .notification-editor-modal footer {
    padding: 16px;
  }
  .notification-editor-body {
    padding: 16px;
  }
}

.payroll-filters {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(180px, 240px) auto auto 1fr;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.payroll-filters label,
.employee-effective-date {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.employee-effective-date {
  margin-top: 8px;
  font-size: 12px;
}

.payroll-warning,
.payroll-review {
  color: #a32626;
  font-weight: 800;
}

.payroll-kpis,
.payroll-employee-grid,
.payroll-store-grid,
.payroll-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.payroll-kpis article,
.payroll-detail-card,
.payroll-employee-card,
.payroll-store-card {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 16px;
}

.payroll-kpis span,
.payroll-detail-grid dt,
.payroll-employee-card span,
.payroll-employee-card small,
.payroll-store-card span,
.payroll-store-card small,
.payroll-section-title p {
  color: var(--muted);
  font-weight: 700;
}

.payroll-kpis strong,
.payroll-detail-grid dd,
.payroll-employee-card b,
.payroll-store-card b {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 24px;
  font-weight: 900;
}

.payroll-store-section {
  margin-bottom: 18px;
}

.payroll-section-title {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.payroll-section-title h2 {
  margin: 0;
  font-size: 22px;
}

.payroll-section-title p {
  margin: 0;
}

.payroll-store-card {
  background: #f8fbff;
}

.payroll-store-card strong,
.payroll-store-card span,
.payroll-store-card small {
  display: block;
}

.payroll-store-card.needs-review {
  background: #fff6ed;
}

.payroll-employee-card {
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.payroll-employee-card.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.payroll-employee-card.needs-review,
.payroll-table tr.needs-review {
  background: #fff6ed;
}

.payroll-detail-card,
.payroll-table-panel {
  margin-bottom: 18px;
}

.payroll-detail-grid {
  margin: 12px 0;
}

.payroll-detail-grid div {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.payroll-table {
  width: 100%;
  min-width: 1680px;
  border-collapse: collapse;
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.payroll-table th,
.payroll-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.payroll-table th {
  color: var(--muted);
  font-weight: 900;
}

.payroll-sort-button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 900;
}

.payroll-sort-button span {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--accent);
}

.payroll-sort-button.is-active {
  color: var(--accent);
}

.payroll-table input {
  width: 100%;
  min-width: 120px;
}

.payroll-table select {
  width: 100%;
  min-width: 150px;
}

.payroll-table input[type="checkbox"] {
  min-width: 0;
  width: 18px;
  height: 18px;
}

.payroll-edit-cell.is-dirty input,
.payroll-edit-cell.is-dirty select {
  border-color: var(--warning);
  background: #fff8e6;
  box-shadow: 0 0 0 2px rgba(214, 155, 45, 0.12);
}

.payroll-table-tools {
  display: grid;
  gap: 12px;
  margin: 12px 0 14px;
}

.payroll-shift-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.payroll-shift-filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.payroll-shift-filters select,
.payroll-shift-filters input {
  min-height: 40px;
}

.payroll-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.payroll-bulk-actions span,
.payroll-table-counter {
  color: var(--muted);
  font-weight: 800;
}

.payroll-select-all {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--text);
  font-weight: 900;
}

.button-secondary.danger {
  border-color: #f2b7ad;
  color: #ad2b1d;
}

.payroll-merged-badge {
  display: block;
  margin-top: 4px;
  color: var(--accent);
  font-weight: 900;
}

.payroll-manual-badge {
  display: block;
  margin-bottom: 4px;
  color: var(--finance);
  font-weight: 900;
}

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

.payroll-panel-heading h2 {
  margin: 0;
}

.payroll-panel-heading span {
  color: var(--muted);
  font-weight: 900;
}

.payroll-manual-shift-modal {
  width: min(720px, 100%);
}

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

.payroll-manual-shift-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.payroll-manual-shift-grid label.is-wide {
  grid-column: 1 / -1;
}

.payroll-manual-shift-grid input,
.payroll-manual-shift-grid select {
  width: 100%;
  min-height: 44px;
}

.payroll-orders-table {
  min-width: 980px;
  font-size: 14px;
  table-layout: fixed;
}

.payroll-orders-table th,
.payroll-orders-table td {
  padding: 8px 10px;
}

.payroll-orders-table .payroll-review {
  display: block;
  max-width: 320px;
  line-height: 1.25;
}

.payroll-orders-toggle {
  margin-top: 12px;
}

.payroll-adjustment-stack {
  display: grid;
  gap: 8px;
  min-width: 260px;
}

.payroll-adjustment-row {
  display: grid;
  grid-template-columns: minmax(88px, 0.55fr) minmax(126px, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.payroll-add-adjustment,
.payroll-remove-adjustment {
  width: fit-content;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.payroll-remove-adjustment {
  width: 32px;
  padding: 0;
  border-color: #f4c4cf;
  color: var(--danger);
}

@media (max-width: 900px) {
  .payroll-filters,
  .payroll-kpis,
  .payroll-employee-grid,
  .payroll-detail-grid {
    grid-template-columns: 1fr;
  }

  .payroll-manual-shift-grid {
    grid-template-columns: 1fr;
  }

  .payroll-manual-shift-grid label.is-wide {
    grid-column: auto;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button,
.report-tile,
.button-link {
  border: 0;
  border-radius: 8px;
  background: var(--primary-dark);
  color: #fff;
  cursor: pointer;
}

button {
  min-height: 40px;
  padding: 0 14px;
}

.button-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  text-decoration: none;
}

.button-link.secondary {
  background: var(--surface-2);
  color: var(--primary-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button.is-secondary-disabled {
  border: 1px solid var(--border);
  background: #eef1f4 !important;
  color: #7a8391 !important;
  opacity: 1;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 20% 16%, rgba(230, 83, 178, 0.12), transparent 32%),
    linear-gradient(180deg, #fff, #fff8fc);
}

.auth-shell {
  min-height: 100vh;
}

.auth-card {
  width: min(520px, 100%);
  display: grid;
  gap: 22px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(39, 24, 48, 0.12);
}

.auth-brand {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.auth-brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  padding: 8px;
  border-radius: 8px;
  background: #fff0f8;
}

.auth-brand strong {
  display: block;
  color: #17132b;
  font-size: 22px;
}

.auth-brand span,
.auth-card p,
.auth-note {
  color: #8b8498;
}

.auth-card h1 {
  margin: 6px 0 8px;
  color: #17132b;
  font-size: 32px;
  line-height: 1.05;
}

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

.auth-form label {
  display: grid;
  gap: 7px;
  color: #17132b;
  font-weight: 850;
}

.auth-form input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: #17132b;
  font-size: 18px;
}

.auth-form button {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: var(--primary-dark);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
}

.auth-error {
  padding: 12px 14px;
  border: 1px solid rgba(206, 57, 57, 0.24);
  border-radius: 8px;
  background: rgba(206, 57, 57, 0.08);
  color: #9f1f1f;
  font-weight: 850;
}

.auth-access-denied {
  display: grid;
  gap: 10px;
}

.auth-access-denied a {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  min-height: 40px;
  align-items: center;
  padding: 0 14px;
  border-radius: 8px;
  background: #9f1f1f;
  color: #fff;
  text-decoration: none;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  color: #9b93a4;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  background: var(--border);
  content: "";
}

.auth-telegram-login {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid #cfe8f8;
  border-radius: 14px;
  background:
    radial-gradient(circle at 94% 8%, rgba(51, 169, 232, 0.18), transparent 32%),
    linear-gradient(145deg, #f8fcff, #eef8fe);
  box-shadow: 0 14px 34px rgba(28, 112, 164, 0.08);
}

.auth-telegram-heading {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.auth-telegram-logo {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #40b3ec, #168dcc);
  box-shadow: 0 10px 22px rgba(26, 145, 207, 0.25);
  color: #fff;
  font-size: 23px;
  line-height: 1;
  transform: rotate(-35deg);
}

.auth-telegram-heading strong {
  color: #17132b;
  font-size: 19px;
}

.auth-telegram-heading p {
  margin: 4px 0 0;
  line-height: 1.45;
}

.auth-telegram-primary {
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 11px 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, #229ed9, #1584c1);
  box-shadow: 0 12px 24px rgba(21, 132, 193, 0.22);
  color: #fff;
  text-align: center;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.auth-telegram-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 28px rgba(21, 132, 193, 0.28);
}

.auth-telegram-primary span {
  font-size: 17px;
  font-weight: 900;
}

.auth-telegram-primary small {
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  font-weight: 700;
}

.auth-telegram-bot-hint {
  padding-top: 12px;
  border-top: 1px solid #d8e8f4;
  font-size: 14px;
}

.auth-telegram-bot-hint strong {
  color: #4d4358;
}

.auth-telegram-bot-hint a {
  color: #1689c9;
  font-weight: 850;
}

.auth-telegram-bot-hint code {
  padding: 2px 6px;
  border-radius: 5px;
  background: #e5f4fc;
  color: #126a9b;
  font-weight: 850;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.mobile-menu-checkbox,
.mobile-topbar,
.mobile-menu-head,
.mobile-menu-backdrop {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  border-right: 1px solid var(--border);
  background: #fff;
}

.brand {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand strong,
.role-card strong {
  display: block;
  font-size: 16px;
}

.brand span,
.role-card span,
.role-card small,
.eyebrow,
label span,
.metric-card span,
.integration-card span,
.report-tile span,
.report-tile small,
.report-tile em {
  color: var(--muted);
  font-size: 12px;
}

nav {
  display: grid;
  gap: 4px;
}

nav a {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}

nav a.is-active,
nav a:hover {
  background: var(--surface-2);
  color: var(--primary-dark);
}

.role-card {
  margin-top: auto;
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.auth-user-card button {
  margin-top: 8px;
  min-height: 34px;
  border: 1px solid rgba(151, 0, 97, 0.16);
  border-radius: 8px;
  background: #fff;
  color: var(--primary-dark);
  font-weight: 850;
}

.workspace {
  min-width: 0;
}

.filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(148px, 1fr)) minmax(168px, 0.9fr) repeat(2, minmax(140px, 0.8fr)) auto;
  gap: 10px;
  align-items: end;
}

.filters.has-manual-compare {
  grid-template-columns: repeat(5, minmax(128px, 1fr)) repeat(2, minmax(132px, 0.8fr)) auto;
}

label {
  display: grid;
  gap: 5px;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
}

.view {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
}

.page-head h1 {
  margin: 4px 0 6px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.02;
  letter-spacing: 0;
}

.page-head p,
.state p,
.integration-card p,
.panel-note {
  margin: 0;
  color: var(--muted);
}

.head-meta {
  display: flex;
  justify-content: flex-end;
  min-width: 180px;
}

.overview-hero {
  display: grid;
  gap: 26px;
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #fff 62%, #fbf8fb 100%);
  box-shadow: var(--shadow);
}

.hero-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.48fr);
  gap: 18px;
  align-items: start;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.overview-chip {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.overview-chip.is-success {
  border-color: rgba(14, 112, 77, 0.16);
  background: rgba(14, 112, 77, 0.14);
  color: var(--success);
}

.overview-chip.is-warning {
  border-color: rgba(214, 155, 45, 0.22);
  background: rgba(214, 155, 45, 0.14);
  color: #7f5710;
}

.overview-chip.is-danger {
  border-color: rgba(229, 106, 84, 0.24);
  background: rgba(229, 106, 84, 0.12);
  color: #9a311e;
}

.hero-period-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(57, 19, 48, 0.08);
}

.hero-period-card button {
  grid-column: 1 / -1;
  width: 100%;
}

.hero-period-card div {
  display: grid;
  gap: 6px;
}

.hero-period-card span,
.module-stats small {
  color: #95a0b3;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.hero-period-card strong {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}

.hero-copy {
  max-width: 880px;
}

.hero-copy h1 {
  margin: 4px 0 12px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1;
  letter-spacing: 0;
}

.hero-copy p:last-child {
  margin: 0;
  max-width: 780px;
  color: #59677c;
  font-size: 18px;
  line-height: 1.55;
}

.overview-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
}

.overview-metric {
  display: grid;
  gap: 10px;
  min-height: 170px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.metric-icon,
.module-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 850;
}

.metric-icon.tone-1,
.module-card.tone-green .module-icon {
  background: rgba(14, 112, 77, 0.15);
  color: var(--success);
}

.metric-icon.tone-2 {
  background: rgba(118, 106, 117, 0.12);
  color: #354052;
}

.metric-icon.tone-3,
.module-card.tone-blue .module-icon {
  background: rgba(39, 111, 180, 0.14);
  color: var(--finance);
}

.metric-icon.tone-4,
.module-card.tone-gold .module-icon {
  background: rgba(214, 155, 45, 0.18);
  color: #8a5f12;
}

.overview-metric small {
  margin-top: 8px;
  color: #95a0b3;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
}

.overview-metric strong {
  font-size: 28px;
  line-height: 1;
}

.overview-metric p,
.module-card p {
  margin: 0;
  color: #67758a;
  line-height: 1.45;
}

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

.module-card {
  min-height: 390px;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--border);
  border-top: 5px solid var(--primary-dark);
  border-radius: 8px;
  background: #fff;
}

.module-card.tone-green {
  border-top-color: var(--success);
  background: linear-gradient(180deg, #fff 0%, rgba(14, 112, 77, 0.05) 100%);
}

.module-card.tone-blue {
  border-top-color: var(--finance);
  background: linear-gradient(180deg, #fff 0%, rgba(39, 111, 180, 0.06) 100%);
}

.module-card.tone-gold {
  border-top-color: var(--warning);
  background: linear-gradient(180deg, #fff 0%, rgba(214, 155, 45, 0.06) 100%);
}

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

.module-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-weight: 750;
}

.module-card h2 {
  margin: 6px 0 -6px;
  font-size: 28px;
  line-height: 1.1;
}

.module-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.module-stats div {
  min-height: 112px;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.module-stats strong {
  font-size: 20px;
  line-height: 1.15;
}

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

.metric-card,
.panel,
.state,
.integration-card,
.report-tile {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.metric-card {
  display: grid;
  gap: 10px;
  min-height: 116px;
  padding: 16px;
}

.metric-card strong {
  font-size: 26px;
  line-height: 1;
}

.metric-card.is-hidden strong {
  color: var(--muted);
}

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

.panel {
  min-width: 0;
  padding: 16px;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(39, 111, 180, 0.12);
  color: var(--finance);
  font-size: 12px;
  font-weight: 700;
}

.badge-success {
  background: rgba(14, 112, 77, 0.12);
  color: var(--success);
}

.badge-warning {
  background: rgba(214, 155, 45, 0.16);
  color: #8a5f12;
}

.badge-danger {
  background: rgba(229, 106, 84, 0.16);
  color: #9a311e;
}

.badge-muted {
  background: var(--surface-2);
  color: var(--muted);
}

.state {
  display: grid;
  gap: 8px;
  padding: 20px;
}

.state-error {
  border-color: rgba(229, 106, 84, 0.4);
}

.state-locked {
  border-color: rgba(214, 155, 45, 0.5);
}

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

.loading-state span {
  height: 116px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-2), #fff, var(--surface-2));
  background-size: 220% 100%;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  from { background-position: 0 0; }
  to { background-position: -220% 0; }
}

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

.report-grid.is-single {
  max-width: 520px;
  grid-template-columns: minmax(260px, 1fr);
}

.report-tile {
  display: grid;
  gap: 8px;
  min-height: 148px;
  padding: 16px;
  color: var(--text);
  text-decoration: none;
}

.report-tile strong {
  font-size: 22px;
}

.report-tile p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #746b7d;
  line-height: 1.35;
}

.reports-empty-state {
  display: grid;
  gap: 8px;
  max-width: 720px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
  background: #fff;
}

.reports-empty-state strong {
  color: var(--text);
  font-size: 24px;
}

.reports-empty-state p,
.reports-empty-state span {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.reports-empty-state span {
  font-size: 14px;
}
  font-size: 13px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.report-tile em {
  font-style: normal;
  margin-top: auto;
}

.report-tile.is-missing {
  border-style: dashed;
  background: #fffaf0;
}

.report-filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-filter-summary span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.comparison-section {
  display: grid;
  gap: 22px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.comparison-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.36fr);
  gap: 18px;
  align-items: start;
}

.comparison-copy {
  max-width: 880px;
}

.comparison-scenarios,
.comparison-store-card {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.comparison-scenarios h2,
.comparison-store-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.comparison-scenarios p,
.comparison-store-card p {
  margin: 0;
  color: #66758a;
  line-height: 1.55;
}

.scenario-group {
  display: grid;
  gap: 10px;
}

.scenario-group > span {
  color: #98a4b5;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.scenario-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scenario-buttons button {
  min-height: 38px;
  border: 1px solid #dfe6ef;
  background: #fff;
  color: #243044;
  font-weight: 750;
}

.scenario-buttons button:hover {
  border-color: rgba(14, 112, 77, 0.32);
  background: rgba(14, 112, 77, 0.08);
  color: var(--success);
}

.comparison-store-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfd;
  box-shadow: 0 10px 26px rgba(57, 19, 48, 0.07);
}

.store-multiselect {
  display: grid;
  gap: 10px;
}

.store-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 188px;
  overflow: auto;
  padding-right: 2px;
}

.store-check {
  display: flex;
  min-width: 0;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #dfe6ef;
  border-radius: 8px;
  background: #fff;
  color: #243044;
  font-weight: 750;
}

.store-check.is-all {
  width: fit-content;
  padding-right: 14px;
}

.store-check input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--success);
}

.store-check span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-copy h2 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.2;
}

.comparison-copy p {
  margin: 0;
  color: #66758a;
  line-height: 1.55;
}

.comparison-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.comparison-form fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.comparison-form legend {
  padding: 0 2px;
  color: var(--text);
  font-weight: 800;
}

.comparison-form button {
  min-height: 58px;
  padding: 0 24px;
  background: var(--success);
  white-space: nowrap;
}

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

.comparison-period-card {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.comparison-period-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.comparison-period-head h3 {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin: 0;
  font-size: 18px;
}

.period-range-inline {
  color: #718199;
  font-size: 14px;
  font-weight: 650;
}

.comparison-period-head em {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #5d6b80;
  font-style: normal;
  font-weight: 700;
}

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

.comparison-metric-card {
  display: grid;
  gap: 10px;
  min-height: 124px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfd;
}

.comparison-metric-card span {
  color: #718199;
  font-size: 13px;
  font-weight: 700;
}

.comparison-metric-card strong {
  color: #101928;
  font-size: 24px;
  line-height: 1.05;
}

.comparison-metric-card p {
  margin: 0;
  color: #718199;
  line-height: 1.4;
}

.integration-card {
  display: grid;
  gap: 10px;
  min-height: 170px;
  padding: 16px;
}

.integration-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

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

.revenue-draft {
  display: grid;
  gap: 18px;
  color: #17132b;
}

.draft-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: start;
}

.draft-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.draft-back-link {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--primary-dark);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(69, 35, 61, 0.06);
}

.draft-back-link:hover {
  border-color: #e8c9de;
  background: #fff3f9;
}

.draft-head h1 {
  margin: 0 0 8px;
  font-size: 44px;
  line-height: 1;
}

.draft-head p,
.draft-panel p,
.draft-period-section > p,
.draft-donut-card p,
.draft-export p {
  margin: 0;
  color: #8b8498;
}

.draft-panel,
.draft-chart-card,
.draft-donut-card,
.draft-period-card,
.draft-export {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.draft-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.draft-report-controls {
  gap: 18px;
}

.draft-selector,
.draft-period-select {
  display: grid;
  gap: 10px;
}

.draft-selector {
  padding-bottom: 16px;
  border-bottom: 1px solid #efe4ee;
}

.draft-load-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid #e7f1eb;
  border-radius: 8px;
  background: #f8fffb;
}

.draft-load-row div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.draft-load-row strong {
  font-size: 16px;
  line-height: 1.25;
}

.draft-load-row span {
  color: #8b8498;
  font-size: 14px;
  line-height: 1.35;
}

.draft-load-statistics {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-width: 250px;
  min-height: 52px;
  background: #12865a;
  font-size: 17px;
  font-weight: 850;
}

.draft-load-statistics.is-loading {
  opacity: 1;
}

.draft-button-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: draft-button-spin 0.8s linear infinite;
}

@keyframes draft-button-spin {
  to {
    transform: rotate(360deg);
  }
}

.draft-load-statistics:hover:not(:disabled),
.draft-load-statistics:focus-visible:not(:disabled) {
  background: #0f744e;
}

.draft-panel h2,
.draft-chart-card h2,
.draft-donut-card h2,
.draft-period-section h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.draft-selector-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.draft-creator-scenarios {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #aaa2b3;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}

.draft-creator-scenarios span {
  color: #aaa2b3;
}

.draft-creator-scenarios button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8b8498;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.draft-creator-scenarios button:hover,
.draft-creator-scenarios button:focus-visible {
  color: var(--primary-dark);
  text-decoration: underline;
}

.draft-creator-scenarios i {
  display: block;
  width: 1px;
  height: 14px;
  background: #d9cdda;
}

.draft-store-select,
.draft-florist-select,
.draft-payment-source-select,
.draft-creator-select {
  position: relative;
}

.draft-store-select summary,
.draft-florist-select summary,
.draft-payment-source-select summary,
.draft-creator-select summary {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: #17132b;
  cursor: pointer;
  list-style: none;
}

.draft-store-select summary::-webkit-details-marker,
.draft-florist-select summary::-webkit-details-marker,
.draft-payment-source-select summary::-webkit-details-marker,
.draft-creator-select summary::-webkit-details-marker {
  display: none;
}

.draft-store-select summary::after,
.draft-florist-select summary::after,
.draft-payment-source-select summary::after,
.draft-creator-select summary::after {
  content: "⌄";
  color: #8b8498;
}

.draft-store-select > div,
.draft-florist-select > div,
.draft-payment-source-select > div,
.draft-creator-select > div {
  position: absolute;
  z-index: 4;
  display: grid;
  gap: 4px;
  width: min(420px, 100%);
  margin-top: 6px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.draft-florist-select > div.draft-creator-menu,
.draft-creator-select > div.draft-creator-menu {
  width: min(1040px, calc(100vw - 64px));
  max-height: 420px;
  overflow: auto;
  gap: 10px;
}

.draft-creator-menu-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.draft-creator-menu-actions button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(151, 0, 97, 0.16);
  border-radius: 7px;
  background: #fff3f9;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 850;
}

.draft-creator-search {
  display: grid !important;
  gap: 6px !important;
}

.draft-creator-search span {
  color: #8b8498;
  font-size: 12px;
  font-weight: 850;
}

.draft-creator-search input {
  width: 100% !important;
  min-height: 38px !important;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: #17132b;
  font-size: 15px;
}

.draft-creator-result-head {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid #efe4ee;
  border-radius: 8px;
  background: #fbf8fb;
}

.draft-creator-result-head strong {
  color: #17132b;
  font-size: 14px;
  line-height: 1.2;
}

.draft-creator-result-head span,
.draft-creator-empty {
  color: #8b8498;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.3;
}

.draft-creator-results {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 6px 12px;
}

.draft-creator-empty {
  padding: 12px;
  border: 1px dashed #e8d7e7;
  border-radius: 8px;
  background: #fff;
}

.draft-store-select label,
.draft-florist-select label,
.draft-payment-source-select label,
.draft-creator-select label {
  display: flex;
  min-height: 30px;
  align-items: center;
  gap: 8px;
}

.draft-florist-select label span,
.draft-creator-select label span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-store-select input,
.draft-florist-select input,
.draft-payment-source-select input,
.draft-creator-select input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--primary-dark);
}

.draft-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.draft-chip-row.is-compact {
  gap: 6px;
}

.draft-chip-row span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 10px;
  border: 1px solid rgba(151, 0, 97, 0.18);
  border-radius: 6px;
  background: #fff3f9;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 750;
}

.draft-chip-row button {
  display: inline-grid;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(151, 0, 97, 0.2);
  border-radius: 50%;
  background: #fff;
  box-sizing: border-box;
  color: var(--primary-dark);
  flex: 0 0 18px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.draft-chip-row button:hover:not(:disabled),
.draft-chip-row button:focus-visible:not(:disabled) {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  color: #fff;
}

.draft-chip-row button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
}

.draft-chip-row em {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #e8d7e7;
  border-radius: 6px;
  background: #fbf8fb;
  color: #8b8498;
  font-size: 13px;
  font-style: normal;
  font-weight: 850;
}

.draft-selected-summary {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #efe4ee;
  border-radius: 8px;
  background: #fbf8fb;
}

.draft-selected-summary strong {
  color: #17132b;
  font-size: 15px;
  line-height: 1.2;
}

.draft-selected-summary > span {
  color: #8b8498;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.3;
}

.draft-period-select {
  overflow: visible;
}

.draft-quick-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border: 1px solid #efe4ee;
  border-radius: 8px;
  background: #fbf7fa;
}

.draft-quick-periods button {
  min-height: 36px;
  border: 1px solid #e4d5e1;
  background: #fff;
  color: #4a4052;
  font-size: 14px;
  font-weight: 800;
}

.draft-quick-periods button:hover,
.draft-quick-periods button:focus-visible {
  border-color: var(--primary-dark);
  color: var(--primary-dark);
}

.draft-period-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.draft-period-actions button {
  min-height: 38px;
  border: 1px solid #d9cdda;
  background: #fff;
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 850;
}

.draft-period-actions button:hover,
.draft-period-actions button:focus-visible {
  border-color: var(--primary-dark);
  background: #fff5fb;
}

.draft-period-row {
  display: grid;
  grid-template-columns: 190px minmax(150px, 230px) 28px minmax(150px, 230px);
  gap: 14px;
  align-items: center;
  min-height: 50px;
  border-top: 1px solid #efe4ee;
}

.draft-period-row.is-single-period {
  grid-template-columns: minmax(220px, 1fr) 44px minmax(220px, 1fr);
  gap: 20px;
  max-width: 820px;
  border-top: 0;
}

.draft-period-row.is-invalid input {
  border-color: #c94b68;
  background: #fff8fa;
}

.draft-period-row input[type="date"] {
  cursor: pointer;
}

.draft-period-row:first-of-type {
  border-top: 0;
}

.draft-period-row strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-left: 28px;
  font-size: 18px;
}

.draft-period-row i {
  color: #17132b;
  font-style: normal;
  font-weight: 800;
  text-align: center;
}

.draft-period-error {
  padding: 12px 14px;
  border: 1px solid #f2b8c8;
  border-radius: 8px;
  background: #fff5f8;
  color: #9b2445;
  font-weight: 800;
}

.draft-period-row label span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.draft-period-remove {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border: 1px solid #efd8e5;
  border-radius: 999px;
  background: #fff7fb;
  color: #9b2445;
  font-size: 17px;
  font-weight: 850;
  line-height: 1;
}

.draft-period-remove:hover,
.draft-period-remove:focus-visible {
  border-color: #c94b68;
  background: #fff0f5;
}

.draft-chart-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1.05fr);
  gap: 18px;
  align-items: stretch;
}

.draft-client-chart-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  gap: 18px;
  align-items: start;
}

.draft-client-chart-layout .draft-client-donut-card {
  grid-column: 1 / -1;
}

.draft-chart-stack {
  display: grid;
  gap: 18px;
}

.draft-chart-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  min-height: 300px;
  align-content: start;
}

.draft-chart-axis {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  min-height: calc(var(--chart-height, 320px) + 58px);
}

.draft-empty-chart {
  display: grid;
  min-height: 220px;
  place-items: center;
  color: #7d7488;
  border: 1px dashed #ead7e4;
  font-weight: 700;
}

.draft-y-labels {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: var(--chart-height, 320px);
  padding: 0;
  color: #5f5870;
  font-size: 10px;
  line-height: 1;
}

.draft-bars {
  display: grid;
  grid-template-columns: repeat(var(--day-count, 7), minmax(42px, 42px));
  align-items: end;
  gap: clamp(6px, 1.1vw, 12px);
  border-left: 1px solid #e8dfe8;
  border-bottom: 1px solid #e8dfe8;
  min-height: calc(var(--chart-height, 320px) + 52px);
  padding: 0 10px 10px;
  overflow-x: auto;
  background-image:
    repeating-linear-gradient(to bottom, rgba(143, 0, 88, 0.12) 0 1px, transparent 1px calc(var(--chart-height, 320px) / var(--axis-steps, 1))),
    repeating-linear-gradient(to right, rgba(143, 0, 88, 0.08) 0 1px, transparent 1px 42px);
  background-size: auto var(--chart-height, 320px), auto var(--chart-height, 320px);
  background-repeat: repeat-x, repeat-x;
}

.draft-margin-bars {
  display: grid;
  grid-template-columns: repeat(var(--day-count, 7), minmax(56px, 56px));
  align-items: end;
  gap: clamp(6px, 1.1vw, 12px);
  border-left: 1px solid #e8dfe8;
  border-bottom: 1px solid #e8dfe8;
  min-height: calc(var(--chart-height, 260px) + 52px);
  padding: 0 10px 10px;
  overflow-x: auto;
  background-image:
    repeating-linear-gradient(to bottom, rgba(143, 0, 88, 0.12) 0 1px, transparent 1px calc(var(--chart-height, 260px) / var(--axis-steps, 10))),
    repeating-linear-gradient(to right, rgba(143, 0, 88, 0.08) 0 1px, transparent 1px 42px);
  background-size: auto var(--chart-height, 260px), auto var(--chart-height, 260px);
  background-repeat: repeat-x, repeat-x;
}

.draft-margin-day {
  display: grid;
  grid-template-columns: repeat(var(--period-count, 3), clamp(12px, 1.2vw, 18px));
  grid-template-rows: var(--chart-height, 260px) 42px;
  justify-content: center;
  align-items: end;
  gap: clamp(1px, 0.22vw, 3px);
  min-width: 56px;
}

.draft-margin-day i {
  display: block;
  grid-row: 1;
  align-self: end;
  width: clamp(12px, 1.2vw, 18px);
  max-height: var(--chart-height, 260px);
  min-height: 3px;
  border-radius: 5px 5px 0 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.75), 0 8px 16px rgba(143, 0, 88, 0.14);
}

.draft-margin-day i.is-empty {
  min-height: 0;
  box-shadow: none;
}

.draft-margin-day span {
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: end;
  max-width: 100%;
  color: #5f5870;
  font-size: 10px;
  line-height: 1;
  text-align: center;
  transform: rotate(-45deg);
  transform-origin: center top;
  white-space: nowrap;
}

.draft-bar-day {
  display: grid;
  grid-template-columns: repeat(var(--period-count, 3), clamp(6px, 0.72vw, 9px));
  grid-template-rows: var(--chart-height, 320px) 42px;
  justify-content: center;
  align-items: end;
  gap: clamp(1px, 0.22vw, 3px);
  min-width: 42px;
}

.draft-bar-day i {
  display: block;
  grid-row: 1;
  align-self: end;
  width: clamp(6px, 0.72vw, 9px);
  max-height: var(--chart-height, 320px);
  border-radius: 2px 2px 0 0;
}

.draft-bar-day span {
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: end;
  color: #5f5870;
  font-size: 10px;
  line-height: 1;
  transform: rotate(-45deg);
  transform-origin: center top;
  text-align: center;
  white-space: nowrap;
}

.period-1 {
  background: #f08ab7;
}

.period-2 {
  background: #d92772;
}

.period-3 {
  background: #8f0058;
}

.period-4 {
  background: #111111;
}

.period-5 {
  background: #7a7a7a;
}

.period-6 {
  background: #c7c7c7;
}

.period-7 {
  background: #4a4a4a;
}

.draft-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  color: #17132b;
  font-size: 11px;
  line-height: 1.25;
}

.draft-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.draft-legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.draft-line-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.draft-line-svg {
  width: 100%;
  min-height: 420px;
}

.draft-line-svg line {
  stroke: #e8dfe8;
  stroke-width: 1;
}

.draft-line-svg .draft-line-grid {
  stroke: rgba(143, 0, 88, 0.14);
  stroke-dasharray: 4 6;
}

.draft-line-svg .draft-line-grid.is-vertical {
  stroke: rgba(143, 0, 88, 0.1);
}

.draft-line-svg polyline {
  fill: none;
  stroke-width: 3.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.period-1-stroke {
  stroke: #f08ab7;
}

.period-2-stroke {
  stroke: #d92772;
}

.period-3-stroke {
  stroke: #8f0058;
}

.period-4-stroke {
  stroke: #111111;
}

.period-5-stroke {
  stroke: #7a7a7a;
}

.draft-line-svg text {
  fill: #5f5870;
  font-size: 10px;
  text-anchor: middle;
}

.draft-line-svg .draft-line-y {
  fill: #5f5870;
  font-size: 10px;
  text-anchor: start;
}

.draft-line-svg .draft-line-x {
  text-anchor: end;
}

.draft-donut-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  align-content: start;
}

.draft-donut-period-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.draft-donut-period-tabs button {
  display: grid;
  gap: 2px;
  min-height: 44px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: #17132b;
  text-align: left;
}

.draft-donut-period-tabs button.is-active {
  border-color: var(--primary-dark);
  background: #fff3fa;
  color: var(--primary-dark);
}

.draft-donut-period-tabs strong {
  font-size: 13px;
  line-height: 1.1;
}

.draft-donut-period-tabs span {
  color: #8b8498;
  font-size: 11px;
  line-height: 1.1;
}

.draft-donut-mode-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
  border: 1px solid #eadde8;
  border-radius: 10px;
  background: #fbf7fb;
  justify-self: start;
}

.draft-donut-mode-tabs button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  background: transparent;
  color: #4a4052;
  font-size: 14px;
  font-weight: 850;
}

.draft-donut-mode-tabs button.is-active {
  border-color: var(--primary-dark);
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 8px 18px rgba(143, 0, 88, 0.1);
}

.draft-donut-wrap {
  display: grid;
  gap: 18px;
  align-items: start;
  justify-items: center;
  min-height: 510px;
}

.draft-donut {
  width: min(390px, 74vw);
  height: min(390px, 74vw);
  place-self: center;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background: conic-gradient(#e9e1e8 0% 100%);
  position: relative;
}

.draft-donut::before {
  content: "";
  position: absolute;
  inset: 104px;
  border-radius: 50%;
  background: #fff;
}

.draft-donut strong,
.draft-donut span {
  position: relative;
  z-index: 1;
}

.draft-donut strong {
  font-size: 28px;
  line-height: 1.05;
}

.draft-donut span {
  color: #8b8498;
  font-size: 14px;
}

.draft-donut-list {
  display: grid;
  width: 100%;
  max-width: 620px;
  gap: 10px 18px;
  min-width: 0;
}

.draft-donut-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  font-weight: 800;
  min-width: 0;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f1e8f0;
}

.draft-donut-list span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  line-height: 1.25;
  font-size: 13px;
}

.draft-donut-list i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.draft-client-tables {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.draft-table-wrap h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.draft-table-wrap tr.is-no-report td {
  color: #8b8498;
  background: #fbf7fb;
}

.draft-client-period-card table {
  min-width: 980px;
}

.draft-client-period-card th {
  white-space: normal;
  line-height: 1.2;
}

.draft-client-period-extra {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.draft-client-extra-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.draft-client-extra-card h3 {
  margin: 0;
  color: #211827;
  font-size: 20px;
  line-height: 1.2;
}

.draft-client-extra-card p {
  margin: 0;
  color: #8b8498;
  font-size: 14px;
  line-height: 1.35;
}

.draft-client-extra-card table {
  min-width: 980px;
}

.draft-client-extra-card a {
  color: var(--primary-dark);
  font-weight: 850;
  text-decoration: none;
}

.draft-client-extra-card a:hover,
.draft-client-extra-card a:focus-visible {
  text-decoration: underline;
}

.draft-period-section {
  display: grid;
  gap: 14px;
}

.draft-period-card {
  --period-color: var(--primary-dark);
  display: grid;
  gap: 14px;
  padding: 18px;
  border-top: 4px solid var(--period-color);
}

.draft-period-card header h3 {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: baseline;
  margin: 0 0 8px;
  color: var(--period-color);
  font-size: 24px;
}

.draft-period-card header h3 span {
  color: #8b8498;
  font-size: 15px;
}

.draft-period-card header p {
  margin: 0;
  color: #8b8498;
}

.draft-metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.draft-metric-row div {
  min-height: 74px;
  padding: 10px 12px;
  border: 1px solid #eee5ee;
  border-radius: 8px;
}

.draft-metric-row span {
  display: block;
  color: #8b8498;
  font-size: 13px;
  font-weight: 800;
}

.draft-metric-row strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.draft-metric-row small {
  display: block;
  margin-top: 3px;
  color: #9b93a4;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
}

.draft-revenue-hint {
  display: inline-grid;
  gap: 1px;
  margin-top: 5px;
  color: #aaa2b3;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.draft-revenue-hint b {
  color: #9b93a4;
  font-size: 12px;
  font-weight: 800;
}

.draft-revenue-hint span {
  color: #b4acbc;
  font-weight: 700;
}

.draft-period-total-row {
  background: #fff3f9;
  box-shadow: inset 4px 0 0 var(--period-color);
}

.draft-period-total-row td {
  border-top: 1px solid rgba(151, 0, 97, 0.18);
  border-bottom: 1px solid rgba(151, 0, 97, 0.18);
  color: #17132b;
  font-weight: 900;
}

.draft-period-total-row td:first-child {
  color: var(--period-color);
  font-size: 15px;
}

.draft-period-total-row strong {
  font-weight: 950;
}

.draft-online-revenue {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
}

.draft-online-revenue strong {
  font-weight: 900;
}

.draft-online-revenue small {
  color: #aaa2b3;
  font-size: 11px;
  font-weight: 750;
}

.draft-writeoffs-percent-cell {
  min-width: 190px;
}

.draft-writeoffs-percent-cell strong {
  display: block;
}

.draft-writeoffs-products {
  display: grid;
  gap: 14px;
}

.draft-writeoffs-products-head {
  display: grid;
  gap: 6px;
}

.draft-writeoffs-products-head h2 {
  margin: 0;
  color: #211827;
  font-size: 22px;
}

.draft-writeoffs-products-head p {
  max-width: 920px;
  margin: 0;
  color: #8b8498;
  line-height: 1.45;
}

.draft-writeoffs-strip-shell {
  position: relative;
  min-width: 0;
}

.draft-writeoffs-strip-shell.has-scroll::after {
  content: "";
  pointer-events: none;
  position: absolute;
  top: 38px;
  right: 0;
  bottom: 18px;
  width: 72px;
  border-radius: 0 8px 8px 0;
  background: linear-gradient(90deg, rgba(255, 251, 255, 0), rgba(255, 251, 255, 0.96));
}

.draft-writeoffs-scroll-cue {
  justify-self: end;
  width: fit-content;
  margin: 0 8px 8px auto;
  padding: 7px 11px;
  border: 1px solid #eaddea;
  border-radius: 999px;
  background: #fff;
  color: #8b8498;
  font-size: 12px;
  font-weight: 850;
}

.draft-writeoffs-period-strip {
  display: flex;
  gap: 12px;
  max-width: 100%;
  overflow-x: auto;
  padding: 2px 72px 12px 2px;
  scroll-snap-type: x proximity;
  scrollbar-color: #8f0058 #f4edf4;
  scrollbar-width: thin;
}

.draft-writeoffs-sticky-periods {
  position: sticky;
  top: 0;
  z-index: 8;
  max-width: 100%;
  overflow: hidden;
  padding: 2px 72px 8px 2px;
  background: linear-gradient(180deg, rgba(255, 251, 255, 0.98), rgba(255, 251, 255, 0.92));
  backdrop-filter: blur(8px);
}

.draft-writeoffs-sticky-track {
  display: flex;
  gap: 12px;
  width: max-content;
  will-change: transform;
}

.draft-writeoffs-sticky-card {
  flex: 0 0 clamp(420px, 28vw, 480px);
  padding: 9px 12px;
  border: 1px solid #eee5ee;
  border-top: 4px solid var(--period-color);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 8px 18px rgba(33, 24, 39, 0.07);
}

.draft-writeoffs-sticky-card strong {
  color: var(--period-color);
  font-size: 18px;
  line-height: 1.15;
}

.draft-writeoffs-sticky-card span {
  margin-left: 8px;
  color: #8b8498;
  font-size: 13px;
  font-weight: 850;
}

.draft-writeoffs-period-strip::-webkit-scrollbar {
  height: 10px;
}

.draft-writeoffs-period-strip::-webkit-scrollbar-track {
  border-radius: 999px;
  background: #f4edf4;
}

.draft-writeoffs-period-strip::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #8f0058;
}

.draft-writeoffs-product-period {
  display: grid;
  gap: 10px;
  flex: 0 0 clamp(420px, 28vw, 480px);
  padding: 12px;
  border: 1px solid #eee5ee;
  border-top: 4px solid var(--period-color);
  border-radius: 8px;
  background: #fff;
  scroll-snap-align: start;
}

.draft-writeoffs-product-card {
  display: grid;
  gap: 8px;
  grid-template-rows: 128px auto;
  padding: 10px;
  border: 1px solid #f0e6ef;
  border-radius: 8px;
  background: #fff;
}

.draft-writeoffs-product-card header {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: 24px 84px;
  gap: 8px;
  align-items: center;
  min-height: 116px;
}

.draft-writeoffs-product-card h3 {
  grid-column: 1 / -1;
  margin: 0;
  min-height: 24px;
  overflow: hidden;
  color: #211827;
  font-size: 16px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-writeoffs-product-card header div {
  display: grid;
  gap: 2px;
  align-content: start;
  height: 84px;
  padding: 7px 8px;
  border: 1px solid #eee5ee;
  border-radius: 8px;
}

.draft-writeoffs-product-card header span,
.draft-writeoffs-product-card header small {
  color: #8b8498;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
}

.draft-writeoffs-product-card header strong {
  color: #211827;
  font-size: 16px;
  line-height: 1.15;
}

.draft-writeoffs-product-card header strong em {
  color: #8f0058;
  font-style: normal;
  font-weight: 850;
}

.draft-writeoffs-product-card table {
  min-width: 720px;
}

.draft-writeoffs-store-products {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.is-up {
  color: #12865a !important;
}

.is-down {
  color: #c94b68 !important;
}

.is-muted {
  color: #aaa2b3 !important;
}

.draft-table-wrap {
  overflow: auto;
  border: 1px solid #eee5ee;
  border-radius: 8px;
}

.draft-table-wrap table {
  min-width: 1080px;
  border: 0;
}

.draft-table-wrap th,
.draft-table-wrap td {
  padding: 10px 12px;
}

.draft-table-wrap td small {
  display: block;
  margin-top: 2px;
  color: #9b93a4;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
}

.draft-table-wrap th:first-child,
.draft-table-wrap td:first-child {
  min-width: 260px;
}

.draft-writeoffs-product-card .draft-table-wrap {
  overflow-x: hidden;
}

.draft-writeoffs-product-card .draft-table-wrap table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.draft-writeoffs-product-card .draft-table-wrap thead tr {
  height: 44px;
}

.draft-writeoffs-product-card .draft-table-wrap tbody tr {
  height: 42px;
}

.draft-writeoffs-product-card .draft-table-wrap th,
.draft-writeoffs-product-card .draft-table-wrap td {
  padding: 7px 8px;
  font-size: 12px;
  line-height: 1.2;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.draft-writeoffs-product-card .draft-table-wrap td:first-child strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-writeoffs-product-card .draft-table-wrap th:first-child,
.draft-writeoffs-product-card .draft-table-wrap td:first-child {
  width: 46%;
  min-width: 0;
}

.draft-writeoffs-product-card .draft-table-wrap th:nth-child(2),
.draft-writeoffs-product-card .draft-table-wrap td:nth-child(2) {
  width: 24%;
}

.draft-writeoffs-product-card .draft-table-wrap th:nth-child(3),
.draft-writeoffs-product-card .draft-table-wrap td:nth-child(3) {
  width: 30%;
}

.draft-export {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(520px, auto);
  gap: 24px;
  align-items: center;
  padding: 20px 22px;
}

.draft-export > div:first-child {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 4px 14px;
  align-items: center;
}

.draft-export > div:first-child::before {
  content: "";
  grid-row: 1 / 3;
  width: 38px;
  height: 44px;
  border: 3px solid #12865a;
  border-radius: 4px;
  background:
    linear-gradient(135deg, transparent 0 52%, rgba(18, 134, 90, 0.18) 53% 100%) right top / 14px 14px no-repeat,
    #f2fff8;
}

.draft-export strong {
  font-size: 20px;
  line-height: 1.2;
}

.draft-export-actions {
  display: flex;
  gap: 14px;
  align-items: stretch;
  justify-content: flex-end;
}

.draft-export-actions button {
  min-width: 230px;
  min-height: 54px;
  height: 54px;
  font-size: 18px;
  font-weight: 800;
}

.draft-export-actions .is-telegram {
  min-width: 290px;
  background: #12865a;
}

.draft-export-actions div {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.draft-export-actions span {
  color: #8b8498;
  font-size: 13px;
  line-height: 1.3;
}

.draft-export-status {
  grid-column: 1 / -1;
  margin: 0;
  color: #12865a;
  font-size: 14px;
  font-weight: 800;
}

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

.employee-tabs {
  display: inline-flex;
  width: fit-content;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbf8fb;
}

.employee-tabs button {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 7px;
  background: transparent;
  color: #8b8498;
  font-weight: 850;
}

.employee-tabs button.is-active {
  background: var(--primary-dark);
  color: #fff;
}

.employee-access-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.employee-access-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.employee-access-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.employee-access-head p,
.employee-access-note {
  margin: 6px 0 0;
  color: var(--muted);
}

.employee-access-head span {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid rgba(151, 0, 97, 0.14);
  border-radius: 999px;
  background: #fff3f9;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 850;
}

.employee-sync-message {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(151, 0, 97, 0.14);
  border-radius: 8px;
  background: #fff3f9;
  color: var(--muted);
  font-weight: 800;
}

.employee-sync-message.is-success {
  border-color: rgba(22, 128, 88, 0.22);
  background: #f2fbf6;
  color: #168058;
}

.employee-sync-message.is-error {
  border-color: rgba(169, 38, 38, 0.24);
  background: #fff1f1;
  color: #a92626;
}

.employee-access-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.employee-access-controls label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.employee-access-controls label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.employee-access-controls select,
.employee-access-controls input {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 750;
}

.employee-access-controls select {
  cursor: pointer;
}

.employee-access-controls input {
  cursor: text;
}

.employee-access-search-note {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.employee-save-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid #e7f1eb;
  border-radius: 8px;
  background: #f8fffb;
}

.employee-save-panel div {
  display: grid;
  gap: 4px;
}

.employee-save-panel strong {
  font-size: 15px;
}

.employee-save-panel span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.employee-save-panel button {
  min-height: 42px;
  background: #12865a;
  white-space: nowrap;
}

.employee-save-panel button:hover:not(:disabled),
.employee-save-panel button:focus-visible:not(:disabled) {
  background: #0f744e;
}

.employee-save-panel.is-error {
  border-color: #ffc7bc;
  background: #fff8f6;
}

.employee-save-panel.is-error button {
  background: var(--primary-dark);
}

.employee-save-panel.is-success {
  border-color: #cce9d8;
}

.employee-save-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 220px;
}

.employee-save-meta span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.employee-save-meta button {
  min-height: 42px;
  padding: 0 22px;
  background: #12865a;
  white-space: nowrap;
}

.employee-save-meta button:hover:not(:disabled),
.employee-save-meta button:focus-visible:not(:disabled) {
  background: #0f744e;
}

.employee-save-meta.is-error span {
  color: var(--danger);
}

.employee-save-meta.is-error button {
  background: var(--primary-dark);
}

.employee-save-meta.is-success span {
  color: #12865a;
}

.employee-access-table-wrap {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.employee-permission-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.employee-permission-table {
  width: 100%;
  min-width: 640px;
}

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

.employee-permission-table th {
  color: #8b8498;
  font-size: 12px;
  text-transform: none;
}

.employee-permission-table strong {
  display: block;
  font-size: 15px;
}

.employee-permission-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.employee-permission-table td > span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.employee-permission-section-row {
  background: #fffafd;
}

.employee-permission-section-row td {
  padding-top: 16px;
  padding-bottom: 16px;
}

.employee-permission-section-row td:first-child {
  width: 70%;
}

.employee-permission-accordion {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.employee-permission-accordion:hover,
.employee-permission-accordion:focus-visible {
  color: var(--primary-dark);
}

.employee-permission-chevron {
  display: inline-grid;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(151, 0, 97, 0.18);
  border-radius: 999px;
  background: #fff;
  color: var(--primary-dark);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.employee-permission-child-row td:first-child {
  padding-left: 28px;
  color: var(--text);
  font-weight: 800;
}

.employee-permission-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  color: var(--text);
  font-weight: 800;
}

.employee-permission-toggle input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--primary-dark);
}

.employee-permission-toggle span {
  color: inherit;
  font-size: 13px;
}

.employee-permission-toggle.is-partial span {
  color: #8b8498;
}

.employee-granted-access {
  display: grid;
  gap: 12px;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid rgba(151, 0, 97, 0.12);
}

.employee-granted-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.employee-granted-table {
  width: 100%;
  min-width: 860px;
}

.employee-granted-table th,
.employee-granted-table td {
  vertical-align: top;
}

.employee-granted-table th {
  color: #8b8498;
  font-size: 12px;
  text-transform: none;
}

.employee-granted-table strong {
  font-size: 15px;
}

.employee-granted-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.employee-granted-tags span {
  padding: 5px 9px;
  border: 1px solid rgba(151, 0, 97, 0.14);
  border-radius: 999px;
  background: #fff5fa;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 850;
}

.employee-granted-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.employee-granted-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.employee-granted-edit {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(151, 0, 97, 0.18);
  background: #fff;
  color: var(--primary-dark);
  font-size: 13px;
}

.employee-granted-edit:hover,
.employee-granted-edit:focus-visible {
  background: #fff5fa;
}

.employee-granted-clear {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #ffc7bc;
  border-radius: 8px;
  background: #fff8f6;
  color: var(--danger);
  font-size: 22px;
  line-height: 1;
}

.employee-granted-clear:hover,
.employee-granted-clear:focus-visible {
  background: #ffece7;
}

.employee-access-table {
  width: 100%;
  min-width: 1870px;
  table-layout: fixed;
}

.employee-access-table th,
.employee-access-table td {
  vertical-align: middle;
  padding: 12px 10px;
  overflow-wrap: anywhere;
}

.employee-access-table th {
  color: #8b8498;
  font-size: 12px;
  line-height: 1.25;
  text-transform: none;
}

.employee-access-table th:nth-child(1) { width: 230px; }
.employee-access-table th:nth-child(2) { width: 205px; }
.employee-access-table th:nth-child(3) { width: 230px; }
.employee-access-table th:nth-child(4) { width: 210px; }
.employee-access-table th:nth-child(5) { width: 135px; }
.employee-access-table th:nth-child(6) { width: 300px; }
.employee-access-table th:nth-child(7) { width: 165px; }
.employee-access-table th:nth-child(8) { width: 175px; }
.employee-access-table th:nth-child(9) { width: 90px; }
.employee-access-table th:nth-child(10) { width: 130px; }

.employee-table-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.employee-sort-button {
  display: inline-grid;
  width: 26px;
  min-width: 26px;
  min-height: 26px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(151, 0, 97, 0.16);
  border-radius: 7px;
  background: #fff;
  color: #8b8498;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.employee-sort-button:hover,
.employee-sort-button:focus-visible,
.employee-sort-button.is-active {
  border-color: rgba(151, 0, 97, 0.32);
  background: #fff3f9;
  color: var(--primary-dark);
}

.employee-access-table strong {
  font-size: 15px;
}

.employee-access-table tr.is-archived td {
  background: #fbfafb;
  color: #77717d;
}

.employee-telegram-status {
  display: grid;
  gap: 3px;
  min-width: 145px;
  border-left: 3px solid #1f9ad7;
  padding-left: 9px;
}

.employee-telegram-status strong {
  overflow-wrap: anywhere;
  color: #157caf;
}

.employee-telegram-status small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.employee-telegram-status.is-empty {
  border-left-color: #c8c1c6;
}

.employee-telegram-status.is-empty strong {
  color: #827881;
}

.employee-telegram-status.is-blocked,
.employee-telegram-status.is-delivery_error {
  border-left-color: #c44736;
}

.employee-telegram-status.is-blocked strong,
.employee-telegram-status.is-delivery_error strong {
  color: #a63426;
}

.employee-activity-cell {
  min-width: 205px;
}

.employee-activity-cell > strong,
.employee-activity-cell > span {
  display: block;
}

.employee-archive-action {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #f1b7ab;
  border-radius: 8px;
  background: #fff8f6;
  color: #a63426;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.employee-archive-action.is-restore {
  border-color: rgba(18, 134, 90, 0.25);
  background: #f1fbf7;
  color: #12865a;
}

.employee-archive-action:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.employee-archive-readonly {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.employee-activity-cell > span {
  margin-top: 4px;
  color: #9a5b27;
  font-size: 12px;
  font-weight: 850;
}

.employee-access-table select,
.employee-money-input input,
.employee-percent-input input,
.employee-pin-input input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 750;
}

.employee-access-table select {
  min-width: 0;
  padding: 0 12px;
  cursor: pointer;
}

.employee-money-input,
.employee-percent-input,
.employee-pin-input {
  position: relative;
  display: block;
  max-width: 190px;
}

.employee-field-with-status,
.employee-access-selected-name,
.regulation-title-with-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.employee-field-with-status {
  width: 100%;
}

.employee-field-with-status > label,
.employee-field-with-status > select {
  flex: 1 1 auto;
}

.pending-approval-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  border: 1px solid rgba(151, 0, 97, 0.28);
  border-radius: 999px;
  background: #fff3f9;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
}

.pending-approval-floating-tooltip {
  position: fixed;
  max-width: min(320px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
  box-shadow: 0 14px 32px rgba(26, 21, 38, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 1000;
}

.pending-approval-floating-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.employee-pin-cell {
  display: grid;
  grid-template-columns: minmax(78px, max-content) minmax(128px, 176px);
  align-items: center;
  gap: 8px;
}

.employee-pin-preview {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(151, 0, 97, 0.18);
  border-radius: 8px;
  background: #fff3f9;
  color: var(--primary-dark);
  font: inherit;
  font-weight: 850;
  letter-spacing: 0.08em;
  cursor: copy;
}

.employee-pin-preview .pin-secret {
  display: none;
}

.employee-pin-preview:hover,
.employee-pin-preview:focus-visible {
  border-color: rgba(151, 0, 97, 0.42);
  background: #fff;
}

.employee-pin-preview:hover .pin-mask,
.employee-pin-preview:focus-visible .pin-mask {
  display: none;
}

.employee-pin-preview:hover .pin-secret,
.employee-pin-preview:focus-visible .pin-secret {
  display: inline;
}

.employee-pin-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.approval-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.approval-rule-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.approval-rule-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.approval-rule-card span {
  display: grid;
  gap: 4px;
}

.approval-rule-card strong {
  color: var(--text);
  font-size: 14px;
}

.approval-rule-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.approval-requests-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.approval-request-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(240px, 1.2fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.approval-request-card:hover,
.approval-request-card:focus-visible {
  border-color: rgba(151, 0, 97, 0.34);
  box-shadow: 0 8px 24px rgba(57, 19, 48, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.approval-request-card.is-closed {
  opacity: 0.72;
}

.approval-request-card > div:first-child {
  display: grid;
  gap: 4px;
}

.approval-request-card strong {
  color: var(--text);
  font-size: 14px;
}

.approval-request-card span,
.approval-request-card small {
  color: var(--muted);
  font-size: 12px;
}

.approval-change-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--text);
  font-weight: 750;
}

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

.approval-actions button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 850;
}

.approval-actions button.secondary {
  border-color: var(--border);
  background: #fff;
  color: var(--primary-dark);
}

.approval-detail-modal {
  width: min(1180px, calc(100vw - 32px));
  max-height: min(880px, calc(100dvh - 32px));
  overflow: auto;
}

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

.approval-detail-head h2 {
  margin: 2px 0 6px;
}

.approval-detail-head p,
.approval-detail-footer > span {
  margin: 0;
  color: var(--muted);
}

.approval-detail-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.approval-detail-meta > div {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffafd;
}

.approval-detail-meta span,
.approval-value-card header small,
.approval-single-value span,
.approval-single-value small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.approval-before-after {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.approval-value-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.approval-value-card.is-old {
  border-color: #e3dbe6;
}

.approval-value-card.is-new {
  border-color: #bfe4d3;
  background: #fbfffd;
}

.approval-value-card > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: #f7f3f7;
}

.approval-value-card.is-new > header {
  background: #eef9f4;
}

.approval-value-card > header span {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.approval-value-content {
  max-height: 480px;
  overflow: auto;
  padding: 16px;
}

.approval-regulation-detail {
  display: grid;
  gap: 14px;
}

.approval-regulation-detail h4 {
  margin: 0;
  font-size: 20px;
}

.approval-regulation-paragraph {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.approval-regulation-paragraph span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.approval-regulation-paragraph p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.approval-permissions-detail,
.approval-detail-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.approval-detail-fields {
  display: grid;
  gap: 8px;
  margin: 0;
}

.approval-detail-fields > div {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1.3fr);
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.approval-detail-fields dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.approval-detail-fields dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 750;
}

.approval-single-value,
.approval-empty-detail {
  display: grid;
  gap: 8px;
  align-content: start;
}

.approval-single-value strong,
.approval-empty-detail strong {
  font-size: 22px;
}

.approval-empty-detail span,
.approval-empty-value,
.approval-sensitive-value {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.approval-detail-footer {
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.regulation-delete-modal h2 {
  margin: 4px 0 8px;
}

.regulation-delete-modal .panel-note.is-error {
  color: var(--danger);
}

.employee-pin-input {
  display: grid;
  gap: 4px;
  max-width: 128px;
}

.employee-money-input input,
.employee-percent-input input {
  padding: 0 36px 0 12px;
}

.employee-pin-input input {
  padding: 0 12px;
  letter-spacing: 0.08em;
}

.employee-money-input span,
.employee-percent-input span {
  position: absolute;
  top: 50%;
  right: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
  transform: translateY(-50%);
}

@media (max-width: 1240px) {
  .draft-creator-results {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
  }

  .draft-chart-layout,
  .draft-client-chart-layout,
  .draft-export {
    grid-template-columns: 1fr;
  }

  .draft-load-row {
    grid-template-columns: 1fr;
  }

  .draft-load-statistics {
    width: 100%;
  }

  .draft-donut-wrap {
    min-height: auto;
  }

  .draft-export-actions {
    justify-content: start;
  }

  .draft-client-chart-layout .draft-client-donut-card {
    grid-column: auto;
  }

  .draft-writeoffs-store-products,
  .draft-writeoffs-product-card header {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .draft-creator-select > div.draft-creator-menu {
    width: min(560px, calc(100vw - 32px));
  }

  .draft-creator-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .draft-head,
  .draft-period-row,
  .draft-donut-wrap,
  .draft-client-tables,
  .draft-export-actions {
    grid-template-columns: 1fr;
  }

  .draft-head {
    display: grid;
  }

  .employee-access-head {
    display: grid;
  }

  .approval-request-card,
  .approval-before-after,
  .approval-detail-meta {
    grid-template-columns: 1fr;
  }

  .approval-detail-head,
  .approval-detail-footer {
    display: grid;
  }

  .approval-detail-footer .approval-actions,
  .approval-detail-footer .approval-actions button {
    width: 100%;
  }

  .approval-value-content {
    max-height: none;
  }

  .employee-save-panel {
    grid-template-columns: 1fr;
  }

  .employee-save-panel button {
    width: 100%;
  }

  .employee-save-meta {
    width: 100%;
    min-width: 0;
    justify-content: stretch;
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .employee-save-meta button {
    width: 100%;
  }

  .employee-tabs {
    width: 100%;
  }

  .employee-tabs button {
    flex: 1 1 0;
  }

  .employee-access-controls {
    grid-template-columns: 1fr;
  }

  .employee-access-search-note {
    margin-bottom: 0;
  }

  .draft-selector-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .draft-creator-scenarios {
    white-space: normal;
  }

  .draft-period-row {
    display: grid;
    gap: 8px;
    padding: 12px 0;
  }

  .draft-period-row strong {
    padding-left: 0;
  }

  .draft-chart-axis {
    grid-template-columns: 66px minmax(360px, 1fr);
    overflow-x: auto;
  }

  .draft-bars {
    min-width: 360px;
  }

  .draft-donut {
    width: 220px;
    height: 220px;
  }

  .draft-metric-row {
    grid-template-columns: 1fr;
  }

  .draft-export-actions {
    display: grid;
  }

  .draft-export-actions button,
  .draft-export-actions .is-telegram {
    width: 100%;
    min-width: 0;
  }
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: #fff;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: none;
}

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

.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(120px, 2fr) minmax(90px, auto);
  gap: 10px;
  align-items: center;
}

.bar-row div {
  height: 9px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--finance);
}

.settings-form,
.mask-list {
  display: grid;
  gap: 12px;
}

.access-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.34fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.access-role-list,
.access-editor {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.access-section-title h2,
.access-editor-head h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.access-section-title p,
.access-editor-head p {
  margin: 0;
  color: #66758a;
  line-height: 1.45;
}

.access-role-card {
  min-height: 104px;
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.access-role-card.is-active {
  border-color: rgba(14, 112, 77, 0.38);
  background: rgba(14, 112, 77, 0.1);
}

.access-role-card strong {
  font-size: 18px;
}

.access-role-card span {
  color: #66758a;
  line-height: 1.45;
}

.access-role-card em {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(14, 112, 77, 0.14);
  color: var(--success);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

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

.access-editor-head button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
}

.role-fields {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(160px, 0.8fr) minmax(220px, 1.4fr);
  gap: 12px;
}

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

.permission-column {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 360px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfd;
}

.permission-column h3 {
  margin: 0;
  color: #95a0b3;
  font-size: 13px;
  letter-spacing: 0;
}

.permission-card {
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 82px;
  padding: 14px;
  border: 1px solid rgba(231, 220, 229, 0.7);
  border-radius: 8px;
  background: #fff;
}

.permission-card input,
.access-enabled input {
  width: 18px;
  min-height: 18px;
  margin: 2px 0 0;
  accent-color: var(--primary);
}

.permission-card span {
  display: grid;
  gap: 6px;
}

.permission-card small {
  color: #718199;
  line-height: 1.4;
}

.permission-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.permission-actions span {
  color: var(--muted);
}

.access-users-panel {
  display: grid;
  gap: 18px;
}

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

.access-user-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(160px, 1fr) minmax(150px, 0.9fr) minmax(130px, 0.8fr) minmax(108px, auto);
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.access-enabled {
  min-height: 40px;
  grid-template-columns: 18px auto;
  gap: 8px;
  align-items: center;
  align-content: end;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.role-settings-grid {
  display: grid;
  grid-template-columns: minmax(126px, 1.2fr) repeat(7, minmax(92px, 1fr));
  gap: 1px;
  margin: 14px 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--border);
}

.role-settings-grid > :nth-child(8n + 1) {
  position: sticky;
  left: 0;
  z-index: 1;
  box-shadow: 1px 0 0 var(--border);
}

.role-settings-head,
.role-settings-role,
.toggle-cell {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 10px;
  background: #fff;
}

.role-settings-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.role-settings-role {
  font-weight: 700;
}

.toggle-cell {
  justify-content: center;
}

.toggle-cell input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--primary);
}

.mask-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.toast {
  margin: 16px 24px 0;
  padding: 12px 14px;
  border: 1px solid rgba(14, 112, 77, 0.22);
  border-radius: 8px;
  background: rgba(14, 112, 77, 0.08);
  color: var(--success);
  font-weight: 700;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.toast a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--success);
  color: #fff;
  text-decoration: none;
}

.draft-payroll-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.draft-payroll-summary article,
.draft-payroll-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.draft-payroll-summary article {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 18px;
}

.draft-payroll-summary span,
.draft-payroll-summary small,
.draft-payroll-card p {
  color: var(--muted);
  font-weight: 700;
}

.draft-payroll-summary strong {
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.draft-payroll-card {
  margin: 18px 0;
  padding: 20px;
}

.draft-payroll-card h2 {
  margin: 0 0 8px;
}

.draft-payroll-card p {
  margin: 0 0 16px;
}

.draft-payroll-card .draft-table-wrap {
  max-width: 100%;
  overflow: auto;
}

.draft-payroll-card table {
  min-width: 1280px;
}

.draft-payroll-card td.is-reconciled {
  background: #eefbf5;
}

.draft-payroll-card td.is-reconciled strong {
  color: #0f8f5f;
}

.payroll-bank-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.payroll-bank-status.is-reconciled {
  background: #d7f7e8;
  color: #0b7d53;
}

.payroll-bank-status.is-pending {
  background: #f4edf3;
  color: var(--muted);
}

.payroll-adjustment-input,
.payroll-comment-input {
  width: 120px;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  background: #fff;
}

.payroll-comment-input {
  width: 220px;
}

.settings-page {
  display: grid;
  gap: 18px;
}

.settings-payroll-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 24px;
}

.settings-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.settings-section-head h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.settings-section-head p,
.payroll-penalty-card small,
.settings-save-row span {
  color: var(--muted);
  font-weight: 700;
}

.settings-add-rule {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 16px;
  background: #fff;
  color: var(--accent);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.payroll-penalty-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.payroll-penalty-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  background: #fffafd;
}

.payroll-penalty-card strong {
  color: var(--accent);
  font-size: 20px;
}

.payroll-penalty-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.payroll-penalty-card-head button {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.payroll-penalty-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.payroll-penalty-card input {
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  font: inherit;
  font-weight: 900;
  background: #fff;
}

.settings-save-row {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.settings-save-row button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 0 22px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.settings-save-row span.is-success {
  color: #0b7d53;
}

.settings-save-row span.is-error {
  color: #b33a2f;
}

.update-log-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.update-log-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.update-log-table th,
.update-log-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.update-log-table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.update-log-table tr:last-child td {
  border-bottom: 0;
}

.update-log-table td strong,
.update-log-table td small {
  display: block;
}

.update-log-table td small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}

.update-log-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  background: #fffafd;
  font-weight: 900;
  white-space: nowrap;
}

.update-log-status.is-success {
  border-color: #bbebd6;
  color: #0b7d53;
  background: #f0fbf5;
}

.update-log-status.is-partial {
  border-color: #f1d6a1;
  color: #8a6100;
  background: #fff8e8;
}

.update-log-status.is-error {
  border-color: #ffc4c1;
  color: #b33a2f;
  background: #fff1f0;
}

.update-log-status.is-running,
.update-log-status.is-queued {
  border-color: #f1d6a1;
  color: #8a6100;
  background: #fff8e8;
}

.update-log-status.is-skipped {
  border-color: #ddd6e3;
  color: var(--muted);
  background: #f7f2f7;
}

.force-refresh-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr)) auto;
  gap: 14px;
  align-items: end;
}

.force-refresh-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.force-refresh-form input {
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 900;
}

.force-refresh-form button {
  min-height: 46px;
  white-space: nowrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(31, 23, 32, 0.38);
}

.confirm-modal {
  width: min(560px, 100%);
  display: grid;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.confirm-modal h2 {
  margin: 0 0 8px;
  font-size: 26px;
}

.confirm-modal p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.confirm-check {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--text);
  font-weight: 800;
}

.confirm-check input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--primary-dark);
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.button-secondary {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--primary-dark);
}

.button-secondary.danger {
  border-color: rgba(169, 38, 38, 0.28);
  color: #a92626;
}

.button-link.is-disabled {
  pointer-events: none;
  opacity: 0.5;
}

.regulations-head {
  align-items: start;
}

.regulation-test-banner,
.learning-progress-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 18px;
  padding: 22px 26px;
  border: 1px solid rgba(151, 0, 97, 0.18);
  border-radius: 8px;
  background: #fff3f9;
  color: var(--primary-dark);
  text-decoration: none;
}

.regulation-test-banner strong {
  font-size: 30px;
  line-height: 1;
}

.regulation-test-banner span,
.learning-progress-band span {
  color: var(--muted);
  font-weight: 850;
}

.learning-progress-band strong {
  font-size: 24px;
}

.tests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.test-card,
.test-runner,
.test-editor,
.profile-card,
.test-attempt-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.test-card {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.test-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.test-card h2,
.profile-card h2,
.test-editor h2 {
  margin: 0;
}

.test-card p,
.profile-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.test-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.test-meta div {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.test-meta dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.test-meta dd {
  margin: 4px 0 0;
  font-weight: 900;
}

.test-warning,
.profile-warning {
  border: 1px solid rgba(169, 38, 38, 0.24);
  border-radius: 8px;
  background: #fff1f1;
  color: #a92626;
}

.test-warning {
  padding: 10px 12px;
}

.test-success {
  color: #168058;
  font-weight: 850;
}

.test-runner,
.test-editor,
.profile-card {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.test-runner {
  counter-reset: test-question;
  align-content: start;
}

.test-question {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  counter-increment: test-question;
}

.test-block-progress {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid rgba(151, 0, 97, 0.16);
  border-radius: 8px;
  background: #fff3f9;
}

.test-block-progress span,
.test-block-progress p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.test-block-progress strong {
  font-size: 22px;
}

.test-block-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.test-block-tabs button {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--primary-dark);
}

.test-block-tabs button.is-active {
  background: var(--primary-dark);
  color: #fff;
}

.required-mark {
  color: #a92626;
}

.test-question:last-child {
  border-bottom: 1px solid var(--border);
}

.test-question h3 {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
}

.test-question h3::before {
  flex: 0 0 100%;
  content: "Вопрос " counter(test-question);
  margin-bottom: 2px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.test-options {
  display: grid;
  gap: 14px;
}

.test-options label,
.test-editor-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.test-options label {
  min-height: 74px;
  padding: 17px 20px;
  line-height: 1.65;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.test-options label > .test-formatted-text {
  max-width: 108ch;
  color: #30272e;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.005em;
}

.test-options label:hover {
  border-color: rgba(151, 0, 97, 0.34);
  background: #fffafe;
}

.test-options label:has(input:checked) {
  border-color: rgba(151, 0, 97, 0.48);
  background: #fff3f9;
  box-shadow: 0 0 0 1px rgba(151, 0, 97, 0.08);
}

.test-options input[type="radio"],
.test-options input[type="checkbox"],
.test-editor-option input[type="checkbox"] {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  accent-color: var(--primary-dark);
}

.test-formatted-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.test-formatted-text.is-multiline {
  display: grid;
  gap: 7px;
  width: 100%;
}

.test-text-line {
  display: block;
}

.test-formatted-text.is-multiline .test-text-line + .test-text-line {
  padding-top: 7px;
  border-top: 1px dashed rgba(116, 96, 109, 0.18);
}

.test-options .test-formatted-text.is-multiline {
  gap: 9px;
}

.test-options .test-formatted-text.is-multiline .test-text-line + .test-text-line {
  padding-top: 0;
  border-top: 0;
}

@media (max-width: 640px) {
  .test-runner {
    gap: 12px;
    padding: 12px;
  }

  .test-question {
    gap: 12px;
    padding: 14px;
  }

  .test-question h3 {
    font-size: 17px;
  }

  .test-options label {
    min-height: 64px;
    padding: 14px;
  }

  .test-options label > .test-formatted-text {
    font-size: 16px;
    line-height: 1.55;
  }
}

.test-editor-questions {
  display: grid;
  gap: 14px;
}

.test-editor-question {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.test-editor-block {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(151, 0, 97, 0.18);
  border-radius: 8px;
  background: #fffafe;
}

.test-editor-block-questions {
  display: grid;
  gap: 12px;
}

.test-editor-question-head,
.test-attempt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.test-editor-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, 180px);
  gap: 12px;
}

.test-editor-options {
  display: grid;
  gap: 8px;
}

.test-editor-option input[type="text"] {
  flex: 1 1 auto;
}

.test-editor-required {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 850;
}

.test-stats-modal {
  width: min(1180px, calc(100vw - 32px));
  height: min(900px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
  grid-template-rows: auto auto auto minmax(0, 1fr);
  overflow: hidden;
}

.regulation-stats-filters.test-stats-filters {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.test-stats-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.test-stats-summary div {
  display: grid;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
}

.test-stats-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.test-stats-summary strong {
  color: var(--primary-dark);
  font-size: 22px;
}

.test-stats-content {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.test-attempts-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  max-height: none;
}

.test-attempt-row {
  padding: 14px;
}

.test-attempt-row details {
  margin-top: 10px;
}

.test-attempt-head > div {
  display: grid;
  gap: 3px;
}

.test-attempt-head small {
  color: var(--muted);
  font-weight: 750;
}

.test-attempt-head b {
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
}

.test-attempt-head b.is-passed,
.test-attempt-row small.is-correct {
  color: #168058;
  background: #eaf9f3;
}

.test-attempt-head b.is-failed,
.test-attempt-row small.is-incorrect {
  color: #a92626;
  background: #fff1f1;
}

.test-attempt-row small.is-correct,
.test-attempt-row small.is-incorrect {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 8px;
  font-weight: 850;
}

.test-attempt-row li {
  margin: 10px 0;
}

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

.profile-motivation-card {
  grid-column: 1 / -1;
  order: 1;
  gap: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 0%, rgba(210, 20, 132, 0.12), transparent 34%),
    #fff;
}

.profile-achievements-card {
  grid-column: 1 / -1;
  order: 2;
  gap: 24px;
  overflow: visible;
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 190, 45, 0.12), transparent 24%),
    radial-gradient(circle at 92% 16%, rgba(210, 20, 132, 0.09), transparent 28%),
    #fff;
}

.profile-regulation-card {
  grid-column: span 2;
  order: 3;
}

.profile-tests-card {
  grid-column: span 2;
  order: 4;
}

.profile-pin-card {
  grid-column: span 1;
  order: 5;
}
.profile-pin-card.is-solo { grid-column: 1 / -1; }

.profile-onboarding-card {
  grid-column: span 1;
  order: 5;
}

.profile-telegram-card {
  grid-column: span 1;
  order: 5;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 176px;
  border-color: rgba(31, 154, 215, 0.24);
  background: linear-gradient(145deg, #fff 20%, #edf8fd);
}

.profile-telegram-card > button {
  grid-column: 1 / -1;
  justify-self: stretch;
}

.profile-telegram-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(145deg, #3fb7ed, #1688c1);
  font-size: 26px;
  font-weight: 950;
  transform: rotate(-7deg);
}

.profile-telegram-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.profile-telegram-copy h2,
.profile-telegram-copy p {
  margin: 0;
}

.profile-telegram-copy strong {
  overflow-wrap: anywhere;
  color: #157caf;
}

.profile-telegram-copy p,
.profile-telegram-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.profile-telegram-card.is-blocked,
.profile-telegram-card.is-delivery_error {
  border-color: #efb0b0;
  background: linear-gradient(145deg, #fff 20%, #fff1f1);
}

.profile-telegram-modal {
  width: min(820px, 100%);
}

.profile-telegram-modal-body {
  display: grid;
  gap: 18px;
}

.profile-telegram-linked,
.profile-telegram-intro {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border: 1px solid #a8dfca;
  border-radius: 16px;
  padding: 20px;
  background: #effbf7;
}

.profile-telegram-linked > span,
.profile-telegram-intro > span {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: #1688c1;
  font-size: 30px;
  font-weight: 950;
}

.profile-telegram-linked p,
.profile-telegram-intro p {
  margin: 5px 0;
  color: var(--muted);
}

.profile-telegram-security-note {
  margin: 0;
  border-left: 4px solid #1f9ad7;
  padding: 11px 14px;
  color: #376b82;
  background: #f1f9fd;
  font-size: 13px;
  line-height: 1.5;
}

.profile-telegram-pairing {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.profile-telegram-pairing img {
  width: 230px;
  height: 230px;
  border: 1px solid rgba(31, 154, 215, 0.24);
  border-radius: 18px;
  padding: 10px;
  background: #fff;
}

.profile-telegram-pairing > div {
  display: grid;
  gap: 12px;
}

.profile-telegram-pairing ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.45;
}

.profile-telegram-pairing small {
  color: var(--muted);
  font-weight: 750;
}

.profile-achievements-card { position: relative; }

.profile-achievements-card.is-onboarding-locked .profile-achievements-content {
  pointer-events: none;
  user-select: none;
  filter: blur(8px) grayscale(.55);
  opacity: .42;
}

.profile-achievements-lock {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 54%;
  display: grid;
  width: min(520px, calc(100% - 40px));
  justify-items: center;
  gap: 8px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(151,0,97,.18);
  border-radius: 18px;
  padding: 26px;
  text-align: center;
  background: rgba(255,255,255,.96);
  box-shadow: 0 22px 60px rgba(51,22,43,.18);
}

.profile-achievements-lock > span { font-size: 28px; }
.profile-achievements-lock strong { font-size: 20px; }
.profile-achievements-lock p { margin: 0; line-height: 1.45; }

.profile-onboarding-card {
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 176px;
  color: var(--text);
  text-align: left;
  box-shadow: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.profile-onboarding-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(57,19,48,.1); }
.profile-onboarding-card-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; font-size: 23px; font-weight: 950; }
.profile-onboarding-card-copy { display: grid; gap: 4px; min-width: 0; }
.profile-onboarding-card-copy small { font-size: 11px; font-weight: 950; letter-spacing: .04em; text-transform: uppercase; }
.profile-onboarding-card-copy strong { font-size: 16px; line-height: 1.25; }
.profile-onboarding-card-copy span { color: var(--muted); font-size: 12px; font-weight: 750; line-height: 1.35; }
.profile-onboarding-card-arrow { font-size: 22px; font-weight: 950; }

.status-gray { --status-color:#827881; --status-bg:#f4f1f3; --status-border:#ddd6db; }
.status-yellow { --status-color:#9a6800; --status-bg:#fff7df; --status-border:#efd293; }
.status-green { --status-color:#147452; --status-bg:#eaf9f3; --status-border:#a8dfca; }
.status-red { --status-color:#a92626; --status-bg:#fff1f1; --status-border:#efb0b0; }
.profile-onboarding-card { border-color: var(--status-border); background: linear-gradient(145deg, #fff 20%, var(--status-bg)); }
.profile-onboarding-card-icon { color: var(--status-color); background: var(--status-bg); }
.profile-onboarding-card-copy small, .profile-onboarding-card-arrow { color: var(--status-color); }

.onboarding-profile-modal { width: min(1040px, 100%); max-height: calc(100vh - 36px); grid-template-rows: auto auto minmax(0,1fr); overflow: hidden; }
.onboarding-modal-body { min-height: 0; overflow: auto; padding: 2px 4px 8px 0; scrollbar-gutter: stable; }
.onboarding-kkt-summary, .onboarding-doc-status, .onboarding-contract-state { border: 1px solid var(--status-border); border-radius: 14px; background: var(--status-bg); color: var(--status-color); }
.onboarding-kkt-summary { display: grid; gap: 6px; padding: 18px 20px; }
.onboarding-kkt-summary span { font-size: 11px; font-weight: 950; text-transform: uppercase; }
.onboarding-kkt-summary strong { color: var(--text); font-size: 19px; }
.onboarding-kkt-summary small { color: var(--muted); font-weight: 750; }
.onboarding-modal-toolbar { display: flex; justify-content: flex-end; margin: 14px 0; }
.onboarding-kkt-document { display: grid; gap: 14px; max-width: 820px; margin: 20px auto; font-size: 16px; line-height: 1.65; }
.onboarding-kkt-document p, .onboarding-kkt-document ul { margin: 0; }
.onboarding-kkt-document h3 { margin: 12px 0 0; font-size: 20px; }
.onboarding-kkt-document ul { display: grid; gap: 8px; padding: 16px 20px 16px 42px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.onboarding-kkt-editor { display: grid; gap: 7px; }
.onboarding-kkt-editor textarea { min-height: 460px; resize: vertical; line-height: 1.55; }
.onboarding-sign-panel { display: grid; grid-template-columns: minmax(0,1fr) 190px auto; gap: 14px; align-items: end; margin-top: 20px; border-top: 1px solid var(--border); padding-top: 18px; }
.onboarding-sign-panel > div, .onboarding-sign-panel label { display: grid; gap: 5px; }
.onboarding-sign-panel span { color: var(--muted); font-size: 12px; font-weight: 750; }
.onboarding-signature-stamp { display: grid; width: min(620px, 100%); gap: 5px; margin: 24px auto 0; border: 2px solid #168058; border-radius: 14px; padding: 18px 20px; color: #126d4e; background: #effbf7; transform: rotate(-.5deg); }
.onboarding-signature-stamp span { font-size: 12px; font-weight: 950; text-transform: uppercase; }
.onboarding-signature-stamp strong { font-size: 18px; }
.onboarding-signature-stamp small { font-weight: 750; }
.onboarding-doc-status { display: flex; gap: 12px; align-items: center; padding: 13px 15px; }
.onboarding-doc-status span { color: var(--text); }
.onboarding-passport-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 16px; }
.onboarding-passport-grid label { display: grid; gap: 6px; }
.onboarding-passport-grid label > span { color: var(--muted); font-size: 12px; font-weight: 850; }
.onboarding-passport-grid label:first-child, .onboarding-passport-grid label:nth-child(6), .onboarding-passport-grid label:nth-child(9) { grid-column: 1/-1; }
.onboarding-photo-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 16px; }
.onboarding-photo-picker { display: grid; gap: 6px; min-height: 110px; align-content: center; border: 1px dashed #c9bdc5; border-radius: 14px; padding: 18px; background: #fbf8fa; cursor: pointer; }
.onboarding-photo-picker.has-file { border-style: solid; border-color: #a8dfca; background: #effbf7; }
.onboarding-photo-picker span, .onboarding-photo-note, .onboarding-locked-note { color: var(--muted); font-size: 12px; font-weight: 750; }
.onboarding-photo-picker input { padding: 7px; background: #fff; }
.onboarding-contract-state { display: grid; grid-template-columns: 60px minmax(0,1fr); gap: 16px; align-items: center; padding: 22px; }
.onboarding-contract-state > span { display: grid; width: 60px; height: 60px; place-items: center; border-radius: 16px; color: var(--status-color); background: #fff; font-size: 30px; font-weight: 950; }
.onboarding-contract-state strong { color: var(--text); font-size: 20px; }
.onboarding-contract-state p { margin: 5px 0 0; }
.onboarding-contract-download { display: inline-flex; width: fit-content; margin-top: 16px; }

@media (max-width: 1100px) {
  .profile-layout { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .profile-pin-card, .profile-onboarding-card, .profile-telegram-card { grid-column: span 1; }
}

@media (max-width: 720px) {
  .profile-layout { grid-template-columns: 1fr; }
  .profile-motivation-card, .profile-achievements-card, .profile-regulation-card, .profile-tests-card, .profile-pin-card, .profile-onboarding-card, .profile-telegram-card { grid-column: 1; }
  .onboarding-sign-panel, .onboarding-passport-grid, .onboarding-photo-grid { grid-template-columns: 1fr; }
  .onboarding-passport-grid label:first-child, .onboarding-passport-grid label:nth-child(6), .onboarding-passport-grid label:nth-child(9) { grid-column: auto; }
}

@media (max-width: 640px) {
  .profile-telegram-pairing { grid-template-columns: 1fr; justify-items: center; }
  .profile-telegram-pairing > div { justify-items: stretch; }
}

.employee-onboarding-icons { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.employee-onboarding-icon { display: inline-grid; grid-template-columns: 22px auto; gap: 4px; align-items: center; min-height: 30px; border: 1px solid var(--status-border); border-radius: 999px; padding: 3px 8px 3px 4px; color: var(--status-color); background: var(--status-bg); box-shadow: none; }
.employee-onboarding-icon > span { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; color: #fff; background: var(--status-color); font-weight: 950; }
.employee-onboarding-icon small { font-size: 9px; font-weight: 950; }
.employee-onboarding-icon:hover { border-color: var(--status-color); transform: translateY(-1px); }
.employee-onboarding-modal { width: min(980px, 100%); max-height: calc(100vh - 36px); grid-template-rows: auto auto minmax(0,1fr); overflow: hidden; }
.employee-onboarding-state { display: grid; grid-template-columns: 54px minmax(0,1fr); gap: 15px; align-items: center; border: 1px solid var(--status-border); border-radius: 14px; padding: 17px; color: var(--status-color); background: var(--status-bg); }
.employee-onboarding-state > span { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 15px; color: #fff; background: var(--status-color); font-size: 25px; font-weight: 950; }
.employee-onboarding-state strong { color: var(--text); font-size: 19px; }
.employee-onboarding-state p { margin: 4px 0 0; color: var(--muted); }
.employee-sensitive-warning { margin-top: 14px; border-left: 4px solid #b47a00; padding: 10px 13px; color: #775100; background: #fff8e5; font-size: 12px; font-weight: 800; }
.employee-passport-detail { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 14px 0; }
.employee-passport-detail div { display: grid; gap: 4px; border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; background: #fff; }
.employee-passport-detail div.is-wide { grid-column: 1/-1; }
.employee-passport-detail dt { color: var(--muted); font-size: 11px; font-weight: 850; }
.employee-passport-detail dd { margin: 0; overflow-wrap: anywhere; font-weight: 800; }
.employee-document-links { display: flex; flex-wrap: wrap; gap: 9px; }
.employee-document-links a, .employee-document-links span { border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; font-size: 12px; font-weight: 850; }
.employee-document-links a { color: var(--primary-dark); background: #fff5fa; }
.employee-review-comment { display: grid; gap: 6px; margin-top: 16px; }
.employee-review-comment span { color: var(--muted); font-size: 12px; font-weight: 850; }
.employee-review-comment textarea { min-height: 90px; resize: vertical; }
.employee-contract-upload { display: grid; grid-template-columns: minmax(0,1fr) 190px; gap: 12px; align-items: end; margin-top: 16px; border: 1px solid var(--border); border-radius: 12px; padding: 15px; }
.employee-contract-upload label { display: grid; gap: 6px; }
.employee-contract-upload label > span { color: var(--muted); font-size: 12px; font-weight: 850; }
.employee-contract-upload .employee-contract-confirm { grid-column: 1/-1; grid-template-columns: auto minmax(0,1fr); align-items: center; }
.employee-contract-upload > button { width: fit-content; }
.employee-contract-history { display: grid; gap: 8px; margin-top: 18px; }
.employee-contract-history h3 { margin: 0; }
.employee-contract-history a { display: flex; justify-content: space-between; gap: 14px; border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; color: var(--text); }
.employee-contract-history span { color: var(--muted); font-size: 12px; font-weight: 750; }
.onboarding-manager-footer { display: flex; gap: 12px; align-items: center; margin-top: 20px; border-top: 1px solid var(--border); padding-top: 15px; }
.onboarding-manager-footer small { color: var(--muted); font-weight: 750; }
.onboarding-audit { margin-top: 16px; border: 1px solid var(--border); border-radius: 11px; padding: 12px; }
.onboarding-audit summary { cursor: pointer; font-weight: 900; }
.onboarding-audit > div { display: grid; gap: 6px; margin-top: 10px; }
.onboarding-audit p { display: flex; justify-content: space-between; gap: 12px; margin: 0; border-top: 1px solid #eee7eb; padding-top: 7px; }
.onboarding-audit span { color: var(--muted); font-size: 11px; }

@media (max-width: 720px) {
  .employee-passport-detail, .employee-contract-upload { grid-template-columns: 1fr; }
  .employee-passport-detail div.is-wide, .employee-contract-upload .employee-contract-confirm { grid-column: auto; }
  .employee-contract-history a, .onboarding-manager-footer, .onboarding-audit p { display: grid; }
}

.profile-achievements-heading,
.achievement-scope-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.profile-achievements-heading h2,
.achievement-scope-head h3 {
  margin-top: 4px;
}

.profile-achievements-heading > span {
  flex: none;
  border: 1px solid rgba(151, 0, 97, 0.12);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.achievement-scope {
  display: grid;
  gap: 18px;
  border: 1px solid rgba(151, 0, 97, 0.12);
  border-radius: 18px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 32px rgba(48, 20, 39, 0.05);
}

.achievement-scope-absolute {
  background: linear-gradient(145deg, #fff 0%, #fff8ec 100%);
  border-color: rgba(180, 119, 0, 0.2);
}

.achievement-scope-head p {
  max-width: 480px;
  margin: 4px 0 0;
  text-align: right;
}

.achievement-holiday-note {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  border: 1px solid #f0d395;
  border-radius: 999px;
  padding: 7px 12px 7px 8px;
  color: #76521a;
  background: #fff9e9;
  font-size: 12px;
  font-weight: 750;
}

.achievement-holiday-note span {
  border-radius: 999px;
  padding: 4px 8px;
  color: #fff;
  background: #a36a08;
  font-weight: 900;
}

.achievement-medal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  gap: 14px;
}

.achievement-medal-card {
  position: relative;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-height: 132px;
  border: 1px solid hsl(var(--medal-hue) 44% 78% / 0.55);
  border-radius: 16px;
  padding: 15px;
  background:
    linear-gradient(145deg, hsl(var(--medal-hue) 100% 98%), #fff 62%);
  box-shadow: 0 12px 24px hsl(var(--medal-hue) 45% 30% / 0.08);
  outline: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.achievement-medal-card:hover,
.achievement-medal-card:focus-visible {
  z-index: 6;
  transform: translateY(-3px);
  border-color: hsl(var(--medal-hue) 68% 56% / 0.62);
  box-shadow: 0 18px 34px hsl(var(--medal-hue) 55% 30% / 0.16);
}

.achievement-medal-card.is-locked {
  border-color: #ded9de;
  background: linear-gradient(145deg, #f7f5f7, #fff);
  box-shadow: none;
}

.achievement-medal {
  position: relative;
  width: 76px;
  height: 102px;
}

.achievement-ribbon {
  position: absolute;
  top: 0;
  width: 31px;
  height: 58px;
  background: linear-gradient(90deg, hsl(var(--medal-hue) 78% 38%), hsl(var(--medal-hue) 84% 57%));
  clip-path: polygon(0 0, 100% 0, 83% 100%, 50% 79%, 17% 100%);
  filter: drop-shadow(0 4px 3px rgba(48, 20, 39, 0.18));
}

.achievement-ribbon-left { left: 10px; transform: rotate(-7deg); }
.achievement-ribbon-right { right: 10px; transform: rotate(7deg); }

.achievement-medal-disc {
  position: absolute;
  inset: 30px 3px 0;
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border: 5px solid hsl(42 94% 67%);
  border-radius: 50%;
  color: hsl(var(--medal-hue) 72% 37%);
  background:
    radial-gradient(circle at 34% 28%, #fff9ce 0 10%, #ffd766 28%, #e49b0b 70%, #b86b00 100%);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.52),
    inset -5px -7px 10px rgba(112, 59, 0, 0.25),
    0 8px 14px rgba(91, 45, 0, 0.27);
}

.achievement-medal-disc::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(116, 68, 0, 0.32);
  border-radius: 50%;
}

.achievement-medal-disc svg {
  position: relative;
  z-index: 1;
  width: 45px;
  height: 45px;
  overflow: visible;
  fill: currentColor;
  filter: drop-shadow(0 2px 1px rgba(255,255,255,.5));
}

.achievement-medal-disc svg .medal-cut {
  fill: #ffe999;
}

.achievement-medal-disc svg text {
  fill: #7d4b00;
  font-size: 22px;
  font-weight: 950;
}

.achievement-medal-card.is-locked .achievement-medal {
  filter: grayscale(1);
  opacity: 0.34;
}

.achievement-medal-copy {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
}

.achievement-medal-copy strong {
  font-size: 15px;
  line-height: 1.2;
}

.achievement-medal-copy > span,
.achievement-medal-copy small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.achievement-medal-copy small {
  font-weight: 850;
}

.achievement-medal-card.is-earned .achievement-medal-copy small {
  color: hsl(var(--medal-hue) 64% 35%);
}

.achievement-medal-copy em {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 7px;
  color: #9a5f00;
  background: #fff2ce;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.achievement-medal-copy a {
  width: fit-content;
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
}

.achievement-tooltip {
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: calc(100% + 10px);
  display: none;
  width: min(290px, calc(100vw - 48px));
  transform: translateX(-50%);
  border-radius: 11px;
  padding: 11px 13px;
  color: #fff;
  background: #241b22;
  box-shadow: 0 12px 28px rgba(20, 10, 17, 0.26);
  font-size: 12px;
  line-height: 1.35;
}

.achievement-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  border: 7px solid transparent;
  border-top-color: #241b22;
  transform: translateX(-50%);
}

.achievement-tooltip strong,
.achievement-tooltip span {
  display: block;
}

.achievement-tooltip span { margin-top: 3px; color: #f3eaf0; }

.achievement-medal-card:hover .achievement-tooltip,
.achievement-medal-card:focus-visible .achievement-tooltip {
  display: block;
}

.achievement-showcase-card {
  grid-column: span 2;
}

.achievement-months {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.achievement-months > span {
  position: relative;
  display: inline-grid;
  min-width: 34px;
  place-items: center;
  border: 1px solid #ddd7dc;
  border-radius: 999px;
  padding: 4px 6px;
  color: #9a9399;
  background: #f3f1f3;
  font-size: 10px;
  font-weight: 900;
}

.achievement-months > span.is-won {
  border-color: #efb324;
  color: #704100;
  background: linear-gradient(#fff2a4, #ffc83d);
  box-shadow: 0 3px 8px rgba(178, 108, 0, .2);
}

.achievement-months i {
  position: absolute;
  z-index: 30;
  bottom: calc(100% + 7px);
  left: 50%;
  display: none;
  width: 210px;
  transform: translateX(-50%);
  border-radius: 8px;
  padding: 8px 10px;
  color: #fff;
  background: #241b22;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.achievement-months > span:hover i,
.achievement-months > span:focus i { display: block; }

.achievement-visibility-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, .75fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 24px;
  border: 1px solid #ead9e5;
  border-radius: 16px;
  padding: 18px;
  background: linear-gradient(135deg, #fff 0%, #fbf4f9 100%);
}

.achievement-visibility-settings > div { display: grid; gap: 5px; }
.achievement-visibility-settings h2,
.achievement-visibility-settings p { margin: 0; }
.achievement-visibility-settings p { color: var(--muted); }
.achievement-visibility-settings label { display: grid; gap: 6px; }
.achievement-visibility-settings label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
.achievement-visibility-settings button { min-height: 46px; }

.achievement-speed-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(145px, .7fr) minmax(150px, .65fr) minmax(230px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

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

.achievement-speed-form label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.achievement-video-field input { padding: 8px; }
.achievement-video-field small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.achievement-speed-records {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

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

.achievement-speed-record-medal {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff4a9, #e7a310);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.5);
}

.achievement-speed-record div { display: grid; gap: 2px; }
.achievement-speed-record small { color: var(--muted); font-weight: 750; }

@media (max-width: 980px) {
  .achievement-visibility-settings { grid-template-columns: 1fr; align-items: stretch; }
  .achievement-speed-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .achievement-speed-form > button { min-height: 46px; }
}

@media (max-width: 720px) {
  .profile-achievements-heading,
  .achievement-scope-head { display: grid; }
  .achievement-scope-head p { text-align: left; }
  .achievement-holiday-note { display: grid; width: 100%; border-radius: 12px; }
  .achievement-holiday-note span { width: fit-content; }
  .achievement-medal-grid { grid-template-columns: 1fr; }
  .achievement-showcase-card { grid-column: auto; }
  .achievement-speed-form { grid-template-columns: 1fr; }
  .achievement-speed-record { grid-template-columns: auto minmax(0, 1fr); }
  .achievement-speed-record a,
  .achievement-speed-record button { width: 100%; }
}

.profile-pin-heading {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.profile-pin-heading h2 {
  margin-top: 4px;
}

.profile-pin-identity {
  display: grid;
  gap: 3px;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
}

.profile-pin-identity strong,
.profile-pin-identity span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-pin-card.is-solo .profile-pin-heading {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
}

@media (max-width: 720px) {
  .profile-pin-card.is-solo .profile-pin-heading {
    grid-template-columns: 1fr;
  }
}

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

.profile-pin-card > label {
  max-width: 520px;
}

.profile-pin-card .settings-save-row {
  justify-content: flex-start;
}

.profile-motivation-heading h2 {
  margin-top: 4px;
}

.profile-motivation-heading p {
  max-width: 720px;
}

.profile-work-identity {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-work-identity > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid rgba(151, 0, 97, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.profile-work-identity span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-work-identity strong {
  min-width: 0;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.profile-primary-store-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

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

.profile-motivation-kpi {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 146px;
  align-content: center;
  overflow: hidden;
  border: 1px solid rgba(151, 0, 97, 0.18);
  border-radius: 14px;
  padding: 22px;
  color: #fff;
  background: linear-gradient(135deg, #970061, #d21484);
}

.profile-motivation-kpi::after {
  content: "₽";
  position: absolute;
  right: 18px;
  bottom: -28px;
  color: rgba(255, 255, 255, 0.14);
  font-size: 118px;
  font-weight: 950;
  line-height: 1;
}

.profile-motivation-kpi.is-percent {
  color: var(--text);
  background: linear-gradient(135deg, #fff4fa, #f3e9ff);
}

.profile-motivation-kpi.is-percent::after {
  content: "%";
  color: rgba(151, 0, 97, 0.09);
}

.profile-motivation-kpi > * {
  position: relative;
  z-index: 1;
}

.profile-motivation-kpi span,
.profile-motivation-kpi small {
  font-weight: 800;
  opacity: 0.84;
}

.profile-motivation-kpi strong {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
}

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

.profile-motivation-action {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 132px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  color: var(--text);
  text-align: left;
  background: #fff;
  box-shadow: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.profile-motivation-action:hover {
  border-color: rgba(151, 0, 97, 0.38);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(79, 27, 63, 0.10);
}

.profile-motivation-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: var(--primary-dark);
  background: #f9eaf4;
  font-size: 25px;
  font-weight: 950;
}

.profile-motivation-action-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.profile-motivation-action-copy small {
  color: var(--primary-dark);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.profile-motivation-action-copy strong {
  font-size: 17px;
  line-height: 1.25;
}

.profile-motivation-action-copy span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
}

.profile-motivation-arrow {
  color: var(--primary-dark);
  font-size: 22px;
  font-weight: 900;
}

.profile-motivation-action em {
  position: absolute;
  right: 14px;
  top: 10px;
  border-radius: 999px;
  padding: 4px 8px;
  color: #168058;
  background: #eaf9f3;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.profile-motivation-modal {
  width: min(980px, 100%);
  max-height: calc(100vh - 40px);
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

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

.profile-motivation-modal-head span {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-motivation-modal-head h2 {
  margin-top: 5px;
}

.profile-motivation-modal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.profile-motivation-body {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.profile-motivation-content {
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.7;
}

.profile-motivation-rich {
  display: grid;
  gap: 15px;
  max-width: 820px;
  margin: 22px auto 0;
}

.profile-motivation-rich > p {
  margin: 0;
  color: #4f4650;
  font-weight: 620;
}

.profile-motivation-section-title {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 20px 0 0;
  color: var(--text);
  font-size: 21px;
  line-height: 1.25;
}

.profile-motivation-section-title span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: var(--primary-dark);
  background: #f9e7f3;
  font-size: 13px;
  font-weight: 950;
}

.profile-motivation-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 16px 18px 16px 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.profile-motivation-list li {
  padding-left: 4px;
  color: #4f4650;
  font-weight: 700;
}

.profile-motivation-list li::marker {
  color: var(--primary-dark);
}

.profile-motivation-formula {
  position: relative;
  display: grid;
  gap: 7px;
  overflow: hidden;
  border-radius: 15px;
  padding: 22px 24px;
  color: #fff;
  background: linear-gradient(135deg, #870058, #d21484);
}

.profile-motivation-formula::after {
  content: "=";
  position: absolute;
  right: 20px;
  top: -22px;
  color: rgba(255,255,255,.13);
  font-size: 104px;
  font-weight: 950;
}

.profile-motivation-formula span,
.profile-motivation-formula strong {
  position: relative;
  z-index: 1;
}

.profile-motivation-formula span {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .76;
}

.profile-motivation-formula strong {
  max-width: 680px;
  font-size: clamp(18px, 2.5vw, 25px);
  line-height: 1.35;
}

.profile-motivation-data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.profile-motivation-data-grid div {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(151,0,97,.16);
  border-radius: 12px;
  padding: 15px;
  background: #fff8fc;
}

.profile-motivation-data-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.profile-motivation-data-grid strong {
  color: var(--primary-dark);
  font-size: 18px;
}

.profile-motivation-callout,
.profile-motivation-example {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border-radius: 12px;
  padding: 16px 18px;
}

.profile-motivation-callout {
  border: 1px solid #efd39c;
  background: #fff8e8;
}

.profile-motivation-callout > span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  background: #b17a00;
  font-weight: 950;
}

.profile-motivation-example {
  border-left: 4px solid var(--primary-dark);
  background: #f8f1f6;
}

.profile-motivation-example > span {
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.profile-motivation-callout p,
.profile-motivation-example p {
  margin: 0;
  color: #4f4650;
  font-weight: 700;
  white-space: pre-wrap;
}

.profile-motivation-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.profile-motivation-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.profile-motivation-table th,
.profile-motivation-table td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.profile-motivation-table th {
  color: var(--primary-dark);
  background: #f8f1f6;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-motivation-table tr:last-child td {
  border-bottom: 0;
}

.profile-motivation-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #fff4fa, #f6f0ff);
}

.profile-motivation-flow > div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  border: 1px solid rgba(151,0,97,.14);
  border-radius: 12px;
  padding: 13px;
  background: rgba(255,255,255,.86);
}

.profile-motivation-flow > div > span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--primary-dark);
  background: #f6ddec;
  font-size: 20px;
  font-weight: 950;
}

.profile-motivation-flow strong {
  font-size: 15px;
}

.profile-motivation-flow small {
  color: var(--muted);
  font-weight: 750;
}

.profile-motivation-flow > b {
  color: var(--primary-dark);
  font-size: 22px;
}

.profile-payment-timeline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #fff4fa, #f6f0ff);
}

.profile-payment-timeline > div {
  display: grid;
  gap: 4px;
  min-height: 74px;
  align-content: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 16px;
  background: #fff;
}

.profile-payment-timeline > div.is-accent {
  border-color: rgba(151,0,97,.28);
  color: var(--primary-dark);
  background: #fff7fc;
}

.profile-payment-timeline span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.profile-payment-timeline > b {
  color: var(--primary-dark);
  font-size: 22px;
}

.profile-motivation-editor {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 850;
}

.profile-motivation-editor textarea {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  color: var(--text);
  background: #fff;
  font: inherit;
  line-height: 1.55;
}

.profile-motivation-updated {
  font-size: 12px;
}

.profile-contract-document,
.profile-contract-document-empty,
.profile-contract-document-editor {
  margin: 4px 0 22px;
  border: 1px solid rgba(151, 0, 97, 0.16);
  border-radius: 14px;
  background: linear-gradient(135deg, #fff 0%, #fff5fa 100%);
}

.profile-contract-document {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.profile-contract-document-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 12px;
  background: #970061;
  color: #fff;
  font-size: 13px;
  font-weight: 950;
}

.profile-contract-document strong,
.profile-contract-document span {
  display: block;
}

.profile-contract-document strong {
  overflow-wrap: anywhere;
  font-size: 16px;
}

.profile-contract-document span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.profile-contract-document a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 16px;
  border-radius: 9px;
  background: #970061;
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.profile-contract-document-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  color: var(--muted);
}

.profile-contract-document-empty > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  background: #f8e7f2;
  color: #970061;
  font-size: 24px;
  font-weight: 900;
}

.profile-contract-document-empty p {
  margin: 0;
  font-weight: 750;
}

.profile-contract-document-editor {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.profile-contract-document-editor > div:first-child strong,
.profile-contract-document-editor > div:first-child span {
  display: block;
}

.profile-contract-document-editor > div:first-child span,
.profile-contract-selected {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.profile-contract-file-picker {
  display: inline-flex;
  width: max-content;
  min-height: 42px;
  align-items: center;
  padding: 0 14px;
  border: 1px dashed rgba(151, 0, 97, 0.42);
  border-radius: 9px;
  background: #fff;
  color: #970061;
  cursor: pointer;
  font-weight: 850;
}

.profile-contract-file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.profile-contract-document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-contract-document-actions .button-danger {
  border: 1px solid #f1b7ab;
  background: #fff8f6;
  color: #a63426;
}

.profile-warning {
  padding: 12px;
}

.profile-warning ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.profile-test-row {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.profile-test-warning {
  width: fit-content;
  max-width: 100%;
  margin-top: 4px;
  border: 1px solid #f1d6a1;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff8e8;
  color: #8a6100;
  font-weight: 850;
}

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

.regulations-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.regulation-system-block {
  display: grid;
  gap: 14px;
  overflow: hidden;
  border: 1px solid rgba(151, 0, 97, 0.24);
  border-radius: 14px;
  padding: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(210, 20, 132, 0.12), transparent 35%),
    linear-gradient(135deg, #fffafd, #fff);
}

.regulation-system-block-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.regulation-system-block-head > div {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.regulation-system-lock {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  color: transparent;
  background: #f6ddec;
}

.regulation-system-lock::after {
  content: "🔒";
  color: var(--primary-dark);
  font-size: 13px;
}

.regulation-system-block-head > strong {
  border-radius: 999px;
  padding: 6px 10px;
  color: #168058;
  background: #eaf9f3;
  font-size: 11px;
}

.regulation-system-block h3 {
  margin: 0;
  font-size: 22px;
}

.regulation-penalty-rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
}

.regulation-penalty-rules > div {
  display: grid;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 13px;
  background: #fff;
}

.regulation-penalty-rules span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.regulation-penalty-rules strong {
  font-size: 18px;
}

.regulation-penalty-rules b {
  margin-top: 6px;
  color: #a92626;
  font-size: 17px;
}

.regulation-system-source {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.regulations-nav,
.regulation-article {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.regulations-nav {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 4px;
  padding: 14px;
}

.regulations-nav strong {
  padding: 4px 8px 8px;
}

.regulations-nav a {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  line-height: 1.2;
}

.regulations-nav a small,
.regulations-summary span,
.regulations-summary small,
.regulation-read-badge span {
  color: var(--muted);
  font-size: 12px;
}

.regulations-nav a.is-active,
.regulations-nav a:hover {
  background: var(--surface-2);
  color: var(--primary-dark);
}

.regulation-article {
  display: grid;
  gap: 14px;
  padding: 28px;
}

.regulation-article-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.regulation-article h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: 0;
}

.regulations-summary,
.regulation-read-badge {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.regulation-read-badge {
  min-width: 150px;
}

.regulation-body {
  display: grid;
  gap: 12px;
  max-width: 920px;
}

.regulation-body p {
  margin: 0;
  color: #302733;
  font-size: 17px;
  line-height: 1.65;
}

.regulation-body a {
  color: var(--primary-dark);
  font-weight: 850;
}

.regulation-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.regulation-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.regulation-editor {
  display: grid;
  gap: 14px;
}

.regulation-editor textarea {
  min-height: 420px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  line-height: 1.55;
  resize: vertical;
}

.regulation-stats-modal {
  width: min(1480px, calc(100vw - 32px));
  height: min(900px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.regulation-stats-table-wrap table {
  width: 100%;
  min-width: 1040px;
}

.regulation-stats-table-wrap th:nth-child(1) { width: 28%; }
.regulation-stats-table-wrap th:nth-child(2) { width: 15%; }
.regulation-stats-table-wrap th:nth-child(3) { width: 27%; }
.regulation-stats-table-wrap th:nth-child(4) { width: 12%; }
.regulation-stats-table-wrap th:nth-child(5) { width: 18%; }

.regulation-stats-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.regulation-stats-head h2 {
  margin: 0 0 6px;
}

.regulation-stats-head p {
  margin: 0;
  color: var(--muted);
}

.regulation-stats-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.regulation-stats-filters label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.regulation-stats-filters select,
.regulation-stats-filters input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
}

.regulation-stats-filter-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.regulation-stats-content {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.regulation-stats-counter {
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 700;
}

.regulation-stats-table-wrap {
  overflow: visible;
}

.regulation-stats-table-wrap thead th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #fff;
}

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

  .mobile-topbar {
    position: fixed;
    z-index: 60;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 30px rgba(57, 19, 48, 0.08);
    backdrop-filter: blur(14px);
  }

  .mobile-menu-button,
  .mobile-menu-close {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    cursor: pointer;
  }

  .mobile-menu-button {
    width: 46px;
    height: 46px;
    gap: 5px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
  }

  .mobile-menu-button span {
    display: block;
    width: 21px;
    height: 2px;
    border-radius: 999px;
    background: var(--primary-dark);
  }

  .mobile-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .mobile-menu-close {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--primary-dark);
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
  }

  .sidebar {
    position: fixed;
    z-index: 80;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(86vw, 360px);
    height: 100dvh;
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: 18px 0 48px rgba(57, 19, 48, 0.16);
  }

  .mobile-menu-checkbox:checked ~ .sidebar {
    transform: translateX(0);
  }

  .mobile-menu-checkbox:checked ~ .mobile-menu-backdrop {
    position: fixed;
    z-index: 70;
    inset: 0;
    display: block;
    background: rgba(31, 23, 32, 0.34);
  }

  nav,
  .filters,
  .filters.has-manual-compare,
  .metric-grid,
  .overview-metrics,
  .report-grid,
  .integration-grid,
  .two-col,
  .module-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-topline,
  .hero-period-card,
  .comparison-toolbar,
  .comparison-form,
  .comparison-results,
  .access-layout,
  .permission-columns,
  .role-fields,
  .access-user-row,
  .regulations-layout {
    grid-template-columns: 1fr;
  }

  .regulations-nav {
    position: static;
  }

  .draft-payroll-summary,
  .payroll-penalty-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  html,
  body {
    overflow-x: hidden;
  }

  .app-shell {
    padding-top: 64px;
  }

  .mobile-topbar {
    min-height: 64px;
    padding: 10px 12px;
  }

  .mobile-topbar .brand {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .mobile-topbar .brand img {
    width: 38px;
    height: 38px;
  }

  .mobile-menu-button {
    width: 42px;
    height: 42px;
  }

  .sidebar {
    width: min(92vw, 340px);
    gap: 18px;
    padding: 18px 14px;
  }

  .sidebar nav {
    gap: 8px;
  }

  .sidebar nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .auth-user-card {
    margin-top: auto;
  }

  .view {
    gap: 14px;
    padding: 14px 12px 20px;
  }

  .overview-hero,
  .module-card {
    padding: 18px;
  }

  nav,
  .filters,
  .metric-grid,
  .overview-metrics,
  .report-grid,
  .integration-grid,
  .two-col,
  .module-grid,
  .comparison-form fieldset,
  .comparison-metric-grid,
  .store-check-grid,
  .access-editor-head,
  .bar-row {
    grid-template-columns: 1fr;
  }

  .access-editor-head {
    display: grid;
  }

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

  .page-head h1 {
    font-size: clamp(27px, 9vw, 36px);
  }

  .head-meta {
    justify-content: start;
    min-width: 0;
  }

  .draft-payroll-summary,
  .payroll-penalty-grid {
    grid-template-columns: 1fr;
  }

  .settings-payroll-panel {
    min-width: 0;
    padding: 14px;
  }

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

  .payroll-penalty-card {
    min-width: 0;
    padding: 14px;
  }

  .payroll-penalty-card-head {
    align-items: flex-start;
  }

  .payroll-penalty-card input,
  .settings-payroll-panel input {
    min-width: 0;
  }

  .settings-save-row {
    align-items: stretch;
    flex-direction: column;
  }

  .force-refresh-form {
    grid-template-columns: 1fr;
  }

  .confirm-modal-actions {
    flex-direction: column-reverse;
  }

  .settings-section-head {
    flex-direction: column;
  }

  .settings-add-rule {
    width: 100%;
  }

  .employee-access-panel {
    min-width: 0;
    padding: 12px;
  }

  .employee-access-table-wrap,
  .employee-permission-table-wrap,
  .employee-granted-table-wrap,
  .table-wrap {
    overflow-x: visible;
  }

  .employee-access-table,
  .employee-permission-table,
  .employee-granted-table {
    min-width: 0;
  }

  .employee-access-table thead,
  .employee-permission-table thead,
  .employee-granted-table thead {
    display: none;
  }

  .employee-access-table,
  .employee-access-table tbody,
  .employee-access-table tr,
  .employee-access-table td,
  .employee-permission-table,
  .employee-permission-table tbody,
  .employee-permission-table tr,
  .employee-permission-table td,
  .employee-granted-table,
  .employee-granted-table tbody,
  .employee-granted-table tr,
  .employee-granted-table td {
    display: block;
    width: 100%;
  }

  .employee-access-table tr,
  .employee-permission-table tr,
  .employee-granted-table tr {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
  }

  .employee-access-table td,
  .employee-permission-table td,
  .employee-granted-table td {
    padding: 0;
    border: 0;
  }

  .employee-access-table td:not(:first-child)::before,
  .employee-granted-table td::before {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
  }

  .employee-access-table td:nth-child(2)::before { content: "Telegram"; }
  .employee-access-table td:nth-child(3)::before { content: "Последняя активность в Posiflora"; }
  .employee-access-table td:nth-child(4)::before { content: "Основная точка"; }
  .employee-access-table td:nth-child(5)::before { content: "Роль"; }
  .employee-access-table td:nth-child(6)::before { content: "ПИН для входа"; }
  .employee-access-table td:nth-child(7)::before { content: "Ставка за смену"; }
  .employee-access-table td:nth-child(8)::before { content: "Процент от выручки"; }
  .employee-access-table td:nth-child(9)::before { content: "Доступ"; }
  .employee-access-table td:nth-child(10)::before { content: "Архив"; }

  .employee-granted-table td:nth-child(1)::before { content: "Сотрудник"; }
  .employee-granted-table td:nth-child(2)::before { content: "Роль"; }
  .employee-granted-table td:nth-child(3)::before { content: "Доступы к разделам"; }
  .employee-granted-table td:nth-child(4)::before { content: "Доступы к подразделам"; }

  .employee-permission-section-row,
  .employee-permission-child-row {
    background: #fff;
  }

  .employee-permission-section-row td:first-child,
  .employee-permission-child-row td:first-child {
    width: 100%;
    padding-left: 0;
  }

  .profile-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .profile-motivation-kpis,
  .profile-motivation-actions,
  .profile-work-identity {
    grid-template-columns: 1fr;
  }

  .profile-motivation-kpi {
    min-height: 128px;
  }

  .profile-motivation-modal-head {
    display: grid;
  }

  .profile-motivation-modal-actions {
    display: grid;
  }

  .profile-motivation-modal-actions button {
    width: 100%;
  }

  .profile-motivation-flow,
  .profile-payment-timeline {
    grid-template-columns: 1fr;
  }

  .profile-contract-document {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .profile-contract-document a {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .profile-contract-file-picker {
    width: 100%;
    justify-content: center;
  }

  .profile-motivation-flow > b,
  .profile-payment-timeline > b {
    transform: rotate(90deg);
    justify-self: center;
  }

  .profile-motivation-data-grid {
    grid-template-columns: 1fr;
  }

  .profile-pin-heading {
    display: grid;
  }

  .profile-pin-identity {
    min-width: 0;
  }

  .test-stats-modal {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    max-height: calc(100vh - 16px);
    padding: 16px;
  }

  .regulation-stats-filters.test-stats-filters,
  .test-stats-summary {
    grid-template-columns: 1fr;
  }

  .profile-card,
  .profile-test-row {
    min-width: 0;
  }

  .profile-card {
    padding: 16px;
  }

  .profile-card label,
  .profile-card input,
  .profile-card .settings-save-row button {
    min-width: 0;
    width: 100%;
  }

  .profile-warning {
    overflow-wrap: anywhere;
  }

  .regulation-article {
    padding: 16px;
  }

  .regulation-system-block-head {
    display: grid;
  }

  .regulation-penalty-rules {
    grid-template-columns: 1fr;
  }

  .regulations-layout {
    gap: 12px;
  }

  .regulations-nav {
    gap: 10px;
    padding: 12px;
  }

  .regulations-nav strong {
    padding: 0;
  }

  .regulations-nav-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(160px, 72vw);
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .regulations-nav-list a {
    scroll-snap-align: start;
    min-height: 74px;
    border: 1px solid var(--border);
    background: #fff;
  }

  .regulations-summary {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .regulation-article h2 {
    font-size: clamp(25px, 8vw, 34px);
  }

  .regulation-body {
    max-width: none;
  }

  .regulation-body p {
    font-size: 16px;
    line-height: 1.55;
  }

  .regulation-pager {
    flex-direction: column;
  }

  .regulation-article-head {
    display: grid;
  }

  .regulation-head-actions,
  .regulation-stats-head {
    display: grid;
    justify-content: stretch;
  }

  .regulation-stats-modal {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    max-height: calc(100vh - 16px);
    padding: 16px;
  }

  .regulation-stats-filters {
    grid-template-columns: 1fr;
  }

  .regulation-stats-filter-actions {
    grid-column: auto;
    display: grid;
  }
}
/* Shift schedule */
.shift-schedule-page { display: grid; gap: 20px; min-width: 0; }
.shift-schedule-toolbar,
.shift-schedule-filters,
.shift-schedule-bulk,
.shift-schedule-store,
.shift-schedule-legend,
.shift-schedule-employees {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line, #eadde6);
  border-radius: 18px;
  background: #fff;
}
.shift-schedule-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 18px 20px; }
.shift-schedule-month-switcher { display: flex; align-items: flex-end; gap: 8px; }
.shift-schedule-month-switcher label,
.shift-schedule-filters label,
.shift-schedule-bulk label,
.shift-schedule-employees > label,
.shift-schedule-settings-grid > label { display: grid; gap: 7px; color: #786d77; font-weight: 700; }
.shift-schedule-month-switcher input,
.shift-schedule-filters select,
.shift-schedule-bulk select,
.shift-schedule-bulk input,
.shift-schedule-employees select,
.shift-schedule-settings-grid select,
.shift-schedule-settings-grid input,
[data-employee-primary-store] { min-height: 44px; border: 1px solid #eadde6; border-radius: 11px; background: #fff; padding: 8px 12px; color: #241b23; font: inherit; }
.shift-schedule-version { display: grid; justify-items: center; gap: 5px; }
.shift-schedule-version em { color: #a15f00; font-size: 12px; font-style: normal; font-weight: 800; }
.shift-schedule-status { border-radius: 999px; padding: 7px 13px; font-weight: 800; }
.shift-schedule-status.is-draft { color: #6e6370; background: #f3eef2; }
.shift-schedule-status.is-pending_approval { color: #946500; background: #fff1c9; }
.shift-schedule-status.is-published { color: #0b7a58; background: #e1f7ed; }
.shift-schedule-status.is-rejected { color: #b52b31; background: #ffe7e6; }
.shift-schedule-toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.shift-schedule-save-button { color: #087152 !important; border-color: #a8dac8 !important; background: #effaf6 !important; }
.shift-schedule-save-button:hover { background: #def5ec !important; border-color: #68bd9e !important; }
.shift-schedule-filters { display: grid; grid-template-columns: repeat(3, minmax(170px, 1fr)); gap: 12px; padding: 16px; }
.shift-schedule-message { position: sticky; top: 12px; z-index: 45; margin: 0; padding: 12px 16px; border: 1px solid #eadde6; border-radius: 12px; background: #f5eff4; color: #6f5f6d; font-weight: 700; box-shadow: 0 8px 24px rgba(49, 28, 44, .12); }
.shift-schedule-message.is-success { color: #087152; background: #e8f8f1; }
.shift-schedule-message.is-error { color: #b02e32; background: #ffedeb; }
.shift-schedule-workspace { display: grid; grid-template-columns: minmax(230px, 280px) minmax(0, 1fr); gap: 18px; align-items: start; }
.shift-schedule-employees { position: sticky; top: 16px; display: grid; gap: 16px; max-height: calc(100vh - 32px); overflow: auto; padding: 18px; }
.shift-schedule-employees h2,
.shift-schedule-employees h3,
.shift-schedule-bulk h2,
.shift-schedule-store h2 { margin: 0; color: #251c24; }
.shift-schedule-employees p { margin: 6px 0 0; color: #7d727c; line-height: 1.45; }
.shift-schedule-employees section { display: grid; gap: 7px; }
.shift-schedule-employees section h3 { color: #8e0c68; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.shift-schedule-employee { display: grid; gap: 3px; width: 100%; text-align: left; border: 1px solid #eadde6; border-radius: 12px; padding: 10px 12px; background: #fff; color: #241b23; cursor: grab; }
.shift-schedule-employee:hover,
.shift-schedule-employee.is-selected { border-color: #bd2589; background: #fff2fa; box-shadow: 0 6px 18px rgba(144, 10, 103, .08); }
.shift-schedule-employee.is-archived { opacity: .55; filter: grayscale(1); }
.shift-schedule-employee small { color: #80747e; }
.shift-schedule-current-selection { display: grid; gap: 4px; padding: 12px; border: 1px solid #e9c7dc; border-radius: 12px; background: #fff5fb; }
.shift-schedule-current-selection span { color: #9c2878; font-size: 11px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.shift-schedule-current-selection small { color: #756972; line-height: 1.35; }
.shift-schedule-content { display: grid; gap: 18px; min-width: 0; }
.shift-schedule-bulk { display: grid; gap: 14px; padding: 18px; }
.shift-schedule-bulk-help { max-width: 920px; margin: 8px 0 0; color: #786d77; line-height: 1.5; }
.shift-schedule-bulk-grid { display: grid; grid-template-columns: 1.5fr 1.5fr 1fr 1fr 1fr; gap: 10px; }
.shift-schedule-weekday-picks { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.shift-schedule-weekday-label { color: #645962; font-size: 13px; font-weight: 800; }
.shift-schedule-weekday-picks label { display: inline-flex; }
.shift-schedule-weekday-picks input { position: absolute; opacity: 0; pointer-events: none; }
.shift-schedule-weekday-picks span { border: 1px solid #e3d4df; border-radius: 999px; padding: 7px 10px; cursor: pointer; color: #776b75; }
.shift-schedule-weekday-picks input:checked + span { background: #8e0c68; border-color: #8e0c68; color: #fff; }
.shift-schedule-weekday-picks button:disabled { opacity: .45; cursor: not-allowed; }
.shift-schedule-bulk-summary { flex-basis: 100%; color: #847983; }
.shift-schedule-store-list { display: grid; gap: 18px; }
.shift-schedule-store { overflow: hidden; }
.shift-schedule-store-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 16px 18px; border-bottom: 1px solid #f0e5ec; background: linear-gradient(135deg, #fff 0%, #fff5fb 100%); }
.shift-schedule-store-head span,
.shift-schedule-bulk > div > span,
.shift-schedule-reminder span { display: block; margin-bottom: 4px; color: #9c2878; font-size: 12px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.shift-schedule-weekdays,
.shift-schedule-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.shift-schedule-weekdays { border-bottom: 1px solid #eee3ea; background: #faf7f9; }
.shift-schedule-weekdays span { padding: 8px; text-align: center; color: #81747e; font-size: 12px; font-weight: 800; }
.shift-schedule-day { position: relative; min-height: 132px; padding: 8px; border-right: 1px solid #f0e7ed; border-bottom: 1px solid #f0e7ed; background: #fff; transition: .15s ease; }
.shift-schedule-day:nth-child(7n) { border-right: 0; }
.shift-schedule-day.is-empty { background: #faf8fa; }
.shift-schedule-day.is-locked { background: #f3f1f2; color: #8f888d; }
.shift-schedule-day.is-locked .shift-schedule-day-rows { opacity: .72; }
.shift-schedule-day.is-weekend { background: #fffafd; }
.shift-schedule-day.is-drag-over { background: #fce7f5; box-shadow: inset 0 0 0 2px #c21c89; }
.shift-schedule-day.has-unplanned { background: #fff7f6; box-shadow: inset 0 0 0 1px #e65a61; }
.shift-schedule-day-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.shift-schedule-day-head strong { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; color: #3c3039; }
.shift-schedule-day-head span { color: #a396a0; font-size: 11px; text-transform: uppercase; }
.shift-schedule-day-rows { display: grid; gap: 5px; }
.shift-schedule-chip,
.shift-schedule-actual { position: relative; display: grid; gap: 2px; border: 1px solid transparent; border-radius: 9px; padding: 7px 26px 7px 8px; font-size: 12px; line-height: 1.25; }
.shift-schedule-chip { cursor: grab; }
.shift-schedule-chip.is-locked { cursor: not-allowed; filter: grayscale(.55); }
.shift-schedule-chip span,
.shift-schedule-actual strong { overflow-wrap: anywhere; }
.shift-schedule-chip small,
.shift-schedule-actual small { opacity: .72; }
.shift-schedule-chip button { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border: 0; padding: 0; border-radius: 50%; background: rgba(255,255,255,.75); color: inherit; }
.shift-schedule-chip.is-day { background: #f8e8f3; color: #861060; border-color: #ebbfdb; }
.shift-schedule-chip.is-night { background: #eceafd; color: #4f4597; border-color: #cdc7f1; }
.shift-schedule-chip.is-internship { background: #e6f7ee; color: #146948; border-color: #b9e5d0; }
.shift-schedule-chip.is-replacement { background: #fff1d7; color: #8e6000; border-color: #f1d49b; }
.shift-schedule-chip.is-fact-mismatch,
.shift-schedule-chip.is-fact-missing,
.shift-schedule-actual { background: #ffe8e6; color: #a72c32; border-color: #efaaa6; }
.shift-schedule-chip.is-fact-matched { box-shadow: inset 3px 0 0 #1ca775; }
.shift-schedule-add-cell { position: absolute; right: 6px; bottom: 6px; width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 1px dashed #c387af; background: #fff; color: #970d6e; opacity: .35; }
.shift-schedule-day:hover .shift-schedule-add-cell { opacity: 1; }
.shift-schedule-locked-label { position: absolute; right: 7px; bottom: 7px; color: #999096; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.shift-schedule-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 18px; color: #716570; }
.shift-schedule-legend span { border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 800; }
.shift-schedule-legend .is-day { background: #f8e8f3; color: #861060; }
.shift-schedule-legend .is-night { background: #eceafd; color: #4f4597; }
.shift-schedule-legend .is-internship { background: #e6f7ee; color: #146948; }
.shift-schedule-legend .is-replacement { background: #fff1d7; color: #8e6000; }
.shift-schedule-legend .is-fact-mismatch { background: #ffe8e6; color: #a72c32; }
.shift-schedule-reminder-backdrop { z-index: 2500; }
.shift-schedule-reminder { display: grid; grid-template-columns: auto 1fr; gap: 16px; width: min(560px, calc(100vw - 32px)); border-radius: 22px; background: #fff; padding: 24px; box-shadow: 0 24px 70px rgba(34, 21, 31, .28); }
.shift-schedule-reminder-icon { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 18px; background: linear-gradient(135deg, #9b0b70, #ef4cad); color: #fff; font-size: 32px; }
.shift-schedule-reminder h2 { margin: 0 0 8px; }
.shift-schedule-reminder p { margin: 0; color: #766a74; line-height: 1.5; }
.shift-schedule-reminder-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.shift-schedule-publish-backdrop,
.shift-schedule-changes-backdrop { z-index: 2700; }
.shift-schedule-publish-modal { display: grid; grid-template-columns: auto 1fr; gap: 18px; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; border-radius: 24px; background: #fff; padding: 26px; box-shadow: 0 28px 80px rgba(35, 20, 31, .3); }
.shift-schedule-publish-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(135deg, #8f0b68, #e843a5); color: #fff; font-size: 30px; font-weight: 900; }
.shift-schedule-publish-modal h2 { margin: 3px 0 10px; }
.shift-schedule-publish-modal > div > span,
.shift-schedule-changes-title span { color: #9c2878; font-size: 12px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.shift-schedule-publish-modal p { margin: 0; color: #746872; line-height: 1.55; }
.shift-schedule-publish-confirm { grid-column: 1 / -1; display: flex; gap: 10px; align-items: flex-start; padding: 14px; border: 1px solid #ead9e4; border-radius: 14px; background: #fff7fb; font-weight: 700; }
.shift-schedule-publish-confirm input { margin-top: 3px; }
.shift-schedule-publish-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; }
.shift-schedule-publish-actions button:disabled { opacity: .45; cursor: not-allowed; }
.shift-schedule-changes-modal { display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 16px; width: min(1320px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: hidden; border-radius: 24px; background: #fff; padding: 24px; box-shadow: 0 28px 80px rgba(35, 20, 31, .3); }
.shift-schedule-changes-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.shift-schedule-changes-title h2 { margin: 4px 0 0; }
.shift-schedule-changes-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.shift-schedule-changes-filters label { display: grid; gap: 6px; color: #776b75; font-size: 13px; font-weight: 800; }
.shift-schedule-changes-filters select { min-width: 0; min-height: 42px; border: 1px solid #eadde6; border-radius: 10px; background: #fff; padding: 8px 10px; font: inherit; }
.shift-schedule-changes-list { display: grid; gap: 10px; overflow: auto; padding-right: 4px; }
.shift-schedule-changes-list article { display: grid; gap: 9px; padding: 14px; border: 1px solid #eadfe6; border-radius: 14px; }
.shift-schedule-change-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shift-schedule-change-head > span { border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 850; }
.shift-schedule-change-head .is-created { color: #087152; background: #e4f7ef; }
.shift-schedule-change-head .is-updated { color: #8c5e00; background: #fff1d4; }
.shift-schedule-change-head .is-deleted { color: #aa3135; background: #ffe9e7; }
.shift-schedule-change-values { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; }
.shift-schedule-change-values p,
.shift-schedule-change-reason { margin: 0; padding: 10px; border-radius: 10px; background: #f8f5f7; color: #4d424b; }
.shift-schedule-change-values span,
.shift-schedule-change-reason span { display: block; margin-bottom: 3px; color: #8b7d87; font-size: 11px; font-weight: 850; text-transform: uppercase; }
.shift-schedule-change-status { color: #0b7457; font-weight: 750; }
.shift-schedule-change-status.is-pending { color: #9a6500; }
.shift-schedule-settings-grid { display: grid; grid-template-columns: 1.5fr .5fr; gap: 14px; margin-top: 18px; }
.shift-schedule-setting-check { grid-column: 1 / -1; display: flex !important; grid-template-columns: auto 1fr; align-items: flex-start; padding: 14px; border: 1px solid #ebdfe7; border-radius: 14px; }
.shift-schedule-setting-check input { min-height: auto; margin-top: 3px; }
.shift-schedule-setting-check span { display: grid; gap: 4px; color: #332730; }
.shift-schedule-setting-check small { color: #7e727b; font-weight: 500; }

@media (max-width: 1180px) {
  .shift-schedule-bulk-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shift-schedule-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shift-schedule-workspace { grid-template-columns: 220px minmax(0, 1fr); }
}

@media (max-width: 820px) {
  .shift-schedule-toolbar { align-items: stretch; flex-direction: column; }
  .shift-schedule-version { justify-items: start; }
  .shift-schedule-toolbar-actions { justify-content: flex-start; }
  .shift-schedule-workspace { grid-template-columns: 1fr; }
  .shift-schedule-employees { position: static; max-height: none; grid-template-columns: 1fr 1fr; }
  .shift-schedule-employees > div,
  .shift-schedule-employees > label { grid-column: 1 / -1; }
  .shift-schedule-calendar,
  .shift-schedule-weekdays { min-width: 700px; }
  .shift-schedule-store { overflow-x: auto; }
  .shift-schedule-day { min-height: 120px; }
  .shift-schedule-changes-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .shift-schedule-filters,
  .shift-schedule-bulk-grid,
  .shift-schedule-settings-grid { grid-template-columns: 1fr; }
  .shift-schedule-setting-check { grid-column: auto; }
  .shift-schedule-employees { grid-template-columns: 1fr; }
  .shift-schedule-page > header { min-width: 0; overflow-wrap: anywhere; }
  .shift-schedule-toolbar { padding: 16px; }
  .shift-schedule-month-switcher { align-items: stretch; flex-wrap: wrap; min-width: 0; }
  .shift-schedule-month-switcher label { flex: 1 1 180px; min-width: 0; }
  .shift-schedule-month-switcher input { box-sizing: border-box; width: 100%; min-width: 0; }
  .shift-schedule-toolbar-actions > button { max-width: 100%; white-space: normal; }
  .shift-schedule-reminder { grid-template-columns: 1fr; }
  .shift-schedule-reminder-actions { grid-column: auto; flex-direction: column; }
  .shift-schedule-publish-modal { grid-template-columns: 1fr; }
  .shift-schedule-publish-confirm,
  .shift-schedule-publish-actions { grid-column: auto; }
  .shift-schedule-publish-actions { flex-direction: column-reverse; }
  .shift-schedule-changes-modal { padding: 16px; }
  .shift-schedule-changes-title { align-items: stretch; flex-direction: column; }
  .shift-schedule-changes-filters { grid-template-columns: 1fr; }
  .shift-schedule-change-values { grid-template-columns: 1fr; }
  .shift-schedule-change-values b { transform: rotate(90deg); text-align: center; }
}

@media print {
  .sidebar,
  .shift-schedule-toolbar-actions,
  .shift-schedule-filters,
  .shift-schedule-employees,
  .shift-schedule-bulk,
  .shift-schedule-add-cell,
  .shift-schedule-chip button,
  .shift-schedule-reminder-backdrop { display: none !important; }
  .app-main { margin: 0 !important; padding: 0 !important; }
  .shift-schedule-workspace { display: block; }
  .shift-schedule-store { break-inside: avoid; }
}

/* Keep employee cards neutral even when legacy global button rules load later. */
button.shift-schedule-employee {
  background: #fff !important;
  color: #241b23 !important;
  border: 1px solid #eadde6 !important;
  padding: 10px 12px !important;
}
button.shift-schedule-employee:hover,
button.shift-schedule-employee.is-selected {
  background: #fff2fa !important;
  color: #6f0b52 !important;
  border-color: #bd2589 !important;
}
button.shift-schedule-employee.is-archived {
  background: #f1eef0 !important;
  color: #777077 !important;
  border-color: #ddd6da !important;
}
