:root {
  --bg: #eef3fa;
  --panel: #ffffff;
  --text: #23243a;
  --muted: #7b8194;
  --line: #e5e9f2;
  --purple: #4D49A9;
  --purple-dark: #3f3b91;
  --purple-soft: #eeedfb;
  --danger: #dc4c64;
  --success: #24966c;
  --shadow: 0 18px 48px rgba(42, 51, 83, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, Arial, sans-serif;
  letter-spacing: 0;
}

a {
  color: var(--purple);
  text-decoration: none;
}

.money-value,
.balance-metric dd,
.control-metric strong,
.summary-card strong,
.dashboard-overview-card strong,
.amount-cell,
.latest-operations-table td:nth-child(6) {
  font-family: "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

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

.sidebar {
  padding: 28px 20px;
  background: #f8fbff;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
}

.brand-logo {
  display: block;
  width: 78px;
  height: 52px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
}

.brand-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.menu {
  display: grid;
  gap: 8px;
}

.menu-link {
  display: block;
  padding: 14px 16px;
  border-radius: 16px;
  color: #5d6377;
  font-weight: 700;
}

.menu-link.active,
.menu-link:hover {
  color: #fff;
  background: var(--purple);
  box-shadow: 0 12px 24px rgba(77, 73, 169, 0.22);
}

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

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
}

.topbar p {
  margin: 8px 0 0;
  color: var(--muted);
}

.topbar-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-info span {
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  font-weight: 700;
}

.topbar-info .role {
  color: #fff;
  background: var(--purple);
}

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

.card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.form-card,
.table-card {
  padding: 24px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.section-head h2 {
  margin: 0;
  font-size: 20px;
}

.section-head p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: #4b5268;
  font-size: 14px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: #fbfcff;
  font: inherit;
}

input:focus {
  outline: 3px solid rgba(77, 73, 169, 0.16);
  border-color: var(--purple);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f7f9fd;
}

.switch-row input {
  width: 22px;
  min-height: 22px;
  accent-color: var(--purple);
}

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

button,
.ghost-button,
.primary-button {
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  padding: 13px 18px;
  color: #fff;
  background: var(--purple);
  box-shadow: 0 12px 24px rgba(77, 73, 169, 0.24);
}

.primary-button:hover {
  background: var(--purple-dark);
}

.ghost-button {
  padding: 13px 18px;
  color: var(--purple);
  background: var(--purple-soft);
}

.alert {
  margin-bottom: 16px;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  font-weight: 700;
}

.alert.success {
  color: var(--success);
}

.alert.error {
  color: var(--danger);
}

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

table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0 10px;
}

th {
  padding: 0 14px 8px;
  color: var(--muted);
  text-align: left;
  font-size: 13px;
}

td {
  padding: 14px;
  background: #fbfcff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

td:first-child {
  border-left: 1px solid var(--line);
  border-radius: 16px 0 0 16px;
}

td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 16px 16px 0;
}


.compact-spreadsheet-id {
  display: -webkit-box;
  max-width: 190px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.25;
  word-break: break-all;
}

.delete-cashdesk-button {
  color: #dc2626;
  background: #fee2e2;
}

.delete-cashdesk-button:hover {
  color: #b91c1c;
  background: #fecaca;
}

.mono {
  max-width: 220px;
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.badge.on {
  color: var(--success);
  background: #e9f8f1;
}

.badge.off {
  color: var(--danger);
  background: #fff0f3;
}

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

.table-action,
.link-button {
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--purple);
  background: var(--purple-soft);
  font-size: 13px;
  font-weight: 800;
}

.link-button {
  border: 0;
}

.copy-access-details {
  display: inline-block;
}

.copy-access-details summary {
  cursor: pointer;
  list-style: none;
}

.copy-access-details summary::-webkit-details-marker {
  display: none;
}

.copy-access-details form {
  display: grid;
  gap: 6px;
  min-width: 210px;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(42, 51, 83, 0.1);
}

.copy-access-details select {
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
}

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

.empty-state {
  max-width: 720px;
}

.empty-state .card {
  padding: 26px;
}

.empty-state h2 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

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

  .sidebar {
    position: static;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .main,
  .sidebar {
    padding: 18px;
  }

  .topbar {
    display: grid;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .card {
    border-radius: 20px;
  }
}

.login-body {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-page {
  width: min(100%, 440px);
}

.login-card {
  padding: 34px;
  background: var(--panel);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.login-brand {
  margin-bottom: 28px;
}

.login-card h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
}

.login-card p {
  margin: 8px 0 22px;
  color: var(--muted);
}

.login-card .primary-button {
  width: 100%;
}

.dashboard-actions,
.detail-head {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 18px;
}

.detail-head {
  justify-content: space-between;
}

.cashdesk-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 390px));
  gap: 16px;
  align-items: start;
}

.cashdesk-card {
  position: relative;
  padding: 18px;
}

.cashdesk-card-head {
  display: block;
  min-height: 38px;
  margin-bottom: 12px;
  padding-right: 88px;
}

.cashdesk-card-head .badge {
  position: absolute;
  top: 18px;
  right: 18px;
  white-space: nowrap;
}

.cashdesk-card h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.cashdesk-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.balance-metric,
.metric-grid {
  margin: 0;
}

.balance-metric {
  margin-bottom: 8px;
}

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

.balance-metric div,
.metric-grid div {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f7f9fd;
}

.summary-card {
  padding: 14px;
  border-radius: 16px;
  background: #f7f9fd;
}

.balance-metric div {
  padding: 12px 14px;
  background: linear-gradient(135deg, #f6f5ff 0%, #ffffff 100%);
  border: 1px solid #e4e2fb;
}


.balance-metric dt,
.metric-grid dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.summary-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.balance-metric dd,
.metric-grid dd {
  display: block;
  margin: 4px 0 0;
  font-weight: 850;
}

.summary-card strong {
  display: block;
  margin: 6px 0 0;
  font-weight: 850;
}

.balance-metric dd {
  color: var(--purple);
  font-size: 26px;
  line-height: 1.12;
}

.metric-grid dd {
  font-size: 16px;
}

.rating-metric.good {
  border: 1px solid #bbf7d0;
  color: #16a34a;
  background: #f0fdf4;
}

.rating-metric.warn {
  border: 1px solid #fde68a;
  color: #b45309;
  background: #fffbeb;
}

.rating-metric.bad {
  border: 1px solid #fecaca;
  color: #dc2626;
  background: #fef2f2;
}

.rating-metric dt,
.rating-metric dd {
  color: currentColor;
}

.summary-card strong {
  font-size: 20px;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.month-created,
.surrender-done {
  color: #16A34A;
  background: #DCFCE7;
}

.month-missing,
.surrender-missing {
  color: #DC2626;
  background: #FEE2E2;
}

.surrender-neutral {
  color: #64748B;
  background: #F1F5F9;
}

.sync-time {
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.cashdesk-card .primary-button,
.cashdesk-card .ghost-button {
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13px;
}

.sync-error {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--danger);
  background: #fff0f3;
  font-weight: 700;
}

.empty-dashboard {
  grid-column: 1 / -1;
  padding: 26px;
}

.empty-dashboard h2 {
  margin: 0 0 8px;
}

.empty-dashboard p {
  margin: 0 0 18px;
  color: var(--muted);
}


.dashboard-overview-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.dashboard-overview-card {
  min-height: 96px;
  padding: 16px;
  border-radius: 18px;
}

.dashboard-overview-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.dashboard-overview-card strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 24px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.rating-overview-card.good {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.rating-overview-card.good span,
.rating-overview-card.good strong {
  color: #16a34a;
}

.rating-overview-card.warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.rating-overview-card.warn span,
.rating-overview-card.warn strong {
  color: #b45309;
}

.rating-overview-card.bad {
  border-color: #fecaca;
  background: #fef2f2;
}

.rating-overview-card.bad span,
.rating-overview-card.bad strong {
  color: #dc2626;
}

.attention-card {
  padding: 18px;
  margin-top: 18px;
  margin-bottom: 0;
}

.attention-list {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
}

.attention-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  width: min(100%, 320px);
  min-height: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: #f8fafc;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.attention-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(42, 51, 83, 0.1);
  border-color: rgba(77, 73, 169, 0.25);
}

.attention-item i {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--purple);
}

.attention-item strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
}

.attention-item ul {
  display: grid;
  gap: 3px;
  margin: 6px 0 0;
  padding-left: 15px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.attention-item li::marker {
  color: currentColor;
}

.attention-item.danger {
  background: #fff1f2;
  border-color: #fecdd3;
}

.attention-item.danger i {
  background: #dc2626;
}

.attention-item.warning {
  background: #fff7ed;
  border-color: #fed7aa;
}

.attention-item.warning i {
  background: #f97316;
}

.attention-item.notice {
  background: var(--purple-soft);
  border-color: rgba(77, 73, 169, 0.18);
}

.dashboard-list-actions {
  align-items: end;
  justify-content: space-between;
}

.sort-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.sort-form select {
  min-height: 40px;
  min-width: 230px;
  padding: 9px 38px 9px 13px;
  border-color: rgba(77, 73, 169, 0.22);
  border-radius: 999px;
  color: var(--purple);
  background: var(--purple-soft);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--purple) 50%), linear-gradient(135deg, var(--purple) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 13px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.cashdesk-status-stack {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  justify-items: end;
  gap: 6px;
}

.cashdesk-status-stack .badge {
  position: static;
}

.rating-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.rating-pill.good {
  color: #16a34a;
  background: #dcfce7;
}

.rating-pill.warn {
  color: #b45309;
  background: #fef3c7;
}

.rating-pill.bad {
  color: #dc2626;
  background: #fee2e2;
}

.rating-value.good {
  color: #16a34a;
}

.rating-value.warn {
  color: #b45309;
}

.rating-value.bad {
  color: #dc2626;
}


.summary-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.operations-card {
  padding: 24px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.operations-table {
  min-width: 1250px;
}

@media (max-width: 1180px) {
  .dashboard-overview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-cards,
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .dashboard-overview-grid,
  .cashdesk-cards,
  .summary-cards,
  .filters {
    grid-template-columns: 1fr;
  }
}

.sheet-info {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f7f9fd;
  color: #4b5268;
  font-size: 13px;
}

.sheet-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.sheet-list.muted {
  padding-left: 0;
  color: var(--muted);
}

@media (max-width: 520px) {
  .cashdesk-card {
    padding: 16px;
  }

  .cashdesk-card-head {
    padding-right: 82px;
  }

  .cashdesk-card-head .badge {
    top: 16px;
    right: 16px;
  }

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

  .balance-metric dd {
    font-size: 24px;
    overflow-wrap: anywhere;
  }
}

.employee-profile-head {
  align-items: center;
}

.profile-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.employee-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding: 22px 24px;
  margin-bottom: 22px;
}

.employee-hero p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.employee-hero h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.employee-hero span {
  display: inline-block;
  margin-top: 7px;
  color: var(--purple);
  font-weight: 800;
}

.employee-hero-meta {
  display: grid;
  gap: 8px;
  min-width: 240px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.profile-section,
.profile-grid,
.profile-card {
  margin-bottom: 20px;
}

.compact-section-head {
  align-items: flex-start;
  margin-bottom: 14px;
}

.compact-section-head h2 {
  margin: 0;
  font-size: 18px;
}

.control-metrics {
  display: grid;
  grid-template-columns: minmax(260px, 1.45fr) repeat(5, minmax(145px, 1fr));
  gap: 14px;
}

.control-metric {
  padding: 17px;
  min-height: 108px;
}

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

.control-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 21px;
  line-height: 1.15;
}

.main-metric {
  background: linear-gradient(135deg, #f6f5ff 0%, #ffffff 78%);
  border-color: #e4e2fb;
}

.main-metric strong {
  color: var(--purple);
  font-size: 34px;
}

.profile-grid {
  display: grid;
  gap: 20px;
}

.two-columns {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
}

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

.profile-card {
  padding: 22px;
}

.profile-table-wrap {
  overflow-x: auto;
}

.profile-table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.profile-table th {
  padding: 0 12px 4px;
  font-size: 12px;
}

.profile-table td {
  padding: 12px;
  background: #fbfcff;
}

.table-status,
.warning-badge,
.tag-list span,
.muted-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-weight: 800;
}

.table-status {
  padding: 6px 9px;
  font-size: 12px;
}

.table-status.done {
  color: #16A34A;
  background: #DCFCE7;
}

.table-status.missing {
  color: #DC2626;
  background: #FEE2E2;
}

.warning-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.warning-badge {
  padding: 8px 10px;
  font-size: 12px;
}

.warning-badge.ok {
  color: #16A34A;
  background: #DCFCE7;
}

.warning-badge.warning {
  color: #b45309;
  background: #fef3c7;
}

.warning-badge.danger {
  color: #DC2626;
  background: #FEE2E2;
}

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

.access-columns h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.tag-list {
  display: flex;
  min-height: 88px;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: #f7f9fd;
}

.tag-list span,
.muted-tag {
  padding: 7px 9px;
  color: var(--purple);
  background: var(--purple-soft);
  font-size: 12px;
}

.danger-tags span {
  color: #DC2626;
  background: #FEE2E2;
}

.exception-tags span {
  color: #64748B;
  background: #F1F5F9;
}

.rank-list,
.unused-list,
.latest-operations {
  display: grid;
  gap: 9px;
}

.rank-list div,
.unused-list div,
.operation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 14px;
  background: #f7f9fd;
}

.rank-list span,
.unused-list span,
.operation-row span {
  color: #4b5268;
  font-size: 13px;
}

.rank-list strong,
.operation-row b {
  color: var(--purple);
  font-size: 16px;
}

.unused-list small {
  color: var(--muted);
  white-space: nowrap;
}

.timeline-placeholder {
  min-height: 154px;
  padding: 16px;
  border-radius: 14px;
  background: #f7f9fd;
  color: var(--muted);
}

.timeline-placeholder p {
  margin: 0;
}

.latest-operations-card .section-head {
  align-items: center;
}

.operation-row strong {
  display: block;
  margin-bottom: 4px;
}

.operation-row b {
  white-space: nowrap;
}

.empty-mini {
  padding: 14px;
  border-radius: 14px;
  color: var(--muted);
  background: #f7f9fd;
  font-weight: 700;
}

@media (max-width: 1280px) {
  .control-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .main-metric {
    grid-column: span 2;
  }

  .two-columns,
  .three-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .employee-hero,
  .detail-head,
  .profile-actions,
  .latest-operations-card .section-head {
    display: grid;
  }

  .employee-hero-meta {
    min-width: 0;
    text-align: left;
  }

  .control-metrics,
  .access-columns {
    grid-template-columns: 1fr;
  }

  .main-metric {
    grid-column: auto;
  }
}

.compact-scroll {
  max-height: 360px;
  overflow: auto;
}

.profile-grid-stable {
  align-items: stretch;
}

.profile-grid-stable .profile-card {
  min-height: 260px;
  margin-bottom: 0;
}

.latest-table-wrap {
  max-height: 430px;
  overflow: auto;
}

.latest-operations-table {
  min-width: 1180px;
  table-layout: fixed;
  border-spacing: 0 6px;
}

.latest-operations-table th {
  padding: 0 10px 4px;
  white-space: nowrap;
}

.latest-operations-table td {
  max-width: 150px;
  height: 44px;
  padding: 8px 10px;
  font-size: 13px;
  vertical-align: middle;
}

.latest-operations-table th:nth-child(1),
.latest-operations-table td:nth-child(1) { width: 90px; }
.latest-operations-table th:nth-child(2),
.latest-operations-table td:nth-child(2) { width: 90px; }
.latest-operations-table th:nth-child(3),
.latest-operations-table td:nth-child(3) { width: 150px; }
.latest-operations-table th:nth-child(4),
.latest-operations-table td:nth-child(4) { width: 90px; }
.latest-operations-table th:nth-child(5),
.latest-operations-table td:nth-child(5) { width: 95px; }
.latest-operations-table th:nth-child(6),
.latest-operations-table td:nth-child(6) { width: 105px; }
.latest-operations-table th:nth-child(7),
.latest-operations-table td:nth-child(7) { width: 130px; }
.latest-operations-table th:nth-child(8),
.latest-operations-table td:nth-child(8) { width: 175px; }
.latest-operations-table th:nth-child(9),
.latest-operations-table td:nth-child(9) { width: 175px; }
.latest-operations-table th:nth-child(10),
.latest-operations-table td:nth-child(10) { width: 80px; }
.latest-operations-table th:nth-child(11),
.latest-operations-table td:nth-child(11) { width: 100px; }

.cell-clip {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.latest-operations-table .table-action {
  display: inline-flex;
  padding: 6px 8px;
  font-size: 12px;
}

.warning-list,
.tag-list,
.rank-list,
.unused-list,
.timeline-placeholder {
  max-height: 320px;
  overflow: auto;
}

.warnings-card {
  min-height: 0;
}

@media (max-width: 820px) {
  .compact-scroll,
  .latest-table-wrap,
  .warning-list,
  .tag-list,
  .rank-list,
  .unused-list,
  .timeline-placeholder {
    max-height: 300px;
  }
}

select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: #fbfcff;
  font: inherit;
}

.surrender-warning-grid {
  grid-template-columns: minmax(280px, 0.8fr) minmax(560px, 1.35fr);
  align-items: start;
}

.surrender-card {
  min-height: 0;
}

.surrender-head {
  gap: 12px;
}

.add-history-details {
  position: relative;
  justify-self: end;
}

.add-history-details summary,
.edit-history-details summary {
  cursor: pointer;
  list-style: none;
}

.add-history-details summary::-webkit-details-marker,
.edit-history-details summary::-webkit-details-marker {
  display: none;
}

.history-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(96px, 1fr));
  gap: 10px;
  width: min(100%, 760px);
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: #f7f9fd;
}

.history-form label {
  font-size: 12px;
}

.history-form input,
.history-form select {
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 11px;
  font-size: 13px;
}

.history-form .wide-field {
  grid-column: span 2;
}

.history-form button {
  align-self: end;
}

.inline-history-form {
  grid-template-columns: repeat(2, minmax(90px, 1fr));
  min-width: 360px;
}

.inline-history-form .wide-field {
  grid-column: 1 / -1;
}

.edit-history-details {
  position: relative;
}

.edit-history-details summary {
  color: var(--purple);
  font-size: 12px;
  font-weight: 800;
}

.danger-button {
  margin-top: 8px;
  color: #DC2626;
  background: #FEE2E2;
}

.surrender-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.surrender-stats div {
  padding: 10px 12px;
  border-radius: 13px;
  background: #f7f9fd;
}

.surrender-stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.surrender-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.surrender-table-wrap {
  max-height: 342px;
  overflow: auto;
}

.surrender-table {
  min-width: 720px;
}

.surrender-table td {
  padding: 9px 10px;
  font-size: 13px;
}

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

.sync-history-wrap {
  max-height: 640px;
  overflow: auto;
}

.sync-history-table {
  min-width: 900px;
  table-layout: fixed;
}

.sync-history-table td {
  padding: 10px 12px;
  font-size: 13px;
}

.sync-history-table th:nth-child(1),
.sync-history-table td:nth-child(1) { width: 150px; }
.sync-history-table th:nth-child(2),
.sync-history-table td:nth-child(2) { width: 90px; }
.sync-history-table th:nth-child(3),
.sync-history-table td:nth-child(3) { width: 110px; }
.sync-history-table th:nth-child(4),
.sync-history-table td:nth-child(4) { width: 180px; }
.sync-history-table th:nth-child(5),
.sync-history-table td:nth-child(5) { width: 160px; }

@media (max-width: 1280px) {
  .surrender-warning-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .history-form,
  .inline-history-form,
  .surrender-stats {
    grid-template-columns: 1fr;
  }

  .history-form .wide-field,
  .inline-history-form .wide-field {
    grid-column: auto;
  }
}

.profile-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}

.full-profile-block {
  margin-bottom: 20px;
}

.quality-card {
  min-height: 0;
}

.quality-score {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 16px;
  background: #f7f9fd;
}

.quality-score strong {
  font-size: 42px;
  line-height: 1;
}

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

.quality-score.good strong { color: #16A34A; }
.quality-score.warn strong { color: #b45309; }
.quality-score.bad strong { color: #DC2626; }

.quality-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e9f2;
}

.quality-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.quality-score.good .quality-bar i { background: #16A34A; }
.quality-score.warn .quality-bar i { background: #f59e0b; }
.quality-score.bad .quality-bar i { background: #DC2626; }

.quality-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.quality-grid div {
  padding: 10px 12px;
  border-radius: 13px;
  background: #f7f9fd;
}

.quality-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.quality-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.surrender-table th:nth-child(1),
.surrender-table td:nth-child(1) { width: 118px; }
.surrender-table th:nth-child(2),
.surrender-table td:nth-child(2) { width: 92px; }
.surrender-table th:nth-child(3),
.surrender-table td:nth-child(3) { width: 105px; }
.surrender-table th:nth-child(4),
.surrender-table td:nth-child(4) { width: 95px; }
.surrender-table th:nth-child(5),
.surrender-table td:nth-child(5) { width: 110px; }
.surrender-table th:nth-child(6),
.surrender-table td:nth-child(6) { width: 126px; }

@media (max-width: 1180px) {
  .profile-layout-grid {
    grid-template-columns: 1fr;
  }
}

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

.main-analytics-grid,
.secondary-analytics-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  align-items: stretch;
}

.main-analytics-grid {
  grid-auto-rows: 1fr;
}

.main-analytics-grid .surrender-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.main-analytics-grid .surrender-table-wrap {
  flex: 1 1 auto;
  min-height: 180px;
  max-height: none;
}

.right-stack {
  display: grid;
  grid-template-rows: minmax(0, auto) minmax(0, auto);
  align-content: stretch;
  gap: 16px;
  height: 100%;
}

.right-stack .profile-card,
.secondary-analytics-grid .profile-card {
  margin-bottom: 0;
}

.compact-warnings-card {
  align-self: start;
}

.compact-warnings-card .warning-list {
  max-height: 170px;
}

.access-wide-card {
  min-height: 0;
}

.access-wide-card .empty-mini {
  min-height: 54px;
}

.table-status.late {
  color: #b45309;
  background: #fef3c7;
}

.table-status.pending {
  color: #64748B;
  background: #F1F5F9;
}



.category-head {
  padding: 22px 24px;
  margin-bottom: 16px;
}

.category-head p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.category-head h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.category-head span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.category-tab {
  padding: 11px 14px;
  border-radius: 14px;
  color: var(--purple);
  background: var(--purple-soft);
  font-size: 13px;
  font-weight: 800;
}

.category-tab.active {
  color: #fff;
  background: var(--purple);
  box-shadow: 0 12px 24px rgba(77, 73, 169, 0.18);
}

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

.category-panel {
  padding: 22px;
  margin-bottom: 20px;
}

.basis-list-card {
  position: sticky;
  top: 20px;
}

.basis-list {
  display: grid;
  gap: 8px;
  max-height: 640px;
  overflow: auto;
}

.basis-list-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: #fbfcff;
}

.basis-list-item.active,
.basis-list-item:hover {
  border-color: #d9d6fb;
  background: #f6f5ff;
}

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

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-dot.on { color: #16A34A; }
.status-dot.off { color: #DC2626; }

.category-table-wrap {
  max-height: 680px;
  overflow: auto;
}

.category-table {
  min-width: 760px;
  table-layout: fixed;
}

.category-table th:nth-child(1),
.category-table td:nth-child(1) { width: 220px; }
.category-table th:nth-child(2),
.category-table td:nth-child(2) { width: 360px; }
.category-table th:nth-child(3),
.category-table td:nth-child(3) { width: 120px; }
.category-table th:nth-child(4),
.category-table td:nth-child(4) { width: 90px; }

.inline-select-form {
  min-width: min(100%, 360px);
}

.access-rule-list {
  display: grid;
  gap: 12px;
  max-height: 760px;
  overflow: auto;
}

.access-rule-card {
  padding: 14px;
  border-radius: 16px;
  background: #f7f9fd;
}

.access-rule-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.access-rule-head h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.access-rule-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.access-rule-head small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.mode-pill {
  align-self: flex-start;
  padding: 6px 9px;
  border-radius: 999px;
  color: #64748B;
  background: #F1F5F9;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.mode-all { color: #16A34A; background: #DCFCE7; }
.mode-only_selected { color: var(--purple); background: var(--purple-soft); }
.mode-all_except { color: #b45309; background: #fef3c7; }
.mode-none { color: #64748B; background: #F1F5F9; }

.category-access-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-height: 180px;
  overflow: auto;
}

.access-chip {
  display: inline-flex;
  padding: 7px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.access-chip.allowed {
  color: #16A34A;
  background: #DCFCE7;
}

.access-chip.blocked {
  color: #64748B;
  background: #F1F5F9;
}

.import-file-list,
.import-paths,
.import-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.import-file-list,
.import-paths {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.import-summary {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.import-file-list div,
.import-paths div,
.import-summary div {
  padding: 12px;
  border-radius: 14px;
  background: #f7f9fd;
}

.import-file-list span,
.import-paths span,
.import-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.import-file-list strong,
.import-paths strong,
.import-summary strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.import-summary strong {
  color: var(--purple);
  font-size: 24px;
}

.import-warnings {
  max-height: 320px;
  overflow: auto;
}

.access-history-table {
  min-width: 900px;
}

@media (max-width: 1100px) {
  .category-catalog-grid,
  .import-file-list,
  .import-paths,
  .import-summary {
    grid-template-columns: 1fr;
  }

  .basis-list-card {
    position: static;
  }

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


.upload-import-form {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

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

.upload-field {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f7f9fd;
}

.upload-field span {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.upload-field input[type="file"] {
  min-height: auto;
  padding: 10px;
  border-radius: 12px;
  background: #fff;
  font-size: 13px;
}

.upload-field small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

@media (max-width: 820px) {
  .import-upload-grid {
    grid-template-columns: 1fr;
  }
}


.catalog-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 220px));
  gap: 12px;
  margin-bottom: 16px;
}

.catalog-summary-card {
  padding: 16px;
}

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

.catalog-summary-card strong {
  display: block;
  margin-top: 6px;
  color: var(--purple);
  font-size: 28px;
  line-height: 1;
}

.catalog-details summary {
  cursor: pointer;
  list-style: none;
}

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

.add-catalog-details {
  margin-bottom: 12px;
}

.add-catalog-details > summary {
  display: inline-flex;
}

.catalog-inline-form {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 96px;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  background: #f7f9fd;
}

.catalog-inline-form label {
  font-size: 12px;
}

.catalog-inline-form input {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 11px;
  font-size: 13px;
}

.catalog-inline-form .wide-field {
  grid-column: 1 / -1;
}

.catalog-inline-form button {
  align-self: end;
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 11px;
  font-size: 12px;
}

.compact-switch {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.compact-switch input {
  width: 18px;
  min-height: 18px;
}

.managed-basis-item {
  gap: 10px;
}

.basis-title-link {
  display: grid;
  gap: 5px;
  color: var(--text);
}

.catalog-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.tiny-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 10px;
  color: var(--purple);
  background: var(--purple-soft);
  font-size: 12px;
  font-weight: 800;
}

.danger-mini-button {
  color: #DC2626;
  background: #FEE2E2;
}

.inline-edit-details {
  position: relative;
}

.inline-edit-details[open] {
  flex-basis: 100%;
}

.inline-edit-details[open] summary {
  margin-bottom: 4px;
}

.table-catalog-actions {
  min-width: 210px;
}

.category-edit-details[open] {
  min-width: 360px;
}

.managed-category-table {
  min-width: 980px;
}

.managed-category-table th:nth-child(1),
.managed-category-table td:nth-child(1) { width: 180px; }
.managed-category-table th:nth-child(2),
.managed-category-table td:nth-child(2) { width: 300px; }
.managed-category-table th:nth-child(3),
.managed-category-table td:nth-child(3) { width: 110px; }
.managed-category-table th:nth-child(4),
.managed-category-table td:nth-child(4) { width: 80px; }
.managed-category-table th:nth-child(5),
.managed-category-table td:nth-child(5) { width: 300px; }

@media (max-width: 720px) {
  .catalog-summary-grid,
  .catalog-inline-form {
    grid-template-columns: 1fr;
  }

  .category-edit-details[open] {
    min-width: 0;
  }
}


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

.access-cashbox-panel {
  position: sticky;
  top: 20px;
}

.access-search-input {
  width: 100%;
  min-height: 42px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.access-cashbox-list,
.access-basis-list {
  display: grid;
  gap: 8px;
  max-height: 650px;
  overflow: auto;
}

.access-cashbox-card,
.access-basis-card {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcff;
  color: var(--text);
}

.access-cashbox-card.active,
.access-cashbox-card:hover,
.access-basis-card.active,
.access-basis-card:hover {
  border-color: #d9d6fb;
  background: #f6f5ff;
}

.access-cashbox-card span,
.access-cashbox-card small,
.access-basis-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.access-empty-state {
  display: grid;
  min-height: 280px;
  place-items: center;
  border: 1px dashed #d9d6fb;
  border-radius: 16px;
  color: var(--muted);
  background: #fbfcff;
  font-weight: 800;
}

.access-editor-head h2 {
  overflow-wrap: anywhere;
}

.access-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.access-summary-grid div {
  padding: 12px;
  border-radius: 14px;
  background: #f7f9fd;
}

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

.access-summary-grid strong {
  display: block;
  margin-top: 5px;
  color: var(--purple);
  font-size: 24px;
  line-height: 1;
}

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

.access-basis-column h3,
.access-category-form h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.access-status {
  display: inline-flex;
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.access-status-all {
  color: #16A34A;
  background: #DCFCE7;
}

.access-status-partial {
  color: var(--purple);
  background: var(--purple-soft);
}

.access-status-none {
  color: #64748B;
  background: #F1F5F9;
}

.access-category-form {
  display: grid;
  gap: 12px;
  min-width: 0;
}

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

.access-category-head p {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.access-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.access-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  padding-right: 2px;
}

.access-category-tile {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 78px;
  padding: 12px 12px 12px 38px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.access-category-tile input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.access-category-tile strong {
  font-size: 13px;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: normal;
}

.access-category-tile small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  max-height: 30px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.access-category-tile small::-webkit-scrollbar {
  width: 4px;
}

.access-category-tile small::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #d9d6fb;
}

.access-checkmark {
  position: absolute;
  left: 12px;
  top: 13px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  color: transparent;
  background: #F1F5F9;
  font-size: 12px;
  font-weight: 900;
}

.access-category-tile.selected {
  border-color: #BBF7D0;
  color: #16A34A;
  background: #F0FDF4;
}

.access-category-tile.selected .access-checkmark {
  color: #fff;
  background: #16A34A;
}

.access-unsaved-bar {
  position: sticky;
  bottom: 14px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #d9d6fb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(32, 38, 64, 0.14);
}

.access-unsaved-bar[hidden] {
  display: none;
}

.access-unsaved-bar span {
  color: var(--purple);
  font-size: 13px;
  font-weight: 900;
}

.access-unsaved-bar div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 1120px) {
  .access-summary-grid {
    grid-template-columns: repeat(3, minmax(110px, 1fr));
  }

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

@media (max-width: 820px) {
  .access-manager-layout {
    grid-template-columns: 1fr;
  }

  .access-cashbox-panel {
    position: static;
  }

  .access-summary-grid {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }

  .access-category-head,
  .access-unsaved-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .access-bulk-actions,
  .access-unsaved-bar div {
    justify-content: flex-start;
  }
}


.access-open-cashdesk-button {
  flex-shrink: 0;
  align-self: flex-start;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .access-editor-head {
    flex-direction: column;
  }
}


.access-analytics-card {
  display: grid;
  gap: 12px;
}

.access-panel-head {
  align-items: flex-start;
  margin-bottom: 2px;
}

.access-edit-button {
  flex-shrink: 0;
  white-space: nowrap;
}

.access-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 45fr) minmax(260px, 30fr) minmax(220px, 25fr);
  gap: 14px;
  align-items: stretch;
}

.access-dashboard-panel {
  min-width: 0;
  padding: 14px;
  border-radius: 16px;
  background: #f7f9fd;
}

.access-dashboard-panel h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.active-basis-list {
  display: grid;
  gap: 8px;
  max-height: 440px;
  overflow: auto;
  padding-right: 2px;
}

.active-basis-row {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.active-basis-row > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  cursor: pointer;
  list-style: none;
}

.active-basis-row > summary::-webkit-details-marker {
  display: none;
}

.active-basis-row > summary div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.active-basis-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.active-basis-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.active-basis-row i {
  color: var(--purple);
  font-style: normal;
  font-weight: 900;
}

.access-state {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.access-state.full {
  color: #16A34A;
  background: #DCFCE7;
}

.access-state.partial {
  color: var(--purple);
  background: var(--purple-soft);
}

.active-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 150px;
  overflow: auto;
  padding: 0 12px 12px;
}

.active-category-chips span {
  padding: 6px 8px;
  border-radius: 999px;
  color: #16A34A;
  background: #DCFCE7;
  font-size: 12px;
  font-weight: 900;
}

.category-mini-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.category-mini-summary div {
  padding: 10px;
  border-radius: 13px;
  background: #fff;
}

.category-mini-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.category-mini-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--purple);
  font-size: 17px;
}

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

.access-analytics-section + .access-analytics-section {
  margin-top: 12px;
}

.access-analytics-section h4 {
  margin: 0;
  font-size: 13px;
}

.access-top-list,
.access-unused-list {
  display: grid;
  gap: 6px;
}

.access-top-list div,
.access-unused-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
}

.access-top-list span,
.access-unused-list span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
}

.access-top-list strong,
.more-count {
  color: var(--purple);
  font-size: 13px;
  white-space: nowrap;
}

.access-unused-list small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.more-count {
  display: block;
  margin-top: 2px;
}

.access-dashboard-warning-panel {
  align-self: start;
}

.access-warning-badges {
  max-height: 220px;
  overflow: auto;
}

.access-warning-badges .warning-badge {
  width: fit-content;
}

@media (max-width: 1180px) {
  .access-dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }

  .access-dashboard-warning-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .access-panel-head,
  .access-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .access-dashboard-warning-panel {
    grid-column: auto;
  }

  .active-basis-row > summary {
    grid-template-columns: minmax(0, 1fr) 18px;
  }

  .access-state {
    grid-column: 1 / -1;
    width: fit-content;
  }
}


.access-analytics-row {
  display: grid;
  grid-template-columns: minmax(0, 45fr) minmax(280px, 30fr) minmax(240px, 25fr);
  gap: 14px;
  align-items: stretch;
}

.access-analytics-row > .card {
  min-width: 0;
  min-height: 0;
  margin: 0;
  max-height: 560px;
  overflow: hidden;
}

.access-analytics-row .access-overview-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.access-overview-card,
.access-rating-card,
.access-recommendations-card {
  display: grid;
  gap: 12px;
  height: 100%;
}

.access-overview-card {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.access-rating-card,
.access-recommendations-card {
  grid-template-rows: auto minmax(0, 1fr);
}

.access-overview-summary {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  margin-bottom: 2px;
}

.access-overview-bases {
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 2px;
}

.access-rating-head {
  align-items: flex-start;
}

.category-sort-select {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.category-sort-select select {
  min-height: 34px;
  min-width: 148px;
  padding: 7px 34px 7px 12px;
  border: 1px solid rgba(77, 73, 169, 0.22);
  border-radius: 999px;
  color: var(--purple);
  background: var(--purple-soft);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--purple) 50%), linear-gradient(135deg, var(--purple) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.category-sort-select select:focus {
  box-shadow: 0 0 0 3px rgba(77, 73, 169, 0.14);
}

.category-rating-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 2px;
}

.category-rating-list[hidden] {
  display: none;
}

.category-rating-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: #f7f9fd;
}

.category-rating-row b {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  color: var(--purple);
  background: var(--purple-soft);
  font-size: 12px;
}

.category-rating-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 900;
}

.category-rating-row strong {
  color: var(--purple);
  font-size: 14px;
}

.category-rating-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.category-rating-row i {
  grid-column: 2 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #E5E7EB;
}

.category-rating-row i em {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), #16A34A);
}

.access-recommendation-list {
  display: grid;
  gap: 10px;
  align-content: start;
  align-items: start;
  grid-auto-rows: max-content;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.access-recommendation-item {
  display: grid;
  gap: 8px;
  align-self: start;
  padding: 12px;
  border-radius: 14px;
  background: #f7f9fd;
}

.access-recommendation-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.access-recommendation-item.warning {
  background: #FFFBEB;
}

.access-recommendation-item.danger {
  background: #FEF2F2;
}

@media (max-width: 900px) {
  .access-analytics-row {
    grid-template-columns: 1fr;
  }

  .access-overview-summary {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .access-rating-head {
    flex-direction: column;
  }

  .category-sort-select {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .access-overview-summary {
    grid-template-columns: 1fr;
  }
}

.computed-edit-hint {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
}


.settings-page-head {
  margin-bottom: 16px;
}

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

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

.settings-card {
  padding: 20px;
}

.settings-card-head h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.settings-card-head p,
.settings-save-bar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.settings-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.setting-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f8fafc;
}

.setting-field span {
  min-width: 0;
}

.setting-field strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.setting-field small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.setting-field input[type="text"],
.setting-field input[type="number"] {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #d8dce6;
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.setting-field input[type="checkbox"] {
  justify-self: end;
  width: 22px;
  height: 22px;
  accent-color: var(--purple);
}

.settings-save-bar {
  position: sticky;
  bottom: 14px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
}

.settings-save-bar strong {
  display: block;
  margin-bottom: 4px;
}

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

  .setting-field {
    grid-template-columns: 1fr;
  }

  .setting-field input[type="checkbox"] {
    justify-self: start;
  }

  .settings-save-bar {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }
}


.settings-tabs {
  margin-top: -4px;
}

.settings-placeholder-card {
  padding: 22px;
}

.settings-placeholder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.settings-placeholder-grid article {
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #f8fafc;
}

.settings-placeholder-grid h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.settings-placeholder-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

@media (max-width: 900px) {
  .settings-placeholder-grid {
    grid-template-columns: 1fr;
  }
}
