/* Service console — builds on common.css (.card/.btn/.subtitle already exist). */

body {
  display: block;
  align-items: initial;
  justify-content: initial;
  padding: 0;
  color: #1f2a44;
  background: #f5f7fb;
}
body::before, body::after { display: none; }
.console { max-width: 960px; margin: 0 auto; padding: 24px 16px 64px; }

/* ── Shell: sidebar + main ─────────────────────────────────────────────── */
.shell { width: 100%; display: flex; min-height: 100vh; align-items: stretch; background: #f5f7fb; }
.sidebar {
  width: 232px; flex: 0 0 232px; background: #141c2c; color: #c8d2e0;
  display: flex; flex-direction: column; padding: 18px 0;
}
.sidebar .brand { padding: 0 20px 16px; font-weight: 700; color: #fff; font-size: 15px; }
.nav { flex: 1; display: flex; flex-direction: column; }
.nav-group { padding: 14px 20px 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #5d6b82; }
.navlink { padding: 9px 20px; color: #c8d2e0; text-decoration: none; font-size: 14px; border-left: 3px solid transparent; }
.navlink:hover { background: #1d2940; color: #fff; }
.navlink.on { background: #1d2940; color: #fff; border-left-color: #4a90e2; font-weight: 600; }
.sidebar-foot { padding: 14px 20px 0; border-top: 1px solid #232f47; display: flex; flex-direction: column; gap: 8px; }
.sidebar-foot .muted { color: #8a93a3; }
.main {
  flex: 1;
  min-width: 0;
  max-width: none;
  padding: 32px clamp(24px, 4vw, 48px) 64px;
}

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.page-head h1 { margin: 0; font-size: 22px; }
.page-head .subtitle { max-width: 760px; }
.page-head .btn { width: auto; margin-top: 0; white-space: nowrap; }
.head-link { width: auto; margin-top: 0; text-decoration: none; white-space: nowrap; }

td.pos { color: #1f9254; } td.neg { color: #c0392b; }
.card.stat.recharge .stat-foot { font-size: 13px; color: #41506b; line-height: 1.5; }
.modal .field select { width: 100%; padding: 9px 11px; border: 1px solid #d6dbe3; border-radius: 7px; background: #fff; }
.modal .field input[readonly] { background: #f4f6f9; color: #8a93a3; }

.console-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 20px;
}
.console-head h1 { margin: 0 0 4px; font-size: 24px; }
.head-actions { display: flex; align-items: center; gap: 12px; }
.muted { color: #8a93a3; font-size: 13px; }

.cards {
  width: 100%;
  max-width: 1180px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.card.stat { padding: 18px 20px; }
.stat-label { font-size: 13px; color: #8a93a3; }
.stat-value { font-size: 32px; font-weight: 700; margin: 6px 0; color: #1f2a44; }
.stat-foot { font-size: 12px; }

.card {
  max-width: none;
  max-height: none;
  margin: 0 0 16px;
  padding: 20px;
  overflow: visible;
  color: #1f2a44;
  background: #fff;
  border-color: #e5e9f0;
  box-shadow: 0 10px 24px rgba(31, 42, 68, .06);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.card::before { display: none; }
.main > .card, .main > .page-head, .main > .subtitle {
  width: 100%;
  max-width: 1180px;
}
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-header h2 { margin: 0; font-size: 17px; }

.console-grid {
  width: 100%;
  max-width: 1180px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .95fr);
  align-items: start;
  gap: 16px;
}
.console-grid > .card { width: 100%; margin-bottom: 0; }
.client-config-card { position: sticky; top: 24px; }

table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #eef1f5; }
th { color: #8a93a3; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
td code { background: #f4f6f9; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.row-actions { white-space: nowrap; text-align: right; }
.empty { color: #8a93a3; padding: 18px 0; text-align: center; }
.config-block { margin: 0 0 16px; }
.config-block h3 { margin: 0 0 8px; font-size: 15px; color: #1f2a44; }
.config-block pre {
  margin: 0; padding: 12px; overflow-x: auto; background: #111827; color: #e5e7eb;
  border-radius: 8px; font-size: 13px; line-height: 1.5;
}
.rights-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.right-item {
  min-width: 0; padding: 14px; border: 1px solid #eef1f5; border-radius: 8px;
  background: #f8fafc; display: flex; flex-direction: column; gap: 5px;
}
.right-item strong { color: #1f2a44; font-size: 15px; }
.right-item span, .config-note span, .guide-list { color: #41506b; font-size: 13px; }
.right-item code, .guide-list code, .config-note code {
  overflow-wrap: anywhere; background: #eef1f5; color: #1f2a44; padding: 2px 6px; border-radius: 4px;
}
.guide-list { margin: 12px 0 0 20px; line-height: 1.8; }
.guide-list a { color: #2563eb; text-decoration: none; font-weight: 600; }
.guide-list a:hover { text-decoration: underline; }
.config-note {
  display: flex; flex-direction: column; gap: 5px; padding: 12px 14px; border-radius: 8px;
  background: #eff6ff; border: 1px solid #dbeafe; color: #1f2a44; font-size: 13px;
}

.btn.small { width: auto; min-height: 0; margin-top: 0; padding: 4px 10px; font-size: 13px; }
.btn.secondary { background: #eef1f5; color: #41506b; }
.btn.danger, .btn.small.danger { background: #fdeaea; color: #c0392b; }

.badge { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.active { background: #e6f7ed; color: #1f9254; }
.badge.revoked { background: #f0f1f4; color: #8a93a3; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(20, 28, 44, .45);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
  background: #fff; border-radius: 12px; padding: 24px; width: min(480px, 92vw);
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
.modal h2 { margin: 0 0 12px; font-size: 18px; }
.modal .field { margin-bottom: 14px; }
.modal .field label { display: block; font-size: 13px; color: #41506b; margin-bottom: 5px; }
.modal .field input { width: 100%; padding: 9px 11px; border: 1px solid #d6dbe3; border-radius: 7px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal-actions .btn { width: auto; margin-top: 0; }
.warn { color: #c0392b; font-size: 13px; }
.secret-box {
  display: flex; align-items: center; gap: 10px; background: #f4f6f9;
  padding: 12px; border-radius: 8px; margin: 10px 0;
}
.secret-box code { flex: 1; word-break: break-all; font-size: 13px; }

@media (max-width: 840px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex: 0 0 auto; }
  .main { padding: 22px 16px 48px; }
  .rights-grid, .cards, .console-grid { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .client-config-card { position: static; }
}
