/* EXPA Emulator — современная тема */
:root {
  --bg: #0f172a;
  --bg-elevated: #1e293b;
  --bg-card: #ffffff;
  --surface: #f8fafc;
  --border: #e2e8f0;
  --border-dark: #334155;
  --text: #0f172a;
  --text-muted: #64748b;
  --accent: #0ea5e9;
  --accent-hover: #0284c7;
  --accent-soft: rgba(14, 165, 233, 0.12);
  --success: #10b981;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --font: 'Outfit', 'Plus Jakarta Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); font-size: 15px; color: var(--text); background: var(--surface); -webkit-font-smoothing: antialiased; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
  font-family: inherit; cursor: pointer; border: none; transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface); border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon { padding: 8px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Карточки */
.card {
  background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px; margin-bottom: 20px; border: 1px solid var(--border);
}
.card h2 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.card .hint { color: var(--text-muted); font-size: 13px; margin-top: 6px; line-height: 1.45; }

/* Инпуты */
.input-wrap { margin-bottom: 16px; }
.input-wrap label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.input-wrap input, .input-wrap textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; transition: border-color 0.15s, box-shadow 0.15s;
}
.input-wrap input:focus, .input-wrap textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.input-with-btn { display: flex; gap: 10px; align-items: center; }
.input-with-btn input { flex: 1; }

/* Токен-блок */
.token-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; font-family: ui-monospace, monospace; font-size: 13px; word-break: break-all; }
.token-block.masked { color: var(--text-muted); }
.token-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.copy-btn.copied { color: var(--success); }

/* Лейаут с сайдбаром */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px; background: var(--bg); color: #e2e8f0; flex-shrink: 0;
  padding: 24px 0; display: flex; flex-direction: column;
}
.sidebar-brand { padding: 0 24px 24px; font-weight: 700; font-size: 18px; color: #fff; }
.sidebar-nav { flex: 1; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px; padding: 12px 24px; color: #94a3b8; text-decoration: none;
  font-size: 14px; font-weight: 500; transition: background 0.15s, color 0.15s;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav a.active { background: var(--accent-soft); color: var(--accent); }
.sidebar-nav a svg { flex-shrink: 0; opacity: 0.9; }
.main { flex: 1; padding: 32px; overflow-x: auto; }

/* Таблицы */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--text-muted); background: var(--surface); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface); }
.empty { text-align: center; color: var(--text-muted); padding: 32px !important; }

/* Страница логина (центрированная) */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(160deg, #f0f9ff 0%, #e0f2fe 50%, #f8fafc 100%); }
.login-card { width: 100%; max-width: 400px; background: var(--bg-card); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 40px; border: 1px solid var(--border); }
.login-card h1 { margin: 0 0 8px; font-size: 24px; font-weight: 700; }
.login-card .sub { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.login-card .error { color: var(--danger); font-size: 13px; margin-top: 12px; }
.login-card .btn { width: 100%; padding: 12px; margin-top: 8px; }

/* Утилиты */
.mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.text-muted { color: var(--text-muted); }
code { background: var(--surface); padding: 2px 8px; border-radius: 4px; font-size: 13px; font-family: ui-monospace, monospace; }
