:root {
  --sidebar: #1f3444;
  --sidebar-2: #243f54;
  --sidebar-soft: #2c4c63;
  --accent: #2f8fcf;
  --accent-2: #16a085;
  --warn: #f39c12;
  --danger: #d9534f;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --head: #eef3f7;
  --border: #dfe6ec;
  --text: #182b39;
  --muted: #6f7f8c;
  --ok: #20b96d;
  --no: #df4d43;
  --shadow: 0 12px 28px rgba(24, 43, 57, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font: 14px/1.45 "Segoe UI", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  background: var(--sidebar);
  color: #dce9f1;
  z-index: 30;
  box-shadow: 8px 0 22px rgba(14, 35, 50, 0.12);
  transition: width 0.18s ease, transform 0.18s ease;
}

.brand {
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 18px;
  background: #365b74;
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
}

.brand span {
  font-weight: 800;
}

.profile {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 18px 14px;
  background: #1a2d3b;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: #183044;
  background: #f6d15d;
  font-weight: 800;
}

.profile strong,
.profile small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile strong {
  color: #fff;
  font-size: 14px;
}

.profile small {
  color: #b6c6d2;
  font-size: 12px;
}

nav {
  padding: 12px 10px;
}

nav a,
nav button.nav-section {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  color: #dbe7ef;
  border-radius: 6px;
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

nav a + a {
  margin-top: 4px;
}

.nav-group {
  margin-top: 8px;
}

nav button.nav-section {
  color: #f6fbff;
  background: var(--sidebar-2);
  font-weight: 600;
  cursor: pointer;
}

nav a.active,
nav a:hover,
nav button.nav-section:hover,
.nav-group.open > .nav-section {
  background: var(--accent);
  color: #fff;
}

.nav-caret {
  margin-left: auto;
  transition: transform 0.16s ease;
}

.nav-group.open .nav-caret {
  transform: rotate(180deg);
}

.nav-submenu {
  display: none;
  padding: 4px 0 0 12px;
}

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

.nav-submenu a {
  min-height: 36px;
  font-size: 13px;
}

.nav-ico {
  display: inline-grid;
  place-items: center;
  width: 18px;
  flex: 0 0 18px;
  text-align: center;
}

.svg-ico {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.icon .svg-ico,
.btn-ico .svg-ico,
.nav-ico .svg-ico {
  width: 17px;
  height: 17px;
}

.stat-icon .svg-ico,
.payment-card > span .svg-ico {
  width: 24px;
  height: 24px;
}

.nav-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main {
  min-height: 100vh;
  margin-left: 240px;
  transition: margin-left 0.18s ease;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.hamburger {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #4d6475;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
}

.hamburger:hover {
  background: #eef4f8;
}

.top-user {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
}

.top-user a {
  color: #286f9f;
  font-weight: 600;
}

.page {
  padding: 22px;
}

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

h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.panel,
.modalish,
.filter-panel {
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  overflow: hidden;
}

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

.panel h2 {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  font-size: 16px;
}

.grid {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: var(--surface);
}

.grid th,
.grid td {
  padding: 13px 16px;
  border-bottom: 1px solid #e9eef3;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.grid th {
  color: #244052;
  background: var(--head);
  font-weight: 700;
}

.grid tbody tr:hover td {
  background: #fbfdff;
}

.grid .center {
  text-align: center;
}

.grid .empty {
  padding: 26px;
  color: var(--muted);
  text-align: center;
}

.grid tr.total td {
  font-weight: 700;
  background: #f8fbfd;
}

.grid tr.spacer td {
  height: 14px;
  background: var(--surface);
  border-bottom: 0;
}

.report th,
.report td {
  padding-inline: 12px;
}

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

.icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fff;
  border-radius: 5px;
  font-weight: 700;
}

.icon.edit,
.icon.money {
  background: var(--warn);
}

.icon.user {
  background: #8fa1aa;
}

.icon.search {
  background: #5f7f8b;
}

.icon.sales {
  background: #1f9d6b;
}

.icon.logs {
  background: #2878a8;
}

.icon.promo {
  background: #b97816;
}

.icon.cash {
  background: #9b3b32;
}

.icon.manual {
  background: #356c9b;
}

.icon.cassette {
  background: #7b5bb7;
}

.icon:hover {
  transform: translateY(-1px);
  filter: brightness(0.98);
}

.ok {
  color: var(--ok);
  font-weight: 800;
}

.no {
  color: var(--no);
  font-weight: 800;
}

.dropdown {
  position: relative;
  flex: 0 0 auto;
}

.dropdown summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  color: #244052;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(24, 43, 57, 0.05);
  cursor: pointer;
  list-style: none;
}

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

.dropdown summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.dropdown[open] {
  z-index: 40;
}

.dropdown[open] summary {
  border-color: #c7d8e5;
  background: #f8fbfd;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 230px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(24, 43, 57, 0.16);
}

.dropdown-menu a,
.dropdown-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  color: #344d5f;
  background: transparent;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
  background: #f1f6f9;
}

.menu-ico,
.btn-ico {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: #456172;
  background: #edf4f8;
  border-radius: 5px;
  font-weight: 800;
}

.menu-ico.success {
  color: #128a57;
  background: #e7f7ef;
}

.menu-ico.danger {
  color: #b13a36;
  background: #fdeceb;
}

.alert {
  margin-bottom: 14px;
  padding: 12px 14px;
  color: #23536e;
  background: #e8f5fc;
  border: 1px solid #cde8f5;
  border-radius: 8px;
}

.alert.error {
  color: #7d302b;
  background: #fdeeed;
  border-color: #f5cbc7;
}

.modalish {
  max-width: 840px;
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-head h3 {
  margin: 0;
  font-size: 17px;
}

.modal-head a {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #667784;
  border-radius: 6px;
}

.modal-head a:hover {
  background: #eef4f8;
}

.edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px 18px;
  padding: 16px;
}

.edit-form label,
.filter-panel label {
  display: grid;
  gap: 6px;
  color: #465b69;
  font-weight: 600;
}

.edit-form input,
.edit-form select,
.filter-panel input,
.filter-panel select {
  min-height: 38px;
  padding: 8px 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid #cfdbe4;
  border-radius: 6px;
  outline: none;
}

.edit-form input:focus,
.edit-form select:focus,
.filter-panel input:focus,
.filter-panel select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 143, 207, 0.14);
}

.edit-form .check {
  display: flex;
  align-items: center;
  gap: 9px;
}

.grant-panel {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
  padding: 12px;
  color: #465b69;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.grant-panel strong {
  color: var(--text);
}

.grant-panel small {
  color: var(--muted);
  font-weight: 600;
}

.grant-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 180px;
  overflow: auto;
  padding: 4px;
}

.grant-choice {
  display: flex !important;
  align-items: center;
  min-height: 34px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #dfe6ec;
  border-radius: 6px;
}

.grant-choice input {
  width: 16px;
  min-height: auto;
  margin: 0;
  padding: 0;
}

.grant-choice span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-status {
  padding: 12px;
  color: #5e7180;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  grid-column: 1 / -1;
}

.form-actions a,
.form-actions button,
.filter-panel button,
.print-btn,
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  color: #344d5f;
  background: #eef3f7;
  border: 1px solid #cfdbe4;
  border-radius: 6px;
  cursor: pointer;
}

.primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}

.primary .btn-ico {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.print-btn {
  background: #fff;
}

.primary:hover,
.print-btn:hover,
.filter-panel button:hover,
.form-actions a:hover {
  filter: brightness(0.98);
}

.filter-panel {
  padding: 16px;
}

.filter-panel form {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-panel .device-select-label {
  display: grid;
  gap: 6px;
  min-width: min(380px, 100%);
  color: #465b69;
  font-weight: 600;
}

.device-multi {
  position: relative;
}

.device-multi summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 8px 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid #cfdbe4;
  border-radius: 6px;
  cursor: pointer;
  list-style: none;
}

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

.device-multi summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: 14px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.device-multi[open] {
  z-index: 45;
}

.device-multi[open] summary {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 143, 207, 0.14);
}

.device-multi-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(430px, calc(100vw - 44px));
  max-height: 330px;
  overflow: auto;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(24, 43, 57, 0.18);
}

.device-multi:not([open]) .device-multi-menu {
  display: none !important;
}

.device-multi[open] .device-multi-menu {
  display: block;
}

.device-choice {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 7px 9px;
  color: #304a5d;
  border-radius: 6px;
  cursor: pointer;
}

.device-choice:hover {
  background: #f1f6f9;
}

.device-choice.all {
  margin-bottom: 5px;
  font-weight: 800;
  border-bottom: 1px solid #edf2f6;
  border-radius: 6px 6px 0 0;
}

.device-choice input {
  width: 16px;
  height: 16px;
  min-height: auto;
  padding: 0;
  flex: 0 0 auto;
}

.device-choice span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-panel select {
  min-width: min(320px, 100%);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 106px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 8px;
  font-size: 20px;
  font-weight: 800;
}

.stat-card small,
.stat-card em {
  display: block;
  color: var(--muted);
  font-style: normal;
}

.stat-card small {
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin: 2px 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.15;
}

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

.payment-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(24, 43, 57, 0.06);
}

.payment-card > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  font-weight: 900;
}

.payment-card small,
.payment-card em {
  display: block;
  color: var(--muted);
  font-style: normal;
}

.payment-card strong {
  display: block;
  margin: 1px 0;
  font-size: 21px;
}

.payment-card.cash {
  border-left-color: #b94a48;
}

.payment-card.cash > span {
  background: #b94a48;
}

.payment-card.card {
  border-left-color: #f39c12;
}

.payment-card.card > span {
  background: #f39c12;
}

.payment-card.promo {
  border-left-color: #3498db;
}

.payment-card.promo > span {
  background: #3498db;
}

.charts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
}

.chart-panel {
  min-height: 260px;
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 0 14px 14px;
  color: var(--muted);
  font-size: 12px;
}

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

.chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.chart-legend .cash {
  background: #c94f55;
}

.chart-legend .card {
  background: #2f8fcf;
}

.chart-legend .promo {
  background: #f2b13f;
}

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

canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 14px;
}

.chart-tooltip {
  position: fixed;
  z-index: 100;
  max-width: 250px;
  padding: 9px 11px;
  color: #fff;
  background: rgba(23, 39, 51, 0.94);
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(20, 36, 48, 0.22);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  white-space: pre-line;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.1s ease, transform 0.1s ease;
}

.chart-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(13, 26, 34, 0.52);
  z-index: 80;
}

.detail-modal {
  width: min(980px, calc(100vw - 48px));
  max-height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(8, 22, 33, 0.28);
}

.detail-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.detail-modal-head span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
}

.detail-modal-head h2 {
  font-size: 20px;
}

.detail-modal-head a {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #667784;
  border-radius: 6px;
  font-size: 24px;
  line-height: 1;
}

.detail-modal-head a:hover {
  background: #eef4f8;
}

.detail-modal-body {
  max-height: calc(min(760px, 100vh - 48px) - 76px);
  overflow: auto;
  padding: 18px 20px 20px;
}

.detail-modal .detail-tabs {
  display: flex;
  gap: 22px;
  margin-bottom: 16px;
  padding: 0;
  border-bottom: 1px solid var(--border);
}

.detail-modal .detail-tabs a {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 9px 2px 11px;
  color: var(--muted);
  background: transparent;
  border-radius: 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.detail-modal .detail-tabs a + a {
  margin-top: 0;
}

.detail-modal .detail-tabs a:hover {
  color: var(--accent);
  background: transparent;
}

.detail-modal .detail-tabs a.active {
  color: var(--accent);
  background: transparent;
}

.detail-modal .detail-tabs a.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  content: "";
}

.detail-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 230px)) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  background: #f7fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.detail-filter label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-filter input {
  height: 38px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid #cfdbe4;
  border-radius: 6px;
}

.mini-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.mini-stat {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  min-height: 74px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.mini-stat span {
  display: grid;
  grid-row: 1 / 3;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: var(--sidebar-soft);
  border-radius: 7px;
  font-weight: 900;
}

.mini-stat small {
  color: var(--muted);
  font-weight: 700;
}

.mini-stat strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.compact-grid {
  min-width: 720px;
}

.log-grid {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.log-grid th:nth-child(1),
.log-grid td:nth-child(1) {
  width: 150px;
}

.log-grid th:nth-child(2),
.log-grid td:nth-child(2) {
  width: 110px;
}

.log-message {
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}

.log-problem-row td {
  background: #fff5f4;
  border-top-color: #f5c3bd;
  border-bottom-color: #f5c3bd;
}

.log-problem-row .log-message {
  color: #8f2f2a;
  font-weight: 800;
}

.compact-grid th,
.compact-grid td {
  padding: 11px 12px;
}

.token-added-grid th:nth-child(n + 2),
.token-added-grid td:nth-child(n + 2) {
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  color: #365061;
  background: #edf4f8;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.badge.cash {
  color: #8c342f;
  background: #fcebe9;
}

.badge.card {
  color: #8a5608;
  background: #fff3d9;
}

.badge.success {
  color: #1d6f4a;
  background: #e5f7ee;
}

.badge.promo,
.badge.info {
  color: #1c638b;
  background: #e7f3fb;
}

.badge.warn {
  color: #85600d;
  background: #fff5cf;
}

.badge.danger {
  color: #9a332d;
  background: #fde9e7;
}

.empty-state {
  padding: 26px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px dashed #cfdbe4;
  border-radius: 8px;
  text-align: center;
}

.sidebar-collapsed .sidebar {
  width: 76px;
}

.sidebar-collapsed .main {
  margin-left: 76px;
}

.sidebar-collapsed .brand {
  justify-content: center;
  padding: 0;
  font-size: 0;
}

.sidebar-collapsed .brand span {
  font-size: 24px;
}

.sidebar-collapsed .profile {
  grid-template-columns: 1fr;
  justify-items: center;
  padding-inline: 10px;
}

.sidebar-collapsed .profile strong,
.sidebar-collapsed .profile small,
.sidebar-collapsed .nav-text,
.sidebar-collapsed .nav-caret {
  display: none;
}

.sidebar-collapsed nav {
  padding-inline: 10px;
}

.sidebar-collapsed nav a,
.sidebar-collapsed nav button.nav-section {
  justify-content: center;
  padding: 0;
}

.sidebar-collapsed .nav-submenu {
  padding-left: 0;
}

.sidebar-backdrop {
  display: none;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(20, 41, 56, 0.94), rgba(39, 91, 113, 0.9)),
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.16), transparent 28%);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(360px, 1fr);
  width: min(920px, calc(100vw - 40px));
  overflow: hidden;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(8, 22, 33, 0.28);
}

.login-shell-single {
  grid-template-columns: 1fr;
  width: min(520px, calc(100vw - 40px));
}

.login-hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 470px;
  padding: 36px;
  color: #fff;
  background: linear-gradient(160deg, #1f3444, #2c6078);
}

.login-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: #1f3444;
  background: #f6d15d;
  border-radius: 10px;
  font-weight: 900;
}

.login-hero h1 {
  margin: auto 0 10px;
  font-size: 42px;
  line-height: 1;
}

.login-hero p {
  max-width: 320px;
  margin: 0;
  color: #d9e8ef;
  font-size: 16px;
}

.login-metrics {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.login-metrics span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  color: #d7e8ef;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

.login-box {
  width: 100%;
  padding: 42px;
  background: #fff;
}

.login-title {
  margin-bottom: 22px;
  text-align: center;
}

.login-title h2 {
  margin-bottom: 4px;
  font-size: 30px;
}

.login-title span {
  color: var(--muted);
}

.login-box form,
.login-box label {
  display: grid;
  gap: 9px;
}

.login-box form {
  gap: 15px;
}

.login-box label {
  color: #465b69;
  font-weight: 700;
}

.login-box input {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #cfdbe4;
  border-radius: 6px;
  outline: none;
}

.login-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 143, 207, 0.14);
}

.login-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
}

@media (max-width: 1100px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payment-grid,
  .mini-stat-grid {
    grid-template-columns: 1fr;
  }

  .charts,
  .charts + .charts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 880px) {
  .login-shell {
    grid-template-columns: 1fr;
    width: min(520px, calc(100vw - 32px));
  }

  .login-hero {
    min-height: auto;
    padding: 28px;
  }

  .login-hero h1 {
    margin-top: 34px;
    font-size: 34px;
  }

  .login-box {
    padding: 28px;
  }
}

@media (max-width: 820px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .main,
  .sidebar-collapsed .main {
    margin-left: 0;
  }

  .sidebar-open .sidebar {
    width: 240px;
    transform: translateX(0);
  }

  .sidebar-open .sidebar-backdrop {
    position: fixed;
    inset: 0;
    display: block;
    background: rgba(13, 26, 34, 0.38);
    z-index: 25;
  }

  .page {
    padding: 16px;
  }

  .modal-overlay {
    padding: 12px;
  }

  .detail-modal {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .detail-modal-body {
    max-height: calc(100vh - 100px);
    padding: 14px;
  }

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

  .content-head {
    align-items: flex-start;
  }

  .dropdown-menu {
    right: 0;
    left: auto;
  }

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

  .grid {
    display: table;
  }

  .top-user span {
    display: none;
  }
}

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

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

  .content-head {
    flex-direction: column;
  }

  .print-btn,
  .dropdown {
    width: 100%;
  }

  .dropdown summary,
  .print-btn {
    width: 100%;
    justify-content: center;
  }

  .login-page {
    padding: 16px;
  }
}
