/* ===== PAGES COMMON ===== */

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

.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: var(--shadow);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.login-logo .logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.login-logo .logo-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.login-box h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-box .subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

/* Admin Profile */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
}

.profile-hero .profile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  position: relative;
}

.profile-hero .profile-info h2 {
  font-size: 1.4rem;
  font-weight: 700;
}

.profile-hero .profile-info p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* Stats row */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.stat-card .stat-icon {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}

.stat-card .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Visitors */
.visitor-row td:first-child { display: flex; align-items: center; gap: 10px; }

.visitor-pages {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Auto-messages */
.message-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.message-card .msg-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.message-card .msg-content { flex: 1; }

.message-card .msg-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-card .msg-text {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.message-card .msg-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Shortcuts */
.shortcut-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: all var(--transition);
}

.shortcut-item:hover { border-color: var(--primary); }

.shortcut-keyword {
  background: rgba(var(--primary-rgb),0.18);
  color: var(--primary-light);
  padding: 3px 10px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  min-width: 80px;
  text-align: center;
}

.shortcut-text {
  flex: 1;
  color: var(--text-light);
  font-size: 0.875rem;
}

.shortcut-actions {
  display: flex;
  gap: 6px;
}

/* Modal (shared) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 24px;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 1rem; font-weight: 600; }

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

/* Settings */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }

.toggle-label-group .toggle-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}
.toggle-label-group .toggle-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border);
  transition: var(--transition);
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background: var(--text-muted);
  transition: var(--transition);
  border-radius: 50%;
}
input:checked + .slider { background: var(--primary); }
input:checked + .slider:before {
  transform: translateX(18px);
  background: #fff;
}

.embed-code-block {
  background: #0b1220;
  border: 1px solid var(--border);
  color: #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow: auto;
}
