:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --tint: #eef2ff;
  --teal: #0d9488;
  --text: #111827;
  --text-2: #6b7280;
  --text-3: #4b5563;
  --muted: #9ca3af;
  --border: #e5e7eb;
  --divider: #f3f4f6;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --success-text: #15803d;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --warning-text: #b45309;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --info: #2563eb;
  --info-bg: #dbeafe;
  --info-text: #1d4ed8;
  --sidebar-w: 248px;
  --header-h: 64px;
  --radius: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
  min-height: 100vh;
  margin: 0;
}
body.promo-login,
body.promo-app {
  margin: 0 !important;
  background: var(--bg);
}
/* Kill common WP content wrappers that shift layout */
body.promo-login .wp-site-blocks,
body.promo-app .wp-site-blocks,
body.promo-login .entry-content,
body.promo-app .entry-content {
  margin: 0;
  padding: 0;
  max-width: none;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: none; background: none; }
table { border-collapse: collapse; width: 100%; }
ul, ol { list-style: none; }

/* Typography */
.h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.h3 { font-size: 18px; font-weight: 600; }
.body { font-size: 15px; }
.secondary { font-size: 13px; color: var(--text-2); }
.caption { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.page-title { font-size: 22px; font-weight: 600; }
.page-sub { font-size: 13px; color: var(--text-2); margin-top: 4px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 16px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
.btn-sm { height: 28px; padding: 0 12px; font-size: 11px; border-radius: 6px; }
.btn-md { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-primary:disabled, .btn-primary.is-disabled {
  background: #a5b4fc; color: #fff; cursor: not-allowed; pointer-events: none;
}
.btn-secondary {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--divider); }
.btn-danger {
  background: var(--surface); color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-danger:hover { background: var(--danger-bg); }
.btn-link { color: var(--primary); font-weight: 500; font-size: 13px; height: auto; padding: 0; }
.btn-block { width: 100%; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  height: 22px; padding: 0 10px; border-radius: 11px;
  font-size: 11px; font-weight: 500; white-space: nowrap;
}
.badge-active { background: var(--success-bg); color: var(--success-text); }
.badge-paused { background: #ffedd5; color: #c2410c; }
.badge-moderation { background: var(--warning-bg); color: var(--warning-text); }
.badge-draft { background: var(--divider); color: var(--text-3); }
.badge-done { background: var(--info-bg); color: var(--info-text); }
.badge-rejected { background: var(--danger-bg); color: var(--danger); }
.badge-none { background: var(--divider); color: var(--text-3); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 500; color: var(--text-3); }
.input, .select, .textarea {
  height: 40px; padding: 0 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.input.is-error { border-color: var(--danger); }
.field-error { font-size: 12px; color: var(--danger); }
.checkbox {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-3); cursor: pointer;
  line-height: 1.2;
}
.checkbox input {
  width: 16px; height: 16px; margin: 0; flex-shrink: 0;
  accent-color: var(--primary); vertical-align: middle;
}

/* Cards / surfaces */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.metric-card { padding: 16px; min-height: 104px; display: flex; flex-direction: column; }
.metric-card .label { font-size: 12px; color: var(--text-2); line-height: 1.3; }
.metric-card .value { font-size: 22px; font-weight: 600; margin-top: 6px; letter-spacing: -0.02em; line-height: 1.2; }
.metric-card .delta { font-size: 12px; font-weight: 500; color: var(--success); margin-top: auto; padding-top: 10px; }
.metric-card.metric-balance {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.metric-card.metric-balance .label,
.metric-card.metric-balance .hint { color: #c7d2fe; }
.metric-card.metric-balance .hint { font-size: 12px; margin-top: auto; padding-top: 10px; }
.metric-card.metric-balance .delta { color: #c7d2fe; }

.cover {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 56px; border-radius: 4px;
  color: #fff; font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.cover-sm { width: 32px; height: 44px; font-size: 10px; border-radius: 3px; }
.cover-lg { width: 48px; height: 64px; font-size: 13px; }
.cover-tg { background: #6366f1; }
.cover-ka { background: #0d9488; }
.cover-ss { background: #d97706; }
.cover-dg { background: #e11d48; }
.cover-gl { background: #475569; }

.progress {
  height: 6px; background: var(--divider); border-radius: 3px; overflow: hidden;
}
.progress > span {
  display: block; height: 100%; background: var(--primary); border-radius: 3px;
}

.chip {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px;
  border-radius: 18px; border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; color: var(--text-3); cursor: pointer;
}
.chip.is-active { background: var(--tint); border-color: transparent; color: var(--primary); font-weight: 500; }

.seg {
  display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; height: 36px;
}
.seg button {
  padding: 0 14px; font-size: 13px; color: var(--text-2); height: 100%;
  display: inline-flex; align-items: center;
}
.seg button.is-active {
  background: var(--tint); color: var(--primary); font-weight: 500;
  border-radius: 6px; margin: 4px; height: calc(100% - 8px);
}

/* Layout app */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: fixed;
  inset: 0 auto 0 0; z-index: 40; padding: 24px 16px;
}
body.admin-bar .sidebar { top: 32px; height: calc(100% - 32px); }
@media screen and (max-width: 782px) {
  body.admin-bar .sidebar { top: 46px; height: calc(100% - 46px); }
}
.brand { display: flex; align-items: center; gap: 12px; }
.sidebar .brand { margin-bottom: 40px; padding: 0 8px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--primary);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px;
  flex-shrink: 0;
}
.brand-title { font-size: 14px; font-weight: 600; line-height: 1.2; }
.brand-sub { font-size: 10px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  height: 40px; padding: 0 16px; border-radius: var(--radius);
  color: var(--text-3); font-size: 13px; font-weight: 500;
}
.nav-item:hover { background: var(--divider); color: var(--text); }
.nav-item.is-active { background: var(--tint); color: var(--primary); }
.nav-icon {
  width: 20px; height: 20px; border-radius: 5px; background: #d1d5db; flex-shrink: 0;
  display: grid; place-items: center; font-size: 10px; color: #fff;
}
.nav-item.is-active .nav-icon { background: var(--primary); }
.nav-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 16px; }

.main {
  margin-left: var(--sidebar-w); flex: 1; min-width: 0;
  display: flex; flex-direction: column; min-height: 100vh;
}
.topbar {
  height: var(--header-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 32px 0 24px; position: sticky; top: 0; z-index: 30;
}
body.admin-bar .topbar { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar .topbar { top: 46px; }
}
.search {
  display: flex; align-items: center; gap: 8px;
  width: 340px; max-width: 40vw; height: 40px; padding: 0 12px;
  background: var(--divider); border-radius: var(--radius); color: var(--muted); font-size: 13px;
}
.search input {
  border: 0; background: transparent; outline: none; width: 100%; color: var(--text);
}
.topbar-spacer { flex: 1; }
.balance-pill {
  height: 36px; padding: 0 14px; border-radius: 18px; background: var(--divider);
  display: inline-flex; align-items: center; font-size: 13px; font-weight: 600;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--tint);
  color: var(--primary); display: grid; place-items: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; position: relative;
  display: grid; place-items: center; color: var(--text-2); flex-shrink: 0;
}
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px; width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%; border: 2px solid #fff;
}
.content { padding: 28px 24px 40px; max-width: 1192px; }

.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.page-head > div:first-child { min-width: 0; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

/* Data table */
.data-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.data-table { width: 100%; }
.data-table th, .data-table td {
  padding: 16px 12px; text-align: left; vertical-align: middle;
  border-bottom: 1px solid var(--divider); font-size: 13px;
}
.data-table th {
  font-size: 12px; font-weight: 500; color: var(--text-2);
  background: #f9fafb; white-space: nowrap; padding-top: 14px; padding-bottom: 14px;
}
.data-table th:first-child, .data-table td:first-child { padding-left: 16px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 16px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafafa; }
.book-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; color: inherit; }
a.book-cell:hover .title { color: var(--primary); }
.book-cell .title { font-weight: 500; font-size: 14px; color: var(--text); }
.book-cell .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.num-sub { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.text-right { text-align: right !important; }
.text-success { color: var(--success); font-weight: 500; }
.text-danger { color: var(--danger); }
.muted { color: var(--muted); }

/* Chart */
.chart-card { padding: 16px 20px 20px; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); }
.legend-bar::before, .legend-dot::before {
  content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 6px;
  border-radius: 2px; background: #818cf8; vertical-align: -1px;
}
.legend-dot::before { border-radius: 50%; background: #22c55e; width: 8px; height: 8px; }
.chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  height: 180px;
  border-bottom: 1px solid var(--border);
  padding: 0 4px;
  position: relative;
}
.chart-col {
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end; height: 100%; position: relative; min-width: 0;
}
.bar {
  width: 100%; max-width: 26px; background: #818cf8; border-radius: 3px 3px 0 0; min-height: 8px;
}
.chart-dot {
  position: absolute; width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e; left: 50%; transform: translateX(-50%);
}
.chart-labels {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 4px 0;
  font-size: 11px; color: var(--muted);
}
.chart-labels span { text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Events */
.events { padding: 16px 20px; }
.events h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.event { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; }
.event + .event { border-top: 1px solid var(--divider); }
.event-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.event-dot.green { background: #22c55e; }
.event-dot.orange { background: #f59e0b; }
.event-dot.blue { background: #3b82f6; }
.event-dot.gray { background: #9ca3af; }
.event p { font-size: 12px; color: var(--text-3); line-height: 1.4; }
.event time { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }

/* Campaign mini cards */
a.campaign-card { color: inherit; display: block; transition: border-color .15s, box-shadow .15s; }
a.campaign-card:hover { border-color: #c7d2fe; box-shadow: 0 2px 8px rgba(79, 70, 229, 0.08); }
.campaign-card { padding: 16px; }
.campaign-card-top { display: flex; gap: 16px; align-items: flex-start; }
.campaign-card-top .info { flex: 1; min-width: 0; }
.campaign-card-top .right { font-size: 11px; color: var(--muted); white-space: nowrap; padding-top: 2px; }
.campaign-card .badge { margin-top: 8px; }
.campaign-card .spent { font-size: 12px; color: var(--text-3); margin: 16px 0 8px; }
.campaign-card .stats-line { font-size: 11px; color: var(--text-2); margin-top: 10px; line-height: 1.4; }

/* Login */
.login-page {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.login-hero {
  background: var(--tint); padding: 64px; position: relative; overflow: hidden;
  display: flex; flex-direction: column;
}
.login-hero .brand {
  position: relative; z-index: 1; margin-bottom: 0;
}
.login-hero .brand-mark {
  width: 40px; height: 40px; border-radius: 10px; font-size: 20px;
}
.login-hero .brand-title { font-size: 16px; }
.login-hero .brand-sub { font-size: 11px; }
.login-hero::before, .login-hero::after {
  content: ''; position: absolute; border-radius: 50%;
  background: rgba(79, 70, 229, 0.08);
}
.login-hero::before { width: 220px; height: 220px; right: -40px; top: 80px; }
.login-hero::after { width: 260px; height: 260px; left: 40px; bottom: -40px; }
.login-hero-inner { position: relative; z-index: 1; max-width: 560px; margin-top: auto; margin-bottom: auto; padding: 24px 0; }
.login-hero h1 { font-size: 32px; font-weight: 600; line-height: 1.25; margin: 0 0 16px; }
.login-hero .lead { font-size: 15px; color: var(--text-3); margin-bottom: 28px; line-height: 1.5; }
.login-list { list-style: none; display: flex; flex-direction: column; gap: 20px; }
.login-list li {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 14px; color: var(--text-3); line-height: 1.4;
}
.login-list li::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); margin-top: 5px; flex-shrink: 0;
}
.login-panel {
  display: flex; align-items: center; justify-content: center; padding: 48px 24px;
  background: var(--bg);
}
.login-card {
  width: 100%; max-width: 440px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 40px; box-shadow: var(--shadow);
}
.login-card h2 { font-size: 22px; font-weight: 600; margin: 0; }
.login-card .sub { font-size: 13px; color: var(--text-2); margin: 8px 0 24px; }
.login-card .field { margin-bottom: 0; }
.login-card .field + .field { margin-top: 14px; }
.login-card .input { height: 44px; }
.login-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin: 16px 0 20px; flex-wrap: wrap;
}
.login-card .btn-block { height: 44px; font-size: 15px; }
.login-divider { height: 1px; background: var(--divider); margin: 24px 0 16px; }
.login-foot { text-align: center; font-size: 13px; color: var(--text-2); margin: 0; line-height: 1.4; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(17, 24, 39, 0.45);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 24px;
}
.modal-backdrop.is-open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius-xl);
  width: 100%; max-width: 480px; padding: 28px; box-shadow: 0 20px 40px rgba(0,0,0,.12);
}
.modal h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.modal p { font-size: 14px; color: var(--text-2); margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.pay-option {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px;
  cursor: pointer;
}
.pay-option.is-selected { border-color: var(--primary); background: var(--tint); }
.pay-option input { accent-color: var(--primary); }
.quick-amounts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.quick-amounts button {
  height: 30px; padding: 0 12px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 13px; color: var(--text-3);
}

/* Alerts / empty / skeleton */
.alert {
  display: flex; gap: 12px; padding: 16px 18px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--surface);
}
.alert-danger { background: #fff5f5; border-color: #fecaca; }
.alert-icon {
  width: 24px; height: 24px; border-radius: 50%; background: var(--danger);
  color: #fff; display: grid; place-items: center; font-weight: 700; flex-shrink: 0;
}
.empty-state {
  text-align: center; padding: 64px 24px; max-width: 560px; margin: 40px auto;
}
.empty-state h3 { font-size: 18px; font-weight: 600; margin: 20px 0 8px; }
.empty-state p { font-size: 14px; color: var(--text-2); margin-bottom: 20px; }
.empty-illus {
  display: flex; justify-content: center; gap: 8px; margin-bottom: 8px;
}
.skeleton-line {
  height: 14px; background: linear-gradient(90deg, #f3f4f6, #e5e7eb, #f3f4f6);
  background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 4px;
}
.skeleton-block { height: 36px; border-radius: 6px; background: #f3f4f6; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Wizard */
.wizard-steps {
  display: flex; gap: 8px; margin-bottom: 24px; align-items: center;
}
.wizard-step {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted);
}
.wizard-step .n {
  width: 24px; height: 24px; border-radius: 50%; background: var(--divider);
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
}
.wizard-step.is-active { color: var(--primary); font-weight: 500; }
.wizard-step.is-active .n { background: var(--primary); color: #fff; }
.wizard-step.is-done .n { background: var(--success); color: #fff; }
.wizard-step .line { width: 40px; height: 1px; background: var(--border); }

/* Filters row */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters .input { width: 280px; height: 36px; }

/* Toggle */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--divider);
}
.toggle {
  width: 44px; height: 24px; border-radius: 12px; background: #d1d5db;
  position: relative; transition: background .15s;
}
.toggle.is-on { background: var(--primary); }
.toggle::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: left .15s;
}
.toggle.is-on::after { left: 23px; }

/* Mobile bottom nav */
.mobile-nav {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; height: 64px;
  background: var(--surface); border-top: 1px solid var(--border);
  z-index: 50; padding: 8px 0 10px;
  grid-template-columns: repeat(5, 1fr);
}
.mobile-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 11px; color: var(--muted);
}
.mobile-nav a.is-active { color: var(--primary); }
.mobile-nav .ico {
  width: 20px; height: 20px; border-radius: 6px; background: currentColor; opacity: .35;
}
.mobile-nav a.is-active .ico { opacity: 1; background: var(--primary); }

.mobile-balance {
  display: none; background: var(--primary); color: #fff;
  border-radius: var(--radius-lg); padding: 16px; margin-bottom: 16px;
}
.mobile-balance .label { font-size: 12px; color: #c7d2fe; }
.mobile-balance .value { font-size: 24px; font-weight: 600; margin: 4px 0 8px; }
.mobile-balance .hint { font-size: 12px; color: #c7d2fe; }

.demo-strip {
  position: fixed; right: 12px; bottom: 76px; z-index: 60;
  display: none; flex-direction: column; gap: 6px;
}
.demo-strip a {
  background: #111827; color: #fff; font-size: 11px; padding: 6px 10px;
  border-radius: 6px; opacity: .85;
}

/* Responsive */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-3 { grid-column: span 2; }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding-bottom: 72px; }
  .mobile-nav { display: grid; }
  .topbar .search { display: none; }
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr 1fr; }
  .span-2, .span-3 { grid-column: span 2; }
  .mobile-balance { display: block; }
  .content { padding: 16px 16px 32px; }
  .data-table-wrap { margin: 0 -8px; }
}
@media (max-width: 560px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: span 1; }
  .balance-pill { display: none; }
}

/* ---------- Инструменты АТ ---------- */
.pos-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.pos-form .field { margin: 0; }
.pos-form .btn { height: 40px; }
.genre-table td, .genre-table th { white-space: nowrap; }
@media (max-width: 720px) { .pos-form .field { width: 100% !important; } .pos-form .btn { width: 100%; } }
.alert[hidden], [data-pos-result][hidden] { display: none !important; }
.metric-card .delta.muted { color: var(--text-2); font-weight: 400; }
.alert-info { background: var(--info-bg); color: var(--info-text); }
.alert-info .alert-icon { background: var(--info); color: #fff; }
.genre-toggle { background: none; border: 0; padding: 0; font: inherit; font-weight: 500; color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.genre-toggle .chev { color: var(--text-2); font-size: 11px; transition: transform .15s; display: inline-block; width: 10px; }
.genre-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.genre-toggle:hover { color: var(--primary); }
.genre-name { font-weight: 500; padding-left: 16px; }
.genre-sub td { background: var(--bg); font-size: 13px; }
.genre-sub-name { padding-left: 32px; color: var(--text-3); }
.pos-book { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.pos-counters { display: flex; gap: 24px; flex-wrap: wrap; }
.pos-cnt { font-size: 18px; font-weight: 600; line-height: 1.3; }
.pos-tracked { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.pos-table .spark { display: block; }