@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500&display=swap');

:root {
  --bg: #0f1115;
  --panel: #161923;
  --panel-2: #1c2030;
  --border: #272c3d;
  --text: #eef0f6;
  --text-dim: #9096ac;
  --accent: #5b8cff;
  --accent-soft: rgba(91, 140, 255, 0.12);
  --success: #4ade80;
  --danger: #f87171;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ===== AUTH PAGE ===== */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(91,140,255,0.08), transparent 40%),
    var(--bg);
}

.auth-card {
  width: 340px;
  padding: 40px 32px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
}

.auth-mark {
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 12px;
}

.auth-title {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 28px;
}

.auth-form { text-align: left; display: flex; flex-direction: column; gap: 16px; }

/* ===== FORM ELEMENTS ===== */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
}

.field input,
.field textarea {
  font-family: 'Inter', sans-serif;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 13px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
}

.field textarea { resize: vertical; }

.btn-primary {
  background: var(--accent);
  color: #0f1115;
  border: none;
  padding: 12px 18px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.error-text {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
}

.status-msg {
  font-size: 13px;
  margin-top: 12px;
  min-height: 18px;
}
.status-msg.success { color: var(--success); }
.status-msg.error { color: var(--danger); }

/* ===== APP SHELL ===== */
.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 24px;
  font-weight: 700;
  font-size: 15px;
}
.brand-mark { color: var(--accent); font-size: 18px; }

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }

.btn-logout {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

.content {
  flex: 1;
  padding: 40px 48px;
  max-width: 720px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-header { margin-bottom: 24px; }
.panel-header h1 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.panel-header p { font-size: 14px; color: var(--text-dim); }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.current-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  padding: 10px 12px;
  background: var(--panel-2);
  border-radius: 8px;
  word-break: break-all;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}

.subscriber-badge {
  align-self: flex-start;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 20px;
  color: var(--accent);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.history-table th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 500;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.history-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-row {
  text-align: center;
  color: var(--text-dim);
  padding: 24px !important;
}

@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
  }
  .brand { padding: 0; margin-right: auto; }
  .nav { flex-direction: row; }
  .btn-logout { margin-left: 8px; }
  .content { padding: 24px 20px; }
}
