:root {
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #111827;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --gold: #c59a38;
  --blue: #2563eb;
  --cyan: #0f8ca8;
  --green: #15803d;
  --red: #dc2626;
  --amber: #b45309;
  --shadow: 0 18px 45px rgba(15, 23, 42, .10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  animation: pageFade .28s ease both;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, opacity .16s ease;
}

button:not(:disabled):hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: .6;
}

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

.app-shell.sidebar-hidden {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar-toggle {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 60;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  color: #fff;
  background: #111827;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .18);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 16px;
  color: #fff;
  background: linear-gradient(180deg, #111827, #1f2937);
  overflow: hidden auto;
  transition: opacity .18s ease, transform .22s ease, padding .22s ease;
}

.sidebar-hidden .sidebar {
  padding-inline: 0;
  opacity: 0;
  transform: translateX(-16px);
  pointer-events: none;
}

.brand-block {
  padding: 8px 10px 22px;
}

.app-menu {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.app-nav {
  min-height: 42px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  color: #e5e7eb;
  background: rgba(255, 255, 255, .08);
  font-weight: 900;
  text-align: left;
  padding: 0 12px;
}

.app-nav.active {
  color: #111827;
  background: #f6d98d;
}

.logout-btn {
  width: 100%;
  margin-bottom: 10px;
  color: #fecaca;
  background: rgba(239, 68, 68, .12);
}

.eyebrow,
.section-kicker {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 180px;
  color: #fff;
  font-size: 28px;
  line-height: 1.05;
}

h2 {
  color: var(--ink);
  font-size: 28px;
  line-height: 1.1;
}

.brand-menu {
  display: grid;
  gap: 8px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height .28s ease, opacity .22s ease, transform .22s ease;
}

.brand-menu.open {
  max-height: 360px;
  opacity: 1;
  transform: translateY(0);
}

.brand-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #d1d5db;
  background: rgba(255, 255, 255, .06);
  font-weight: 800;
  text-align: left;
}

.brand-tab strong {
  min-width: 30px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #111827;
  background: #e5e7eb;
  font-size: 12px;
  text-align: center;
}

.brand-tab.active {
  color: #111827;
  background: #f6d98d;
}

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

.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: viewIn .24s ease both;
}

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

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(98px, 1fr));
  gap: 10px;
}

.stats div {
  min-width: 98px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
  animation: softPop .24s ease both;
}

.stats span {
  display: block;
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
}

.stats small,
.muted,
.result-line {
  color: var(--muted);
}

.toolbar,
.table-panel,
.modal {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-right {
  min-width: min(520px, 100%);
}

.voucher-toolbar {
  align-items: end;
}

.inline-field {
  display: grid;
  gap: 6px;
  min-width: 150px;
}

.inline-field span {
  color: #374151;
  font-size: 12px;
  font-weight: 900;
}

.proxy-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 260px;
}

.page-size-control,
.pager-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-size-control {
  flex: 0 0 auto;
}

.page-size-control span {
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.page-size-control input {
  width: 74px;
  min-height: 34px;
  padding: 0 9px;
  font-weight: 900;
}

.pager-control .ghost-btn {
  min-height: 34px;
  padding: 0 10px;
}

.proxy-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  color: #64748b;
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.proxy-status.active {
  color: #075985;
  background: #e0f2fe;
}

#proxySelect {
  min-width: 92px;
  width: auto;
  min-height: 34px;
  padding: 0 10px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
  padding: 11px 12px;
}

input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--blue);
}

textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.45;
}

.notes-input {
  min-height: 120px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.primary-btn,
.ghost-btn,
.mini-btn,
.icon-btn {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 850;
  white-space: nowrap;
}

.primary-btn {
  color: #fff;
  background: var(--ink);
}

.ghost-btn {
  color: var(--ink);
  background: #edf2f7;
}

.ghost-btn.strong {
  color: #fff;
  background: var(--cyan);
}

.running-btn {
  color: #fff;
  background: var(--blue);
}

.redeem-btn {
  color: #fff;
  background: var(--green);
}

.table-panel {
  position: relative;
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
  transition: filter .2s ease, opacity .2s ease;
}

.hidden-col {
  display: none !important;
}

.processing .table-wrap {
  filter: blur(4px);
  opacity: .45;
  pointer-events: none;
}

.processing-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--ink);
  background: rgba(248, 250, 252, .56);
  backdrop-filter: blur(2px);
  text-align: center;
}

.processing .processing-overlay {
  display: flex;
}

.processing-overlay span {
  color: var(--muted);
  font-size: 13px;
}

.loader {
  width: 34px;
  height: 34px;
  border: 4px solid #dbeafe;
  border-top-color: var(--blue);
  border-radius: 999px;
  animation: spin .8s linear infinite;
}

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

@keyframes pageFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes softPop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes rowIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
}

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.select-col {
  width: 44px;
  text-align: center;
}

.selected-count {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 900;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #475569;
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

th[data-sort] {
  cursor: pointer;
  user-select: none;
}

th[data-sort]::after {
  content: "";
  display: inline-block;
  margin-left: 6px;
  color: var(--blue);
}

th.sorted[data-dir="asc"]::after {
  content: "▲";
}

th.sorted[data-dir="desc"]::after {
  content: "▼";
}

tbody tr {
  background: #fff;
  animation: rowIn .18s ease both;
}

tbody tr:hover {
  background: #fbfdff;
}

tbody tr.row-running {
  background: #dbeafe;
}

tbody tr.row-running:hover {
  background: #bfdbfe;
}

tbody tr.row-redeem {
  background: #dcfce7;
}

tbody tr.row-redeem:hover {
  background: #bbf7d0;
}

tbody tr.row-running.row-redeem {
  background: linear-gradient(90deg, #dbeafe 0 50%, #dcfce7 50% 100%);
}

tbody tr.row-processing {
  position: relative;
}

tbody tr.row-processing td:not(:last-child) {
  filter: blur(2px);
  opacity: .48;
}

.row-processing-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-top: 6px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--blue);
  background: #dbeafe;
  font-size: 12px;
  font-weight: 900;
}

code {
  display: inline-block;
  max-width: 170px;
  padding: 4px 6px;
  overflow: hidden;
  border-radius: 6px;
  color: #0f172a;
  background: #eef2f7;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-cell,
.email-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.email-cell {
  flex-wrap: wrap;
}

.email-copy-btn {
  min-height: 22px;
  padding: 0 8px;
  font-size: 11px;
}

.pwa-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.phone-number {
  display: inline-block;
  min-width: 96px;
  white-space: nowrap;
  font-weight: 800;
  color: #0f172a;
}

.pwa-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .02em;
}

.pwa-badge.welcome {
  color: #92400e;
  background: #fef3c7;
}

.pwa-badge.notif {
  color: #075985;
  background: #e0f2fe;
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.tag-badge.running {
  color: #1d4ed8;
  background: #dbeafe;
}

.tag-badge.redeem {
  color: #166534;
  background: #bbf7d0;
}

.copy-btn {
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 9px;
  color: var(--blue);
  background: #fff;
  font-size: 12px;
  font-weight: 900;
}

.copy-btn:disabled {
  color: var(--muted);
  background: #f1f5f9;
}

.numeric {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.email-link {
  border: 0;
  padding: 0;
  color: var(--blue);
  background: transparent;
  font-weight: 900;
  text-align: left;
}

.email-link:hover {
  text-decoration: underline;
}

tr.phone-ok .email-link {
  color: var(--green);
}

tr.phone-not-ok .email-link {
  color: var(--red);
}

.phone-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 7px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  vertical-align: middle;
}

.phone-badge.phone-ok {
  color: var(--green);
  background: #dcfce7;
}

.phone-badge.phone-not-ok {
  color: var(--red);
  background: #fee2e2;
}

.note-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 7px;
  border-radius: 999px;
  background: var(--gold);
  vertical-align: middle;
}

.redeem-countdown {
  display: inline-flex;
  min-height: 20px;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #166534;
  background: #bbf7d0;
  font-size: 11px;
  font-weight: 900;
  vertical-align: middle;
}

.brand,
.tier,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.brand {
  color: #8a650c;
  background: #fff4d6;
}

.brand-amild {
  color: #b91c1c;
  background: linear-gradient(90deg, #ffffff 0 45%, #fee2e2 45% 100%);
  border: 1px solid #fca5a5;
}

.brand-marlboro {
  color: #ffffff;
  background: #dc2626;
}

.brand-djisamsoe {
  color: #6b3f16;
  background: #ead0a6;
}

.brand-magnum {
  color: #ffffff;
  background: #111111;
}

.tier {
  color: #334155;
  background: #e2e8f0;
}

.badge.success {
  color: var(--green);
  background: #dcfce7;
}

.badge.error {
  color: var(--red);
  background: #fee2e2;
}

.badge.idle {
  color: var(--amber);
  background: #ffedd5;
}

.row-error {
  display: block;
  max-width: 280px;
  margin-top: 4px;
  color: var(--red);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.mini-btn {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
  color: var(--ink);
  background: #edf2f7;
}

.mini-btn.danger {
  color: #fff;
  background: var(--red);
}

.mini-btn.refresh {
  color: #fff;
  background: var(--blue);
}

.mini-btn.check {
  color: #fff;
  background: var(--green);
}

.phone-btn {
  color: #fff;
  background: #7c3aed;
}

.mini-btn.welcome,
.welcome-btn {
  color: #92400e;
  background: #fef3c7;
}

.mini-btn.notif,
.notif-btn {
  color: #075985;
  background: #e0f2fe;
}

.empty-state {
  display: none;
  padding: 46px;
  color: var(--muted);
  text-align: center;
}

.voucher-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.redeem-account-field {
  min-width: 340px;
}

.redeem-section {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

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

.redeem-section-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.redeem-section-head span,
.redeem-state {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--muted);
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 900;
}

.redeem-state.claimed {
  color: var(--green);
  background: #dcfce7;
}

.redeem-state.expired {
  color: #991b1b;
  background: #fee2e2;
}

.voucher-code {
  display: block;
  max-width: none;
  width: 100%;
  color: #0f172a;
  background: #fef3c7;
  border: 1px solid #fde68a;
  font-weight: 900;
  text-align: center;
}

.redeem-action {
  width: 100%;
}

.claimed-voucher-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.claimed-voucher-actions .redeem-state {
  justify-content: center;
}

.add-claimed-voucher {
  min-height: 28px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 950;
}

.checkin-toolbar {
  align-items: end;
}

.danger-lite {
  color: #991b1b;
  background: #fee2e2;
}

.checkin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.checkin-head,
.checkin-row {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr) 90px 110px;
  gap: 12px;
  align-items: center;
}

.worldwide-head,
.worldwide-row,
.authentic-head,
.authentic-row {
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr) 120px;
}

.worldwide-head,
.worldwide-row {
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr) 120px 90px;
}

.worldwide-actions {
  display: flex;
  justify-content: flex-start;
}

.amild-feed-head,
.amild-feed-row,
.amild-survey-head,
.amild-survey-row {
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr) 90px 110px;
}

.checkin-head {
  padding: 11px 14px;
  color: #475569;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.checkin-results {
  display: grid;
}

.checkin-row {
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  animation: rowIn .18s ease both;
}

.checkin-row strong {
  color: var(--blue);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkin-row span {
  font-weight: 800;
}

.checkin-row em,
.checkin-row b {
  font-style: normal;
  font-weight: 900;
}

.checkin-row.success span {
  color: var(--green);
}

.checkin-row.error span {
  color: var(--red);
}

.checkin-row.skipped span,
.checkin-row.skipped em,
.checkin-row.skipped b {
  color: var(--amber);
}

.empty-state.visible {
  display: block;
}

.voucher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.voucher-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  animation: cardIn .24s ease both;
  transition: transform .18s ease, box-shadow .18s ease;
}

.voucher-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, .10);
}

.voucher-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #e5e7eb;
}

.voucher-image.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
}

.voucher-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.voucher-category {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.voucher-details {
  display: grid;
  gap: 5px;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
}

.voucher-details span {
  overflow-wrap: anywhere;
}

.voucher-body h3 {
  margin: 0;
  min-height: 44px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.voucher-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.voucher-meta span,
.voucher-meta strong {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.voucher-meta span {
  color: #334155;
  background: #e2e8f0;
}

.voucher-meta strong {
  color: #166534;
  background: #dcfce7;
}

dialog {
  width: min(540px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  overflow: hidden;
}

.bulk-dialog {
  width: min(680px, calc(100vw - 32px));
}

.notes-dialog {
  width: min(560px, calc(100vw - 24px));
}

.columns-dialog {
  width: min(460px, calc(100vw - 24px));
}

dialog::backdrop {
  background: rgba(15, 23, 42, .58);
}

.modal {
  display: grid;
  gap: 14px;
  width: 100%;
  max-height: calc(100vh - 32px);
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

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

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

.field span {
  color: #374151;
  font-size: 13px;
  font-weight: 800;
}

.notes-content {
  min-height: 120px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
}

.notes-content.empty-notes {
  color: var(--muted);
  font-style: italic;
}

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

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

.history-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

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

.history-table th {
  color: var(--muted);
  background: #f8fafc;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.history-code {
  max-width: 220px;
}

.history-voucher-code {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-copy-btn {
  min-height: 28px;
  padding: 6px 9px;
  border-radius: 7px;
  color: var(--blue);
  background: #eff6ff;
  font-size: 11px;
  font-weight: 950;
}

.status-toggle {
  min-width: 86px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 950;
}

.status-toggle.used {
  color: #166534;
  background: #dcfce7;
}

.status-toggle.not-used {
  color: #92400e;
  background: #fef3c7;
}

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

.edit-voucher-btn,
.delete-voucher-btn {
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 950;
}

.edit-voucher-btn {
  color: #111827;
  background: #e5e7eb;
}

.delete-voucher-btn {
  color: #fff;
  background: var(--red);
}

.column-choice {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  font-weight: 850;
}

.column-choice input {
  width: 17px;
  height: 17px;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 2px;
}

.result-line {
  min-height: 18px;
  margin: 0;
  font-size: 13px;
}

#bulkText {
  min-height: 210px;
  max-height: 320px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
}

#addVoucherBulk {
  min-height: 118px;
}

.icon-btn {
  width: 38px;
  padding: 0;
  color: var(--ink);
  background: #edf2f7;
  font-size: 18px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: min(420px, calc(100% - 48px));
  padding: 13px 16px;
  border-radius: 8px;
  color: #fff;
  background: #111827;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: .2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background: var(--green);
}

.toast.error {
  background: var(--red);
}

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

  .app-shell.sidebar-hidden {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar-hidden .sidebar {
    display: none;
  }

  .brand-block {
    padding-bottom: 14px;
  }

  h1 {
    max-width: none;
  }

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

@media (max-width: 820px) {
  .content {
    padding: 18px;
  }

  .topbar,
  .toolbar,
  .toolbar-left,
  .toolbar-right {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 640px) {
  .brand-menu,
  .stats {
    grid-template-columns: 1fr;
  }

  .table-wrap,
  .history-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    display: table;
    min-width: 1320px;
  }

  .history-table {
    display: table;
    min-width: 860px;
  }

  thead {
    display: table-header-group;
  }

  tbody {
    display: table-row-group;
  }

  tr {
    display: table-row;
    padding: 0;
  }

  th,
  td {
    display: table-cell;
    min-width: initial;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
  }

  td::before {
    content: none;
  }

  .actions {
    display: flex;
  }

  code {
    max-width: 170px;
  }
}
