/* ==========================================================================
   جريدة تحت الضوء الإخبارية — التصميم الملكي العصري (Royal Obsidian & Imperial Gold)
   AI Newsroom CMS Design System v4.0
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Readex+Pro:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Obsidian Dark (Default Theme) */
  --bg-app: #090D16;
  --bg-sidebar: #060910;
  --bg-surface: rgba(17, 24, 39, 0.75);
  --bg-surface-elevated: rgba(31, 41, 55, 0.85);
  --bg-surface-hover: rgba(37, 49, 66, 0.9);
  --bg-input: #0B0F19;
  --bg-input-focus: #0f1523;

  /* Imperial Gold Palette */
  --accent-gold: #F59E0B;
  --accent-gold-hover: #D97706;
  --accent-gold-active: #B45309;
  --accent-gold-glow: rgba(245, 158, 11, 0.28);
  --accent-gold-subtle: rgba(245, 158, 11, 0.08);
  --accent-gold-border: rgba(245, 158, 11, 0.35);

  /* Status Colors */
  --color-success: #10B981;
  --color-success-bg: rgba(16, 185, 129, 0.12);
  --color-success-border: rgba(16, 185, 129, 0.3);
  --color-error: #EF4444;
  --color-error-bg: rgba(239, 68, 68, 0.12);
  --color-error-border: rgba(239, 68, 68, 0.3);
  --color-warning: #F59E0B;
  --color-warning-bg: rgba(245, 158, 11, 0.12);
  --color-warning-border: rgba(245, 158, 11, 0.3);
  --color-info: #38BDF8;
  --color-info-bg: rgba(56, 189, 248, 0.12);
  --color-info-border: rgba(56, 189, 248, 0.3);

  /* Typography Colors */
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-gold: #FBBF24;

  /* Fonts */
  --font-display: 'Readex Pro', sans-serif;
  --font-body: 'Cairo', sans-serif;
  --font-code: 'JetBrains Mono', monospace;

  /* Borders & Shadows */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: rgba(245, 158, 11, 0.2);
  --glass-blur: blur(16px);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-gold: 0 0 25px rgba(245, 158, 11, 0.35);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Gray Theme Modifier */
body[data-theme="gray"] {
  --bg-app: #1A1E27;
  --bg-sidebar: #141720;
  --bg-surface: rgba(35, 40, 51, 0.85);
  --bg-surface-elevated: rgba(47, 54, 68, 0.9);
  --bg-input: #191D26;
  --border-subtle: rgba(255, 255, 255, 0.1);
}

/* Light Theme Modifier */
body[data-theme="light"] {
  --bg-app: #F1F5F9;
  --bg-sidebar: #FFFFFF;
  --bg-surface: rgba(255, 255, 255, 0.9);
  --bg-surface-elevated: #FFFFFF;
  --bg-surface-hover: #F8FAFC;
  --bg-input: #F8FAFC;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --border-subtle: #E2E8F0;
  --border-card: rgba(217, 119, 6, 0.25);
  --accent-gold: #D97706;
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

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

html,
body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-body);
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: var(--bg-app);
}

::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold);
}

/* App Layout Grid */
#app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ==========================================================================
   SIDEBAR NAVIGATION
   ========================================================================== */
.sidebar {
  width: 270px;
  min-width: 270px;
  height: 100%;
  background-color: var(--bg-sidebar);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 14px;
  z-index: 50;
  transition: var(--transition-normal);
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-crest {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, rgba(185, 28, 28, 0.15) 70%, rgba(18, 15, 8, 0.8) 100%);
  border: 2px solid var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.35), 0 4px 12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  padding: 2px;
  flex-shrink: 0;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.brand-crest:hover {
  transform: scale(1.08) rotate(3deg);
  border-color: #FBBF24;
  box-shadow: 0 0 28px rgba(245, 158, 11, 0.6), 0 6px 16px rgba(0, 0, 0, 0.6);
}

.brand-crest img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.brand-crest svg {
  width: 26px;
  height: 26px;
  fill: var(--accent-gold);
}

.brand-info h1 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.brand-info span {
  font-size: 11px;
  color: var(--accent-gold);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.brand-info span::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-success);
  display: inline-block;
  box-shadow: 0 0 8px var(--color-success);
}

/* Nav Menu */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: var(--transition-fast);
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-item:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.03));
  color: var(--accent-gold);
  border-color: var(--accent-gold-border);
  box-shadow: 0 0 15px var(--accent-gold-glow);
}

.nav-item svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

/* Sidebar Footer */
.sidebar-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.server-status-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 11px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
  display: inline-block;
}

/* ==========================================================================
   MAIN CONTENT WRAPPER & TOP BAR
   ========================================================================== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-app);
}

.topbar {
  height: 64px;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 40;
}

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

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Status Badges in Topbar */
.hud-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: var(--glass-blur);
}

.hud-pill.gold {
  border-color: var(--accent-gold-border);
  color: var(--accent-gold);
}

.hud-pill.success {
  border-color: var(--color-success-border);
  color: var(--color-success);
}

.hud-pill.warning {
  border-color: var(--color-warning-border);
  color: var(--color-warning);
}

/* User Profile Badge */
.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--transition-fast);
}

.user-badge:hover {
  border-color: var(--accent-gold-border);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F59E0B, #92400E);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #FFFFFF;
}

/* Tri-Theme Switcher Buttons */
.theme-switcher {
  display: flex;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.theme-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.theme-btn:hover {
  color: var(--text-primary);
}

.theme-btn.active {
  background: var(--accent-gold);
  color: #000000;
  box-shadow: 0 0 10px var(--accent-gold-glow);
}

/* ==========================================================================
   CONTENT VIEW CONTAINER & CARDS
   ========================================================================== */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px 30px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.view-section {
  display: none;
  animation: fadeIn 0.3s ease-out forwards;
}

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

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Glass Card */
.glass-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-card);
  position: relative;
}

.glass-card.gold-glow {
  border-color: var(--accent-gold-border);
  box-shadow: 0 0 20px var(--accent-gold-glow);
}

.card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.card-title svg {
  color: var(--accent-gold);
  width: 20px;
  height: 20px;
}

/* Forms & Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13.5px;
  outline: none;
  transition: var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  background-color: var(--bg-input-focus);
  border-color: var(--accent-gold);
  box-shadow: 0 0 12px var(--accent-gold-glow);
}

/* Dark Mode Autofill Overrides & Native Password Button Reset */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #111827 inset !important;
  -webkit-text-fill-color: #F8FAFC !important;
  caret-color: #F8FAFC !important;
  transition: background-color 5000s ease-in-out 0s;
}

input::-ms-reveal,
input::-ms-clear,
input::-webkit-credentials-auto-fill-button {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.7;
}

/* Buttons System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition-normal);
  text-decoration: none;
}

.btn-gold {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #000000;
  box-shadow: 0 0 18px var(--accent-gold-glow);
}

.btn-gold:hover {
  background: linear-gradient(135deg, #FBBF24, #F59E0B);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.5);
  transform: translateY(-1px);
}

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

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

.btn-danger {
  background: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid var(--color-error-border);
}

.btn-danger:hover {
  background: var(--color-error);
  color: #FFFFFF;
}

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

.btn-success:hover {
  background: var(--color-success);
  color: #FFFFFF;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 15px;
}

/* ==========================================================================
   VIEW 0: LOGIN MODAL / SCREEN
   ========================================================================== */
#login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 40%, #151C2C 0%, #090D16 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-card {
  width: 440px;
  max-width: 90%;
  background: rgba(17, 24, 39, 0.85);
  border: 1.5px solid var(--accent-gold-border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  backdrop-filter: blur(24px);
  box-shadow: 0 0 50px rgba(245, 158, 11, 0.25);
  text-align: center;
  animation: loginAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes loginAppear {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.login-crest {
  width: 110px;
  height: 110px;
  margin: 0 auto 18px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, rgba(185, 28, 28, 0.18) 60%, rgba(18, 15, 8, 0.9) 100%);
  border: 3px solid var(--accent-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.45), 0 8px 24px rgba(0, 0, 0, 0.6), inset 0 0 15px rgba(245, 158, 11, 0.2);
  overflow: hidden;
  padding: 4px;
  transition: all 0.4s ease;
  animation: crestPulse 4s infinite ease-in-out;
}

@keyframes crestPulse {
  0%, 100% {
    box-shadow: 0 0 35px rgba(245, 158, 11, 0.45), 0 8px 24px rgba(0, 0, 0, 0.6);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 45px rgba(245, 158, 11, 0.65), 0 10px 28px rgba(185, 28, 28, 0.4);
    transform: scale(1.03);
  }
}

.login-crest:hover {
  transform: scale(1.06);
  border-color: #FBBF24;
}

.login-crest img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

.login-crest svg {
  width: 36px;
  height: 36px;
  fill: var(--accent-gold);
}

.login-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ==========================================================================
   VIEW 1 & 2: SERP SIMULATOR & PHONE MOCKUP
   ========================================================================== */
.serp-card {
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.serp-url {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.serp-title {
  font-size: 16px;
  font-weight: 700;
  color: #38BDF8;
  cursor: pointer;
  line-height: 1.4;
}

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

.serp-snippet {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Smartphone WhatsApp Mockup */
.phone-mockup {
  width: 320px;
  background: #0C1317;
  border: 3px solid #233138;
  border-radius: 28px;
  padding: 14px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.phone-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #1F2C34;
}

.phone-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #00A884;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  color: #FFFFFF;
}

.phone-bubble {
  background-color: #005C4B;
  color: #E9EDEF;
  border-radius: 12px 0 12px 12px;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 320px;
  overflow-y: auto;
}

/* ==========================================================================
   DATA TABLE & LISTS
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.data-table th {
  background-color: var(--bg-surface-elevated);
  color: var(--text-muted);
  font-weight: 700;
  text-align: right;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

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

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}

.badge-success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
}

.badge-error {
  background: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid var(--color-error-border);
}

.badge-gold {
  background: var(--accent-gold-subtle);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold-border);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  min-width: 280px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease forwards;
}

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

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

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

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==========================================================================
   PUBLISH PROGRESS & SUCCESS CELEBRATION MODAL STYLES
   ========================================================================== */
@keyframes pulseGlow {
  0% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
  }

  100% {
    transform: scale(1.06);
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.7);
  }
}

@keyframes modalZoomIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(15px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.publish-modal-card {
  animation: modalZoomIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   REPORTERS & TELEGRAM BOT HUB - PREMIUM REDESIGN STYLES
   ========================================================================== */

.reporters-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 16px;
}

.reporters-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat-kpi-card {
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.stat-kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.stat-kpi-card.highlight-gold {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.08), rgba(18, 24, 38, 0.7));
}

.stat-kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-kpi-icon {
  font-size: 20px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.stat-kpi-val {
  font-family: var(--font-code);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.1;
}

.stat-kpi-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Search and Filter Ribbon */
.reporters-filter-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  background: var(--bg-card);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.reporters-search-wrapper {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 400px;
}

.reporters-search-wrapper .search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  opacity: 0.6;
  pointer-events: none;
}

.reporters-search-wrapper input {
  padding-right: 36px;
  padding-left: 32px;
  font-size: 13px;
  width: 100%;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  height: 38px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.reporters-search-wrapper input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
  outline: none;
}

.reporters-search-wrapper .clear-search-btn {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 4px;
  display: none;
}

.reporters-search-wrapper .clear-search-btn:hover {
  color: var(--text-primary);
}

.reporters-filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rep-tab-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.rep-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.rep-tab-btn.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.2);
}

.view-mode-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.view-toggle-btn {
  background: none;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.view-toggle-btn:hover {
  color: var(--text-primary);
}

.view-toggle-btn.active {
  background: var(--bg-card);
  color: var(--accent-gold);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Reporters Grid & Cards */
.reporters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

.reporter-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 20px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(10px);
}

.reporter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
  opacity: 0.6;
  transition: opacity 0.3s;
}

.reporter-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.45);
  border-color: rgba(245, 158, 11, 0.45);
}

.reporter-card:hover::before {
  opacity: 1;
}

.reporter-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.reporter-avatar {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: #FFFFFF;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
}

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

.reporter-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 3px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reporter-role-title {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reporter-badges-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.rep-badge-pill {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 20px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.rep-badge-emerald {
  background: rgba(16, 185, 129, 0.14);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.rep-badge-amber {
  background: rgba(245, 158, 11, 0.14);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.rep-badge-stats {
  background: rgba(56, 189, 248, 0.12);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Key container and strict text truncation */
.rep-key-container {
  background: var(--bg-input);
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  padding: 10px 12px;
  margin-bottom: 14px;
  width: 100%;
  box-sizing: border-box;
}

.rep-key-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.rep-key-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.rep-key-value {
  flex: 1;
  min-width: 0;
  font-family: var(--font-code);
  font-size: 11px;
  color: var(--accent-gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: ltr;
  text-align: left;
}

.rep-key-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.rep-icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.rep-icon-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.reporter-card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.reporter-card-actions .btn {
  padding: 5px 11px;
  font-size: 12px;
  border-radius: 6px;
}

@media (max-width: 768px) {
  .reporters-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .reporters-filter-ribbon {
    flex-direction: column;
    align-items: stretch;
  }
  .reporters-search-wrapper {
    max-width: 100%;
  }
}

/* ==========================================================================
   MOBILE RESPONSIVE SYSTEM — Full Mobile-First Overhaul
   جريدة تحت الضوء v4.0 Mobile UX
   ========================================================================== */

/* --------------------------------------------------------------------------
   MOBILE BOTTOM NAVIGATION BAR — 100% Full-Width Screen Coverage
   -------------------------------------------------------------------------- */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100vw !important;
  height: 64px;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border-subtle);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 900;
  padding: 0 !important;
  padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
}

.mobile-bottom-nav-inner {
  display: flex !important;
  width: 100% !important;
  flex: 1 1 100% !important;
  align-items: stretch !important;
  justify-content: space-around !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 4px !important;
  gap: 0 !important;
  box-sizing: border-box !important;
}

.mobile-nav-item {
  flex: 1 1 0px !important;
  width: 20% !important;
  min-width: 0 !important;
  max-width: none !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px;
  padding: 8px 0;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 12px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  box-sizing: border-box;
}

.mobile-nav-item .mobile-nav-icon {
  font-size: 22px;
  line-height: 1;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-nav-item .mobile-nav-label {
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.mobile-nav-item.active {
  color: var(--accent-gold);
}

.mobile-nav-item.active .mobile-nav-icon {
  transform: translateY(-2px) scale(1.12);
}

.mobile-nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--accent-gold);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-gold);
}

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

.mobile-nav-item .mobile-nav-badge {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(4px);
  min-width: 16px;
  height: 16px;
  background: var(--accent-gold);
  color: #000;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* --------------------------------------------------------------------------
   MOBILE DRAWER / SLIDE-IN MENU
   -------------------------------------------------------------------------- */
.mobile-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-drawer-overlay.open {
  opacity: 1;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  transform: translateX(105%);
  width: min(320px, 85vw);
  height: 100%;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-subtle);
  z-index: 1200;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  will-change: transform;
}

.mobile-drawer.open {
  transform: translateX(0);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.6);
}

.mobile-drawer-header {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 14px;
}

.mobile-drawer-crest {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--accent-gold);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
  background: radial-gradient(circle, rgba(245, 158, 11, 0.2), rgba(0, 0, 0, 0.5));
}

.mobile-drawer-crest img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

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

.mobile-drawer-username {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-drawer-role {
  font-size: 11.5px;
  color: var(--accent-gold);
  font-weight: 600;
  margin-top: 2px;
}

.mobile-drawer-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  flex-shrink: 0;
  transition: color 0.2s, background 0.2s;
}

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

.mobile-drawer-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  text-align: right;
  width: 100%;
  transition: background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.mobile-drawer-nav-item .drawer-nav-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.mobile-drawer-nav-item:hover,
.mobile-drawer-nav-item.active {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.03));
  color: var(--accent-gold);
}

.mobile-drawer-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 8px 14px;
}

.mobile-drawer-section-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 14px 4px;
}

.mobile-drawer-footer {
  padding: 14px 10px;
  border-top: 1px solid var(--border-subtle);
}

.mobile-drawer-footer-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  color: #EF4444;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: rgba(239, 68, 68, 0.08);
  font-family: var(--font-body);
  text-align: right;
  width: 100%;
  transition: background 0.2s;
}

.mobile-drawer-footer-btn:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* Server status in drawer */
.mobile-drawer-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-surface);
  border-radius: 8px;
  font-size: 11px;
  color: var(--text-muted);
  margin: 0 10px 10px;
}

/* --------------------------------------------------------------------------
   MOBILE HAMBURGER BUTTON IN TOPBAR
   -------------------------------------------------------------------------- */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.mobile-menu-btn:hover {
  border-color: var(--accent-gold-border);
  background: var(--bg-surface-hover);
}

/* Mobile topbar brand (hidden on desktop) */
.mobile-topbar-brand {
  display: none;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: center;
}

.mobile-topbar-brand .mobile-brand-crest {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-gold);
  overflow: hidden;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
  background: radial-gradient(circle, rgba(245, 158, 11, 0.2), rgba(0, 0, 0, 0.5));
  flex-shrink: 0;
}

.mobile-topbar-brand .mobile-brand-crest img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.mobile-topbar-brand span {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-display);
}

/* --------------------------------------------------------------------------
   FLOATING ACTION BUTTON (FAB)
   -------------------------------------------------------------------------- */
.mobile-fab {
  display: none;
  position: fixed;
  bottom: 80px;
  left: 18px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #000;
  font-size: 26px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.5), 0 8px 30px rgba(0, 0, 0, 0.4);
  z-index: 800;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.mobile-fab:hover,
.mobile-fab:active {
  transform: scale(1.12);
  box-shadow: 0 6px 28px rgba(245, 158, 11, 0.65), 0 10px 35px rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------------------------------
   MAIN RESPONSIVE BREAKPOINT — ≤ 768px
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {

  /* Show mobile-only elements */
  .mobile-bottom-nav {
    display: flex !important;
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
  }

  .mobile-bottom-nav-inner {
    display: flex !important;
    width: 100% !important;
    flex: 1 1 100% !important;
    justify-content: space-around !important;
    align-items: stretch !important;
  }

  .mobile-nav-item {
    flex: 1 1 0px !important;
    width: 20% !important;
    min-width: 0 !important;
    max-width: none !important;
  }

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

  .mobile-topbar-brand {
    display: flex;
  }

  .mobile-fab {
    display: flex;
  }

  /* Hide desktop-only elements */
  .sidebar {
    display: none !important;
  }

  .topbar-left {
    display: none !important;
  }

  /* ─── Topbar Mobile Layout ─────────────────────────────────────────────── */
  /* Order: [hamburger] [brand center] [user avatar] */
  .topbar {
    padding: 0 12px;
    height: 56px;
    gap: 0;
    justify-content: flex-start;
  }

  .mobile-menu-btn {
    order: 1;
    flex-shrink: 0;
    margin-left: 0;
    margin-right: 0;
  }

  .mobile-topbar-brand {
    order: 2;
    flex: 1;
  }

  .topbar-right {
    order: 3;
    gap: 8px;
    flex-shrink: 0;
  }

  /* Hide theme switcher and logout on mobile (available in drawer) */
  .theme-switcher,
  #btn-logout {
    display: none !important;
  }

  /* Shrink topbar user badge to avatar only */
  .user-badge > div:not(.user-avatar) {
    display: none !important;
  }

  .user-badge {
    padding: 4px;
    border-radius: 50%;
    gap: 0;
  }

  /* ─── Content area padding for Bottom Nav & FAB breathing room ──────── */
  .content-area {
    padding: 16px 14px;
    padding-bottom: 120px !important;
    gap: 14px;
  }

  /* Main wrapper takes full width */
  .main-wrapper {
    width: 100%;
  }

  /* ---------- View Create: Single Column & Form Refinement ---------- */
  #view-create > div[style*="grid-template-columns"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }

  /* Mobile image dropzone full width stack */
  .image-uploader-container,
  #view-create .glass-card:nth-of-type(2) > div[style*="display: flex; gap: 16px"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  #image-preview-box {
    width: 100% !important;
    height: 120px !important;
  }

  .image-uploader-container .btn,
  #view-create .glass-card:nth-of-type(2) label.btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Helper text in create view: higher contrast */
  #view-create .text-muted,
  #view-create span[style*="color: var(--text-muted)"] {
    color: #94a3b8 !important;
    line-height: 1.5;
  }

  /* ---------- Archive View: Full-width Touch Filters ---------- */
  .archive-filters-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .archive-search-box {
    max-width: 100% !important;
    width: 100% !important;
  }

  .archive-actions-box {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .archive-actions-box select,
  .archive-actions-box button {
    flex: 1 !important;
    min-width: 100px !important;
    justify-content: center !important;
  }

  /* ---------- View Settings: Single Column ---------- */
  #view-settings > div[style*="grid-template-columns"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }

  /* Make settings full width */
  #admin-users-card,
  #admin-activation-card {
    grid-column: unset !important;
  }

  /* Activation code form: stack on mobile */
  #form-create-activation-code {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Bot control: single column */
  #view-bot-control > div[style*="grid-template-columns"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
  }

  /* Accounting filter buttons: smooth horizontal pill carousel */
  .acc-filters-row {
    margin-bottom: 14px !important;
  }

  .acc-filter-chips,
  #view-accounting > div[style*="justify-content"] > div[style*="flex-wrap"] {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    padding-top: 2px;
    width: 100% !important;
    scrollbar-width: none;
  }
  .acc-filter-chips::-webkit-scrollbar,
  #view-accounting > div[style*="justify-content"] > div[style*="flex-wrap"]::-webkit-scrollbar {
    display: none;
  }

  .acc-filter-btn {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: 12px !important;
    padding: 7px 14px !important;
  }

  /* Accounting KPI cards: 2 per row */
  #view-accounting > div[style*="grid-template-columns"]:nth-of-type(2) {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }

  /* KPI cards smaller on mobile */
  .glass-card[style*="padding: 18px"] {
    padding: 14px !important;
  }

  /* ---------- TABLE → RESPONSIVE CARDS ---------- */
  .table-responsive {
    overflow: visible !important;
  }

  .data-table thead {
    display: none !important;
  }

  .data-table,
  .data-table tbody,
  .data-table tr {
    display: block !important;
    width: 100% !important;
  }

  .data-table tr {
    background: var(--bg-surface);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 12px;
    position: relative;
    box-shadow: var(--shadow-card);
  }

  .data-table td {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding: 7px 0 !important;
    border: none !important;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.04) !important;
    text-align: right !important;
  }

  .data-table td:last-child {
    border-bottom: none !important;
    padding-bottom: 0 !important;
    padding-top: 10px !important;
    justify-content: flex-end;
  }

  .data-table td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 90px;
    text-align: right;
  }

  .data-table td[colspan] {
    display: block !important;
    text-align: center !important;
    padding: 22px 10px !important;
    justify-content: center !important;
    color: var(--text-muted);
  }

  .data-table td[colspan]::before {
    display: none !important;
  }

  .data-table td:not([data-label])::before,
  .data-table td[data-label=""]::before {
    display: none !important;
  }

  /* ---------- GLASS CARDS ---------- */
  .glass-card {
    padding: 16px;
    border-radius: var(--radius-md);
  }

  /* ---------- FORM INPUTS: TOUCH FRIENDLY ---------- */
  .form-input,
  .form-textarea,
  .form-select {
    min-height: 48px;
    font-size: 15px; /* Prevents iOS zoom */
    padding: 12px 14px;
  }

  .form-textarea {
    min-height: 140px;
    font-size: 15px;
  }

  /* ---------- BUTTONS: TOUCH FRIENDLY ---------- */
  .btn {
    min-height: 46px;
    font-size: 14px;
  }

  .btn-lg {
    min-height: 54px;
    font-size: 15px;
  }

  /* ---------- DIRECT PUBLISH BUTTON ---------- */
  #btn-direct-publish {
    min-height: 56px !important;
    font-size: 15px !important;
  }

  /* ---------- CARD TITLE ---------- */
  .card-title {
    font-size: 14px;
  }

  /* ---------- REPORTER CARDS GRID: SINGLE COL ---------- */
  .reporters-grid {
    grid-template-columns: 1fr !important;
  }

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

  .reporters-filter-ribbon {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 12px;
    gap: 10px;
  }

  .reporters-filter-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 6px;
  }

  .reporters-filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .reporters-search-wrapper {
    max-width: 100%;
    min-width: unset;
  }

  .view-mode-toggle {
    flex-shrink: 0;
  }

  /* ---------- LOGIN CARD ---------- */
  .login-card {
    padding: 28px 20px;
    max-width: 95%;
  }

  .login-crest {
    width: 90px;
    height: 90px;
  }

  /* ---------- TOAST ON MOBILE: BOTTOM ABOVE NAV ---------- */
  #toast-container {
    bottom: 76px !important;
    left: 14px !important;
    right: 14px;
    align-items: stretch;
  }

  .toast {
    min-width: unset !important;
    width: 100% !important;
  }

  /* ---------- VERIFICATION SECTION ---------- */
  #view-verification .glass-card > div[style*="display: flex"] {
    flex-direction: column !important;
    gap: 10px !important;
  }

  #view-verification #btn-do-verify {
    min-width: unset !important;
    width: 100%;
  }

  /* Verify result - header flex */
  #view-verification .glass-card:first-child > div:first-child {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  /* ---------- ACCOUNTING MODAL SEARCH AREA ---------- */
  #view-accounting .glass-card > div[style*="justify-content: space-between"] {
    flex-direction: column !important;
    gap: 10px !important;
    align-items: stretch !important;
  }

  /* ---------- BOT TERMINAL: SHORTER ON MOBILE ---------- */
  #bot-terminal-stream {
    height: 220px !important;
  }

  #logs-terminal {
    height: 320px !important;
  }

  /* ---------- TOPBAR BRAND ON MOBILE ---------- */
  .brand-header {
    padding-bottom: 0;
    border: none;
  }

  /* ─── Verification: input + button stack ──────────────────────────────── */
  /* Direct flex containers with input + button */
  #view-verification > div > div > div[style*="display: flex"][style*="gap"] {
    flex-direction: column !important;
  }
  /* Target the verify input row specifically */
  div:has(> #verify-query-input) {
    flex-direction: column !important;
    gap: 10px !important;
  }
  #verify-query-input {
    width: 100% !important;
  }
  #btn-do-verify {
    width: 100% !important;
    min-width: unset !important;
  }

  /* ─── Fix btn-open-manual-register on mobile ──────────────────────────── */
  #btn-open-manual-register {
    width: 100% !important;
    justify-content: center !important;
  }

  /* ─── Create view: AI key alert flex wrap ────────────────────────────── */
  #create-missing-ai-key-alert > div {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  #create-missing-ai-key-alert > div > button {
    width: 100% !important;
    justify-content: center !important;
  }

  /* ─── Duplicate alert flex wrap ──────────────────────────────────────── */
  #create-duplicate-alert > div {
    flex-direction: column !important;
  }

  /* ─── Accounting top bar: filter + add button ─────────────────────────── */
  #view-accounting > div > div[style*="justify-content: space-between"] {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: stretch !important;
  }
  #view-accounting > div > div[style*="justify-content: space-between"] > button {
    width: 100% !important;
    justify-content: center !important;
  }

  /* ─── Login overlay: ensure it covers full height ───────────────────── */
  #login-overlay {
    padding: 16px !important;
    align-items: center !important;
  }

  /* ─── Reporters page header on mobile ───────────────────────────────── */
  .reporters-page-header {
    flex-direction: column;
    align-items: stretch;
  }
  .reporters-page-header > button,
  .reporters-page-header > div > button {
    width: 100%;
    justify-content: center;
  }

  /* ─── Fix all inline style flex rows that aren't handled ─────────────── */
  /* Any flex with gap inside glass-card first-level: wrap on mobile */
  .glass-card > div[style*="display: flex"][style*="justify-content: space-between"] {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  /* ─── Settings security / reset buttons: full width ─────────────────── */
  #view-settings .btn-danger,
  #view-settings .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  /* ─── Bot control action buttons ─────────────────────────────────────── */
  #view-bot-control .btn {
    min-height: 46px;
  }
}


/* --------------------------------------------------------------------------
   EXTRA SMALL — ≤ 480px (iPhones SE, etc.)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {

  .content-area {
    padding: 12px 10px;
    padding-bottom: 120px !important;
  }

  .mobile-bottom-nav {
    display: flex !important;
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
  }

  .mobile-bottom-nav-inner {
    display: flex !important;
    width: 100% !important;
    flex: 1 1 100% !important;
    justify-content: space-around !important;
    align-items: stretch !important;
    gap: 0 !important;
  }

  .mobile-nav-item {
    flex: 1 1 0px !important;
    width: 20% !important;
    min-width: 0 !important;
  }

  .mobile-nav-item .mobile-nav-label {
    font-size: 10px;
  }

  .data-table td::before {
    min-width: 70px;
    font-size: 10.5px;
  }

  /* Accounting KPI 2 col still but smaller */
  #view-accounting > div[style*="grid-template-columns"]:nth-of-type(2) {
    gap: 10px !important;
  }

  .glass-card {
    padding: 12px;
  }

  .login-crest {
    width: 80px;
    height: 80px;
  }

  .login-title {
    font-size: 17px;
  }
}

/* --------------------------------------------------------------------------
   BOTTOM SHEET MODALS — on mobile all modals slide up from bottom
   -------------------------------------------------------------------------- */
@keyframes slideUpSheet {
  from {
    transform: translateY(100%);
    opacity: 0.7;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-sheet-handle {
  display: none;
  width: 40px;
  height: 4px;
  background: var(--border-subtle);
  border-radius: 2px;
  margin: 0 auto 16px;
}

@media (max-width: 768px) {

  .modal-sheet-handle {
    display: block;
  }

  /* All modal inner panels */
  #modal-add-accounting-transaction > div.glass-card,
  #modal-manual-register > div.glass-card,
  #modal-add-reporter > div.glass-card,
  #modal-edit-reporter > div.glass-card,
  #modal-set-custom-cut > div.glass-card,
  #publish-modal-overlay > div.publish-modal-card {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 20px 20px 0 0 !important;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 20px) !important;
    animation: slideUpSheet 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  }

  /* Center the modal overlays */
  #modal-add-accounting-transaction,
  #modal-manual-register,
  #modal-add-reporter,
  #modal-edit-reporter,
  #modal-set-custom-cut {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  #publish-modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  /* Account tx modal: stack grids */
  #modal-add-accounting-transaction div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

/* --------------------------------------------------------------------------
   TABLET / MEDIUM SCREENS — 769px to 1024px
   -------------------------------------------------------------------------- */
@media (min-width: 769px) and (max-width: 1024px) {

  .sidebar {
    width: 220px;
    min-width: 220px;
  }

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

  .brand-info h1 {
    font-size: 13px;
  }

  .nav-item {
    font-size: 12.5px;
    padding: 9px 12px;
  }
}

/* --------------------------------------------------------------------------
   CIRCULAR LOGO REFINEMENT
   -------------------------------------------------------------------------- */
.login-crest img,
.brand-crest img {
  object-fit: cover !important;
  border-radius: 50% !important;
}

/* Pulsing ring for login logo */
.login-crest {
  box-shadow:
    0 0 0 3px rgba(245, 158, 11, 0.15),
    0 0 35px rgba(245, 158, 11, 0.45),
    0 8px 24px rgba(0, 0, 0, 0.6),
    inset 0 0 15px rgba(245, 158, 11, 0.2) !important;
}

/* Brand crest: stronger ring effect */
.brand-crest {
  box-shadow:
    0 0 0 2px rgba(245, 158, 11, 0.3),
    0 0 20px rgba(245, 158, 11, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.5) !important;
}