/* ==========================================================================
   Design System & CSS Variables - Aqsaty Mobile Application
   ========================================================================== */
:root {
  /* Brand Core Colors (Extracted from Aqsaty Logo & Brand Identity) */
  --brand-blue: #0047FF;
  --brand-blue-dark: #0036C8;
  --brand-blue-light: #EBF2FF;
  --brand-blue-gradient: linear-gradient(135deg, #0052FF 0%, #0038B8 100%);
  --brand-hero-gradient: linear-gradient(135deg, #0047FF 0%, #0099FF 50%, #00C2FF 100%);

  --brand-green: #00D06C;
  --brand-green-dark: #059669;
  --brand-green-light: #ECFDF5;
  --brand-green-gradient: linear-gradient(135deg, #10B981 0%, #00D06C 100%);

  --brand-cyan: #00C2FF;
  --brand-cyan-light: #F0F9FF;
  --brand-cyan-gradient: linear-gradient(135deg, #00C2FF 0%, #0EA5E9 100%);

  --brand-danger: #EF4444;
  --brand-danger-light: #FEF2F2;
  --brand-warning: #F59E0B;
  --brand-warning-light: #FFFBEB;
  --brand-purple: #8B5CF6;
  --brand-purple-light: #F5F3FF;
  --brand-orange: #EA580C;
  --brand-orange-light: #FFF7ED;

  /* Neutral & Surface System */
  --bg-app: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --border-subtle: #E2E8F0;
  --border-card: rgba(226, 232, 240, 0.9);

  --text-main: #0F172A;
  --text-body: #334155;
  --text-muted: #64748B;
  --text-subtle: #94A3B8;
  --text-white: #FFFFFF;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 2px 10px -1px rgba(15, 23, 42, 0.05);
  --shadow-fab: 0 8px 24px -2px rgba(0, 71, 255, 0.45);

  /* Typography */
  --font-arabic: 'Cairo', system-ui, -apple-system, sans-serif;
  --font-digits: 'Plus Jakarta Sans', 'Cairo', sans-serif;

  /* Layout Constants */
  --max-width-mobile: 430px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 9999px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   Base & Resets
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 15px;
  background: #E2E8F0;
  height: 100%;
}

body {
  font-family: var(--font-arabic);
  background-color: #E2E8F0;
  color: var(--text-main);
  min-height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

input, select, textarea {
  font-family: inherit;
}

svg {
  display: inline-block;
  vertical-align: middle;
}

/* ==========================================================================
   Mobile Viewport Simulation Container
   ========================================================================== */
.app-viewport {
  width: 100%;
  max-width: var(--max-width-mobile);
  height: 96vh;
  max-height: 890px;
  background-color: var(--bg-app);
  border-radius: 36px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.25), 0 0 0 8px #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

@media (max-width: 480px) {
  .app-viewport {
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    box-shadow: none;
    border: none;
  }
}

/* ==========================================================================
   Header & Brand
   ========================================================================== */
.app-header {
  background: var(--bg-surface);
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 30;
  flex-shrink: 0;
}

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

.menu-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.brand-logo {
  cursor: pointer;
}

.logo-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #F0F6FF;
  padding: 4px 10px 4px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid #D6E6FF;
}

.logo-text {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--brand-blue);
  letter-spacing: -0.3px;
}

.calendar-icon-wrapper {
  position: relative;
  width: 22px;
  height: 22px;
  color: var(--brand-blue);
}

.calendar-svg {
  width: 100%;
  height: 100%;
}

.check-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: var(--brand-green);
  color: #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #FFFFFF;
  font-size: 0.55rem;
  font-weight: 900;
}

.header-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-body);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.notif-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  background-color: var(--brand-danger);
  border-radius: 50%;
  border: 1.5px solid #FFFFFF;
}

.avatar-ring {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--brand-blue-light);
  cursor: pointer;
}

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

.online-status {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 9px;
  height: 9px;
  background-color: var(--brand-green);
  border: 2px solid #FFFFFF;
  border-radius: 50%;
}

.header-subinfo {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 5px;
  border-top: 1px dashed var(--border-subtle);
}

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

.date-chip svg {
  width: 13px;
  height: 13px;
  color: var(--brand-blue);
}

.mode-tag {
  font-size: 0.66rem;
  font-weight: 700;
  background: var(--brand-green-light);
  color: var(--brand-green-dark);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
}

/* ==========================================================================
   Main Scrollable Area
   ========================================================================== */
.app-main-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px 20px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.app-main-content::-webkit-scrollbar {
  width: 3px;
}
.app-main-content::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 3px;
}

/* ==========================================================================
   Page Views Controller
   ========================================================================== */
.app-page-view {
  display: none;
}

.app-page-view.active-view {
  display: block;
  animation: fadeIn 0.2s ease;
}

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

/* ==========================================================================
   Quick Actions Section (Compact & Sleek)
   ========================================================================== */
.quick-actions-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 10px;
}

.action-card-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 7px 4px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.action-card-btn:active {
  transform: scale(0.96);
}

.action-icon-circle {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  margin-bottom: 3px;
  position: relative;
}

.action-icon-circle svg {
  width: 15px;
  height: 15px;
}

.blue-grad { background: var(--brand-blue-gradient); }
.cyan-grad { background: var(--brand-cyan-gradient); }
.green-grad { background: var(--brand-green-gradient); }

.mini-plus, .mini-check {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 11px;
  height: 11px;
  background: #FFFFFF;
  border-radius: 50%;
  font-size: 0.55rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-plus { color: var(--brand-blue); }
.mini-check { color: var(--brand-green); }

.action-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.action-sublabel {
  font-size: 0.56rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ==========================================================================
   Metrics Grid & Period Filter (Dashboard)
   ========================================================================== */
.metrics-grid-section {
  margin-bottom: 12px;
}

.metrics-header-block {
  margin-bottom: 6px;
}

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

.title-with-badge {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: var(--brand-blue);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0, 71, 255, 0.2);
}

.section-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
}

.active-filter-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--brand-blue);
}

.badge-total-clients {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--brand-blue);
  background: var(--brand-blue-light);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

/* Filter Pills */
.filter-pills-container {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 2px 1px 5px;
  scrollbar-width: none;
}

.filter-pills-container::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  white-space: nowrap;
  padding: 4px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-body);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 3px;
}

.filter-pill.active {
  background: var(--brand-blue);
  color: #FFFFFF;
  border-color: var(--brand-blue);
  font-weight: 700;
}

.filter-pill.custom-pill svg {
  width: 10px;
  height: 10px;
}

/* 2-Column Metrics Grid */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.metric-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 7px 8px 6px;
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.metric-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-body);
}

.metric-icon-box {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon-box svg {
  width: 10px;
  height: 10px;
}

.metric-icon-box.blue { background: #EFF6FF; color: var(--brand-blue); }
.metric-icon-box.green { background: #ECFDF5; color: var(--brand-green-dark); }
.metric-icon-box.cyan { background: #F0F9FF; color: var(--brand-cyan); }
.metric-icon-box.red { background: #FEF2F2; color: var(--brand-danger); }
.metric-icon-box.purple { background: #F5F3FF; color: var(--brand-purple); }
.metric-icon-box.amber { background: #FFFBEB; color: var(--brand-warning); }

.card-body {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-bottom: 1px;
}

.metric-val {
  font-family: var(--font-digits);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.metric-curr {
  font-size: 0.56rem;
  font-weight: 600;
  color: var(--text-muted);
}

.card-footer-split {
  display: flex;
  justify-content: space-between;
  font-size: 0.56rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-subtle);
  padding-top: 2px;
}

.card-footer-note {
  font-size: 0.56rem;
  color: var(--text-muted);
  font-weight: 600;
}

.text-green { color: var(--brand-green-dark) !important; }
.text-cyan { color: #0284C7 !important; }
.text-red { color: var(--brand-danger) !important; }
.text-orange { color: #EA580C !important; }
.text-blue { color: var(--brand-blue) !important; }

/* ==========================================================================
   Transactions & Priorities Section
   ========================================================================== */
.transactions-section {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 10px 9px;
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-sm);
}

.tabs-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.trans-tabs {
  display: flex;
  gap: 3px;
  background: var(--bg-subtle);
  padding: 2px;
  border-radius: var(--radius-pill);
}

.trans-tab-btn {
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  transition: all var(--transition-fast);
}

.trans-tab-btn.active {
  background: #FFFFFF;
  color: var(--brand-blue);
  box-shadow: var(--shadow-sm);
}

.view-all-link {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--brand-blue);
}

.view-all-link svg {
  width: 11px;
  height: 11px;
}

.search-input-wrap {
  position: relative;
  margin-bottom: 7px;
}

.search-icon {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-subtle);
}

.search-input-wrap input {
  width: 100%;
  padding: 6px 30px 6px 10px;
  font-size: 0.74rem;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  outline: none;
  color: var(--text-main);
}

.search-input-wrap input:focus {
  border-color: var(--brand-blue);
  background: #FFFFFF;
}

/* Records Items */
.records-list-wrapper {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.record-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px;
  background: var(--bg-app);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.record-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  color: #FFFFFF;
  flex-shrink: 0;
}

.blue-avatar { background: var(--brand-blue); }
.purple-avatar { background: var(--brand-purple); }
.green-avatar { background: var(--brand-green); }

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

.record-primary {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 1px;
}

.client-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-tag {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.tag-danger { background: var(--brand-danger-light); color: var(--brand-danger); }
.tag-warning { background: var(--brand-warning-light); color: #B45309; }
.tag-orange { background: #FFF7ED; color: #EA580C; }
.tag-success { background: var(--brand-green-light); color: var(--brand-green-dark); }
.tag-cyan { background: var(--brand-cyan-light); color: #0284C7; }

.record-secondary {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.64rem;
  color: var(--text-muted);
}

.record-amount-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
}

.amount-val {
  font-family: var(--font-digits);
  font-size: 0.82rem;
  font-weight: 800;
}

.amount-cur {
  font-size: 0.58rem;
  color: var(--text-muted);
}

.danger-text { color: var(--brand-danger); }

.call-client-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #E0E7FF;
  color: var(--brand-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.call-client-btn svg {
  width: 11px;
  height: 11px;
}

/* ==========================================================================
   Dedicated Pages Top Bar & Summary Strip
   ========================================================================== */
.page-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sales-title-box {
  display: flex;
  flex-direction: column;
}

.page-top-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.page-top-sub {
  font-size: 0.6rem;
  color: var(--text-muted);
}

.back-btn, .icon-btn-mini {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.back-btn svg, .icon-btn-mini svg {
  width: 16px;
  height: 16px;
}

.btn-new-sale-header {
  background: var(--brand-blue);
  color: #FFFFFF;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 6px rgba(0, 71, 255, 0.3);
}

.btn-new-sale-header svg {
  width: 14px;
  height: 14px;
}

.collections-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-bottom: 8px;
}

.strip-card {
  padding: 5px 4px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.strip-card.green-bg { background: #ECFDF5; border: 1px solid #A7F3D0; }
.strip-card.red-bg { background: #FEF2F2; border: 1px solid #FECACA; }
.strip-card.blue-bg { background: #EFF6FF; border: 1px solid #BFDBFE; }
.strip-card.cyan-bg { background: #F0F9FF; border: 1px solid #BAE6FD; }
.strip-card.amber-bg { background: #FFFBEB; border: 1px solid #FDE68A; }

.strip-lbl { font-size: 0.56rem; color: var(--text-muted); font-weight: 600; }
.strip-val { font-size: 0.72rem; font-weight: 800; margin-top: 1px; }
.strip-card.green-bg .strip-val { color: var(--brand-green-dark); }
.strip-card.red-bg .strip-val { color: var(--brand-danger); }
.strip-card.blue-bg .strip-val { color: var(--brand-blue); }
.strip-card.cyan-bg .strip-val { color: #0284C7; }
.strip-card.amber-bg .strip-val { color: #D97706; }

/* Filter Pills in Sub-Pages */
.collection-filter-pills {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  margin-bottom: 8px;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.collection-filter-pills::-webkit-scrollbar {
  display: none;
}

.col-pill {
  padding: 4px 9px;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-body);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.col-pill.active {
  background: var(--brand-blue);
  color: #FFFFFF;
  border-color: var(--brand-blue);
}

.collection-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ==========================================================================
   PAGE 6: المبيعات والعقود (4 Stat Cards from Screenshot)
   ========================================================================== */
.sales-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.sales-stat-card {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.stat-card-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card-icon-wrap svg {
  width: 16px;
  height: 16px;
}

.gray-icon { background: #F1F5F9; color: #64748B; }
.orange-icon { background: #FFF7ED; color: #EA580C; }
.green-icon { background: #ECFDF5; color: var(--brand-green-dark); }
.pink-icon { background: #FDF2F8; color: #DB2777; }

.stat-card-info {
  display: flex;
  flex-direction: column;
}

.stat-card-lbl {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-card-val {
  font-family: var(--font-digits);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

/* Generic Card Styles for SPA Views */
.app-card-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 9px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.app-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.app-card-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-main);
}

.app-card-code {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-family: var(--font-digits);
  background: var(--bg-subtle);
  padding: 1px 5px;
  border-radius: 4px;
}

.app-card-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-app);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
}

.app-card-detail-col {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.app-card-detail-lbl {
  font-size: 0.58rem;
  color: var(--text-muted);
}

.app-card-detail-val {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-main);
}

.app-card-amount-box {
  text-align: left;
}

.app-card-amount {
  font-family: var(--font-digits);
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--brand-blue);
}

.app-card-actions {
  display: flex;
  gap: 5px;
  margin-top: 2px;
}

.btn-card-action-primary {
  flex: 1;
  background: var(--brand-blue);
  color: #FFFFFF;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-card-action-secondary {
  padding: 5px 8px;
  background: var(--bg-subtle);
  color: var(--text-body);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
}

/* ==========================================================================
   NEW SALE WIZARD & MODAL (Mobile First)
   ========================================================================== */
.modal-large {
  max-width: 410px;
  padding: 12px;
}

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge-contracts-plan {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--brand-green-dark);
  background: var(--brand-green-light);
  border: 1px solid #A7F3D0;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}

.sale-wizard-step {
  display: none;
}

.sale-wizard-step.active-step {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* Sale Type Selection (Step 1) */
.sale-types-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 0;
}

.sale-type-card {
  background: #FFFFFF;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.sale-type-card:hover {
  border-color: var(--brand-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.sale-type-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.sale-type-icon-box.purple { background: #F5F3FF; color: var(--brand-purple); }
.sale-type-icon-box.green { background: #ECFDF5; color: var(--brand-green-dark); }

.sale-type-icon-box svg {
  width: 22px;
  height: 22px;
}

.sale-type-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 3px;
}

.sale-type-sub {
  font-size: 0.62rem;
  color: var(--text-muted);
  line-height: 1.2;
  margin-bottom: 10px;
  min-height: 26px;
}

.btn-choose-type {
  width: 100%;
  background: var(--brand-blue);
  color: #FFFFFF;
  padding: 6px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
}

.btn-choose-type.green-btn {
  background: var(--brand-green-dark);
}

/* Wizard Header & Steps */
.wizard-top-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--border-subtle);
  padding-bottom: 6px;
}

.btn-change-type {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--brand-blue);
  background: #EFF6FF;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.active-mode-tag {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--brand-purple);
  background: var(--brand-purple-light);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.active-mode-tag.green-tag {
  color: var(--brand-green-dark);
  background: var(--brand-green-light);
}

.sale-step-box {
  background: #F8FAFC;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px;
  margin-bottom: 8px;
}

.sale-step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.step-title-with-num {
  display: flex;
  align-items: center;
  gap: 5px;
}

.step-num-badge {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-blue);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sale-step-title {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--text-main);
}

.manual-total-checkbox {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.62rem;
  color: var(--text-muted);
  cursor: pointer;
}

.customer-picker-row {
  display: flex;
  gap: 5px;
}

.btn-add-quick-client {
  background: #FFFFFF;
  border: 1px solid var(--brand-blue);
  color: var(--brand-blue);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.input-with-action {
  display: flex;
  gap: 4px;
}

.btn-input-mini-plus {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--brand-blue-light);
  color: var(--brand-blue);
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #BFDBFE;
}

.calc-box-display {
  padding: 6px 8px;
  background: #E2E8F0;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-main);
  text-align: center;
}

.btn-add-another-item {
  width: 100%;
  padding: 5px;
  border: 1px dashed #93C5FD;
  background: #EFF6FF;
  color: var(--brand-blue);
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 700;
  margin-top: 5px;
}

.checkbox-options-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.checkbox-label-styled {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-body);
  cursor: pointer;
}

/* Sale Summary Card */
.sale-summary-card {
  background: #EFF6FF;
  border: 1.5px solid #BFDBFE;
  border-radius: var(--radius-md);
  padding: 8px;
  margin-bottom: 8px;
}

.summary-card-header {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  color: var(--brand-blue);
  margin-bottom: 6px;
}

.summary-badge-icon {
  width: 16px;
  height: 16px;
  background: var(--brand-blue);
  color: #FFFFFF;
  border-radius: 50%;
  font-size: 0.6rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-details-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-body);
}

.summary-highlight-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FFFFFF;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid #93C5FD;
  margin-top: 4px;
}

.installment-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-main);
}

.installment-highlight {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.inst-val {
  font-family: var(--font-digits);
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--brand-blue);
}

.inst-unit {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
}

.btn-save-draft {
  padding: 7px 12px;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-body);
}

/* ==========================================================================
   Bottom Navigation
   ========================================================================== */
.curved-bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #FFFFFF;
  border-top: 1px solid var(--border-subtle);
  padding: 5px 8px 6px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 40;
}

.nav-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-muted);
  gap: 2px;
  padding: 2px 6px;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-tab-item.active {
  color: var(--brand-blue);
}

.nav-icon svg {
  width: 20px;
  height: 20px;
}

.nav-title {
  font-size: 0.62rem;
  font-weight: 700;
}

.active-dot {
  width: 4px;
  height: 4px;
  background: var(--brand-blue);
  border-radius: 50%;
  opacity: 0;
  position: absolute;
  bottom: -3px;
}

.nav-tab-item.active .active-dot {
  opacity: 1;
}

.center-fab-wrapper {
  position: relative;
  top: -14px;
}

.center-fab-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand-blue-gradient);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-fab);
  transition: transform var(--transition-fast);
}

.center-fab-btn:active {
  transform: scale(0.92);
}

.center-fab-btn svg {
  width: 22px;
  height: 22px;
}

.bottom-spacer {
  height: 52px;
}

/* ==========================================================================
   Sidebar Drawer (8 items matching exact screenshot)
   ========================================================================== */
.sidebar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  z-index: 150;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

.sidebar-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 78%;
  max-width: 290px;
  background: #FFFFFF;
  box-shadow: -8px 0 25px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  padding: 14px 10px;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  overflow-y: auto;
}

.sidebar-overlay.active .sidebar-drawer {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-brand-card {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.sidebar-app-name {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--brand-blue);
  line-height: 1.1;
}

.sidebar-app-sub {
  font-size: 0.58rem;
  color: var(--text-muted);
}

.sidebar-logo-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #EFF6FF;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid #BFDBFE;
}

.logo-text-mini {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--brand-blue);
}

.cal-mini {
  position: relative;
  width: 14px;
  height: 14px;
  color: var(--brand-blue);
}

.cal-check {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 0.45rem;
  background: var(--brand-green);
  color: #fff;
  border-radius: 50%;
  width: 7px;
  height: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-close-btn {
  font-size: 1.4rem;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-subtle);
}

.sidebar-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-body);
  transition: all var(--transition-fast);
  text-align: right;
  width: 100%;
}

.sidebar-nav-item:hover {
  background: #F1F5F9;
  color: var(--brand-blue);
}

.sidebar-nav-item.active-nav {
  background: var(--brand-blue);
  color: #FFFFFF;
}

.sidebar-nav-item.active-nav .sidebar-item-icon {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

.sidebar-item-icon {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-item-icon svg {
  width: 15px;
  height: 15px;
}

.sidebar-item-icon.blue { background: #EFF6FF; color: var(--brand-blue); }
.sidebar-item-icon.cyan { background: #F0F9FF; color: #0284C7; }
.sidebar-item-icon.teal { background: #F0FDFA; color: #0D9488; }
.sidebar-item-icon.purple { background: #FAF5FF; color: #9333EA; }
.sidebar-item-icon.violet { background: #F5F3FF; color: #7C3AED; }
.sidebar-item-icon.blue-alt { background: #EFF6FF; color: #2563EB; }
.sidebar-item-icon.green { background: #ECFDF5; color: var(--brand-green-dark); }
.sidebar-item-icon.amber { background: #FFFBEB; color: #D97706; }

/* ==========================================================================
   Quick Actions Bottom Sheet
   ========================================================================== */
.bottom-sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: flex-end;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.bottom-sheet-overlay.active {
  display: flex;
  opacity: 1;
}

.bottom-sheet-content {
  width: 100%;
  background: #FFFFFF;
  border-radius: 24px 24px 0 0;
  padding: 10px 14px 20px;
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

.bottom-sheet-overlay.active .bottom-sheet-content {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: #CBD5E1;
  border-radius: var(--radius-pill);
  margin: 0 auto 8px;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.sheet-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.sheet-close-btn {
  font-size: 1.3rem;
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-subtle);
}

.sheet-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.sheet-options-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sheet-option-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: right;
  transition: all var(--transition-fast);
  width: 100%;
}

.sheet-option-item:hover {
  background: var(--brand-blue-light);
  border-color: #BFDBFE;
}

.option-icon-box {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: #EFF6FF;
  color: var(--brand-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.option-icon-box svg {
  width: 16px;
  height: 16px;
}

.option-icon-box.green { background: #ECFDF5; color: var(--brand-green-dark); }
.option-icon-box.purple { background: #F5F3FF; color: var(--brand-purple); }
.option-icon-box.orange { background: #FFF7ED; color: var(--brand-orange); }

.option-texts {
  display: flex;
  flex-direction: column;
}

.option-texts strong {
  font-size: 0.8rem;
  color: var(--text-main);
}

.option-texts small {
  font-size: 0.62rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Full Modal Dialogs
   ========================================================================== */
.modal-dialog-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-dialog-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-dialog-card {
  width: 100%;
  max-width: 390px;
  max-height: 92vh;
  background: #FFFFFF;
  border-radius: 18px;
  padding: 12px;
  overflow-y: auto;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.modal-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 6px;
}

.modal-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.modal-subtitle {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.modal-close-icon {
  font-size: 1.3rem;
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-dialog-form {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

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

.label-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-main);
}

.link-btn {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--brand-blue);
  background: none;
  cursor: pointer;
}

.form-input {
  width: 100%;
  padding: 5px 8px;
  background: #F8FAFC;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  color: var(--text-main);
  outline: none;
}

.form-input:focus {
  border-color: var(--brand-blue);
  background: #FFFFFF;
}

.form-select {
  cursor: pointer;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.phone-input-wrap {
  display: flex;
  direction: ltr;
}

.phone-prefix {
  background: #E2E8F0;
  padding: 5px 5px;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-body);
  border: 1px solid var(--border-subtle);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.phone-field {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  text-align: left;
}

.radio-pill-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.radio-pill-label {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px 2px;
  background: #F8FAFC;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.6rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-body);
}

.radio-pill-label input {
  display: none;
}

.radio-pill-label:has(input:checked) {
  background: #EFF6FF;
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

.items-repeater-box {
  background: #F8FAFC;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px;
}

.repeater-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.repeater-title {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-add-item {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--brand-blue);
}

.item-entry-row {
  display: flex;
  gap: 4px;
}

.modal-footer-actions {
  display: flex;
  gap: 5px;
  margin-top: 4px;
}

.btn-submit-primary {
  flex: 1;
  background: var(--brand-blue);
  color: #FFFFFF;
  padding: 7px;
  border-radius: var(--radius-md);
  font-size: 0.76rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-submit-primary.green-btn {
  background: var(--brand-green-dark);
}

.btn-submit-primary svg {
  width: 14px;
  height: 14px;
}

.btn-cancel {
  padding: 7px 12px;
  background: var(--bg-subtle);
  color: var(--text-body);
  border-radius: var(--radius-md);
  font-size: 0.76rem;
  font-weight: 700;
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast-message {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(-60px);
  background: #0F172A;
  color: #FFFFFF;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  z-index: 250;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

.toast-message.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==========================================================================
   CUSTOMER DETAILS VIEW (تفاصيل العميل)
   ========================================================================== */
.cust-profile-card {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}

.cust-profile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-subtle);
}

.cust-info-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cust-profile-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.cust-profile-phone {
  font-family: var(--font-digits);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-blue);
  text-align: right;
}

.cust-profile-nid {
  font-size: 0.64rem;
  color: var(--text-muted);
}

.cust-profile-city {
  font-size: 0.64rem;
  color: var(--text-body);
  font-weight: 600;
}

.cust-score-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.credit-score-gauge {
  position: relative;
  width: 76px;
  height: 46px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.gauge-svg {
  width: 100%;
  height: 100%;
}

.gauge-number-wrap {
  position: absolute;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.gauge-val {
  font-family: var(--font-digits);
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--brand-blue);
}

.gauge-max {
  font-size: 0.48rem;
  color: var(--text-muted);
  font-weight: 600;
}

.gauge-badges-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.why-score-link {
  font-size: 0.55rem;
  color: var(--brand-blue);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

.cust-metrics-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 5px;
}

.cust-metric-box {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.cust-metric-lbl {
  font-size: 0.58rem;
  color: var(--text-muted);
  font-weight: 600;
}

.cust-metric-val {
  font-family: var(--font-digits);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 1px;
}

/* Customer Details Tabs */
.cust-tabs-header {
  display: flex;
  gap: 4px;
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-pill);
  padding: 3px;
  margin-bottom: 8px;
}

.cust-tab-btn {
  flex: 1;
  text-align: center;
  padding: 5px 8px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  transition: all var(--transition-fast);
}

.cust-tab-btn.active {
  background: var(--brand-blue);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.cust-tab-content {
  display: none;
}

.cust-tab-content.active-tab-content {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* Statement Card (كشف الحساب) */
.statement-card {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: var(--shadow-sm);
}

.statement-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.statement-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  background: var(--bg-app);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.st-date-type {
  display: flex;
  flex-direction: column;
}

.st-date {
  font-size: 0.58rem;
  color: var(--text-muted);
}

.st-type {
  font-size: 0.68rem;
  font-weight: 700;
}

.st-amount {
  font-family: var(--font-digits);
  font-size: 0.84rem;
  font-weight: 800;
}

.st-method {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 0.62rem;
  color: var(--text-muted);
}

.method-tag {
  background: #E2E8F0;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.56rem;
  font-weight: 600;
}

.statement-footer-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--text-main);
}

/* Follow-ups CRM (المتابعات) */
.followup-form-card {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 10px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}

.form-section-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.followup-log-section {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 10px;
  box-shadow: var(--shadow-sm);
}

.followup-list-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.followup-log-item {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.log-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.log-channel-badge {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--brand-blue);
  background: var(--brand-blue-light);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

.log-datetime {
  font-size: 0.58rem;
  color: var(--text-muted);
}

.log-result {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-main);
}

.log-note {
  font-size: 0.66rem;
  color: var(--text-muted);
}

/* ==========================================================================
   NOTIFICATIONS CENTER (مركز الإشعارات والتنبيهات)
   ========================================================================== */

.notif-badge-count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  color: #FFFFFF;
  border-radius: var(--radius-pill);
  font-size: 0.62rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #FFFFFF;
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
  animation: notifPulse 2.5s infinite;
}

@keyframes notifPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); box-shadow: 0 0 10px rgba(239, 68, 68, 0.6); }
}

.sidebar-badge-red {
  background: #FEE2E2;
  color: #DC2626;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  margin-right: auto;
}

.page-title-with-pill {
  display: flex;
  align-items: center;
  gap: 8px;
}

.unread-counter-badge {
  background: rgba(0, 71, 255, 0.1);
  color: var(--brand-blue);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 71, 255, 0.2);
}

.top-bar-right-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
}

.notif-settings-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  animation: slideDownFade 0.25s ease-out;
}

@keyframes slideDownFade {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.notif-settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.notif-settings-header h4 {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.settings-close-x {
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.notif-settings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-body);
  position: relative;
  padding: 4px 0;
}

.setting-toggle-row input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  width: 36px;
  height: 20px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  position: relative;
  transition: 0.3s;
  flex-shrink: 0;
}

.toggle-slider:before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 2px;
  background-color: #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: 0.3s;
}

.setting-toggle-row input:checked + .toggle-slider {
  background-color: var(--brand-blue);
  border-color: var(--brand-blue);
}

.setting-toggle-row input:checked + .toggle-slider:before {
  transform: translateX(16px);
}

.notif-quick-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0 6px;
  padding: 0 2px;
}

.notif-stream-lbl {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-muted);
}

.mark-all-read-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--brand-blue);
  background: rgba(0, 71, 255, 0.08);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.mark-all-read-btn svg {
  width: 12px;
  height: 12px;
}

.mark-all-read-btn:hover {
  background: rgba(0, 71, 255, 0.16);
}

/* Notifications Feed & Cards */
.notifications-feed-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.notif-timeline-header {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.notif-timeline-header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.notif-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  position: relative;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notif-card:active {
  transform: scale(0.995);
}

.notif-card.is-unread {
  background: linear-gradient(135deg, rgba(240, 246, 255, 0.95) 0%, #FFFFFF 100%);
  border-color: #BFDBFE;
  border-right: 3.5px solid var(--brand-blue);
  box-shadow: 0 4px 12px rgba(0, 71, 255, 0.06);
}

.notif-card-main-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.notif-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #FFFFFF;
}

.notif-icon-box svg {
  width: 18px;
  height: 18px;
}

.notif-icon-box.danger-grad {
  background: linear-gradient(135deg, #EF4444 0%, #B91C1C 100%);
  box-shadow: 0 3px 8px rgba(239, 68, 68, 0.3);
}

.notif-icon-box.success-grad {
  background: linear-gradient(135deg, #10B981 0%, #047857 100%);
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.3);
}

.notif-icon-box.warning-grad {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  box-shadow: 0 3px 8px rgba(245, 158, 11, 0.3);
}

.notif-icon-box.purple-grad {
  background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
  box-shadow: 0 3px 8px rgba(139, 92, 246, 0.3);
}

.notif-icon-box.cyan-grad {
  background: linear-gradient(135deg, #06B6D4 0%, #0891B2 100%);
  box-shadow: 0 3px 8px rgba(6, 182, 212, 0.3);
}

.notif-icon-box.blue-grad {
  background: linear-gradient(135deg, #0047FF 0%, #002BB8 100%);
  box-shadow: 0 3px 8px rgba(0, 71, 255, 0.3);
}

.notif-icon-box.emerald-grad {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 3px 8px rgba(5, 150, 105, 0.3);
}

.notif-content-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.notif-header-subrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.notif-cat-badge {
  font-size: 0.58rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

.notif-time-text {
  font-size: 0.58rem;
  color: var(--text-muted);
}

.notif-card-title {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.35;
  margin: 0;
}

.notif-card.is-unread .notif-card-title {
  color: #0F172A;
}

.notif-card-desc {
  font-size: 0.67rem;
  color: var(--text-body);
  line-height: 1.45;
  margin: 0;
}

.notif-card-dismiss {
  color: var(--text-muted);
  font-size: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

.notif-card-dismiss:hover {
  color: #EF4444;
}

.notif-actions-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 2px;
}

.btn-notif-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.64rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-notif-action.btn-primary-mini {
  background: var(--brand-blue);
  color: #FFFFFF;
}

.btn-notif-action.btn-primary-mini:hover {
  background: #0036CC;
}

.btn-notif-action.btn-whatsapp-mini {
  background: #25D366;
  color: #FFFFFF;
}

.btn-notif-action.btn-whatsapp-mini:hover {
  background: #1EBE5D;
}

.btn-notif-action.btn-secondary-mini {
  background: var(--bg-subtle);
  color: var(--text-body);
  border: 1px solid var(--border-subtle);
}

.btn-notif-action.btn-secondary-mini:hover {
  background: #E2E8F0;
}

.btn-notif-action svg {
  width: 12px;
  height: 12px;
}

.empty-notif-box {
  background: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 30px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.empty-notif-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-notif-icon svg {
  width: 24px;
  height: 24px;
}

.empty-notif-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.empty-notif-subtitle {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin: 0;
}

