/* ─── Reset & tokens ─────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0b0e14;
  --surface: #151921;
  --surface-2: #1c2128;
  --border: #2d333b;
  --border-sub: #21282f;
  --accent: #377dff;
  --accent-dim: rgba(55, 125, 255, 0.12);
  --text: #e6edf3;
  --text-muted: #7d8590;
  --text-dim: #4a5568;
  --green: #3fb950;
  --yellow: #d29922;
  --red: #f85149;
  --radius: 8px;
  --font: "Open Sans", sans-serif;
  --mono: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.wrap {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Navbar ─────────────────────────────────────────────────────────────── */
.nav {
  height: 52px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}
.nav-inner {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-link {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font);
}
.nav-link:hover {
  color: var(--text);
}
.nav-link.danger:hover {
  color: var(--red);
}

/* ─── Page body ──────────────────────────────────────────────────────────── */
.page {
  padding: 28px 0 48px;
}

/* ─── Section label ──────────────────────────────────────────────────────── */
.section-label {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}

/* ─── Stats bar ──────────────────────────────────────────────────────────── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}
.stat-cell {
  background: var(--surface);
  padding: 16px 20px;
  transition: background 0.15s;
}
.stat-cell:hover {
  background: var(--surface-2);
}
.stat-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.stat-val {
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.02em;
  transition: opacity 0.4s ease;
}
.stat-val.loading {
  color: var(--text-dim);
  font-size: 16px;
}

/* Polling states */
.stat-val.updating {
  animation: pulse 1.2s ease-in-out infinite;
}
.stat-val.stale {
  opacity: 0.45;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

.stat-sub {
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Live indicator dot in navbar */
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin-left: 6px;
  vertical-align: middle;
  animation: livepulse 2.4s ease-in-out infinite;
}
.live-dot.stale {
  background: var(--text-dim);
  animation: none;
}

@keyframes livepulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.75);
  }
}

/* ─── Two-col grid ───────────────────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  align-items: start;
}

/* ─── Card ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-sub);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.card-body {
  padding: 20px;
}

/* ─── Form ───────────────────────────────────────────────────────────────── */
.field {
  margin-bottom: 14px;
}
.field-label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
}
.input::placeholder {
  color: var(--text-dim);
}
.input:focus {
  border-color: var(--accent);
}
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%237D8590' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
select.input option {
  background: var(--surface-2);
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  padding: 9px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  margin-bottom: 10px;
}
.btn-primary:hover {
  background: #4d8eff;
  border-color: #4d8eff;
}
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
  margin-bottom: 10px;
}
.btn-ghost:hover {
  color: var(--text);
  border-color: #4a5568;
  background: var(--surface-2);
}
.btn-ghost-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
  font-size: 15px;
  padding: 7px 15px;
  margin-bottom: 10px;
}
.btn-ghost-danger:hover {
  color: var(--text);
  background-color: var(--red);
}

/* ─── Inline alert ───────────────────────────────────────────────────────── */
.alert {
  display: none;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid;
  margin-bottom: 16px;
  line-height: 1.4;
}
.alert.ok {
  color: var(--green);
  border-color: rgba(63, 185, 80, 0.25);
  background: rgba(63, 185, 80, 0.06);
}
.alert.err {
  color: var(--red);
  border-color: rgba(248, 81, 73, 0.25);
  background: rgba(248, 81, 73, 0.06);
}

/* ─── Table ──────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
thead th {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: left;
  border-bottom: 1px solid var(--border-sub);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border-sub);
  transition: background 0.1s;
}
tbody tr:last-child {
  border-bottom: none;
}
tbody tr:hover {
  background: var(--surface-2);
}
tbody td {
  padding: 12px 16px;
  vertical-align: middle;
}
.td-name {
  font-weight: 500;
  color: var(--text);
}
.td-sub {
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 2px;
}
.td-muted {
  color: var(--text-muted);
  font-size: 15px;
}

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid;
  white-space: nowrap;
  margin: 2px 2px 2px 0;
}
.badge-green {
  color: var(--green);
  border-color: rgba(63, 185, 80, 0.2);
  background: rgba(63, 185, 80, 0.07);
}
.badge-yellow {
  color: var(--yellow);
  border-color: rgba(210, 153, 34, 0.2);
  background: rgba(210, 153, 34, 0.07);
}
.badge-red {
  color: var(--red);
  border-color: rgba(248, 81, 73, 0.2);
  background: rgba(248, 81, 73, 0.07);
}
.badge-purple {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.2);
  background: rgba(167, 139, 250, 0.07);
}
.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.mono {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  display: none;
}

/* ─── Log Modal ──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
}
.modal-overlay.open {
  display: flex;
}
.modal-box {
  width: 100%;
  max-width: 940px;
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 80px);
  overflow: hidden;
}
.modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.modal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
}
/* macOS-style window dots */
.win-dots {
  display: flex;
  gap: 6px;
}
.win-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.win-dot-r {
  background: #ff5f57;
}
.win-dot-y {
  background: #ffbd2e;
}
.win-dot-g {
  background: #28c840;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 4px;
  transition:
    color 0.15s,
    background 0.15s;
}
.modal-close:hover {
  color: var(--text);
  background: var(--surface-2);
}
.modal-body {
  flex: 1;
  overflow-y: auto;
}
.modal-footer {
  padding: 11px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.modal-meta {
  font-size: 14px;
  color: var(--text-dim);
  font-family: var(--mono);
}

/* VS Code-style pre */
#errorLogContent {
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.8;
  background: #0d1117;
  padding: 20px 24px;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 300px;
  color: #ce9178;
}
.log-line {
  display: block;
}
.log-lnum {
  color: #3c4450;
  user-select: none;
  margin-right: 16px;
}
.log-ts {
  color: #608b4e;
  margin-right: 10px;
}
.log-lvl {
  color: #569cd6;
  margin-right: 8px;
}
.log-msg {
  color: #ce9178;
}
.log-ok {
  color: #3fb950;
}

/* ─── Scrollbar ──────────────────────────────────────────────────────────── */

/* ─── Entrance animation ─────────────────────────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.anim {
  animation: fadeUp 0.35s ease both;
}
.anim-1 {
  animation-delay: 0.05s;
}
.anim-2 {
  animation-delay: 0.12s;
}
.anim-3 {
  animation-delay: 0.19s;
}

/* ─── Stat cell icon ─────────────────────────────────────────────────────── */
.stat-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}
.stat-icon {
  color: var(--text-dim);
  flex-shrink: 0;
}
.stat-name {
  margin-bottom: 0;
}

/* ─── Card title with icon ───────────────────────────────────────────────── */
.card-title {
  display: flex;
  align-items: center;
  gap: 7px;
}
.card-title svg {
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ─── Nav link icon ──────────────────────────────────────────────────────── */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ─── Empty state icon ───────────────────────────────────────────────────── */
.empty-icon {
  display: block;
  margin: 0 auto 10px;
  color: var(--text-dim);
}

/* ─── Refresh spin on click ──────────────────────────────────────────────── */
.spinning {
  animation: spin360 0.5s ease;
}
@keyframes spin360 {
  to {
    transform: rotate(360deg);
  }
}

/* ─── Suspension / delete action buttons ────────────────────────────────── */
.btn-suspend {
  color: var(--yellow);
  border-color: rgba(210, 153, 34, 0.3);
  background: transparent;
  padding: 5px 15px;
  margin-bottom: 10px;
}
.btn-suspend:hover {
  background: rgba(210, 153, 34, 0.08);
  border-color: var(--yellow);
}

.btn-resume {
  color: var(--green);
  border-color: rgba(63, 185, 80, 0.3);
  background: transparent;
  margin-bottom: 10px;
}
.btn-resume:hover {
  background: rgba(63, 185, 80, 0.08);
  border-color: var(--green);
}

.btn-delete {
  color: var(--red);
  border-color: rgba(248, 81, 73, 0.3);
  background: transparent;
}
.btn-delete:hover {
  background: rgba(248, 81, 73, 0.08);
  border-color: var(--red);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Suspended row: dim the whole row */
tbody tr.suspended {
  opacity: 0.55;
}
tbody tr.suspended:hover {
  opacity: 0.75;
}

/* ─── Modal animations ───────────────────────────────────────────────────── */
@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes modalOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}
.modal-overlay {
  transition: opacity 0.2s ease;
}
.modal-overlay.open {
  opacity: 1;
}
.modal-overlay.hiding {
  opacity: 0;
  pointer-events: none;
}
.modal-box {
  animation: modalIn 0.22s ease both;
}
.modal-box.out {
  animation: modalOut 0.18s ease both;
}

/* ─── Confirm dialog modal ───────────────────────────────────────────────── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
}
.confirm-overlay.open {
  display: flex;
}
.confirm-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 360px;
  animation: modalIn 0.2s ease both;
}
.confirm-box.out {
  animation: modalOut 0.16s ease both;
}
.confirm-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.confirm-msg {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}
.confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
/* ── Plan-type badges ───────────────────────────────────────────────────── */
.badge-trial {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}
.badge-month {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}
.badge-year {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
}

/* ── Yearly extension button — gold / premium look ──────────────────────── */
.btn-year {
  font-size: 15px;
  padding: 7px 12px;
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition:
    opacity 0.15s,
    transform 0.1s;
  white-space: nowrap;
  margin-bottom: 10px;
}
.btn-year:hover {
  color: var(--text);
  border-color: #4a5568;
  background: var(--surface-2);
}
.btn-year:active {
  transform: scale(0.97);
}

.user-search {
  max-width: 1194px;
  margin: 0 0 24px auto;
  position: relative;
  display: flex;
  align-items: center;
}

#searchIconSlot {
  position: absolute;
  left: 14px;
  color: #9ca3af;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.user-search-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  padding: 12px;
  outline: none;
  padding-left: 38px;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.user-search-input::placeholder {
  color: var(--text-dim);
}
.user-search-input:focus {
  border-color: var(--accent);
}

/* ─── Actions wrapper & grids ───────────────────────────────────────────── */
.actions-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.actions-grid-3 {
  display: flex;
  gap: 4px;
}
.actions-grid-3 > .btn {
  flex: 1;
}

.actions-grid-2 {
  display: flex;
  gap: 4px;
}
.actions-grid-2 > .btn {
  flex: 1;
}

/* actions-grid-billing is a dynamic variant (2 or 3 cols) — inherits from grid-2/3 */
.actions-grid-billing {
  display: flex;
  gap: 4px;
}
.actions-grid-billing > .btn {
  flex: 1;
}

.btn-sm {
  font-size: 14px;
  padding: 7px 12px;
}

.btn-full-width {
  width: 100%;
}

.mobile-table {
  width: 100%;
  border-collapse: collapse;
}

.mobile-table th {
  text-align: left;
  padding: 12px 8px;
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  border-bottom: 2px solid var(--border);
}

.mobile-table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border-sub);
}

/* keep action buttons from wrapping awkwardly */
td .btn + .btn {
  margin-left: 4px;
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #4a5568;
}

/* ============================================================
   MOBILE RESPONSIVE — style.css (Admin Dashboard)
   Append this block to the END of src/web/public/style.css
   ============================================================ */

@media (max-width: 767px) {
  /* ─── Layout ─────────────────────────────────────────────── */
  .wrap {
    padding: 0 14px;
  }

  .page {
    padding: 16px 0 40px;
  }

  /* ─── Navbar ──────────────────────────────────────────────── */
  .nav-inner {
    padding: 0 14px;
  }

  /* Collapse nav links into a tighter row; hide lower-priority ones if needed */
  .nav-actions {
    gap: 12px;
  }

  .nav-link {
    font-size: 15px;
  }

  /* ─── Stats bar: 2-per-row on mobile ──────────────────────── */
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 16px;
  }

  /* If there's a lone 3rd cell, stretch it full width */
  .stat-cell:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .stat-val {
    font-size: 22px;
  }

  .stat-cell {
    padding: 14px 14px;
  }

  /* ─── Two-column grid → single column ────────────────────── */
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* ─── Card ────────────────────────────────────────────────── */
  .card-body {
    padding: 14px;
  }

  .card-head {
    padding: 12px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* ─── Buttons: larger touch targets ──────────────────────── */
  .btn {
    padding: 11px 16px;
    font-size: 14px;
  }

  .btn-ghost-danger,
  .btn-suspend,
  .btn-resume,
  .btn-delete {
    padding: 9px 14px;
    font-size: 15px;
  }

  .btn-year {
    padding: 6px 12px;
    margin-bottom: 10px;
  }

  /* Stack action buttons in table cells vertically */
  td .btn + .btn,
  .btn-edit,
  .extend-btn {
    margin-left: 0;
    margin-top: 4px;
  }

  /* ─── Table → Card layout ─────────────────────────────────── */
  /*
   * Converts each <tbody tr> into a standalone card block.
   * Works with the existing table markup without any JS changes.
   */
  .table-wrap {
    overflow-x: unset; /* let cards reflow naturally */
  }

  table {
    display: block;
  }

  thead {
    display: none; /* headers become inline labels via data-label */
  }

  tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  tbody tr {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    border-bottom: 1px solid var(--border); /* override the collapse reset */
    padding: 12px 14px;
    transition: background 0.1s;
  }

  tbody tr:hover {
    background: var(--surface-2);
  }

  tbody tr.suspended {
    opacity: 0.55;
  }

  tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-sub);
    font-size: 15px;
    gap: 8px;
  }

  tbody td:last-child {
    border-bottom: none;
  }

  /* Label pulled from data-label="Column Name" attribute on each <td> */
  tbody td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
    min-width: 90px;
  }

  /* Cells that hold only action buttons: no label, full-width */
  tbody td.td-actions {
    justify-content: stretch;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 10px;
  }

  tbody td.td-actions::before {
    display: none;
  }

  /* Action grids stack vertically on mobile */
  .actions-wrapper {
    width: 100%;
  }

  .actions-grid-3,
  .actions-grid-2,
  .actions-grid-billing {
    width: 100%;
  }

  .actions-grid-3 > .btn,
  .actions-grid-2 > .btn,
  .actions-grid-billing > .btn {
    padding: 10px 8px;
    font-size: 15px;
  }

  .btn-full-width {
    padding: 10px;
    font-size: 15px;
  }

  /* ─── Modals: full-width, scrollable ──────────────────────── */
  .modal-overlay {
    padding: 12px 8px;
    align-items: flex-start;
  }

  .modal-box {
    max-width: 100%;
    width: 95%;
    max-height: calc(100vh - 24px);
    border-radius: var(--radius);
  }

  .modal-header {
    padding: 12px 14px;
  }

  .modal-footer {
    padding: 10px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  #errorLogContent {
    font-size: 14px;
    padding: 14px;
    word-break: break-word;
  }

  .modal-extend-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  /* ─── Confirm dialog ──────────────────────────────────────── */
  .confirm-box {
    max-width: 92%;
    padding: 18px 16px;
  }

  .confirm-actions {
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .confirm-actions .btn {
    flex: 1;
  }

  /* ─── Section label ───────────────────────────────────────── */
  .section-label {
    margin-bottom: 8px;
  }

  /* ─── Mono / badge wrap on small cells ───────────────────── */
  .mono {
    font-size: 11.5px;
    word-break: break-all;
  }

  .badge {
    font-size: 11px;
    padding: 2px 7px;
  }

  .mobile-table thead {
    display: none;
  } /* Прячем шапку */

  .mobile-table tr {
    display: block;
    background: var(--surface-2); /* Делаем легкую подложку карточке */
    margin-bottom: 15px;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid var(--border);
  }

  .mobile-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px 4px;
    text-align: right;
  }

  .mobile-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-right: 15px;
    text-align: left;
    flex: 1;
  }

  .mobile-table td:last-child {
    border-bottom: none;
    justify-content: center;
    padding-top: 15px;
  }

  .mobile-table .btn {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .card-head {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 10px;
  }
  #tenantSearch {
    width: 100% !important;
  }
}
