/* ═══════════════════════════════════════════════════════════════════════════ */
/* DeRa Admin - Minimalist Dark Theme                                          */
/* ═══════════════════════════════════════════════════════════════════════════ */

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

:root {
  --bg:           #0f1419;
  --surface:      #1a1f26;
  --surface2:     #252c35;
  --surface3:     #303844;
  --border:       #3a424d;
  --accent:       #5a9fd4;
  --accent-hover: #6eb3e8;
  --text:         #e8eaed;
  --text-muted:   #9ca3af;
  --sidebar-w:    240px;
  --radius:       8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--accent-hover);
}

/* ─── App layout ────────────────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

/* ─── Mobile overlay ────────────────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
}
.sidebar-overlay.open { display: block; }

/* ─── Sidebar ───────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.logo-icon { font-size: 20px; }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 2px;
  transition: all 0.15s;
  border-left: 2px solid transparent;
  cursor: pointer;
}
.nav-item:hover {
  background: var(--surface2);
  color: var(--accent);
  text-decoration: none;
  border-left-color: var(--accent);
}
.nav-item.active {
  background: var(--surface2);
  color: var(--accent);
  border-left-color: var(--accent);
}
.nav-icon { font-size: 15px; width: 20px; text-align: center; }

.nav-divider {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 14px 12px 6px;
}

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border);
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin-bottom: 6px;
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.user-name  { font-weight: 600; font-size: 13px; }
.user-role  { font-size: 11px; color: var(--text-muted); }
.logout-btn {
  display: block;
  text-align: center;
  padding: 7px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13px;
  border: 1px solid var(--border);
  transition: all 0.15s;
  cursor: pointer;
  background: none;
}
.logout-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ─── Main ──────────────────────────────────────────────────────────────── */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 12px;
}
.page-title { font-size: 18px; font-weight: 600; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Hamburger */
.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.15s;
}
.mobile-menu-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.content { padding: 20px 24px; }

/* ─── Flash messages ────────────────────────────────────────────────────── */
.flashes { padding: 12px 24px 0; }
.flash {
  padding: 11px 16px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 14px;
  border-left: 3px solid;
}
.flash-success { background: rgba(76, 175, 80, 0.1); border-left-color: #4caf50; color: #9ccc65; }
.flash-error   { background: rgba(244, 67, 54, 0.1); border-left-color: #f44336; color: #ef5350; }
.flash-info    { background: rgba(33, 150, 243, 0.1); border-left-color: #2196f3; color: #64b5f6; }

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary  {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-outline  {
  background: transparent;
  color: var(--accent);
  border-color: var(--border);
}
.btn-outline:hover {
  background: var(--surface2);
  border-color: var(--accent);
}

.btn-danger   {
  background: transparent;
  color: #ef5350;
  border-color: #ef5350;
}
.btn-danger:hover {
  background: rgba(244, 67, 54, 0.1);
}

.btn-success  {
  background: #4caf50;
  color: #fff;
  border-color: #4caf50;
}
.btn-success:hover {
  background: #66bb6a;
}

.btn-gray     {
  background: var(--surface2);
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-gray:hover {
  color: var(--text);
  background: var(--surface3);
}

.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ─── Cards ─────────────────────────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: all 0.15s;
}

.card:hover {
  border-color: var(--accent);
}

.card-label { font-size: 11px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 8px; }
.card-value { font-size: 26px; font-weight: 700; color: var(--accent); }

/* ─── Tables ────────────────────────────────────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

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

thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

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

.key-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

/* ─── Badges ────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-success { background: rgba(76, 175, 80, 0.2); color: #9ccc65; }
.badge-danger  { background: rgba(244, 67, 54, 0.2); color: #ef5350; }
.badge-warning { background: rgba(255, 152, 0, 0.2); color: #ffb74d; }
.badge-accent  { background: rgba(90, 159, 212, 0.2); color: var(--accent-hover); }
.badge-muted   { background: var(--surface2); color: var(--text-muted); }

.tariff-vpn         { background: rgba(76, 175, 80, 0.2); color: #9ccc65; }
.tariff-vpn_plus    { background: rgba(156, 39, 176, 0.2); color: #ce93d8; }
.tariff-family      { background: rgba(33, 150, 243, 0.2); color: #64b5f6; }
.tariff-family_plus { background: rgba(244, 67, 54, 0.2); color: #ef5350; }

/* ─── Forms ─────────────────────────────────────────────────────────────── */
.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.form-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.form-group input, .form-group select, .form-group textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 12px;
  font-size: 14px;
  transition: border-color 0.15s;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group select option { background: var(--surface); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 12px; color: var(--text-muted); }

/* ─── Grid layouts ──────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.gap-20 { margin-top: 20px; }

/* ─── Section header ────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-title { font-size: 14px; font-weight: 600; }

/* ─── VPN link box ──────────────────────────────────────────────────────── */
.vpn-link-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  word-break: break-all;
  color: var(--text-muted);
}

/* ─── Action log ────────────────────────────────────────────────────────── */
.action-log { display: flex; flex-direction: column; gap: 8px; }

.action-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.action-icon { font-size: 16px; flex-shrink: 0; }
.action-body { flex: 1; min-width: 0; }
.action-title { font-size: 13px; font-weight: 500; }
.action-meta  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ─── Filters bar ───────────────────────────────────────────────────────── */
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.filters input,
.filters select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 7px 12px;
  font-size: 13px;
  height: 36px;
}

.filters input:focus, .filters select:focus { outline: none; border-color: var(--accent); }
.filters input { min-width: 140px; }
.filter-actions { display: flex; gap: 6px; align-items: flex-end; }

/* ─── Login page ────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.login-card {
  width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
}

.login-logo {
  text-align: center;
  font-size: 32px;
  margin-bottom: 8px;
}

.login-title {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-sub {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.login-card .form-group { margin-bottom: 14px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 6px; padding: 11px; }

/* ─── Operator card ─────────────────────────────────────────────────────── */
.operator-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.op-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.op-info { flex: 1; min-width: 0; }
.op-name { font-weight: 600; font-size: 15px; }
.op-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.op-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ─── Chart container ───────────────────────────────────────────────────── */
.chart-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.chart-title { font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.07em; }

/* ─── Empty state ───────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state-text { font-size: 15px; }

/* ─── Tabs ──────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }

.tab-btn {
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
  white-space: nowrap;
}

.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-btn:hover  { color: var(--text); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Copy button ───────────────────────────────────────────────────────── */
.copy-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.copy-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ─── Danger zone ───────────────────────────────────────────────────────── */
.danger-zone {
  border: 1px solid #ef5350;
  border-radius: var(--radius);
  padding: 20px;
  background: rgba(244, 67, 54, 0.05);
}

.danger-zone-title { color: #ef5350; font-weight: 600; margin-bottom: 8px; }
.danger-zone-desc  { color: var(--text-muted); font-size: 13px; margin-bottom: 14px; }

/* ─── Log viewer ────────────────────────────────────────────────────────── */
.log-container {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  overflow-x: auto;
  max-height: 70vh;
  overflow-y: auto;
}

.log-line {
  padding: 2px 0;
  border-bottom: 1px solid rgba(58, 66, 77, 0.4);
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
}

.log-line.error   { color: #ef5350; }
.log-line.warning { color: #ffb74d; }
.log-line.info    { color: var(--text-muted); }

/* ─── Server card (ENV manager) ─────────────────────────────────────────── */
.server-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.server-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}

.server-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.server-card-body { padding: 18px; }

/* ─── Backup list ───────────────────────────────────────────────────────── */
.backup-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.backup-icon { font-size: 20px; flex-shrink: 0; }
.backup-info { flex: 1; min-width: 0; }
.backup-name { font-weight: 500; font-size: 13px; font-family: monospace; }
.backup-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.backup-actions { display: flex; gap: 6px; }

/* ─── Journal ───────────────────────────────────────────────────────────── */
.journal-entry {
  display: flex;
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
  transition: all 0.15s;
}

.journal-entry:last-child { border-bottom: none; }
.journal-entry:hover { background: var(--surface2); }
.journal-icon { font-size: 15px; flex-shrink: 0; margin-top: 2px; }
.journal-body { flex: 1; min-width: 0; }
.journal-action { font-size: 13px; font-weight: 500; }
.journal-details { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.journal-meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

.journal-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 4px;
  background: var(--surface2);
  color: var(--accent);
}

.tag-key   { background: rgba(90, 159, 212, 0.15); color: var(--accent); }
.tag-admin { background: rgba(76, 175, 80, 0.15); color: #9ccc65; }
.tag-login { background: rgba(90, 159, 212, 0.15); color: var(--accent); }

/* ─── Misc ──────────────────────────────────────────────────────────────── */
.text-muted    { color: var(--text-muted); font-size: 12px; }
.text-mono     { font-family: 'Courier New', monospace; font-size: 12px; }
.fw-600        { font-weight: 600; }
.mt-8          { margin-top: 8px; }
.mt-16         { margin-top: 16px; }
.mt-24         { margin-top: 24px; }
.flex          { display: flex; }
.items-center  { align-items: center; }
.gap-8         { gap: 8px; }
.gap-12        { gap: 12px; }
hr.divider     { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

.info-box {
  background: rgba(90, 159, 212, 0.1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* МОБИЛЬНАЯ АДАПТАЦИЯ                                                         */
/* ─────────────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 240px;
    z-index: 200;
  }
  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: block;
  }

  .main-header {
    padding: 12px 16px;
    flex-wrap: wrap;
  }

  .content {
    padding: 14px 16px;
  }

  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 15px;
  }

  .header-actions {
    width: 100%;
    order: 3;
  }

  .header-actions .btn {
    padding: 6px 10px;
    font-size: 12px;
    flex: 1;
  }

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

  table {
    min-width: 500px;
  }

  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    width: 100%;
  }

  .filters input,
  .filters select {
    width: 100%;
    min-width: unset;
  }

  .filter-actions {
    flex-direction: row;
    justify-content: flex-end;
    width: 100%;
    margin-top: 4px;
  }

  .form-section {
    padding: 16px;
  }

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

  .login-card {
    width: 90%;
    padding: 24px;
    margin: 0 auto;
  }

  .operator-card,
  .backup-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .op-actions,
  .backup-actions {
    width: 100%;
  }

  .op-actions .btn,
  .backup-actions .btn {
    width: 100%;
  }

  .chart-wrap {
    padding: 14px;
  }

  .chart-wrap canvas {
    max-height: 200px;
  }

  .danger-zone {
    padding: 14px;
  }

  .danger-zone .btn {
    width: 100%;
  }

  .vpn-link-box {
    font-size: 11px;
    padding: 10px;
  }

  .copy-btn {
    width: 100%;
    justify-content: center;
  }

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    font-size: 12px;
    padding: 8px 12px;
  }

  #template-buttons {
    flex-direction: column;
  }

  #template-buttons .btn {
    width: 100%;
    justify-content: center;
  }

  .key-actions {
    flex-direction: column;
  }

  .key-actions .btn {
    width: 100%;
    font-size: 11px;
    padding: 6px 10px;
  }

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

  .flex.gap-8 {
    flex-direction: column;
  }

  .flex.gap-8 .btn {
    width: 100%;
    justify-content: center;
  }

  .action-item {
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
  }

  .journal-entry {
    flex-direction: column;
    gap: 8px;
  }

  #view-client table,
  .form-section table {
    width: 100%;
  }

  #view-client table tr,
  .form-section table tr {
    display: block;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
  }

  #view-client table td,
  .form-section table td {
    display: block;
    width: 100%;
    padding: 4px 0;
  }

  #view-client table td.text-muted,
  .form-section table td.text-muted {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10px;
  }

  .server-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .cards {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 14px;
  }

  body {
    font-size: 13px;
  }

  .card-value {
    font-size: 22px;
  }

  .card-label {
    font-size: 10px;
  }

  .login-card {
    width: 95%;
    padding: 20px;
  }

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

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

  .btn-sm {
    font-size: 11px;
    padding: 4px 8px;
  }

  .action-item {
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
  }

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

  table {
    font-size: 11px;
    min-width: 400px;
  }

  thead th {
    font-size: 9px;
    padding: 8px 10px;
  }

  tbody td {
    padding: 8px 10px;
  }
}
