/* Crispy Crust Enterprise Marketing Automation, SMS Studio, Social Hub & ROI (@marketing_app) */
/* Unified Design System - Strict 13.5px Industrial Precision & Zero Unicode Emojis */

:root {
  font-size: 13.5px;
  --bg-base: #06090e;
  --bg-surface: #0b1120;
  --bg-card: #0f172a;
  --bg-card-hover: #162035;
  --bg-subtle: rgba(255, 255, 255, 0.03);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-focus: #0d9488;
  --text-main: #f8fafc;
  --text-dim: #94a3b8;
  --text-muted: #64748b;
  --accent-mkt: #0d9488;
  --accent-mkt-hover: #14b8a6;
  --accent-mkt-glow: rgba(13, 148, 136, 0.2);
  --accent-gold: #f59e0b;
  --accent-gold-glow: rgba(245, 158, 11, 0.18);
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.18);
  --accent-blue: #38bdf8;
  --accent-blue-glow: rgba(56, 189, 248, 0.18);
  --accent-red: #f43f5e;
  --accent-red-glow: rgba(244, 63, 94, 0.18);
  --accent-purple: #a855f7;
  --accent-purple-glow: rgba(168, 85, 247, 0.18);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --header-height: 52px;
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
  --font-family: 'Cairo', system-ui, -apple-system, sans-serif;
}

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

body {
  background-color: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-family);
  direction: rtl;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   TOP HORIZONTAL 52px NAVBAR (Standard Matching POS, Sales, CRM & ERP)
   ========================================================================== */
.mkt-navbar {
  height: var(--header-height);
  min-height: var(--header-height);
  background-color: #0b1120;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(8px);
}

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

.brand-logo {
  height: 34px;
  width: auto;
  object-fit: contain;
  border-radius: 4px;
}

.facility-badge-locked {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(13, 148, 136, 0.12);
  border: 1px solid rgba(13, 148, 136, 0.3);
  color: #2dd4bf;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
}

.svg-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Desktop Horizontal Navigation Tabs */
.desktop-nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.nav-tab-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.nav-tab-btn.active {
  background: rgba(13, 148, 136, 0.15);
  border-color: rgba(13, 148, 136, 0.4);
  color: #2dd4bf;
  font-weight: 700;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 800;
  background: rgba(13, 148, 136, 0.3);
  color: #5eead4;
}

/* Mobile Screen Switcher (Hidden on Desktop) */
.mobile-screens-dropdown-wrap {
  display: none;
}

/* Header Status Panel */
.header-status-panel {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-capsule {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11.5px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulseAnimation 2s infinite;
}

@keyframes pulseAnimation {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.user-profile-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1e293b;
  border: 1px solid var(--border-medium);
  color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.user-profile-btn:hover {
  background: #334155;
  border-color: #0d9488;
}

.dropdown-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 220px;
  background: #0f172a;
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8);
  z-index: 10000;
  display: none;
}

.dropdown-menu-popover.show {
  display: block;
}

.dropdown-user-header {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 6px;
}

.user-name-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
}

.user-code-badge {
  font-size: 10.5px;
  color: #0d9488;
  font-weight: 600;
  margin-top: 2px;
}

.dropdown-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: right;
  transition: all 0.15s;
  font-family: inherit;
}

.dropdown-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.dropdown-menu-item.danger {
  color: #f87171;
}

.dropdown-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

/* ==========================================================================
   MAIN CONTAINER & KPI METRICS GRID
   ========================================================================== */
.main-view-container {
  padding: 16px;
  max-width: 1540px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}

.kpi-metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
}

.kpi-info {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 2px;
}

.kpi-value {
  font-size: 18px;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.kpi-subtext {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.kpi-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon-box.teal { background: rgba(13, 148, 136, 0.15); color: #2dd4bf; }
.kpi-icon-box.green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.kpi-icon-box.blue { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.kpi-icon-box.amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.kpi-icon-box.purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.kpi-icon-box.rose { background: rgba(244, 63, 94, 0.15); color: #fb7185; }

/* ==========================================================================
   VIEW TAB PANELS
   ========================================================================== */
.view-panel {
  display: none;
}

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

/* Card Container Standard */
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

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

.card-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-main);
}

.card-subtitle {
  font-size: 11.5px;
  color: var(--text-dim);
}

/* Odoo-style Status Stepper Ribbon */
.odoo-stepper {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
}

.stepper-step {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
  font-family: inherit;
}

.stepper-step.active {
  background: #0d9488;
  color: #ffffff;
}

.stepper-step.completed {
  background: rgba(13, 148, 136, 0.2);
  color: #2dd4bf;
}

/* Action Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, #0d9488, #0f766e);
  color: #ffffff;
}
.btn-primary:hover {
  opacity: 0.92;
  box-shadow: 0 0 12px rgba(13, 148, 136, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
}
.btn-success:hover {
  opacity: 0.92;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.btn-amber {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
}
.btn-amber:hover {
  opacity: 0.92;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-medium);
  color: #e2e8f0;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-outline-teal {
  background: rgba(13, 148, 136, 0.1);
  border-color: rgba(13, 148, 136, 0.3);
  color: #2dd4bf;
}
.btn-outline-teal:hover {
  background: rgba(13, 148, 136, 0.2);
}

/* Form Controls */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  background: #020617;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--text-main);
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--border-focus);
}

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

/* Data Tables */
.data-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 12px;
}

.data-table th {
  background: #0b1120;
  color: var(--text-dim);
  font-weight: 700;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-medium);
  white-space: nowrap;
}

.data-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  white-space: nowrap;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Status Chips */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
}

.status-chip.running { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.status-chip.sent { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.status-chip.new { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.status-chip.draft { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }
.status-chip.in_queue { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.status-chip.stopped { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }

/* Multi-Stage Workflow Visual Node Card */
.workflow-builder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.workflow-card {
  background: #0b1120;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: all 0.2s;
}

.workflow-card:hover {
  border-color: rgba(13, 148, 136, 0.4);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.workflow-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.workflow-code {
  font-size: 11px;
  font-weight: 800;
  color: #2dd4bf;
  font-family: monospace;
}

.workflow-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 4px;
}

.workflow-steps-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workflow-step-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.step-timing-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: #fbbf24;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.step-action-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: #38bdf8;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Sparkline mini comparison bar */
.sparkline-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.sparkline-bar {
  flex: 1;
  height: 6px;
  background: rgba(244, 63, 94, 0.3);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.sparkline-fill {
  height: 100%;
  background: #10b981;
  border-radius: 3px;
}

/* SMS Mobile Preview Mockup */
.sms-preview-phone {
  width: 280px;
  background: #020617;
  border: 2px solid #334155;
  border-radius: 24px;
  padding: 16px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  margin: 0 auto;
}

.sms-phone-speaker {
  width: 48px;
  height: 4px;
  background: #475569;
  border-radius: 2px;
  margin: 0 auto 12px;
}

.sms-chat-bubble {
  background: #1e293b;
  border-radius: 12px 12px 0 12px;
  padding: 10px 12px;
  font-size: 11.5px;
  line-height: 1.5;
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sms-bubble-meta {
  font-size: 9.5px;
  color: #94a3b8;
  text-align: left;
  margin-top: 4px;
}

/* Social Multi-Stream Columns */
.social-stream-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.social-column {
  background: #0b1120;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.social-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.social-post-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 11.5px;
}

.social-post-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 10.5px;
  color: var(--text-dim);
}

/* Email Template Visual Frame */
.email-preview-container {
  background: #020617;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 16px;
  max-width: 620px;
  margin: 0 auto;
}

.email-voucher-banner {
  background: linear-gradient(135deg, #0d9488, #0369a1);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  color: #ffffff;
  margin-bottom: 14px;
}

.email-voucher-code {
  display: inline-block;
  background: #0f172a;
  border: 2px dashed #38bdf8;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 900;
  font-family: monospace;
  margin: 10px 0;
  letter-spacing: 2px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.show {
  display: flex;
}

.modal-card {
  background: #0f172a;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
}

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

.modal-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
}

.modal-body {
  padding: 16px 18px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-msg {
  background: #0f172a;
  border: 1px solid #0d9488;
  color: #f8fafc;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  animation: slideToast 0.3s ease;
}

@keyframes slideToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

