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

:root,
[data-theme="dark"] {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #a5b4fc;
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --text: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #475569;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --bg: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

.hidden {
  display: none !important;
}

.page {
  min-height: 100vh;
}

/* Login Page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
}

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

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 20px;
  margin-bottom: 24px;
  color: white;
}

.login-header h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

.form-group {
  margin-bottom: 20px;
}

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

.form-group input {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.error-message {
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: #ef4444;
  font-size: 14px;
  text-align: center;
}

.login-hint {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

.btn-secondary:hover {
  background: var(--bg-card-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
}

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

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-full {
  width: 100%;
}

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 600;
  font-size: 18px;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.nav-tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-tab:hover {
  color: var(--text);
}

.nav-tab.active {
  background: var(--primary);
  color: white;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.theme-toggle:hover {
  background: var(--bg-card-hover);
  color: var(--text);
  border-color: var(--primary);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

#user-name {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Main Content */
.main-content {
  padding: 32px;
  max-width: 1400px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 8px;
}

.section-header h2 {
  font-size: 24px;
  font-weight: 600;
  width: 100%;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 8px;
  flex: 1;
}

.section-actions {
  display: flex;
  gap: 12px;
}

/* Documents Grid */
.documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.document-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.document-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.document-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: white;
}

.document-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  word-break: break-word;
}

.document-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.document-actions {
  margin-top: 16px;
  display: flex;
  gap: 8px;
}

/* Stats Grid */
.stats-grid, .admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-card.highlight {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #4338ca 100%);
  border-color: var(--primary);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon.users {
  background: rgba(99, 102, 241, 0.2);
}

.stat-icon.docs {
  background: rgba(34, 197, 94, 0.2);
}

.stat-icon.time {
  background: rgba(245, 158, 11, 0.2);
}

.stat-icon.cost {
  background: rgba(255, 255, 255, 0.2);
}

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.stat-card.highlight .stat-label {
  color: rgba(255, 255, 255, 0.8);
}

/* Users Table */
.users-section {
  margin-top: 32px;
}

.users-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.users-table-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
}

.users-table th,
.users-table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.users-table th {
  background: var(--bg);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

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

.user-id {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: white;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
}

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

.status-badge.active {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.status-badge.inactive {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.status-badge.admin {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary-light);
  margin-left: 6px;
}

.status-badge.verified {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
  margin-left: 6px;
  font-size: 11px;
}

.status-badge.unverified {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  margin-left: 6px;
  font-size: 11px;
}

.status-badge.lifetime {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  margin-left: 6px;
}

.status-badge.referral {
  background: rgba(168, 85, 247, 0.2);
  color: #a855f7;
  margin-left: 6px;
  font-size: 11px;
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.referral-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.referral-stat-card {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.user-referral-code {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

.user-referral-code code {
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
  color: #a855f7;
  font-size: 12px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

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

.modal-body {
  padding: 24px;
}

.modal-field {
  margin-bottom: 20px;
}

.modal-field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.modal-field input[type="number"] {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
}

.modal-field input[type="number"]:focus {
  outline: none;
  border-color: var(--primary);
}

.toggle-group {
  display: flex;
  gap: 12px;
}

.toggle-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.toggle-btn:hover:not(.active) {
  border-color: var(--text-muted);
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.modal-actions .btn {
  flex: 1;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 16px;
}

/* User Detail Modal */
.user-detail-header {
  display: flex;
  gap: 16px;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.user-detail-avatar {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.user-id-large {
  font-size: 24px;
  font-weight: 700;
  color: white;
}

.user-folder {
  font-size: 12px;
  color: var(--primary-light);
  font-family: monospace;
  background: rgba(99, 102, 241, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  margin-top: 4px;
  display: inline-block;
}

.user-detail-info h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px;
}

.user-detail-info p {
  color: var(--text-muted);
  margin: 0;
  font-size: 14px;
}

.user-joined {
  font-size: 12px !important;
  margin-top: 4px !important;
}

.user-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.user-stat-card {
  background: var(--bg);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.user-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.user-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-docs-section {
  margin-bottom: 20px;
}

.user-docs-section h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.user-docs-list {
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 8px;
  padding: 8px;
}

.user-doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 6px;
  transition: background 0.15s;
}

.user-doc-item:hover {
  background: var(--bg-card-hover);
}

.user-doc-item svg {
  color: var(--primary);
  flex-shrink: 0;
}

.user-doc-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

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

.user-doc-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.empty-docs {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

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

.modal-body h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

/* Settings Section */
.settings-section {
  margin-bottom: 32px;
}

.settings-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.settings-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
}

.settings-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

/* Referral Styles */
.referral-stats-row {
  display: flex;
  gap: 32px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.referral-stat {
  display: flex;
  flex-direction: column;
}

.referral-stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
}

.referral-stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.referral-link-section {
  margin-bottom: 24px;
}

.referral-link-row {
  display: flex;
  gap: 12px;
}

.referral-link-input {
  flex: 1;
  padding: 12px 16px;
  font-size: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: monospace;
}

.referral-link-input:focus {
  outline: none;
  border-color: var(--primary);
}

.referral-invite-section {
  margin-bottom: 24px;
}

.referral-invite-row {
  display: flex;
  gap: 12px;
}

.referral-invite-input {
  flex: 1;
  padding: 12px 16px;
  font-size: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
}

.referral-invite-input:focus {
  outline: none;
  border-color: var(--primary);
}

.referral-invite-input::placeholder {
  color: var(--text-muted);
}

.invite-message {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.invite-message.success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--success);
}

.invite-message.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.invite-history-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.invite-history-list {
  background: var(--bg);
  border-radius: var(--radius-sm);
  max-height: 240px;
  overflow-y: auto;
}

.empty-history {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.invite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

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

.invite-email {
  font-size: 14px;
  color: var(--text);
}

.invite-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.invite-date {
  font-size: 12px;
  color: var(--text-muted);
}

.invite-badge {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 20px;
  text-transform: uppercase;
}

.invite-badge.pending {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.invite-badge.accepted {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.copied-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  z-index: 1001;
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .navbar {
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px;
  }

  .nav-tabs {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .main-content {
    padding: 20px;
  }

  .users-table-container {
    overflow-x: auto;
  }

  .admin-only {
    display: none;
  }

  .user-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .user-detail-header {
    flex-direction: column;
    text-align: center;
  }

  .referral-stats-row {
    flex-direction: column;
    gap: 16px;
  }

  .referral-link-row,
  .referral-invite-row {
    flex-direction: column;
  }

  .referral-link-row .btn,
  .referral-invite-row .btn {
    width: 100%;
  }
}

/* Legal Footer */
.legal-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  z-index: 50;
}

.legal-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.legal-footer a:hover {
  color: var(--primary-light);
}

.legal-footer span {
  color: var(--text-muted);
}

/* SEO Settings Tab */
.seo-settings-container {
  max-width: 800px;
}

.seo-page-selector {
  margin-bottom: 24px;
}

.seo-page-selector label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-select {
  width: 100%;
  max-width: 300px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
}

.seo-form {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.seo-form .form-group {
  margin-bottom: 20px;
}

.seo-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text);
}

.seo-form .form-control {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.seo-form .form-control:focus {
  outline: none;
  border-color: var(--primary);
}

.seo-form textarea.form-control {
  resize: vertical;
  min-height: 60px;
}

.form-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.seo-form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.save-status {
  font-size: 14px;
  font-weight: 500;
}

.save-status.success {
  color: var(--success);
}

.save-status.error {
  color: var(--danger);
}

.seo-preview {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
}

.seo-preview h4 {
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.google-preview {
  background: white;
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: Arial, sans-serif;
}

.google-title {
  color: #1a0dab;
  font-size: 18px;
  font-weight: normal;
  margin-bottom: 4px;
  cursor: pointer;
  text-decoration: none;
}

.google-title:hover {
  text-decoration: underline;
}

.google-url {
  color: #006621;
  font-size: 13px;
  margin-bottom: 4px;
}

.google-description {
  color: #545454;
  font-size: 13px;
  line-height: 1.4;
}

/* FAQ Admin Styles */
.faq-admin-container {
  max-width: 900px;
}

.faq-actions {
  margin-bottom: 24px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.faq-item.inactive {
  opacity: 0.6;
}

.faq-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.faq-item-order {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.faq-item-question {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 15px;
}

.faq-item-status {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.faq-item-status.active {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.faq-item-status.inactive {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.faq-item-actions {
  display: flex;
  gap: 8px;
}

.faq-item-body {
  padding: 16px;
}

.faq-item-answer {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.faq-edit-form {
  padding: 16px;
  background: var(--bg-secondary);
}

.faq-edit-form .form-group {
  margin-bottom: 16px;
}

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

.faq-edit-form .form-control {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.faq-edit-form .form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.faq-edit-form textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.faq-edit-form .form-row {
  display: flex;
  gap: 16px;
}

.faq-edit-form .form-row .form-group {
  flex: 1;
}

.faq-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.faq-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.faq-tab {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.faq-tab:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.faq-tab.active {
  background: var(--primary);
  color: white;
}

.faq-category-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.faq-category-item.inactive {
  opacity: 0.6;
}

.faq-item-category-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 500;
}

.faq-actions {
  margin-bottom: 20px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* FAQ Grouped List Styles */
.faq-grouped-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-category-group {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.faq-category-group.inactive {
  opacity: 0.7;
}

.faq-category-group.uncategorized {
  border-style: dashed;
}

.faq-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card-hover);
  cursor: pointer;
  transition: background 0.2s;
}

.faq-category-header:hover {
  background: var(--border);
}

.faq-category-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.faq-expand-icon {
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.faq-expand-icon.expanded {
  transform: rotate(90deg);
}

.faq-category-order {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: white;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.faq-category-name {
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
}

.faq-category-count {
  font-size: 13px;
  color: var(--text-muted);
}

.faq-inactive-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
  font-weight: 500;
}

.faq-category-actions {
  display: flex;
  gap: 4px;
}

.btn-add {
  color: var(--success);
}

.btn-add:hover {
  background: rgba(34, 197, 94, 0.15);
}

.faq-category-items {
  display: none;
  border-top: 1px solid var(--border);
}

.faq-category-items.expanded {
  display: block;
}

.faq-empty-category {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  font-style: italic;
}

.faq-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  transition: background 0.15s;
}

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

.faq-item:hover {
  background: var(--bg-card-hover);
}

.faq-item.inactive {
  opacity: 0.6;
}

.faq-item-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.faq-item-order {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--bg-card-hover);
  color: var(--text-secondary);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.faq-item-text {
  flex: 1;
  min-width: 0;
}

.faq-item-question {
  display: block;
  font-weight: 500;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.faq-item-answer-preview {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.faq-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
