:root {
  --bg: #eef3fb;
  --bg-accent: radial-gradient(circle at 12% 8%, #dbeafe 0%, transparent 45%), radial-gradient(circle at 88% 12%, #e0e7ff 0%, transparent 40%);
  --surface: #ffffff;
  --surface-soft: #f6f9ff;
  --ink: #13203b;
  --muted: #5a6b87;
  --border: #d7e1f0;
  --rail: #0f1b35;
  --rail-ink: #b9c7e2;
  --rail-active: linear-gradient(90deg, #2557d6, #3b6df0);
  --primary: #2359d6;
  --primary-ink: #ffffff;
  --primary-soft: #e8efff;
  --ok: #12805c;
  --ok-bg: #dcfce7;
  --warn: #9a5200;
  --warn-bg: #fef3c7;
  --bad: #a81f33;
  --bad-bg: #ffe4e8;
  --demo: #6d28d9;
  --demo-bg: #ede9fe;
  --suspended: #475569;
  --suspended-bg: #e2e8f0;
  --shadow: 0 10px 28px rgba(16, 30, 62, 0.07);
  --radius: 15px;
  --rail-width: 248px;
}

:root[data-theme="dark"] {
  --bg: #0b1324;
  --bg-accent: radial-gradient(circle at 15% 10%, #17274d 0%, transparent 45%), radial-gradient(circle at 85% 10%, #1d1e42 0%, transparent 40%);
  --surface: #121d36;
  --surface-soft: #182645;
  --ink: #eef3ff;
  --muted: #98a9c8;
  --border: #253659;
  --rail: #0a1121;
  --rail-ink: #9eb0d1;
  --rail-active: linear-gradient(90deg, #2b62e8, #4b7cf5);
  --primary: #4b7cf5;
  --primary-soft: #1c2e59;
  --ok: #34d399;
  --ok-bg: rgba(16, 185, 129, 0.16);
  --warn: #fbbf24;
  --warn-bg: rgba(245, 158, 11, 0.16);
  --bad: #fb7185;
  --bad-bg: rgba(244, 63, 94, 0.18);
  --demo: #c4b5fd;
  --demo-bg: rgba(139, 92, 246, 0.2);
  --suspended: #cbd5e1;
  --suspended-bg: rgba(148, 163, 184, 0.16);
  --shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  background-image: var(--bg-accent);
  color: var(--ink);
  font: 14.5px/1.45 "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
  border: 0;
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary);
  transition: filter 0.15s ease, transform 0.1s ease, background 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

button:hover {
  filter: brightness(0.95);
}

button:active {
  transform: translateY(1px);
}

button.primary {
  background: var(--primary);
  color: var(--primary-ink);
  box-shadow: 0 6px 16px rgba(35, 89, 214, 0.24);
}

button.danger {
  background: var(--bad-bg);
  color: var(--bad);
}

button.whatsapp {
  background: #dcfce7;
  color: #15803d;
}

:root[data-theme="dark"] button.whatsapp {
  background: rgba(22, 163, 74, 0.22);
  color: #4ade80;
}

button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

button.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  flex: none;
}

/* Sidebar */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail-width);
  background: var(--rail);
  color: #fff;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 30;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px;
}

.brand-mark,
.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
  flex: none;
}

.brand-mark {
  background: linear-gradient(135deg, #2563eb, #6366f1);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
}

.brand-text {
  display: grid;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 16px;
  letter-spacing: -0.02em;
}

.brand-text span {
  font-size: 11px;
  font-weight: 700;
  color: #7dd3fc;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rail-utilities {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: var(--rail-ink);
}

.rail-clock {
  display: grid;
  gap: 1px;
  font-variant-numeric: tabular-nums;
}

.rail-clock strong {
  color: #fff;
  font-size: 13px;
}

.rail-util-actions {
  display: flex;
  gap: 6px;
}

.rail-util-actions button {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.rail-nav {
  display: grid;
  gap: 6px;
}

.rail-nav button {
  width: 100%;
  justify-content: flex-start;
  background: transparent;
  color: var(--rail-ink);
  padding: 11px 12px;
  border-radius: 11px;
  font-weight: 600;
}

.rail-nav button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  filter: none;
}

.rail-nav button.active {
  background: var(--rail-active);
  color: #fff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.rail-nav svg,
.rail-util-actions svg,
button svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.rail-footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.rail-footer small {
  color: var(--rail-ink);
  font-size: 11.5px;
  opacity: 0.85;
  padding: 0 4px;
}

.mobile-menu-btn {
  display: none;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 38px;
  height: 38px;
  padding: 0;
}

.drawer-backdrop {
  display: none;
}

/* Main Layout */
main {
  margin-left: var(--rail-width);
  padding: 28px 32px 60px;
  max-width: 1480px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.page-header h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.page-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 6px;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--stat-accent, var(--primary));
}

.stat-card small {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.stat-card .stat-num {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stat-card .stat-sub {
  font-size: 12px;
  color: var(--muted);
}

/* Toolbar & Filters */
.toolbar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

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

.plan-select {
  width: auto;
  min-width: 170px;
}

.search-wrap {
  flex: 1 1 260px;
  position: relative;
}

.search-wrap input {
  padding-left: 36px;
}

.search-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

.filter-pills {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  background: var(--surface-soft);
  color: var(--muted);
  border: 1px solid var(--border);
}

.filter-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Inputs */
input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(35, 89, 214, 0.15);
}

/* Cards & Grids */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  align-content: start;
}

.license-card {
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.license-card:hover {
  transform: translateY(-2px);
}

.license-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.license-user {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 14px;
}

.license-title {
  min-width: 0;
}

.license-title h3 {
  margin: 0;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.license-title small {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-demo { background: var(--demo-bg); color: var(--demo); }
.badge-suspended { background: var(--suspended-bg); color: var(--suspended); }
.badge-plan { background: var(--primary-soft); color: var(--primary); }

.countdown-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 12.5px;
}

.countdown-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  font-size: 13.5px;
}

.cred-list {
  display: grid;
  gap: 7px;
}

.cred-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--surface-soft);
  font-size: 13px;
}

.cred-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  min-width: 68px;
}

.cred-val {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
}

.cred-actions {
  display: flex;
  gap: 4px;
}

.license-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.license-note {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 12.5px;
  color: var(--muted);
}

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

.license-actions-sub {
  display: contents;
}

.license-actions .btn-wa-main {
  grid-column: 1 / -1;
}

.license-actions .btn-del-acct {
  grid-column: 1 / -1;
}

.label-mobile {
  display: none;
}

.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  display: grid;
  gap: 10px;
  justify-items: center;
}

/* Plan selector cards inside modal */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

.plan-option {
  position: relative;
}

.plan-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.plan-option span {
  display: grid;
  gap: 2px;
  padding: 10px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface-soft);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.plan-option span strong {
  font-size: 13px;
}

.plan-option span small {
  color: var(--muted);
  font-size: 11.5px;
}

.plan-option input:checked + span {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

/* Dashboard sections */
.dash-split {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
}

.mini-list {
  display: grid;
  gap: 9px;
}

.mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.mini-row-info {
  min-width: 0;
}

.mini-row-info strong {
  display: block;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-row-info small {
  color: var(--muted);
  font-size: 12px;
}

/* Table */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

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

th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

/* Settings & Forms */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 16px;
  align-items: start;
}

.settings-card summary {
  list-style: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

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

.settings-card summary::after {
  content: "▾";
  color: var(--muted);
  transition: transform 0.15s ease;
}

.settings-card[open] summary::after {
  transform: rotate(180deg);
}

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

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.fields .wide {
  grid-column: 1 / -1;
}

label.field {
  display: grid;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
}

.input-group {
  display: flex;
  gap: 6px;
}

.input-group input {
  flex: 1;
}

.alert-warn {
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 12.5px;
  font-weight: 600;
}

.code-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  overflow-x: auto;
  margin: 0;
}

/* Modal */
dialog {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  width: min(640px, calc(100% - 24px));
  max-height: 90vh;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(8, 15, 36, 0.45);
}

dialog::backdrop {
  background: rgba(8, 15, 36, 0.6);
  backdrop-filter: blur(3px);
}

/* Admin sign-in */
#ken-cloud-dialog.admin-auth-dialog {
  width: min(440px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  padding: 32px;
  border-color: var(--border);
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
}

#ken-cloud-dialog.admin-auth-dialog::backdrop {
  background: rgba(7, 17, 39, 0.78);
  backdrop-filter: blur(8px);
}

.admin-auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
  color: var(--ink);
  font-weight: 800;
  font-size: 17px;
}

.admin-auth-brand img {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  object-fit: contain;
}

.admin-auth-brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

#ken-cloud-dialog h1 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 25px;
  letter-spacing: -0.04em;
}

.admin-auth-description {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

#ken-cloud-dialog [data-cloud-form] label {
  display: block;
  margin: 16px 0 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

#ken-cloud-dialog [data-cloud-form] input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

#ken-cloud-dialog [data-cloud-form] input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

#ken-cloud-dialog [data-cloud-message] {
  min-height: 21px;
  margin: 13px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.admin-auth-submit {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 11px;
  background: var(--primary);
  color: var(--primary-ink);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  transition: filter 150ms ease, transform 150ms ease;
}

.admin-auth-submit:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.admin-auth-submit:disabled {
  cursor: wait;
  opacity: 0.7;
}

.ken-cloud-status {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 9998;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 600 12px system-ui;
  box-shadow: var(--shadow);
  cursor: pointer;
}

dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

dialog header h2 {
  margin: 0;
  font-size: 19px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* Toast */
#toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #0f1b35;
  color: #fff;
  padding: 11px 16px;
  border-radius: 10px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  z-index: 60;
}

/* Responsive */
@media (max-width: 960px) {
  .dash-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .sidebar {
    position: sticky;
    top: 0;
    inset: 0 0 auto 0;
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    gap: 8px;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  .brand-text strong {
    font-size: 14.5px;
  }

  .brand-text span {
    font-size: 10px;
  }

  .rail-clock,
  .rail-footer,
  .mobile-menu-btn,
  .drawer-backdrop {
    display: none !important;
  }

  .rail-utilities {
    display: flex;
    background: transparent;
    padding: 0;
    margin-left: auto;
  }

  .brand {
    width: auto;
    padding: 0;
  }

  .rail-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    background: rgba(15, 27, 53, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.28);
    transform: none;
    z-index: 50;
  }

  .rail-nav button {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    padding: 5px 2px;
    font-size: 10.5px;
    border-radius: 9px;
    min-width: 0;
  }

  .rail-nav button svg {
    width: 17px;
    height: 17px;
  }

  main {
    margin-left: 0;
    padding: 8px 9px 68px;
  }

  #toast {
    right: 12px;
    bottom: 78px;
  }

  .page-header {
    margin-bottom: 10px;
    gap: 8px;
    align-items: center;
  }

  .page-header h1 {
    font-size: 18.5px;
    white-space: nowrap;
  }

  .page-header p {
    display: none;
  }

  .header-actions {
    gap: 5px;
  }

  .header-actions button {
    padding: 6px 9px;
    font-size: 11.5px;
    border-radius: 8px;
    white-space: nowrap;
  }

  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 10px;
  }

  .stat-card {
    padding: 8px 9px;
    gap: 2px;
    border-radius: 10px;
  }

  .stat-card small {
    font-size: 9.5px;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stat-card .stat-num {
    font-size: 16.5px;
  }

  .stat-card .stat-sub {
    display: none;
  }

  .dash-split {
    gap: 8px;
  }

  .dash-split h2 {
    font-size: 14px !important;
  }

  .dash-split .license-head button {
    padding: 5px 9px;
    font-size: 11.5px;
  }

  .mini-list {
    gap: 6px;
  }

  .mini-row {
    padding: 7px 9px;
  }

  .toolbar-card {
    padding: 8px 9px;
    gap: 6px;
    margin-bottom: 8px;
    border-radius: 11px;
  }

  .toolbar-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 108px;
    gap: 6px;
  }

  .search-wrap {
    flex: none;
    min-width: 0;
  }

  .search-wrap input {
    padding-left: 30px;
    font-size: 12.5px;
  }

  .search-wrap svg {
    left: 9px;
    width: 14px;
    height: 14px;
  }

  .plan-select {
    min-width: 0;
    width: 100%;
    font-size: 11.5px;
    padding: 7px 6px;
  }

  .filter-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 5px;
    padding-bottom: 0;
    scrollbar-width: none;
  }

  .filter-pills::-webkit-scrollbar {
    display: none;
  }

  .filter-pill {
    white-space: nowrap;
    padding: 4px 8px;
    font-size: 11px;
  }

  .cards-grid {
    gap: 8px;
  }

  .card {
    padding: 9px 10px;
    gap: 6px;
    border-radius: 11px;
  }

  .avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 11px;
  }

  .license-user {
    gap: 7px;
  }

  .license-title h3 {
    font-size: 13.5px;
  }

  .license-title small {
    font-size: 10.5px;
    white-space: nowrap;
  }

  .badges {
    flex-direction: row;
    align-items: center;
    gap: 4px;
  }

  .badge {
    padding: 2px 6px;
    font-size: 10px;
  }

  .countdown-box {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 7px;
  }

  .countdown-time {
    font-size: 11px;
  }

  .cred-list {
    gap: 4px;
  }

  .cred-row {
    padding: 4px 7px;
    gap: 5px;
    border-radius: 7px;
  }

  .cred-label {
    min-width: 40px;
    font-size: 10.5px;
  }

  .cred-val {
    font-size: 11px;
  }

  button.icon-btn {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .license-meta {
    font-size: 10.5px;
  }

  .license-note {
    padding: 5px 7px;
    font-size: 11px;
  }

  .label-desktop {
    display: none;
  }

  .label-mobile {
    display: inline;
  }

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

  .license-actions button {
    padding: 5.5px 5px;
    font-size: 11px;
    border-radius: 7px;
    gap: 4px;
    white-space: nowrap;
  }

  .license-actions .btn-wa-main,
  .license-actions .btn-renew-main {
    grid-column: auto;
  }

  .license-actions-sub {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 34px;
    gap: 5px;
  }

  .license-actions-sub .btn-del-acct {
    grid-column: auto;
    padding: 7px 0;
  }

  .fields {
    grid-template-columns: 1fr;
    gap: 8px;
  }

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

  .settings-grid {
    gap: 10px;
  }

  .settings-card summary {
    font-size: 14.5px;
  }

  .settings-body {
    gap: 9px;
    margin-top: 9px;
  }

  label.field {
    font-size: 11.5px;
    gap: 3px;
  }

  input, select, textarea {
    padding: 7px 9px;
    font-size: 13px;
    border-radius: 8px;
  }

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

  .plan-option span {
    padding: 7px 4px;
  }

  .plan-option span strong {
    font-size: 12px;
  }

  .plan-option span small {
    font-size: 10.5px;
  }

  dialog {
    padding: 16px;
  }

  dialog header {
    margin-bottom: 10px;
  }

  th, td {
    padding: 7px 8px;
    font-size: 12px;
  }

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

  .payments-table,
  .payments-table tbody {
    display: block;
    width: 100%;
  }

  .payments-table thead {
    display: none;
  }

  .payments-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "name plan amount"
      "email dur date";
    align-items: center;
    gap: 2px 6px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
  }

  .payments-table tr:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .payments-table td {
    display: block;
    border: 0;
    padding: 0;
    min-width: 0;
  }

  .payments-table .td-name {
    grid-area: name;
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .payments-table .td-plan {
    grid-area: plan;
    justify-self: end;
  }

  .payments-table .td-amount {
    grid-area: amount;
    justify-self: end;
    font-size: 12.5px;
    white-space: nowrap;
  }

  .payments-table .td-email {
    grid-area: email;
    font-size: 11px;
    color: var(--muted);
    overflow-wrap: anywhere;
  }

  .payments-table .td-dur {
    grid-area: dur;
    justify-self: end;
    font-size: 10.5px;
    color: var(--muted);
    white-space: nowrap;
  }

  .payments-table .td-date {
    grid-area: date;
    justify-self: end;
    font-size: 10.5px;
    color: var(--muted);
    white-space: nowrap;
  }
}
