/* Taqnia Stores Monitor - Premium Responsive CSS (Light & Dark Themes) */

/* Global Tokens & System Preferences */
:root {
  color-scheme: light dark;

  /* Font Families */
  --font-arabic: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* Constant Cloudflare & Brand Accents */
  --color-cf-orange: #f38020;
  --color-cf-blue: #0051c3;

  /* Status & Tier Colors (maintained vibrant & clear across both themes) */
  --color-green: #10b981;
  --color-yellow: #f59e0b;
  --color-orange: #f97316;
  --color-red: #ef4444;
  --color-purple: #8b5cf6;
}

/* ==========================================================================
   Dark Theme (Default & [data-theme="dark"])
   ========================================================================== */
:root, [data-theme="dark"] {
  --bg-main: #0a0d14;
  --bg-gradient: 
    radial-gradient(at 0% 0%, rgba(243, 128, 32, 0.07) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(0, 81, 195, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.04) 0px, transparent 50%);
  
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 34, 52, 0.85);
  --bg-inner-box: rgba(0, 0, 0, 0.25);
  --bg-inner-row: rgba(255, 255, 255, 0.02);
  --bg-selector: rgba(0, 0, 0, 0.4);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-capacity: rgba(243, 128, 32, 0.25);
  --border-hover: rgba(243, 128, 32, 0.4);
  
  --text-title: #ffffff;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --brand-gradient: linear-gradient(135deg, #ffffff 40%, #f38020 100%);
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 16px 32px -8px rgba(0, 0, 0, 0.6);
  --progress-track-bg: rgba(255, 255, 255, 0.06);

  --badge-tag-bg: rgba(255, 255, 255, 0.06);
  --badge-tag-text: var(--text-muted);

  --summary-card-glow: linear-gradient(90deg, transparent, rgba(243, 128, 32, 0.5), transparent);
}

/* ==========================================================================
   Light Theme ([data-theme="light"])
   ========================================================================== */
[data-theme="light"] {
  --bg-main: #f4f6f9;
  --bg-gradient: 
    radial-gradient(at 0% 0%, rgba(243, 128, 32, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(0, 81, 195, 0.06) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.03) 0px, transparent 50%);
  
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-inner-box: #f8fafc;
  --bg-inner-row: #f1f5f9;
  --bg-selector: #e2e8f0;
  
  --border-color: #e2e8f0;
  --border-card: #e2e8f0;
  --border-capacity: rgba(243, 128, 32, 0.4);
  --border-hover: rgba(243, 128, 32, 0.6);
  
  --text-title: #0f172a;
  --text-main: #1e293b;
  --text-muted: #475569;
  --text-dim: #64748b;
  
  --brand-gradient: linear-gradient(135deg, #0f172a 35%, #ea580c 100%);
  --shadow-card: 0 4px 18px -2px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 12px 28px -4px rgba(0, 0, 0, 0.12), 0 4px 12px -2px rgba(0, 0, 0, 0.06);
  --progress-track-bg: #e2e8f0;

  --badge-tag-bg: #f1f5f9;
  --badge-tag-text: #475569;

  --summary-card-glow: linear-gradient(90deg, transparent, rgba(243, 128, 32, 0.6), transparent);
}

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

body {
  background-color: var(--bg-main);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-arabic);
  min-height: 100vh;
  padding: 24px 16px;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.app-container {
  max-width: 1440px;
  margin: 0 auto;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 18px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 28px;
  transition: var(--transition);
}

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

.brand-icon {
  width: 48px;
  height: 48px;
  background: rgba(243, 128, 32, 0.12);
  border: 1px solid rgba(243, 128, 32, 0.25);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-text h1 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text .sub-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-selector);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-arabic);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.theme-toggle-btn:hover {
  border-color: var(--color-cf-orange);
  color: var(--color-cf-orange);
  transform: translateY(-1px);
}

[data-theme="dark"] .theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: inline-flex; align-items: center; gap: 4px; }

[data-theme="light"] .theme-icon-light { display: none; }
[data-theme="light"] .theme-icon-dark { display: inline-flex; align-items: center; gap: 4px; }

/* Time Selector */
.time-selector {
  display: flex;
  background: var(--bg-selector);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.time-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 18px;
  font-family: var(--font-arabic);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.time-btn:hover {
  color: var(--text-title);
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .time-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.time-btn.active {
  background: var(--color-cf-orange);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(243, 128, 32, 0.35);
}

/* Status Indicator */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 14px;
  border-radius: 30px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-green);
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.live-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-green);
}

/* ==========================================================================
   Capacity & Store Addition Decision Section
   ========================================================================== */
.capacity-section {
  margin-bottom: 32px;
}

.capacity-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-capacity);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.capacity-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #8b5cf6, #3b82f6, #f38020, #10b981);
}

.capacity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.capacity-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.capacity-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-purple);
}

.capacity-title-wrap h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-title);
  margin-bottom: 2px;
}

.capacity-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Final Decision Badges */
.final-decision-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  text-align: right;
  gap: 2px;
}

.final-decision-badge .decision-code {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.final-decision-badge .decision-arabic {
  font-size: 0.76rem;
  font-weight: 700;
}

.badge-decision-structural {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: var(--color-purple);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.2);
}
[data-theme="dark"] .badge-decision-structural { color: #c4b5fd; }
[data-theme="dark"] .badge-decision-structural .decision-code { color: #ddd6fe; }
[data-theme="light"] .badge-decision-structural { color: #6d28d9; background: rgba(139, 92, 246, 0.12); border-color: rgba(139, 92, 246, 0.35); }
[data-theme="light"] .badge-decision-structural .decision-code { color: #5b21b6; }

.badge-decision-monitor {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #2563eb;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.2);
}
[data-theme="dark"] .badge-decision-monitor { color: #93c5fd; }

.badge-decision-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #059669;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.2);
}
[data-theme="dark"] .badge-decision-success { color: #6ee7b7; }

.badge-decision-caution {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #d97706;
}
[data-theme="dark"] .badge-decision-caution { color: #fcd34d; }

.badge-decision-warning {
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.4);
  color: #ea580c;
}
[data-theme="dark"] .badge-decision-warning { color: #fdba74; }

.badge-decision-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #dc2626;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.2);
}
[data-theme="dark"] .badge-decision-danger { color: #fca5a5; }

/* 4 Pillars Grid */
.capacity-pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.pillar-card {
  background: var(--bg-inner-box);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pillar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.pillar-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-title);
}

.pillar-metrics {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pillar-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-inner-row);
  padding: 4px 8px;
  border-radius: 4px;
}

.pillar-metric-row strong {
  font-family: var(--font-mono);
  color: var(--text-title);
}

.pillar-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

.pillar-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: var(--text-dim);
  background: var(--bg-inner-row);
  padding: 5px 8px;
  border-radius: 4px;
}

.pillar-meta strong {
  font-family: var(--font-mono);
  color: var(--text-title);
}

.nearest-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-title);
  margin-bottom: 6px;
}

.nearest-stats {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nearest-headroom {
  color: var(--color-green);
  font-weight: 700;
  font-size: 0.72rem;
}

/* Status Pills */
.status-pill-green {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.3);
}
[data-theme="dark"] .status-pill-green { color: var(--color-green); }

.status-pill-yellow {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.3);
}
[data-theme="dark"] .status-pill-yellow { color: var(--color-yellow); }

.status-pill-orange {
  background: rgba(249, 115, 22, 0.15);
  color: #ea580c;
  border-color: rgba(249, 115, 22, 0.3);
}
[data-theme="dark"] .status-pill-orange { color: var(--color-orange); }

.status-pill-purple {
  background: rgba(139, 92, 246, 0.15);
  color: #6d28d9;
  border-color: rgba(139, 92, 246, 0.3);
}
[data-theme="dark"] .status-pill-purple { color: #c4b5fd; }

.status-pill-dim {
  background: var(--bg-inner-row);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Reasons Box */
.reasons-section {
  background: var(--bg-inner-box);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.reasons-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-title);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.reasons-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reasons-list li {
  font-size: 0.8rem;
  color: var(--text-muted);
  position: relative;
  padding-right: 18px;
  line-height: 1.5;
}

.reasons-list li::before {
  content: '▸';
  position: absolute;
  right: 0;
  color: var(--color-cf-orange);
  font-weight: 800;
}

/* Summary Section */
.summary-section {
  margin-bottom: 32px;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title-wrap h2 {
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-title);
}

.badge-tag {
  background: var(--badge-tag-bg);
  border: 1px solid var(--border-color);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--badge-tag-text);
  font-weight: 600;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.summary-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--summary-card-glow);
  opacity: 0;
  transition: var(--transition);
}

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

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

.summary-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.summary-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.summary-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(243, 128, 32, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-cf-orange);
}

.summary-value {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-title);
  margin-bottom: 4px;
  direction: ltr;
  text-align: right;
}

.summary-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Real Data Indicators */
.badge-real-indicator {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
}
[data-theme="dark"] .badge-real-indicator { color: var(--color-green); }

.multi-stats .stats-sub-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg-inner-box);
  padding: 4px 8px;
  border-radius: 6px;
}

.multi-stats .stats-sub-row strong {
  color: var(--text-title);
  font-family: var(--font-mono);
}

/* Store Monitor Section */
.stores-section {
  margin-bottom: 32px;
}

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

.legend-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  padding: 8px 16px;
  border-radius: 30px;
  border: 1px solid var(--border-card);
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  box-shadow: var(--shadow-card);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.color-green { background-color: var(--color-green); box-shadow: 0 0 6px var(--color-green); }
.color-yellow { background-color: var(--color-yellow); box-shadow: 0 0 6px var(--color-yellow); }
.color-orange { background-color: var(--color-orange); box-shadow: 0 0 6px var(--color-orange); }
.color-red { background-color: var(--color-red); box-shadow: 0 0 6px var(--color-red); }

/* Master-Detail Layout System */
.view-container {
  animation: fadeInView 0.25s ease-out;
}

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

/* Master View: Store Summary Cards Grid */
.stores-master-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}

.store-master-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.store-master-card:hover {
  border-color: var(--color-cf-orange);
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.store-master-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-cf-orange), transparent);
  opacity: 0;
  transition: var(--transition);
}

.store-master-card:hover::before {
  opacity: 1;
}

.store-master-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.store-master-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.store-master-info h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-title);
}

.store-master-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.store-master-glance {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-inner-box);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  border: 1px solid var(--border-color);
}

.store-master-glance strong {
  font-family: var(--font-mono);
  color: var(--text-title);
}

.store-master-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--color-cf-orange);
  padding-top: 6px;
}

.store-master-action .arrow-icon {
  font-size: 1.1rem;
  transition: transform 0.2s ease;
}

.store-master-card:hover .store-master-action .arrow-icon {
  transform: translateX(-5px);
}

/* ==========================================================================
   Store Detail View Styling
   ========================================================================== */

.detail-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.back-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-title);
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-arabic);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.back-link-btn:hover {
  background: var(--color-cf-orange);
  color: #ffffff;
  border-color: var(--color-cf-orange);
  transform: translateX(4px);
}

.back-link-btn .back-arrow {
  font-size: 1.1rem;
}

/* Detail Store Hero Card */
.detail-store-hero {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.detail-store-hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-cf-orange), #3b82f6, #10b981);
}

.detail-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.detail-hero-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.detail-hero-brand .store-avatar {
  width: 56px;
  height: 56px;
  font-size: 1.5rem;
}

.detail-hero-title h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-title);
  margin-bottom: 4px;
}

.detail-hero-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.detail-meta-box {
  background: var(--bg-inner-box);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-meta-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-meta-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-title);
  font-family: var(--font-mono);
  word-break: break-all;
}

/* Detail Analytics Grid */
.detail-analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 22px;
  margin-bottom: 32px;
}

.detail-metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.detail-metric-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
}

.detail-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.detail-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-title);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   Central Provider Management Section in Store Detail
   ========================================================================== */

.provider-mgmt-section {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.provider-mgmt-section::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #10b981, var(--color-cf-orange), #8b5cf6);
}

.provider-mgmt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.provider-mgmt-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.provider-mgmt-title h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-title);
}

.provider-readonly-banner {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.provider-readonly-banner .lock-icon {
  font-size: 1.1rem;
}

.provider-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.provider-meta-item {
  background: var(--bg-inner-box);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.provider-meta-label {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.provider-meta-val {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-title);
  display: flex;
  align-items: center;
  gap: 6px;
}

.provider-actions-container {
  background: var(--bg-inner-box);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 24px;
}

.provider-actions-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.provider-actions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.provider-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-arabic);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.provider-btn-primary {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(0, 81, 195, 0.2));
  border-color: #10b981;
  color: var(--text-title);
}

.provider-btn-primary:not(:disabled):hover {
  background: #10b981;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.provider-btn-secondary {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-title);
}

.provider-btn-secondary:not(:disabled):hover {
  border-color: var(--color-cf-orange);
  color: var(--color-cf-orange);
  transform: translateY(-2px);
}

.provider-btn-warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
  color: #f59e0b;
}

.provider-btn-warning:not(:disabled):hover {
  background: #f59e0b;
  color: #000;
  transform: translateY(-2px);
}

.provider-btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.provider-btn-danger:not(:disabled):hover {
  background: #ef4444;
  color: #ffffff;
  transform: translateY(-2px);
}

.provider-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* History Timeline & Table Section */
.provider-history-box {
  margin-top: 20px;
}

.provider-history-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-inner-box);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-title);
  user-select: none;
}

.provider-history-table-wrapper {
  overflow-x: auto;
  margin-top: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.provider-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: right;
}

.provider-history-table th {
  background-color: var(--bg-inner-box);
  padding: 10px 14px;
  color: var(--text-dim);
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
}

.provider-history-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

.provider-history-table tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.history-action-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
  margin-left: 4px;
}

.history-action-btn:hover {
  border-color: var(--color-cf-orange);
  color: var(--text-title);
}

.history-action-btn.delete-btn:hover {
  border-color: var(--color-red);
  color: var(--color-red);
}

/* Owner Info & Telegram Bar */
.provider-owner-details-box {
  background: var(--bg-inner-box);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
}

.provider-owner-details-box summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-title);
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.owner-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.provider-whatsapp-reminder-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #25d366;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-arabic);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  transition: var(--transition);
  margin-bottom: 18px;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
}

.provider-whatsapp-reminder-btn:hover {
  background: #1ebc59;
  transform: translateY(-2px);
}

.provider-quick-renew-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 16px;
}

.quick-renew-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  color: var(--text-title);
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}

.quick-renew-btn:hover {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.telegram-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 20px;
  font-size: 0.85rem;
}


/* Provider Action Confirmation Modal */
.confirm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeInModal 0.2s ease-out;
}

.confirm-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-hover);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.confirm-modal-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-title);
}

.confirm-modal-summary {
  background: var(--bg-inner-box);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
}

.confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.confirm-label {
  color: var(--text-dim);
}

.confirm-val {
  font-weight: 700;
  color: var(--text-title);
}

.confirm-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.confirm-form-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.confirm-input, .confirm-select {
  background: var(--bg-inner-row);
  border: 1px solid var(--border-color);
  color: var(--text-title);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-arabic);
  font-size: 0.88rem;
  outline: none;
}

.confirm-input:focus, .confirm-select:focus {
  border-color: var(--color-cf-orange);
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}


/* Legacy & Shared Store Cards */
.stores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
}

.store-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
}

.store-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.store-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  gap: 10px;
}

.store-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.store-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(243, 128, 32, 0.18), rgba(59, 130, 246, 0.12));
  border: 1px solid rgba(243, 128, 32, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--color-cf-orange);
}

.store-title-text h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-title);
  margin-bottom: 2px;
}

.store-id-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.store-header-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 30px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.status-badge.status-healthy {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
[data-theme="dark"] .status-badge.status-healthy { color: var(--color-green); }

/* Lifecycle & Data Maturity Badges */
.badge-lifecycle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.badge-lifecycle-design {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.3);
}
[data-theme="dark"] .badge-lifecycle-design { color: #a78bfa; }

.badge-lifecycle-pilot {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
[data-theme="dark"] .badge-lifecycle-pilot { color: #60a5fa; }

.badge-lifecycle-live {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
[data-theme="dark"] .badge-lifecycle-live { color: var(--color-green); }

.store-lifecycle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 6px 10px;
  background: var(--bg-inner-box);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
}

.store-lifecycle-row .label-tag {
  color: var(--text-dim);
}

.store-lifecycle-row .maturity-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Metrics List */
.metrics-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.metric-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-name {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.metric-values {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  direction: ltr;
}

.metric-current {
  color: var(--text-title);
  font-weight: 700;
}

.metric-max {
  color: var(--text-dim);
  font-size: 0.72rem;
}

.percent-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Progress Bars */
.progress-track {
  width: 100%;
  height: 7px;
  background: var(--progress-track-bg);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Tier Bar Colors */
.tier-green {
  background: linear-gradient(90deg, #10b981, #059669);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.tier-yellow {
  background: linear-gradient(90deg, #f59e0b, #d97706);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.tier-orange {
  background: linear-gradient(90deg, #f97316, #ea580c);
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.4);
}

.tier-red {
  background: linear-gradient(90deg, #ef4444, #dc2626);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
  animation: bar-glow 1.5s infinite alternate;
}

@keyframes bar-glow {
  from { opacity: 0.8; }
  to { opacity: 1; }
}

/* Store Footer */
.store-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.store-sync-badge {
  display: flex;
  align-items: center;
  gap: 5px;
}

.store-action-tag {
  background: var(--bg-inner-row);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  border: 1px solid var(--border-color);
}

/* Footer */
.footer {
  margin-top: 40px;
  padding: 20px 0;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Responsive */
@media (max-width: 900px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .stores-grid {
    grid-template-columns: 1fr;
  }

  .capacity-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .final-decision-badge {
    align-items: flex-start;
    width: 100%;
  }
}

@media (max-width: 600px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .legend-bar {
    width: 100%;
    justify-content: space-between;
  }

  .capacity-pillars-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Beginner-Friendly Context-Aware Help Modal & Tooltips
   ========================================================================== */

.help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  background: var(--bg-inner-row);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  margin-right: 6px;
  transition: var(--transition);
  vertical-align: middle;
  padding: 0;
}

.help-btn:hover, .help-btn:focus-visible {
  background: var(--color-cf-orange);
  color: #ffffff;
  border-color: var(--color-cf-orange);
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(243, 128, 32, 0.4);
  outline: none;
}

.clickable-help {
  cursor: pointer;
  transition: var(--transition);
}

.clickable-help:hover {
  color: var(--color-cf-orange) !important;
}

/* Modal Backdrop */
.help-modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

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

/* Modal Card */
.help-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--border-color);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

@keyframes modalScale {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Modal Header */
.help-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-inner-box);
  gap: 16px;
}

.help-modal-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.help-modal-title-ar {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-title);
  display: flex;
  align-items: center;
  gap: 10px;
}

.help-modal-title-en {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-cf-orange);
  background: rgba(243, 128, 32, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
  border: 1px solid rgba(243, 128, 32, 0.2);
}

.help-modal-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-back-btn {
  background: var(--bg-selector);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-arabic);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.help-back-btn:hover {
  background: var(--color-cf-orange);
  color: #ffffff;
  border-color: var(--color-cf-orange);
}

.help-modal-close-btn {
  background: var(--bg-selector);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
}

.help-modal-close-btn:hover {
  color: #ffffff;
  background: var(--color-red);
  border-color: var(--color-red);
  transform: rotate(90deg);
}

/* Modal Body */
.help-modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  line-height: 1.7;
}

/* Structured Help Sections */
.help-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.help-section-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-title);
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-section-title .section-icon {
  font-size: 1.05rem;
}

.help-plain-text {
  font-size: 0.9rem;
  color: var(--text-main);
  background: var(--bg-inner-box);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  line-height: 1.7;
}

/* Dynamic Live Snapshot Card */
.help-snapshot-card {
  background: var(--bg-inner-box);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.snapshot-item {
  background: var(--bg-inner-row);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.snapshot-label {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.snapshot-value {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-title);
}

.snapshot-meaning {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-selector);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border-right: 3px solid var(--color-cf-orange);
}

/* Related Interactive Terms Pills */
.related-terms-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.term-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-selector);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: 20px;
  font-family: var(--font-arabic);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.term-pill-btn:hover {
  background: rgba(243, 128, 32, 0.15);
  border-color: var(--color-cf-orange);
  color: var(--color-cf-orange);
  transform: translateY(-1px);
}

.term-pill-btn .pill-icon {
  font-size: 0.85rem;
}

/* Practical Store Example Box */
.help-example-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.6;
}

/* Why It Matters Box */
.help-why-box {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.6;
}

/* When To Watch Box */
.help-watch-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.6;
}

/* Production Maturity Note Box */
.help-prod-box {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.6;
}

/* ==========================================================================
   PWA Installation UX & Responsive Breakpoints
   ========================================================================== */

.pwa-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(243, 128, 32, 0.18), rgba(0, 81, 195, 0.2));
  border: 1px solid var(--color-cf-orange);
  color: var(--text-title);
  padding: 7px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-arabic);
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(243, 128, 32, 0.2);
  user-select: none;
}

.pwa-install-btn:hover {
  background: var(--color-cf-orange);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(243, 128, 32, 0.4);
}

.pwa-install-btn .install-icon {
  font-size: 1.05rem;
}

/* ==========================================================================
   Comprehensive Responsive System (320px -> 1920px+)
   ========================================================================== */

html, body {
  width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

/* Base large container */
.app-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 4px;
}

/* Large Desktop (1440px - 1920px+) */
@media (min-width: 1440px) {
  .summary-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .stores-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .capacity-pillars-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Desktop Standard (1024px - 1439px) */
@media (max-width: 1439px) and (min-width: 1024px) {
  .summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .stores-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .capacity-pillars-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablets Landscape & Medium Screens (820px - 1023px) */
@media (max-width: 1023px) and (min-width: 820px) {
  .header {
    padding: 16px 20px;
  }
  .summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .stores-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .capacity-pillars-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablets Portrait (768px - 819px) */
@media (max-width: 819px) and (min-width: 768px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stores-grid {
    grid-template-columns: 1fr;
  }
  .capacity-pillars-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .capacity-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .final-decision-badge {
    align-items: flex-start;
    width: 100%;
  }
}

/* Small Tablets & Large Mobiles (600px - 767px) */
@media (max-width: 767px) and (min-width: 600px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }
  .header-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stores-grid {
    grid-template-columns: 1fr;
  }
  .capacity-pillars-grid {
    grid-template-columns: 1fr;
  }
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .legend-bar {
    width: 100%;
    justify-content: space-between;
  }
}

/* Mobile Phones (430px, 390px, 360px) */
@media (max-width: 599px) {
  body {
    padding: 14px 10px;
  }
  .header {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px;
    margin-bottom: 20px;
    gap: 14px;
  }
  .brand {
    gap: 12px;
  }
  .brand-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }
  .brand-text h1 {
    font-size: 1.25rem;
  }
  .brand-text .sub-title {
    font-size: 0.76rem;
  }
  .header-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .header-actions > * {
    width: 100%;
    justify-content: center;
  }
  .time-selector {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr 1.3fr;
  }
  .time-btn {
    padding: 8px 6px;
    font-size: 0.78rem;
    text-align: center;
  }
  .status-indicator {
    justify-content: center;
  }
  .capacity-card {
    padding: 16px;
  }
  .capacity-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .final-decision-badge {
    align-items: flex-start;
    width: 100%;
  }
  .capacity-pillars-grid {
    grid-template-columns: 1fr;
  }
  .summary-grid {
    grid-template-columns: 1fr;
  }
  .stores-grid {
    grid-template-columns: 1fr;
  }
  .store-card {
    padding: 16px;
  }
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .legend-bar {
    width: 100%;
    justify-content: space-between;
    padding: 6px 12px;
    font-size: 0.72rem;
  }
  .help-modal-card {
    max-height: 94vh;
    border-radius: var(--radius-md);
  }
  .help-modal-header {
    padding: 14px 16px;
  }
  .help-modal-title-ar {
    font-size: 1.15rem;
  }
  .help-modal-body {
    padding: 14px 16px;
    gap: 14px;
  }
  .snapshot-grid {
    grid-template-columns: 1fr;
  }
}

/* Extra Small Phones (320px - 359px) */
@media (max-width: 359px) {
  body {
    padding: 10px 6px;
  }
  .brand-text h1 {
    font-size: 1.1rem;
  }
  .brand-text .sub-title {
    font-size: 0.7rem;
  }
  .time-btn {
    padding: 6px 4px;
    font-size: 0.72rem;
  }
  .summary-value {
    font-size: 1.25rem;
  }
  .metric-values {
    font-size: 0.75rem;
  }
  .store-title-text h3 {
    font-size: 1.05rem;
  }
  .legend-bar {
    font-size: 0.68rem;
    gap: 8px;
  }
}

/* Mobile Landscape Optimization */
@media (orientation: landscape) and (max-height: 520px) {
  .help-modal-card {
    max-height: 92vh;
  }
  .help-modal-body {
    max-height: calc(92vh - 70px);
    overflow-y: auto;
  }
}

/* ==========================================================================
   Pages Deployments Section Styles
   ========================================================================== */
.deployments-section {
  margin-bottom: 36px;
}

.deployments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.deployments-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.deployments-title-wrap h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-title);
  display: flex;
  align-items: center;
  gap: 10px;
}

.deployments-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.deployments-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-selector);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-arabic);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.deployments-refresh-btn:hover:not(:disabled) {
  border-color: var(--color-cf-orange);
  color: var(--color-cf-orange);
  transform: translateY(-1px);
}

.deployments-refresh-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.deployments-refresh-btn .spin-icon {
  display: inline-block;
  transition: transform 0.4s ease;
}

.deployments-refresh-btn.loading .spin-icon {
  animation: spinAnim 1s linear infinite;
}

@keyframes spinAnim {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

.deploy-summary-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.deploy-summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--summary-card-glow);
  opacity: 0.7;
}

.deploy-summary-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.deploy-summary-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.deploy-summary-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(243, 128, 32, 0.1);
  color: var(--color-cf-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.deploy-summary-value {
  font-size: 1.65rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: var(--text-title);
  line-height: 1.2;
  margin-bottom: 6px;
}

.deploy-summary-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.deploy-triggers-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.trigger-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.trigger-adhoc {
  background: rgba(0, 81, 195, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(0, 81, 195, 0.25);
}

[data-theme="light"] .trigger-adhoc {
  background: rgba(0, 81, 195, 0.08);
  color: #0284c7;
  border-color: rgba(0, 81, 195, 0.2);
}

.trigger-git {
  background: rgba(139, 92, 246, 0.12);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

[data-theme="light"] .trigger-git {
  background: rgba(139, 92, 246, 0.08);
  color: #7c3aed;
  border-color: rgba(139, 92, 246, 0.2);
}

.trigger-hook {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

[data-theme="light"] .trigger-hook {
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.2);
}

.trigger-other {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  border: 1px solid var(--border-color);
}

/* Deployments Table Container */
.deployments-table-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: var(--transition);
}

.deployments-table-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.deployments-table-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-title);
  display: flex;
  align-items: center;
  gap: 8px;
}

.deployments-search-wrap {
  position: relative;
  min-width: 220px;
}

.deployments-search-input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  background: var(--bg-inner-box);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-arabic);
  font-size: 0.82rem;
  outline: none;
  transition: var(--transition);
}

.deployments-search-input:focus {
  border-color: var(--color-cf-orange);
  box-shadow: 0 0 0 2px rgba(243, 128, 32, 0.15);
}

.deployments-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.85rem;
  pointer-events: none;
}

.deployments-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.deployments-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.85rem;
}

.deployments-table th {
  background: var(--bg-inner-box);
  color: var(--text-muted);
  font-weight: 700;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  user-select: none;
}

.deployments-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
  transition: background 0.15s ease;
}

.deployments-table tbody tr:hover td {
  background: var(--bg-inner-row);
}

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

.project-name-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.project-name-title {
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-title);
  font-size: 0.92rem;
}

.project-subdomain {
  font-size: 0.74rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  direction: ltr;
  text-align: right;
}

.count-badge-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 4px 10px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.88rem;
  background: var(--bg-inner-box);
  border: 1px solid var(--border-color);
}

.count-badge-pill.highlight {
  background: rgba(243, 128, 32, 0.12);
  color: var(--color-cf-orange);
  border-color: rgba(243, 128, 32, 0.3);
}

/* Latest Deployment Status Badge */
.dep-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.dep-status-badge.status-success {
  background: rgba(16, 185, 129, 0.14);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

[data-theme="light"] .dep-status-badge.status-success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.dep-status-badge.status-failure {
  background: rgba(239, 68, 68, 0.14);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

[data-theme="light"] .dep-status-badge.status-failure {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.dep-status-badge.status-canceled {
  background: rgba(148, 163, 184, 0.14);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.dep-status-badge.status-running {
  background: rgba(59, 130, 246, 0.14);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.dep-status-badge.status-idle {
  background: rgba(245, 158, 11, 0.14);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.dep-status-badge.status-unknown {
  background: var(--bg-inner-box);
  color: var(--text-dim);
  border: 1px solid var(--border-color);
}

/* Deployments Table Footer Total Row */
.deployments-table tfoot tr,
.deployments-total-row {
  background: var(--bg-inner-box);
  border-top: 2px solid var(--border-color);
  font-weight: 700;
}

.deployments-table tfoot td,
.deployments-total-row td {
  padding: 14px 18px;
  color: var(--text-title);
  border-bottom: none;
  vertical-align: middle;
}

.total-title-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: var(--color-cf-orange);
  font-size: 0.88rem;
}

.date-cell-baghdad {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.date-main {
  font-weight: 700;
  color: var(--text-main);
}

.date-relative {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-arabic);
}

/* Deployments Error Card */
.deployments-error-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: right;
}

.deployments-error-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.deployments-error-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.12);
  color: var(--color-red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.deployments-error-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-title);
}

.deployments-error-msg {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.deployments-retry-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-cf-orange);
  color: #ffffff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-arabic);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(243, 128, 32, 0.3);
  transition: var(--transition);
}

.deployments-retry-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(243, 128, 32, 0.4);
}

@media (max-width: 768px) {
  .deployments-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .deployments-actions {
    width: 100%;
    justify-content: space-between;
  }
  .deployments-summary-grid {
    grid-template-columns: 1fr;
  }
  .deployments-table th, .deployments-table td {
    padding: 10px 12px;
    font-size: 0.78rem;
  }
  .project-name-title {
    font-size: 0.84rem;
  }
}

/* ==========================================================================
   Store Storage Quota Section Styles (Phase 1)
   ========================================================================== */
.storage-quota-section {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.storage-quota-section:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
}

.storage-quota-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.storage-quota-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.storage-quota-title svg {
  color: var(--color-cf-orange);
}

.storage-quota-title h3 {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-title);
  margin: 0;
}

.storage-quota-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.storage-quota-card {
  background: var(--bg-inner-box);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: var(--transition);
}

.storage-quota-card:hover {
  border-color: var(--border-hover);
}

.quota-stat-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.quota-stat-val {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-title);
  margin: 2px 0;
}

.quota-stat-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.quota-progress-container {
  background: var(--bg-inner-box);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 20px;
}

.quota-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 6px;
}

.quota-progress-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

[data-theme="light"] .quota-progress-track {
  background: rgba(0, 0, 0, 0.08);
}

.quota-progress-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease-out;
}

.quota-alert-banner {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.5;
}

.quota-banner-danger {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

[data-theme="light"] .quota-banner-danger {
  color: #991b1b;
  background: rgba(239, 68, 68, 0.1);
}

.quota-banner-warning {
  background: rgba(249, 115, 22, 0.14);
  border: 1px solid rgba(249, 115, 22, 0.35);
  color: #fdba74;
}

[data-theme="light"] .quota-banner-warning {
  color: #9a3412;
  background: rgba(249, 115, 22, 0.1);
}

.quota-banner-alert {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
}

[data-theme="light"] .quota-banner-alert {
  color: #92400e;
  background: rgba(245, 158, 11, 0.1);
}

.storage-quota-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-color);
}

.quota-control-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.quota-control-group label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-muted);
}

.quota-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quota-unit-tag {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.86rem;
  color: var(--text-dim);
}

.quota-recalc-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.quota-last-recalc {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-arabic);
}

@media (max-width: 768px) {
  .storage-quota-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .storage-quota-controls {
    flex-direction: column;
    align-items: flex-start;
  }
  .quota-recalc-group {
    align-items: flex-start;
    width: 100%;
  }
  .quota-recalc-group button {
    width: 100%;
    justify-content: center;
  }
}




