:root {
  --bg: #020503;
  --panel: #0b110c;
  --panel-2: #121b14;
  --line: #1f3524;
  --green: #64e887;
  --green-strong: #00d863;
  --muted: #a8b8ab;
  --text: #f6fff7;
  --warn: #f5c542;
  --danger: #ef4444;
  --blue: #52a7f9;
  --radius: 8px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background: radial-gradient(circle at 15% 0%, rgba(0,216,99,.14), transparent 26%), linear-gradient(135deg, #020503, #050806 48%, #07100a); color: var(--text); font-family: Arial, Helvetica, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a, a:visited { color: inherit; text-decoration: none; }
label { color: var(--muted); font-size: 12px; display: block; margin-bottom: 6px; }
input, select, textarea { width: 100%; color: var(--text); background: #071007; border: 1px solid #254425; border-radius: 8px; min-height: 42px; padding: 9px 11px; outline: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.03); }
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); }
.hidden { display: none !important; }

.login { position: fixed; inset: 0; z-index: 99; display: grid; place-items: center; background: radial-gradient(circle at 25% 10%, #123d18, transparent 32%), #030503; padding: 22px; }
.login-card { width: min(430px, 100%); border: 1px solid rgba(100,232,135,.24); background: linear-gradient(180deg, rgba(13,24,14,.96), rgba(5,8,5,.98)); border-radius: 16px; padding: 24px; box-shadow: 0 24px 70px rgba(0,0,0,.55); }
.login-card h1 { margin: 18px 0 8px; }
.login-card p { color: var(--muted); margin: 0 0 18px; }
.error { color: #ff8b8b; margin-top: 10px; font-size: 13px; }

.shell { display: grid; grid-template-columns: 292px 1fr; min-height: 100vh; }
.sidebar { border-right: 1px solid rgba(100,232,135,.18); background: linear-gradient(180deg, rgba(3,5,3,.98), rgba(6,14,8,.98)); padding: 22px 18px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.brand { display: flex; align-items: center; gap: 12px; min-height: 54px; }
.brand-mark { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #123d18, #0a120a); color: var(--green); font-weight: 900; font-size: 30px; border: 1px solid #2b6b35; }
.brand-title { font-weight: 900; font-size: 18px; line-height: 1.05; }
.brand-title span { display: block; color: var(--green); font-size: 13px; letter-spacing: 4px; margin-top: 3px; }
.nav { display: grid; gap: 6px; }
.nav button { min-height: 44px; border: 1px solid transparent; background: rgba(255,255,255,.015); color: #dbe8db; border-radius: 10px; display: flex; align-items: center; gap: 11px; padding: 0 12px; text-align: left; transition: .15s ease; }
.nav button:hover, .nav button.active { color: #fff; border-color: rgba(100,232,135,.9); background: linear-gradient(90deg, rgba(16,45,24,.96), rgba(7,18,10,.8)); box-shadow: 0 0 0 1px rgba(100,232,135,.08), 0 10px 26px rgba(0,0,0,.22); }
.nav .ico { width: 24px; height: 24px; border: 1px solid #6f806f; color: var(--green); display: grid; place-items: center; border-radius: 6px; font-size: 12px; font-weight: 800; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { min-height: 78px; border-bottom: 1px solid rgba(100,232,135,.16); padding: 16px 26px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: rgba(2,5,3,.72); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 12; }
.topbar h1 { margin: 0; font-size: 24px; }
.topbar p { margin: 4px 0 0; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.pill { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 999px; padding: 8px 12px; white-space: nowrap; font-size: 13px; }
.online:before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green-strong); margin-right: 6px; }
.content { padding: 24px 26px 36px; overflow: auto; }

.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { border: 1px solid rgba(100,232,135,.16); background: linear-gradient(180deg, rgba(13,20,14,.96), rgba(7,12,8,.96)); border-radius: 12px; padding: 16px; min-width: 0; box-shadow: var(--shadow); }
.card h2, .card h3 { margin: 0 0 12px; }
.metric { display: grid; gap: 8px; }
.metric .num { font-size: 30px; font-weight: 900; color: var(--green); }
.metric .label { color: var(--muted); font-size: 13px; }
.seller-code-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-color: rgba(100,232,135,.45); }
.seller-code-card .num { margin-top: 6px; color: var(--green); font-size: 36px; font-weight: 900; letter-spacing: 4px; }
.seller-code-card p { max-width: 620px; margin: 0; line-height: 1.45; }

table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid rgba(100,232,135,.09); padding: 12px; text-align: left; font-size: 14px; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; background: rgba(255,255,255,.025); }
tr:hover td { background: rgba(100,232,135,.045); }
.btn { min-height: 40px; border: 1px solid var(--green); background: linear-gradient(180deg, #12381e, #0d2615); color: #fff !important; border-radius: 8px; padding: 9px 14px; font-weight: 800; text-decoration: none !important; display: inline-flex; align-items: center; justify-content: center; transition: .15s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(0,0,0,.24); }
.btn.primary { width: 100%; margin-top: 12px; }
.login-download { width: 100%; margin-top: 18px; }
.btn.secondary { background: rgba(8,13,8,.9); border-color: #2b462b; color: #dbe8db; }
.btn.danger { border-color: #7f1d1d; background: #3b0b0b; }
.btn.ghost { background: #050805; border-color: #254425; }
.icon-btn { width: 36px; height: 36px; border-radius: 6px; border: 1px solid #2b462b; background: #080d08; color: #fff; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tag { display: inline-flex; align-items: center; min-height: 24px; max-width: 100%; padding: 3px 8px; border-radius: 999px; background: #102d18; color: var(--green); border: 1px solid #285c33; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.tag.off { background: #111; color: #8a8a8a; border-color: #333; }
.tag.warn { background: #2b2208; color: var(--warn); border-color: #6b5412; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.client-create-identity-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.client-create-login-grid { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.client-list-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.client-list-title .icon-btn { flex: 0 0 auto; }
.client-device-id { margin-top: 4px; overflow-wrap: anywhere; }
.brand.brand-logo-only {
  align-items: center;
  min-height: 68px;
}
.brand-mark.brand-mark-image {
  width: min(210px, 100%);
  height: auto;
  min-height: 0;
  max-height: 72px;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.brand-mark.brand-mark-image img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 72px;
  object-fit: contain;
  object-position: left center;
}
.login-card .brand-logo-only {
  justify-content: center;
}
.login-card .brand-mark.brand-mark-image {
  width: min(260px, 100%);
  max-height: 92px;
  justify-content: center;
}
.login-card .brand-mark.brand-mark-image img {
  max-height: 92px;
  object-position: center;
}
.full { grid-column: 1 / -1; }
.split { display: grid; grid-template-columns: 360px 1fr; gap: 14px; align-items: start; }
.list { display: grid; gap: 8px; }
.list-item { border: 1px solid var(--line); background: #080d08; border-radius: var(--radius); padding: 12px; cursor: pointer; }
.list-item.active, .list-item:hover { border-color: var(--green); background: #102d18; }
.check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.check-row { min-height: 38px; border: 1px solid var(--line); background: #070b07; border-radius: 6px; padding: 8px 10px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.check-row input { width: auto; min-height: auto; }
.radio-visibility-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.radio-visibility-row > div:first-child { flex: 1; }
.toggle-control { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; white-space: nowrap; }
.toggle-control input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-slider { width: 54px; height: 28px; border-radius: 14px; border: 1px solid #455045; background: #303630; position: relative; transition: 160ms ease; }
.toggle-slider::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #aab2aa; transition: 160ms ease; }
.toggle-control input:checked + .toggle-slider { background: #0d6b2c; border-color: var(--green); box-shadow: 0 0 12px rgba(57, 255, 107, .28); }
.toggle-control input:checked + .toggle-slider::after { transform: translateX(26px); background: var(--green); }
.muted { color: var(--muted); }
.hint { color: var(--muted); margin: 12px 0 0; line-height: 1.45; }
.eyebrow { display: inline-flex; margin-bottom: 6px; color: var(--green); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.trial-hero { margin-bottom: 14px; border: 1px solid rgba(100,232,135,.24); border-radius: 14px; padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: linear-gradient(135deg, rgba(15,48,25,.95), rgba(7,12,8,.95)); box-shadow: var(--shadow); }
.trial-hero h2 { margin: 0 0 6px; font-size: 24px; }
.trial-hero p { margin: 0; color: #d5e5d7; max-width: 860px; line-height: 1.45; }
.feature-card { position: relative; overflow: hidden; }
.feature-card:before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--green), transparent); opacity: .78; }
.emergency-card:before { background: linear-gradient(90deg, #ff5a3d, transparent); }
.card-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-title-row h2 { margin-bottom: 0; }
.compact-form { gap: 10px; }
.compact-form .full, .compact-form div:nth-child(3), .compact-form div:nth-child(4) { grid-column: 1 / -1; }
.data-card h3 { color: var(--green); }
.green { color: var(--green); }
.danger-text { color: var(--danger); }
.login-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(260px, 1fr) 150px;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid rgba(100, 232, 135, .18);
  border-radius: 8px;
  background: rgba(5, 10, 5, .62);
}
.login-credentials {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.nav-backup {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(100, 232, 135, .75);
  border-radius: var(--radius);
  color: #fff !important;
  background: #102d18;
  font-weight: 800;
  text-decoration: none;
  margin-top: 8px;
}

.theme-preview { border: 1px solid #244424; border-radius: 8px; overflow: hidden; min-height: 310px; background: #030503; color: #fff; }
.theme-preview.light { background: #ece7de; color: #20231f; }
.theme-preview.light .preview-card, .theme-preview.light .preview-banner, .theme-preview.light .preview-side { background: #f7f2ea; color: #20231f; border-color: #b7ab9b; }
.theme-preview.light .preview-menu.active { background: #d7e2d8; color: #18251d; border-color: #4d6e5a; }
.preview-app { display: grid; grid-template-columns: 112px 1fr; min-height: 310px; font-size: 11px; }
.preview-side { padding: 14px 10px; display: grid; align-content: start; gap: 8px; border-right: 1px solid rgba(255,255,255,.08); }
.preview-logo { font-weight: 900; color: var(--green); }
.preview-menu { border-radius: 6px; padding: 8px 10px; color: #eaf5ea; border: 1px solid transparent; }
.preview-menu.active { color: #fff; border-color: var(--green); background: rgba(0,200,83,.16); }
.preview-main { padding: 14px; display: grid; gap: 10px; align-content: start; }
.preview-banner { min-height: 88px; border-radius: 8px; border: 1px solid rgba(255,255,255,.16); padding: 14px; background: linear-gradient(90deg, #081008, #12391b, #071007); }
.preview-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.preview-card { min-height: 50px; border-radius: 7px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); display: grid; place-items: center; text-align: center; font-weight: 800; }

.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(0,0,0,.68); padding: 22px; }
.modal-card { width: min(760px, 100%); max-height: 90vh; overflow: auto; border: 1px solid var(--line); background: #080d08; border-radius: 12px; padding: 18px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.modal-head h2 { margin: 0; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 90; border: 1px solid var(--green); background: #081208; color: #fff; border-radius: 8px; padding: 12px 14px; box-shadow: 0 12px 30px rgba(0,0,0,.4); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .18s; max-width: 340px; font-weight: 700; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .cols-2, .cols-3, .cols-4, .split, .form-grid { grid-template-columns: 1fr; }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Visual polish for the production panel */
body {
  background: #050805;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

.shell {
  grid-template-columns: 292px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: linear-gradient(180deg, #061006 0%, #020402 100%);
  box-shadow: inset -1px 0 0 rgba(100, 232, 135, .18);
}

.brand {
  border-bottom: 1px solid rgba(100, 232, 135, .18);
  padding-bottom: 18px;
}

.brand-mark {
  overflow: hidden;
  background: #0d1b0d;
  box-shadow: 0 0 0 3px rgba(100, 232, 135, .08);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-title {
  max-width: 178px;
  word-break: break-word;
}

.nav {
  gap: 8px;
}

.nav button {
  position: relative;
  min-height: 46px;
  padding: 0 14px 0 18px;
  border-color: transparent;
  font-weight: 700;
}

.nav button:before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #3f5b3f;
  margin-right: 10px;
}

.nav button:hover,
.nav button.active {
  background: linear-gradient(90deg, rgba(0, 200, 83, .22), rgba(0, 200, 83, .05));
  border-color: rgba(100, 232, 135, .75);
}

.nav button.active:before {
  background: var(--green);
  box-shadow: 0 0 12px rgba(100, 232, 135, .75);
}

.topbar {
  background: rgba(5, 8, 5, .86);
  backdrop-filter: blur(8px);
}

.content {
  max-width: 1320px;
  width: 100%;
}

.card {
  background: linear-gradient(180deg, rgba(14, 21, 14, .98), rgba(8, 13, 8, .98));
  box-shadow: 0 14px 34px rgba(0, 0, 0, .2);
}

.card h2 {
  font-size: 24px;
}

.btn {
  min-width: 0;
  letter-spacing: .01em;
}

.btn.secondary {
  background: #0b120b;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  flex: 0 0 36px;
  color: var(--green);
  border-color: rgba(100, 232, 135, .35);
}

.icon-btn:hover {
  background: #102d18;
  border-color: var(--green);
}

.icon-btn.danger-icon {
  color: #ff9a9a;
  border-color: rgba(239, 68, 68, .38);
}

.icon-btn.danger-icon:hover {
  background: #2a0b0b;
  border-color: #ef4444;
}

th {
  background: #091109;
  color: #c6dec6;
}

td {
  color: #f4fff4;
}

.list-item {
  transition: border-color .16s, background .16s, transform .16s;
}

.list-item:hover,
.list-item.active {
  transform: translateX(2px);
}

.theme-preview.light {
  background: #ece7de;
  color: #20231f;
}

.theme-preview.light .preview-side {
  background: #ddd6ca;
  color: #20231f;
}

.theme-preview.light .preview-menu {
  color: #3f423d;
}

.theme-preview.light .preview-banner {
  background: linear-gradient(90deg, #e4dccf, #f7f2ea);
  color: #20231f;
  border-color: #b7ab9b;
}

.theme-preview.light .preview-card {
  background: #efe8dd;
  color: #20231f;
  border-color: #b7ab9b;
}

.modal-card {
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
}

.qr-preview {
  min-height: 132px;
  display: grid;
  align-items: center;
  gap: 10px;
}

.qr-preview img {
  width: 132px;
  height: 132px;
  border: 8px solid #fff;
  border-radius: 6px;
  background: #fff;
}

/* Fixes for modal placement, edit forms and compact tables */
.modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px !important;
  background: rgba(0, 0, 0, .74) !important;
}

.modal.hidden {
  display: none !important;
}

.modal-card {
  width: min(720px, calc(100vw - 36px)) !important;
  max-height: min(82vh, 760px) !important;
  overflow: auto !important;
  margin: 0 !important;
}

.modal-card .form-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  padding: 0 !important;
  accent-color: var(--green-strong);
}

.check-grid {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  margin: 8px 0 2px;
}

.check-row {
  min-height: 42px;
  justify-content: flex-start;
}

.compact-card,
.server-card {
  max-width: 1040px;
  padding: 14px;
}

.compact-card h2,
.server-card h2 {
  font-size: 22px;
}

.compact-card table,
.server-card table {
  table-layout: fixed;
}

.compact-card th,
.compact-card td,
.server-card th,
.server-card td {
  padding: 8px 10px;
  font-size: 13px;
}

.server-card th:nth-child(1),
.server-card td:nth-child(1) { width: 18%; }
.server-card th:nth-child(2),
.server-card td:nth-child(2),
.server-card th:nth-child(3),
.server-card td:nth-child(3),
.server-card th:nth-child(4),
.server-card td:nth-child(4) { width: 15%; }
.server-card th:nth-child(5),
.server-card td:nth-child(5) { width: 10%; }
.server-card th:nth-child(6),
.server-card td:nth-child(6) { width: 15%; }
.server-card th:nth-child(7),
.server-card td:nth-child(7) { width: 12%; }

.file-field {
  padding: 7px;
  background: #081108;
}

.qr-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #060906;
}

.qr-row img {
  width: 88px;
  height: 88px;
  border: 6px solid #fff;
  border-radius: 6px;
  background: #fff;
}

.thumb {
  width: 82px;
  height: 46px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #050805;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
}

.logo-preview {
  width: 150px;
  max-height: 86px;
  object-fit: contain;
  display: block;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050805;
  padding: 10px;
}

.preview-strip {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #060906;
}

.preview-strip img {
  width: min(100%, 520px);
  height: auto;
  aspect-ratio: 16 / 4;
  object-fit: contain;
  background: #000;
  border-radius: 6px;
}

.content-preview-box {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #060906;
}

.content-preview-title {
  font-weight: 900;
  margin-bottom: 10px;
}

.content-preview-frame {
  width: 100%;
  min-height: 110px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #000;
}

.content-preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-preview-box .content-preview-frame {
  aspect-ratio: 16 / 4;
}

.highlight-preview-box .content-preview-frame {
  max-width: 360px;
  aspect-ratio: 16 / 9;
}

.theme-preview.mxq .preview-app {
  grid-template-columns: 88px 1fr;
}

.theme-preview.mxq .preview-banner {
  min-height: 58px;
  background: #111;
}

.theme-preview.mxq .preview-card {
  min-height: 38px;
  font-size: 10px;
}

.theme-preview.blue-premium {
  background: #020712;
}

.theme-preview.blue-premium .preview-side {
  background: #06101f;
}

.theme-preview.blue-premium .preview-banner {
  background: linear-gradient(90deg, #020712, #123b67, #09172a);
  border-color: #2b6fb4;
}

.theme-preview.blue-premium .preview-card {
  background: #0d1b31;
  border-color: #244a70;
}

.theme-preview.blue-premium .preview-menu.active {
  background: #123b67;
  border-color: #4da3ff;
}

.theme-preview.red-premium {
  background: #120202;
}

.theme-preview.red-premium .preview-side {
  background: #1b0505;
}

.theme-preview.red-premium .preview-banner {
  background: linear-gradient(90deg, #120202, #5a1515, #260909);
  border-color: #913b3b;
}

.theme-preview.red-premium .preview-card {
  background: #301010;
  border-color: #743030;
}

.theme-preview.red-premium .preview-menu.active {
  background: #5a1515;
  border-color: #ff5656;
}

.theme-preview.dark-premium {
  background: #030303;
}

.theme-preview.dark-premium .preview-side {
  background: #090909;
}

.theme-preview.dark-premium .preview-banner {
  background: linear-gradient(90deg, #030303, #191919, #111111);
  border-color: #444;
}

.theme-preview.dark-premium .preview-card {
  background: #191919;
  border-color: #343434;
}

.theme-preview.dark-premium .preview-menu.active {
  background: #2a2a2a;
  border-color: #cfcfcf;
}

.confirm-box p {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
}

.confirm-actions {
  justify-content: flex-end;
}

.confirm-actions .btn {
  min-width: 150px;
}

.confirm-actions .btn.danger {
  background: #8f1111;
  border-color: #ff5a5a;
  color: #fff;
}

.confirm-actions .btn.danger:hover {
  background: #b91c1c;
}

@media (max-width: 760px) {
  .client-create-identity-grid,
  .client-create-login-grid { grid-template-columns: 1fr; }
  .modal-card .form-grid,
  .check-grid {
    grid-template-columns: 1fr;
  }

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

/* Mobile-only layout: keep desktop untouched */
@media (max-width: 860px) {
  .radio-visibility-row { align-items: stretch; flex-direction: column; }
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  .shell {
    display: block !important;
    grid-template-columns: 1fr !important;
    min-height: 100vh;
  }

  .sidebar {
    position: relative !important;
    top: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 18px 16px 14px !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--line);
    box-shadow: none;
  }

  .brand {
    min-height: 58px;
    padding-bottom: 14px;
    margin-bottom: 4px;
  }

  .brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 14px;
  }

  .brand-title {
    font-size: 21px;
    max-width: none;
  }

  .brand-title span {
    font-size: 13px;
    letter-spacing: 5px;
  }

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

  .nav button {
    min-height: 48px;
    padding: 10px 12px !important;
    align-items: center;
    justify-content: flex-start;
    font-size: 15px;
    line-height: 1.2;
    white-space: normal;
  }

  .nav button:before {
    display: none;
  }

  #logoutBtn {
    width: 100%;
    margin-top: 14px;
  }

  .main {
    display: block;
    width: 100%;
  }

  .topbar {
    min-height: 0;
    padding: 18px 16px;
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar h1 {
    font-size: 26px;
    line-height: 1.15;
  }

  .topbar p {
    font-size: 15px;
  }

  .top-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .mobile-back {
    width: 100%;
    order: -1;
  }

  .pill {
    white-space: normal;
  }

  .content {
    width: 100%;
    max-width: none;
    padding: 16px !important;
    overflow: visible;
  }

  .grid,
  .cols-2,
  .cols-3,
  .cols-4,
  .split,
  .form-grid {
    grid-template-columns: 1fr !important;
  }

  .card {
    padding: 14px;
    border-radius: 10px;
  }

  .card h2 {
    font-size: 21px;
  }

  .metric .num {
    font-size: 28px;
  }

  .seller-code-card {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .seller-code-card .num {
    font-size: 32px;
  }

  .actions {
    width: 100%;
    align-items: stretch;
  }

  .actions .btn,
  .btn {
    width: 100%;
    min-height: 44px;
    white-space: normal;
  }

  .actions .icon-btn {
    width: 44px;
    min-width: 44px;
    flex-basis: 44px;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  th,
  td {
    padding: 10px;
  }

  .check-grid {
    grid-template-columns: 1fr !important;
  }

  .check-row {
    justify-content: space-between;
    min-height: 46px;
  }

  .login-row,
  .login-credentials {
    grid-template-columns: 1fr !important;
  }

  .modal {
    align-items: flex-end !important;
    padding: 12px !important;
  }

  .modal-card {
    width: 100% !important;
    max-height: 88vh !important;
    border-radius: 14px 14px 10px 10px;
  }

  .modal-card .form-grid {
    grid-template-columns: 1fr !important;
  }

  .qr-row {
    grid-template-columns: 88px 1fr;
  }

  .shell.mobile-page-open .sidebar {
    display: none !important;
  }

  .shell.mobile-page-open .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(5, 8, 5, .96);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .35);
  }

  .shell.mobile-page-open .content {
    padding-top: 16px !important;
  }
}

@media (max-width: 420px) {
  .nav {
    grid-template-columns: 1fr !important;
  }

  .brand-title {
    font-size: 19px;
  }

  .content {
    padding: 12px !important;
  }

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

/* v241 RC - information hierarchy and responsive administration */
.shell {
  grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
  padding: 20px 14px;
  gap: 14px;
}

.nav {
  gap: 14px;
}

.nav-group {
  display: grid;
  gap: 5px;
}

.nav-group-title {
  padding: 2px 12px 4px;
  color: #7f9683;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nav button {
  min-height: 42px;
}

.nav-backup {
  margin-top: 0;
}

.topbar {
  min-height: 72px;
  padding: 14px clamp(18px, 2.2vw, 32px);
}

.topbar > div:first-child {
  min-width: 220px;
}

.top-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.content {
  max-width: 1480px;
  padding: 22px clamp(18px, 2.2vw, 32px) 40px;
}

.card {
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
}

.table-shell {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(100, 232, 135, .12);
  border-radius: 8px;
  background: rgba(3, 8, 4, .45);
  -webkit-overflow-scrolling: touch;
}

.table-shell table {
  min-width: 680px;
}

.table-shell th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.form-grid > div,
.login-credentials > div {
  min-width: 0;
}

.modal-card {
  width: min(820px, 100%);
}

@media (min-width: 861px) and (max-width: 1180px) {
  .shell {
    grid-template-columns: 232px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 12px;
  }

  .brand-title {
    font-size: 16px;
  }

  .top-actions .pill {
    display: none;
  }

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

  .split {
    grid-template-columns: 300px minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .sidebar {
    padding: 14px !important;
  }

  .brand {
    min-height: 48px;
    padding-bottom: 10px;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 8px;
  }

  .brand-title {
    font-size: 18px;
  }

  .nav {
    gap: 12px !important;
    margin-top: 8px;
  }

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

  .nav-group-title {
    grid-column: 1 / -1;
    padding: 4px 4px 0;
  }

  .nav button {
    min-height: 44px;
    padding: 8px 11px !important;
    font-size: 14px;
  }

  .nav-backup {
    min-height: 44px;
  }

  .topbar {
    gap: 12px;
    padding: 14px;
  }

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

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

  .top-actions .mobile-back {
    grid-column: 1 / -1;
  }

  .top-actions .pill {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    text-align: center;
  }

  .content {
    padding: 14px !important;
  }

  .card {
    padding: 14px;
    box-shadow: none;
  }

  .table-shell {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .table-shell table,
  .table-shell tbody,
  .table-shell tr,
  .table-shell td {
    display: block;
    width: 100%;
    min-width: 0;
    white-space: normal;
  }

  .table-shell thead {
    display: none;
  }

  .table-shell tbody {
    display: grid;
    gap: 10px;
  }

  .table-shell tr {
    overflow: hidden;
    border: 1px solid rgba(100, 232, 135, .16);
    border-radius: 8px;
    background: #080d08;
  }

  .table-shell td {
    display: grid;
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 42px;
    padding: 9px 11px;
    border-bottom: 1px solid rgba(100, 232, 135, .08);
    overflow-wrap: anywhere;
  }

  .table-shell td:last-child {
    border-bottom: 0;
  }

  .table-shell td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  .table-shell td[colspan] {
    display: block;
  }

  .table-shell td[colspan]::before {
    display: none;
  }

  .table-shell td .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal {
    padding: 0 !important;
  }

  .modal-card {
    max-height: 94vh !important;
    border-radius: 12px 12px 0 0;
    padding: 14px;
  }
}

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

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

  .top-actions .mobile-back {
    grid-column: 1 / -1;
  }

  .nav button {
    min-height: 48px;
    font-size: 13px;
    overflow-wrap: anywhere;
  }

  .table-shell td {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* v242 - mobile readability without changing panel behavior */
@media (max-width: 860px) {
  .form-grid,
  .login-credentials,
  .compact-form,
  .settings-grid,
  .payment-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .form-grid > *,
  .login-credentials > *,
  .card,
  .list-item,
  .notice,
  .tag,
  .pill,
  .actions,
  .actions > * {
    min-width: 0;
    max-width: 100%;
  }

  .card-title-row,
  .preview-strip,
  .trial-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .card-title-row .btn,
  .preview-strip .btn,
  .actions .btn {
    width: 100%;
  }

  .table-shell td {
    grid-template-columns: minmax(108px, 36%) minmax(0, 1fr);
    word-break: normal;
    overflow-wrap: anywhere;
  }

  .table-shell td::before,
  .table-shell td > * {
    min-width: 0;
    word-break: normal;
  }

  .table-shell td.actions {
    display: grid;
    grid-template-columns: minmax(108px, 36%) minmax(0, 1fr);
  }

  .table-shell td.actions > .btn,
  .table-shell td.actions > button {
    width: 100%;
  }

  .modal-card input,
  .modal-card select,
  .modal-card textarea,
  .modal-card .btn {
    max-width: 100%;
  }
}

@media (max-width: 420px) {
  .table-shell td,
  .table-shell td.actions {
    grid-template-columns: 1fr;
  }

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

  .top-actions .mobile-back {
    grid-column: auto;
  }
}
