:root {
  --bg-primary: #0a0f1d;
  --bg-secondary: #111827;
  --bg-card: #1e293b;
  --bg-card-hover: #263349;
  --border-color: #334155;
  --border-focus: #3b82f6;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  --accent-purple: #8b5cf6;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Vazirmatn", "Tahoma", sans-serif;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #8b5cf6;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --accent-blue: #2563eb;
  --accent-cyan: #0284c7;
  --accent-emerald: #059669;
  --accent-rose: #e11d48;
  --accent-amber: #d97706;
  --accent-purple: #7c3aed;
}

[data-theme="light"] body {
  background-color: var(--bg-primary);
  color: var(--text-main);
}

[data-theme="light"] .app-header {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.95));
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .panel,
[data-theme="light"] .metric-card,
[data-theme="light"] .account-badge-card,
[data-theme="light"] .nav-tabs-bar {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .nav-tab-btn {
  color: #64748b !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .nav-tab-btn:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

[data-theme="light"] .nav-tab-btn.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(99, 102, 241, 0.15)) !important;
  color: #7c3aed !important;
  border: 1px solid rgba(139, 92, 246, 0.5) !important;
}

[data-theme="light"] input,
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="tel"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="file"],
[data-theme="light"] textarea,
[data-theme="light"] select,
[data-theme="light"] .form-control {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light"] input:focus,
[data-theme="light"] textarea:focus,
[data-theme="light"] select:focus {
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15) !important;
}

[data-theme="light"] .ig-account-card {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

/* Smart Direct & All Tabs Card Styling in Light Mode */
[data-theme="light"] .stat-card {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}
[data-theme="light"] .stat-label {
  color: #64748b !important;
}

[data-theme="light"] .rule-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
}
[data-theme="light"] .rule-card:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}
[data-theme="light"] .rule-card h4 {
  color: #0f172a !important;
}
[data-theme="light"] .rule-card div[style*="background:rgba(0,0,0"] {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}
[data-theme="light"] .rule-card div[style*="color:#cbd5e1"] {
  color: #475569 !important;
}

[data-theme="light"] .kw-tag {
  background: #f1f5f9 !important;
  color: #4338ca !important;
  border: 1px solid #c7d2fe !important;
}

[data-theme="light"] .follow-gate-panel {
  background: #fdf4ff !important;
  border-color: #d8b4fe !important;
}
[data-theme="light"] .follow-gate-panel h3 {
  color: #581c87 !important;
}
[data-theme="light"] .follow-gate-panel p {
  color: #475569 !important;
}

[data-theme="light"] .simulator-panel {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] .accordion-toggle {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}

[data-theme="light"] .accordion-content {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] .terminal-window {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #1e293b !important;
}
[data-theme="light"] .log-entry {
  border-bottom-color: #e2e8f0 !important;
}
[data-theme="light"] .log-entry .log-time {
  color: #64748b !important;
}
[data-theme="light"] .log-entry .log-content {
  color: #1e293b !important;
}

/* Headings and labels in Light Mode */
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] .panel-title,
[data-theme="light"] .metric-header span:first-child,
[data-theme="light"] label {
  color: #0f172a !important;
}

[data-theme="light"] p,
[data-theme="light"] .metric-sub,
[data-theme="light"] small,
[data-theme="light"] .text-muted {
  color: #64748b !important;
}

[data-theme="light"] [style*="color:#f8fafc"],
[data-theme="light"] [style*="color: #f8fafc"],
[data-theme="light"] [style*="color:#fff"]:not(.btn-primary):not(.btn-success):not(.btn-danger):not(.badge-new),
[data-theme="light"] [style*="color: #fff"]:not(.btn-primary):not(.btn-success):not(.btn-danger):not(.badge-new) {
  color: #0f172a !important;
}

[data-theme="light"] [style*="color:#cbd5e1"],
[data-theme="light"] [style*="color: #cbd5e1"],
[data-theme="light"] [style*="color:#e2e8f0"],
[data-theme="light"] [style*="color: #e2e8f0"] {
  color: #475569 !important;
}

[data-theme="light"] div[style*="background:rgba(15,23,42"],
[data-theme="light"] div[style*="background: rgba(15, 23, 42"] {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] .user-profile-badge {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}

[data-theme="light"] .connection-pill {
  background: rgba(16, 185, 129, 0.1) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
  color: #059669 !important;
}

[data-theme="light"] .ui-mode-switcher {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] .modal-box {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] .plan-card {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}

[data-theme="light"] .plan-card.recommended {
  border-color: #8b5cf6 !important;
  background: #ffffff !important;
}

[data-theme="light"] .gateway-option {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}

[data-theme="light"] .gateway-option:hover,
[data-theme="light"] .gateway-option.selected {
  background: #ffffff !important;
  border-color: #8b5cf6 !important;
}

[data-theme="light"] .users-table th {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border-bottom-color: #cbd5e1 !important;
}

[data-theme="light"] .users-table td {
  border-bottom-color: #f1f5f9 !important;
  color: #1e293b !important;
}

/* Header Pills & Badges: Strict No-wrap prevention */
.connection-pill {
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  flex-shrink: 0 !important;
}
.connection-pill span {
  white-space: nowrap !important;
}
.user-profile-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}
.user-profile-badge > *,
.subscription-pill,
.btn-ui-mode,
#btnThemeToggle,
#btnAdminPanel,
#btnLogout {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}
.header-status {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  flex-wrap: wrap !important;
  justify-content: flex-end !important;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  direction: rtl;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Container */
.container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 1rem;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(17, 24, 39, 0.95));
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ec4899, #8b5cf6, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.logo-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(to right, #60a5fa, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.connection-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.connection-pill.offline {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.3);
}

.dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Metrics Row */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, border-color 0.2s;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-blue);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.metric-value {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.metric-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.color-emerald { color: var(--accent-emerald); }
.color-rose { color: var(--accent-rose); }
.color-cyan { color: var(--accent-cyan); }
.color-amber { color: var(--accent-amber); }

/* Accounts Live Strip */
.accounts-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .accounts-strip {
    grid-template-columns: 1fr;
  }
}

.account-badge-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.85rem;
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.acc-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.acc-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.acc-details h3 {
  font-size: 0.9rem;
  font-weight: 700;
}

.acc-details span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.acc-status-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
}

.acc-status-tag.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.35);
}

.acc-status-tag.standby {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border-color: rgba(6, 182, 212, 0.35);
}

.acc-status-tag.error {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.35);
}

/* Main Split Layout */
.main-layout {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* Panels */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

/* Form Styles */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.6rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

textarea {
  resize: vertical;
  min-height: 75px;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
}

.checkbox-group input {
  accent-color: var(--accent-blue);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Tabs */
.tabs-header {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.tab-btn.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

/* Buttons */
.btn {
  padding: 0.7rem 1.2rem;
  border-radius: 0.65rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  transition: all 0.2s ease-in-out;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #34d399, #10b981);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #f87171, #ef4444);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #334155;
  color: #f8fafc;
}

.btn-secondary:hover:not(:disabled) {
  background: #475569;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.btn-outline:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: var(--text-muted);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-full {
  width: 100%;
}

/* Action Bar */
.action-bar {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Verification Result Box */
.verify-result-box {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  display: none;
  margin-top: 0.4rem;
}

.verify-result-box.show {
  display: block;
}

.verify-result-box.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.verify-result-box.error {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fb7185;
}

/* Terminal & Logs */
.terminal-window {
  background: #090d16;
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  flex: 1;
  min-height: 480px;
  max-height: 640px;
  overflow-y: auto;
  padding: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.log-entry {
  padding: 0.5rem 0.75rem;
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.03);
  border-right: 3px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

.log-entry.success {
  border-right-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.04);
}

.log-entry.error {
  border-right-color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.06);
}

.log-entry.info {
  border-right-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.04);
}

.log-entry.warning {
  border-right-color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.06);
}

.log-header-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.log-time {
  direction: ltr;
}

.log-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.log-tag.success { background: #065f46; color: #6ee7b7; }
.log-tag.error { background: #881337; color: #fda4af; }
.log-tag.info { background: #1e3a8a; color: #93c5fd; }
.log-tag.warning { background: #78350f; color: #fde68a; }

.log-content {
  color: #e2e8f0;
  word-break: break-word;
}

.log-meta {
  font-size: 0.7rem;
  color: #64748b;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Terminal Controls */
.terminal-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Details Modal / Accordion */
.accordion-toggle {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.accordion-content {
  display: none;
  flex-direction: column;
  gap: 0.85rem;
  padding-top: 0.5rem;
}

.accordion-content.open {
  display: flex;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* -------------------------------------------------------------
   Authentication & User Management Styles
   ------------------------------------------------------------- */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 29, 0.92);
  backdrop-filter: blur(16px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  padding: 2.25rem 2rem;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-tab-btn.active {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan)) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.login-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.login-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(to right, #60a5fa, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
}

.subscription-pill {
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.subscription-pill.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.subscription-pill.expired {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.35);
}

/* Modal Dialog */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.show {
  display: flex !important;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  width: 100%;
  max-width: 650px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}

.close-btn:hover {
  color: #fff;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: right;
}

.users-table th, .users-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.users-table th {
  color: var(--text-muted);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.2);
}

/* Instagram Connected Account Box */
.ig-account-card {
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1rem;
  background: rgba(17, 24, 39, 0.6);
  margin-bottom: 1rem;
  transition: all 0.2s ease;
}

.ig-account-card.connected {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(6, 182, 212, 0.05));
}

.ig-connected-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ig-user-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.ig-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #ec4899, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

.ig-handle {
  font-weight: 700;
  font-size: 0.95rem;
  color: #34d399;
}

.ig-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ig-actions {
  display: flex;
  gap: 0.4rem;
}

/* ============================================================
   Main Navigation Tabs & Marketing Section Styles
   ============================================================ */
.nav-tabs-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  background: var(--bg-secondary);
  padding: 0.4rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.nav-tab-btn {
  flex: 1 1 auto;
  min-width: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.84rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-family);
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab-btn.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(139, 92, 246, 0.25));
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.3);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.badge-new {
  background: linear-gradient(135deg, #ef4444, #f59e0b);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 1rem;
  font-weight: 700;
}

.marketing-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 992px) {
  .marketing-grid {
    grid-template-columns: 1fr;
  }
}

.category-tabs-bar {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  flex-wrap: wrap;
}

.category-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.6rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-family);
}

.category-tab-btn:hover {
  color: var(--text-main);
  border-color: #475569;
}

.category-tab-btn.active {
  background: linear-gradient(135deg, #1e293b, #334155);
  color: #38bdf8;
  border-color: #38bdf8;
}

.tab-count-badge {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  padding: 0.1rem 0.45rem;
  border-radius: 0.8rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.discovered-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.2s ease;
  position: relative;
}

.post-card:hover {
  border-color: #475569;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.post-card.selected {
  border-color: #3b82f6;
  background: rgba(30, 41, 59, 0.9);
}

.post-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.post-card-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.post-meta-handle {
  font-weight: 700;
  font-size: 0.85rem;
  color: #e2e8f0;
}

.post-badge-relevance {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.2rem 0.5rem;
  border-radius: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.post-badge-viral {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
  padding: 0.2rem 0.5rem;
  border-radius: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.post-stats-row {
  display: flex;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.4rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.post-stats-row b {
  color: var(--text-main);
}

.post-caption-snippet {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.15);
  padding: 0.5rem;
  border-radius: 0.4rem;
}

.post-reason-box {
  font-size: 0.75rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.post-card-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin-top: auto;
}

.empty-state-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1.5rem;
  background: rgba(30, 41, 59, 0.4);
  border: 1px dashed var(--border-color);
  border-radius: 0.75rem;
  color: var(--text-muted);
}

.empty-state-card span {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}




/* Wide Desktop Modal styles for Admin Panel & User Editing */
#adminModal .modal-box {
  max-width: 1150px !important;
  width: 95% !important;
  max-height: 90vh !important;
}

#editUserModal .modal-box {
  max-width: 900px !important;
  width: 95% !important;
  max-height: 90vh !important;
}

/* Guide Step Styles */
.guide-step-tab {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}
.guide-step-tab:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.05);
}
.guide-step-tab.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  font-weight: 700;
}
.guide-step-tab .step-num {
  background: #334155;
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}
.guide-step-tab.active .step-num {
  background: #38bdf8;
  color: #0f172a;
}
.guide-step-arrow {
  color: #475569;
  font-size: 0.8rem;
}

/* Payment Checkout Modal Styles */
.gateway-option {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 0.75rem;
    padding: 0.9rem 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}
.gateway-option:hover {
    border-color: #64748b;
    background: #243248;
}
.gateway-option.selected {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.12);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.25);
}
.gateway-badge-prio {
    position: absolute;
    top: -9px;
    left: 1rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}
.gateway-icon {
    font-size: 1.5rem;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.gateway-info {
    flex: 1;
}
.gateway-name {
    font-size: 0.88rem;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 0.2rem;
}
.gateway-desc {
    font-size: 0.72rem;
    color: #94a3b8;
    line-height: 1.5;
}


/* ========================================================
   Content Studio (Tab 5) Custom Boxes
   ======================================================== */
.studio-box-hook {
  background: #0f172a;
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  border-right: 4px solid #f59e0b;
}
.studio-box-caption {
  background: #0f172a;
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  border-right: 4px solid #3b82f6;
}
.studio-box-hashtags {
  background: #0f172a;
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  border-right: 4px solid #10b981;
}
.studio-box-reply {
  background: #0f172a;
  padding: 0.65rem;
  border-radius: 0.5rem;
  border-right: 3px solid #ec4899;
}
.studio-box-direct {
  background: #0f172a;
  padding: 0.65rem;
  border-radius: 0.5rem;
  border-right: 3px solid #8b5cf6;
}
.studio-vision-upload-box {
  background: #0f172a;
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px dashed #475569;
  margin-bottom: 0.85rem;
}
.studio-textarea {
  background: #1e293b;
  color: #e2e8f0;
}

/* ========================================================
   Marketing Assistant & Instagram Sunset Cards in Light Mode
   ======================================================== */
[data-theme="light"] .post-card {
  background: #ffffff !important;
  border: 1px solid #fed7aa !important;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.06) !important;
}

[data-theme="light"] .post-card:hover {
  border-color: #f43f5e !important;
  box-shadow: 0 8px 24px rgba(225, 48, 108, 0.15) !important;
  transform: translateY(-2px);
}

[data-theme="light"] .post-card.selected {
  background: linear-gradient(135deg, #ffffff 0%, #fff7ed 50%, #fdf2f8 100%) !important;
  border: 2px solid #e1306c !important;
  box-shadow: 0 6px 20px rgba(225, 48, 108, 0.18) !important;
}

[data-theme="light"] .post-meta-handle {
  color: #0f172a !important;
  font-weight: 800 !important;
}

[data-theme="light"] .post-stats-row {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}

[data-theme="light"] .post-stats-row b {
  color: #0f172a !important;
}

[data-theme="light"] .post-caption-snippet {
  background: #fdf2f8 !important;
  color: #334155 !important;
  border: 1px solid #fce7f3 !important;
  border-radius: 0.4rem;
  padding: 0.5rem;
}

[data-theme="light"] .post-reason-box {
  color: #64748b !important;
  background: #fff7ed !important;
  padding: 0.35rem 0.5rem !important;
  border-radius: 0.35rem !important;
  border: 1px solid #ffedd5 !important;
}

[data-theme="light"] .post-card .post-card-actions a.btn-outline,
[data-theme="light"] .post-card .post-card-actions .btn-instagram {
  background: linear-gradient(135deg, #f09433, #dc2743, #bc1888) !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 700 !important;
  box-shadow: 0 3px 10px rgba(220, 39, 67, 0.25) !important;
}

[data-theme="light"] .post-card .post-card-actions a.btn-outline:hover,
[data-theme="light"] .post-card .post-card-actions .btn-instagram:hover {
  background: linear-gradient(135deg, #e08323, #c91f3b, #a81379) !important;
  box-shadow: 0 5px 14px rgba(220, 39, 67, 0.35) !important;
}

[data-theme="light"] .post-card .post-card-actions button.btn-secondary {
  background: #ffffff !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

[data-theme="light"] #mktOnlineNotice {
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
}
[data-theme="light"] #mktOnlineNotice span {
  color: #1e40af !important;
}

[data-theme="light"] #mktModalPreviewBox {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}

/* ========================================================
   Content Studio (Tab 5) in Light Mode
   ======================================================== */
[data-theme="light"] .studio-box-hook {
  background: #fffbeb !important;
  border: 1px solid #fef3c7 !important;
  border-right: 4px solid #f59e0b !important;
}
[data-theme="light"] .studio-box-hook span {
  color: #b45309 !important;
}
[data-theme="light"] #studioOutputHook {
  color: #78350f !important;
}

[data-theme="light"] .studio-box-caption {
  background: #eff6ff !important;
  border: 1px solid #dbeafe !important;
  border-right: 4px solid #3b82f6 !important;
}
[data-theme="light"] .studio-box-caption span {
  color: #1d4ed8 !important;
}
[data-theme="light"] #studioOutputCaption {
  background: #ffffff !important;
  border-color: #bfdbfe !important;
  color: #1e293b !important;
}

[data-theme="light"] .studio-box-hashtags {
  background: #ecfdf5 !important;
  border: 1px solid #a7f3d0 !important;
  border-right: 4px solid #10b981 !important;
}
[data-theme="light"] .studio-box-hashtags span {
  color: #047857 !important;
}

[data-theme="light"] .studio-box-reply {
  background: #fdf2f8 !important;
  border: 1px solid #fbcfe8 !important;
  border-right: 3px solid #ec4899 !important;
}
[data-theme="light"] .studio-box-reply span {
  color: #be185d !important;
}
[data-theme="light"] #studioOutputCommentReply {
  background: #ffffff !important;
  border-color: #fbcfe8 !important;
  color: #1e293b !important;
}

[data-theme="light"] .studio-box-direct {
  background: #f5f3ff !important;
  border: 1px solid #ddd6fe !important;
  border-right: 3px solid #8b5cf6 !important;
}
[data-theme="light"] .studio-box-direct span {
  color: #6d28d9 !important;
}
[data-theme="light"] #studioOutputDirectMessage {
  background: #ffffff !important;
  border-color: #ddd6fe !important;
  color: #1e293b !important;
}

[data-theme="light"] .studio-vision-upload-box {
  background: #f8fafc !important;
  border: 1px dashed #cbd5e1 !important;
}

[data-theme="light"] #studioEmptyHeading {
  color: #0f172a !important;
}

/* ========================================================
   Simple Mode (نمای ساده فروشگاهی) vs Pro Mode
   ======================================================== */
body.mode-simple #tabNavMarketing,
body.mode-simple #tabNavExecution,
body.mode-simple #tabNavContentStudio,
body.mode-simple #tabNavAiEngine {
  display: none !important;
}

body.mode-simple #panelServerConsole,
body.mode-simple #consoleAccordionContainer,
body.mode-simple .mode-pro-only {
  display: none !important;
}

body.mode-simple #simpleModeBanner {
  display: flex !important;
}

body:not(.mode-simple) #simpleModeBanner {
  display: none !important;
}

[data-theme="light"] #simpleModeBanner {
  background: linear-gradient(135deg, #f5f3ff, #ede9fe) !important;
  border-color: #ddd6fe !important;
  color: #6d28d9 !important;
}
[data-theme="light"] #simpleModeBanner b {
  color: #4c1d95 !important;
}


/* ========================================================
   Mobile Responsive Optimizations (Flowgram Mobile Theme)
   ======================================================== */
@media (max-width: 768px) {
  /* 1. App Container & Layout */
  .container {
    padding: 0.5rem !important;
    max-width: 100% !important;
    overflow-x: hidden;
  }

  /* 2. Header Mobile Styling */
  .app-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
    padding: 0.85rem !important;
  }

  .logo-area {
    justify-content: center !important;
    text-align: center !important;
  }

  .logo-text h1 {
    font-size: 1.15rem !important;
  }

  .logo-text p {
    font-size: 0.75rem !important;
  }

  .header-status {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.4rem !important;
    width: 100% !important;
  }

  .user-profile-badge {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.35rem !important;
    padding: 0.35rem 0.6rem !important;
  }

  .ui-mode-switcher {
    margin: 0 auto;
  }

  /* 3. Navigation Tabs Bar: Smooth Horizontal Swipe Ribbon */
  .nav-tabs-bar {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE */
    padding: 0.45rem 0.35rem !important;
    gap: 0.5rem !important;
    border-radius: 0.85rem !important;
    margin-bottom: 1rem !important;
  }

  .nav-tabs-bar::-webkit-scrollbar {
    display: none !important; /* Chrome / Safari */
    width: 0 !important;
    height: 0 !important;
  }

  .nav-tab-btn {
    flex: 0 0 auto !important;
    min-width: auto !important;
    white-space: nowrap !important;
    font-size: 0.82rem !important;
    padding: 0.55rem 0.85rem !important;
    border-radius: 9999px !important;
  }

  /* 4. Metrics Grid: Clean 2x2 for Mobile */
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.6rem !important;
    margin-bottom: 1rem !important;
  }

  .metric-card {
    padding: 0.75rem 0.85rem !important;
    border-radius: 0.75rem !important;
  }

  .metric-header {
    font-size: 0.75rem !important;
  }

  .metric-value {
    font-size: 1.25rem !important;
  }

  .metric-sub {
    font-size: 0.68rem !important;
  }

  /* 5. Account Badges Strip */
  .accounts-strip {
    grid-template-columns: 1fr !important;
    gap: 0.6rem !important;
    margin-bottom: 1rem !important;
  }

  /* 6. Form Grids & Layouts */
  .marketing-grid,
  .main-layout,
  .two-col-grid,
  .form-row-grid,
  .panel-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  /* 7. Marketing Post Cards Grid */
  .posts-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  .post-card {
    padding: 0.85rem !important;
  }

  .post-card-actions {
    flex-direction: column !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }

  .post-card-actions a,
  .post-card-actions button {
    width: 100% !important;
    text-align: center !important;
    padding: 0.6rem 0.8rem !important;
    font-size: 0.85rem !important;
  }

  /* 8. Touch Friendliness & Auto-Zoom Prevention */
  input[type="text"],
  input[type="number"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px !important; /* Prevents iOS Safari 16px auto-zoom */
    min-height: 42px !important;
    border-radius: 0.5rem !important;
  }

  .btn {
    min-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* 9. Light Theme Specific Mobile Polishing */
  [data-theme="light"] .nav-tabs-bar {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  }

  [data-theme="light"] .nav-tab-btn.active {
    background: linear-gradient(135deg, #8b5cf6, #6366f1) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.28) !important;
  }

  [data-theme="light"] .nav-tab-btn.active span {
    color: #ffffff !important;
  }

  [data-theme="light"] .post-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
  }

  [data-theme="light"] .post-stats-row {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
  }

  /* 10. Modals Responsive */
  .modal-content,
  .modal-dialog {
    width: 95vw !important;
    max-width: 95vw !important;
    margin: 1.5rem auto !important;
    padding: 1rem !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
  }
}

@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.4rem !important;
  }

  .metric-card {
    padding: 0.6rem !important;
  }

  .metric-value {
    font-size: 1.1rem !important;
  }

  .logo-text h1 {
    font-size: 1.05rem !important;
  }

  .nav-tab-btn {
    font-size: 0.78rem !important;
    padding: 0.45rem 0.75rem !important;
  }
}

/* User Profile Modal Light Theme Adaptations */
[data-theme="light"] #userProfileModal .modal-box {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] #userProfileModal label,
[data-theme="light"] #userProfileModal .profile-label {
  color: #1e293b !important;
  font-weight: 700 !important;
}

[data-theme="light"] #userProfileModal #userProfileModalTitle {
  color: #0f172a !important;
}

[data-theme="light"] #userProfileModal #userProfileModalSubtitle {
  color: #64748b !important;
}

[data-theme="light"] #userProfileModal input,
[data-theme="light"] #userProfileModal select {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light"] #userProfileModal #profPhoneNumber {
  background: #f1f5f9 !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  direction: ltr !important;
}
