/* ============================================================
   UptimePulse — Admin Dashboard Stylesheet
   Monochrome dark theme. Apple HIG inspired. Inter font.
   ============================================================ */

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

:root {
  /* Monochrome palette */
  --bg-root: #09090b;
  --bg-surface: #0f0f11;
  --bg-elevated: #18181b;
  --bg-hover: #1f1f23;
  --bg-active: #27272a;
  --bg-input: #131316;

  --border-subtle: #1e1e22;
  --border-default: #27272a;
  --border-strong: #3f3f46;
  --border-focus: #71717a;

  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --text-disabled: #52525b;
  --text-inverse: #09090b;

  --accent: #e4e4e7;
  --accent-hover: #d4d4d8;
  --accent-muted: #3f3f46;

  --status-up: #d4d4d8;
  --status-down: #52525b;
  --status-paused: #3f3f46;
  --status-pending: #71717a;

  --danger: #a1a1aa;
  --danger-bg: rgba(161,161,170,0.08);
  --success-bg: rgba(212,212,216,0.08);

  /* Sizing */
  --sidebar-width: 240px;
  --header-height: 56px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Transitions */
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --duration: 0.15s;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-root);
  color: var(--text-primary);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  outline: none;
  transition: border-color var(--duration) var(--ease);
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
}

input::placeholder, textarea::placeholder {
  color: var(--text-disabled);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2371717a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* ---------- Layout Shell ---------- */
.app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 20;
  transition: transform 0.25s var(--ease);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo svg {
  width: 22px;
  height: 22px;
  color: var(--text-primary);
}

.sidebar-logo span {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 0;
}

.nav-section-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-disabled);
  padding: 16px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 450;
  transition: all var(--duration) var(--ease);
  cursor: pointer;
  user-select: none;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--bg-active);
  color: var(--text-primary);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.6;
}

.nav-item.active svg {
  opacity: 1;
}

.nav-item .badge {
  margin-left: auto;
  background: var(--accent-muted);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  line-height: 1.5;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}

.sidebar-user:hover {
  background: var(--bg-hover);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-active);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Main Content Area ---------- */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.main-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.main-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: background var(--duration) var(--ease);
}

.mobile-menu-btn:hover {
  background: var(--bg-hover);
}

.mobile-menu-btn svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

.page-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.main-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease);
}

.header-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.header-btn svg {
  width: 18px;
  height: 18px;
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  scroll-behavior: smooth;
}

.content-area::-webkit-scrollbar {
  width: 6px;
}

.content-area::-webkit-scrollbar-track {
  background: transparent;
}

.content-area::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 3px;
}

/* ---------- Page views ---------- */
.page-view {
  display: none;
  animation: fadeIn 0.2s var(--ease);
}

.page-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Stat Cards Grid ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color var(--duration) var(--ease);
}

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

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  line-height: 1.1;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.15px;
}

.card-body {
  padding: 20px;
}

.card-body.no-pad {
  padding: 0;
}

/* ---------- Tables ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-disabled);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--bg-hover);
}

.data-table .cell-primary {
  color: var(--text-primary);
  font-weight: 500;
}

/* ---------- Status dot ---------- */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  flex-shrink: 0;
}

.status-dot.up {
  background: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(250,250,250,0.12);
}

.status-dot.down {
  background: var(--text-disabled);
  box-shadow: 0 0 0 3px rgba(82,82,91,0.2);
}

.status-dot.paused {
  background: transparent;
  border: 1.5px solid var(--text-disabled);
}

.status-dot.pending {
  background: var(--text-tertiary);
  animation: pulse 1.5s ease-in-out infinite;
}

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

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  gap: 6px;
}

.status-badge.up {
  background: var(--success-bg);
  color: var(--accent);
}

.status-badge.down {
  background: var(--danger-bg);
  color: var(--text-tertiary);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  cursor: pointer;
  line-height: 1.4;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--text-inverse);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-active);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn-ghost {
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-danger {
  color: var(--text-tertiary);
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
}

.btn-danger:hover {
  background: var(--danger-bg);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

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

.btn-lg {
  padding: 10px 20px;
  font-size: 14px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
}

.btn-group {
  display: flex;
  gap: 8px;
}

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: overlayIn 0.15s var(--ease);
  padding: 20px;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.2s var(--ease);
  box-shadow: 0 24px 48px -12px rgba(0,0,0,0.5);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.modal-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  transition: all var(--duration) var(--ease);
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-body {
  padding: 0 24px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-body::-webkit-scrollbar {
  width: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 2px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-disabled);
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 20px 0;
}

/* ---------- Tags / Chips ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-active);
  color: var(--text-secondary);
  gap: 4px;
}

/* ---------- Empty State ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--text-disabled);
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-tertiary);
  max-width: 320px;
  margin-bottom: 20px;
}

/* ---------- Chart container ---------- */
.chart-container {
  position: relative;
  height: 260px;
  padding: 16px;
}

/* ---------- Timeline ---------- */
.timeline {
  padding: 0 20px;
}

.timeline-item {
  position: relative;
  padding: 16px 0 16px 28px;
  border-left: 1px solid var(--border-subtle);
}

.timeline-item:last-child {
  border-left-color: transparent;
}

.timeline-dot {
  position: absolute;
  left: -5px;
  top: 19px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-disabled);
  border: 2px solid var(--bg-elevated);
}

.timeline-item.active .timeline-dot {
  background: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(250,250,250,0.1);
}

.timeline-item.resolved .timeline-dot {
  background: var(--text-tertiary);
}

.timeline-time {
  font-size: 11px;
  color: var(--text-disabled);
  margin-bottom: 4px;
}

.timeline-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.timeline-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.timeline-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

/* ---------- Alert channel cards ---------- */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.channel-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color var(--duration) var(--ease);
}

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

.channel-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.channel-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-active);
  display: flex;
  align-items: center;
  justify-content: center;
}

.channel-card-icon svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

.channel-card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.channel-card-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.channel-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---------- Toggle switch ---------- */
.toggle {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--bg-active);
  border-radius: 10px;
  border: 1px solid var(--border-default);
  transition: background var(--duration) var(--ease);
  cursor: pointer;
}

.toggle input:checked + .toggle-track {
  background: var(--text-primary);
  border-color: var(--text-primary);
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: transform var(--duration) var(--ease), background var(--duration) var(--ease);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(16px);
  background: var(--bg-root);
}

/* ---------- API key row ---------- */
.api-key-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.api-key-row:last-child {
  border-bottom: none;
}

.api-key-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 100px;
}

.api-key-value {
  flex: 1;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 12px;
  color: var(--text-tertiary);
  background: var(--bg-input);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-key-actions {
  display: flex;
  gap: 4px;
}

/* ---------- Plan card ---------- */
.plan-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.plan-card.current {
  border-color: var(--border-strong);
}

.plan-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}

.plan-price {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.plan-features {
  list-style: none;
  margin-bottom: 20px;
}

.plan-features li {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-features li::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-disabled);
  flex-shrink: 0;
}

/* ---------- Status page list ---------- */
.status-page-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--duration) var(--ease);
}

.status-page-item:last-child {
  border-bottom: none;
}

.status-page-item:hover {
  background: var(--bg-hover);
}

.status-page-info {
  flex: 1;
  min-width: 0;
}

.status-page-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.status-page-slug {
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.status-page-monitors {
  font-size: 12px;
  color: var(--text-disabled);
}

/* ---------- Notification toast ---------- */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: 0 8px 24px -4px rgba(0,0,0,0.5);
  animation: toastIn 0.25s var(--ease);
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.error {
  border-color: var(--border-strong);
}

.toast.leaving {
  animation: toastOut 0.2s var(--ease) forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(10px); }
}

/* ---------- Section header ---------- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ---------- Two-column settings layout ---------- */
.settings-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  max-width: 800px;
}

.settings-label-col h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.settings-label-col p {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.settings-section {
  margin-bottom: 40px;
}

/* ---------- Copy button feedback ---------- */
.copy-feedback {
  font-size: 11px;
  color: var(--text-tertiary);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.copy-feedback.show {
  opacity: 1;
}

/* ---------- Confirm dialog ---------- */
.confirm-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}

/* ---------- Two-column overview row ---------- */
.overview-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 1024px) {
  .overview-row {
    grid-template-columns: 1fr;
  }
}

/* ---------- Loading spinner ---------- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-default);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  gap: 12px;
  color: var(--text-tertiary);
  font-size: 13px;
}

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

.login-card {
  width: 100%;
  max-width: 380px;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 32px;
}

.login-logo svg {
  width: 28px;
  height: 28px;
  color: var(--text-primary);
}

.login-logo span {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.login-form .form-group {
  margin-bottom: 14px;
}

.login-form input {
  height: 42px;
}

.login-form .btn {
  width: 100%;
  height: 42px;
  margin-top: 8px;
}

.login-error {
  background: var(--danger-bg);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  display: none;
}

.login-error.visible {
  display: block;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .settings-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

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

  .content-area {
    padding: 20px 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
  }

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

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

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

  .modal {
    max-width: 100%;
    margin: 10px;
    max-height: 90vh;
  }
}

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

  .main-header {
    padding: 0 16px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 10px;
  }
}
