[hidden] {
  display: none !important;
}

/* ============================================================================
   نظام التنسيقات الشامل لكافة موديولات النظام (GYM System Modules Complete CSS)
   ============================================================================ */

.system-page {
  min-height: 100vh;
  padding-bottom: 40px;
}

/* الشريط العلوي للموديول Topbar */
.system-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.system-topbar .eyebrow {
  margin: 0 0 4px;
  color: #9299b0;
  font-size: 13px;
  font-weight: 600;
}

.system-topbar h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.05em;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.system-topbar h1 span {
  color: #efb247;
  font-size: 18px;
}

.system-topbar .top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* شريط التبويبات الحديث (Modern Segmented Pill Tabs) */
.system-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #edf1f8;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid #dbe2ef;
  box-shadow: inset 0 1px 2px rgba(16, 21, 55, 0.04);
  margin-bottom: 16px;
}

.system-tab {
  flex: 0 0 auto;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #626e8c;
  padding: 8px 18px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.system-tab:hover:not(.active) {
  color: #151c3a;
  background: rgba(255, 255, 255, 0.65);
}

.system-tab.active {
  background: #182246;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(24, 34, 70, 0.22);
}

/* زر التحديث والإجراءات الناعمة (Soft Toolbar Buttons) */
.soft-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 11px;
  border: 1px solid #d9e1f0;
  background: #ffffff;
  color: #4a5472;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 21, 55, 0.04);
  transition: all 0.18s ease;
}

.soft-button:hover:not(:disabled) {
  background: #f5f8ff;
  border-color: #c0cde6;
  color: var(--sky);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(16, 21, 55, 0.08);
}

.soft-button:active:not(:disabled) {
  transform: translateY(0);
}

/* بطاقات المؤشرات KPIs */
.system-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.system-kpi {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 21, 55, 0.03), 0 10px 24px -8px rgba(16, 21, 55, 0.08);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.system-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -6px rgba(30, 41, 84, 0.14);
}

.system-kpi:before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3.5px;
  background: var(--tone, var(--sky));
}

.system-kpi span {
  display: block;
  color: #8f97ae;
  font-size: 13px;
  font-weight: 600;
}

.system-kpi strong {
  display: block;
  margin: 6px 0 2px;
  font-family: Manrope, sans-serif;
  font-size: 24px;
  letter-spacing: -0.06em;
  color: #151c3a;
}

.system-kpi small {
  display: block;
  color: #9ba3ba;
  font-size: 12px;
}

/* شريط الأدوات والبحث Toolbar */
.system-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.system-toolbar select,
.system-toolbar input[type="date"] {
  height: 42px;
  border: 1px solid #e0e5f0;
  border-radius: 11px;
  background: #fff;
  color: #56617c;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
  outline-color: var(--sky);
}

/* الألواح والشبكات Panels */
.system-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 21, 55, 0.03), 0 10px 24px -8px rgba(16, 21, 55, 0.08);
  margin-bottom: 18px;
}

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

.system-panel-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #151c3a;
}

.system-panel-head p {
  margin: 3px 0 0;
  color: #8f97ae;
  font-size: 13px;
}

.system-grid {
  display: grid;
  gap: 18px;
}

.system-grid.two {
  grid-template-columns: repeat(2, 1fr);
}

.system-grid.three {
  grid-template-columns: repeat(3, 1fr);
}

/* الجداول Tables */
.system-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 21, 55, 0.03), 0 10px 24px -8px rgba(16, 21, 55, 0.08);
  margin-bottom: 18px;
}

.invoices-assets-table-wrap .system-table-wrap {
  max-height: 360px;
  overflow-y: auto;
  overflow-x: auto;
  margin-bottom: 0;
  border-radius: 12px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.invoices-assets-table-wrap .system-table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.invoices-assets-table-wrap .system-table-wrap::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 6px;
}

.invoices-assets-table-wrap .system-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fafbfe;
  box-shadow: 0 1px 0 var(--line, #e8ecf4);
}

/* مربع جدول الحضور والخروج وحضور الموظفين — عرض 13 صف مع سكرول داخلي وترويسة ثابتة */
.attendance-table-wrap .system-table-wrap,
[data-att-table] .system-table-wrap,
[data-staff-att-table] .system-table-wrap {
  max-height: 700px;
  overflow-y: auto;
  overflow-x: auto;
  margin-bottom: 18px;
  border-radius: 18px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.attendance-table-wrap .system-table-wrap::-webkit-scrollbar,
[data-att-table] .system-table-wrap::-webkit-scrollbar,
[data-staff-att-table] .system-table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.attendance-table-wrap .system-table-wrap::-webkit-scrollbar-thumb,
[data-att-table] .system-table-wrap::-webkit-scrollbar-thumb,
[data-staff-att-table] .system-table-wrap::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 6px;
}

.attendance-table-wrap .system-table-wrap thead th,
[data-att-table] .system-table-wrap thead th,
[data-staff-att-table] .system-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fafbfe;
  box-shadow: 0 1px 0 var(--line, #e8ecf4);
}

/* مربع جدول المتدربين — عرض 7 صفوف مع سكرول داخلي وترويسة ثابتة */
.members-table-wrap {
  max-height: 580px;
  overflow-y: auto;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.members-table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.members-table-wrap::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 6px;
}

.members-table-wrap thead th,
.members-table-wrap th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fbfcff;
  box-shadow: 0 1px 0 #f0f2f7;
}

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

.system-table th {
  padding: 13px 16px;
  background: #fafbfe;
  color: #8c95ac;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}

.system-table td {
  padding: 13px 16px;
  border-top: 1px solid #f0f2f7;
  color: #4a5470;
  vertical-align: middle;
}

.system-table tr:hover td {
  background: #f8f9fe;
}

.system-empty {
  text-align: center;
  color: #8f97ae;
  padding: 32px 20px;
  font-size: 14px;
}

/* شارات الحالة Status Badges */
.system-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.system-status.ok {
  background: #e5f8ec;
  color: #2f9f61;
}

.system-status.warn {
  background: #fff4dd;
  color: #c78a1a;
}

.system-status.bad {
  background: #fff0f1;
  color: #d65363;
}

.system-status.info {
  background: var(--sky-soft);
  color: var(--sky);
}

/* شريط الإشغال Occupancy Bar */
.system-occupancy {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 130px;
}

.system-occupancy-bar {
  flex: 1;
  height: 8px;
  border-radius: 9px;
  background: #edf0f6;
  overflow: hidden;
}

.system-occupancy-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sky), #785cf5);
}

.system-occupancy small {
  white-space: nowrap;
  color: #68728b;
  font: 700 12px Manrope, sans-serif;
}

/* شارة البث المباشر Live Bar */
.system-live {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1f2a58, #304185);
  color: #fff;
  margin-bottom: 20px;
  box-shadow: 0 10px 24px rgba(31, 42, 88, 0.2);
}

.system-live i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #52c982;
  box-shadow: 0 0 0 4px rgba(82, 201, 130, 0.25);
  animation: pulseDot 1.4s infinite;
}

.system-live span {
  font-size: 14px;
  font-weight: 600;
}

.system-live strong {
  margin-right: 0;
  font-family: Manrope, sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #52c982;
  background: rgba(82, 201, 130, 0.16);
  padding: 2px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.system-live small {
  margin-right: auto;
  color: #b6c4ee;
  font-size: 13px;
}

/* ============================================================================
   نقطة البيع والمتجر والكافيه (Point of Sale - POS & Cafe)
   ============================================================================ */

.system-pos {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 20px;
  align-items: start;
  margin-top: 16px;
}

@media (max-width: 1120px) {
  .system-pos {
    grid-template-columns: 1fr;
  }
}

/* شريط التحكم والبحث والفلاتر (Catalog Toolbar) */
.pos-catalog-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  background: #ffffff;
  border: 1px solid #e2e8f5;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 2px 6px rgba(18, 25, 60, 0.03);
}

.pos-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pos-search-box {
  position: relative;
  flex: 1;
}

.pos-search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #8c9bb5;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.pos-search-input {
  width: 100%;
  padding: 11px 40px 11px 36px;
  border-radius: 11px;
  border: 1.5px solid #dce4f4;
  background: #fbfcfe;
  font-size: 13.5px;
  font-family: inherit;
  color: #172146;
  outline: none;
  transition: all 0.15s ease;
}

.pos-search-input:focus {
  border-color: var(--sky);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(75, 113, 255, 0.12);
}

.pos-search-clear {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: #e9effd;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #57688c;
  padding: 0;
  transition: all 0.15s ease;
}

.pos-search-clear:hover {
  background: #d8e4fc;
  color: #1a274c;
}

.pos-category-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.pos-category-pills::-webkit-scrollbar {
  display: none;
}

.pos-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid #e1e7f5;
  background: #f8faff;
  color: #556285;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.pos-cat-pill:hover {
  border-color: #b7caff;
  color: var(--sky);
  background: #f0f4ff;
}

.pos-cat-pill.active {
  background: var(--sky);
  color: #ffffff;
  border-color: var(--sky);
  box-shadow: 0 3px 10px rgba(75, 113, 255, 0.28);
}

.pos-cat-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.07);
  font-weight: 800;
}

.pos-cat-pill.active .pos-cat-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* شبكة الأصناف Product Cards */
.system-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.system-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 12px;
  border: 1.5px solid #e2e8f5;
  border-radius: 16px;
  background: #ffffff;
  text-align: right;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(18, 25, 60, 0.04);
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.18s ease, border-color 0.18s ease;
  user-select: none;
}

.system-tile:hover:not(.is-out-of-stock) {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -4px rgba(75, 113, 255, 0.18);
  border-color: #9cb5fa;
}

.system-tile:active:not(.is-out-of-stock) {
  transform: translateY(-1px) scale(0.98);
}

.system-tile.is-out-of-stock {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(0.6);
}

.system-tile-media {
  position: relative;
  width: 100%;
  height: 115px;
  border-radius: 11px;
  overflow: hidden;
  background: linear-gradient(135deg, #f2f5fb, #e8edf8);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.system-tile-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.system-tile:hover:not(.is-out-of-stock) .system-tile-media img {
  transform: scale(1.06);
}

.system-tile-hover-action {
  position: absolute;
  inset: 0;
  background: rgba(23, 33, 70, 0.55);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  border-radius: 11px;
  z-index: 3;
}

.system-tile-hover-action span {
  font-size: 12px;
  font-weight: 700;
}

.system-tile:hover:not(.is-out-of-stock) .system-tile-hover-action {
  opacity: 1;
}

.system-tile-icon-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #8b99b5;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #f7f9fd, #edf2fc);
  border: 1px dashed #d5ddf0;
  border-radius: 11px;
}

.system-tile:hover:not(.is-out-of-stock) .system-tile-icon-placeholder {
  background: linear-gradient(145deg, #eef4ff, #e3ecfc);
  color: var(--sky);
  border-color: #b3c5f7;
}

.system-tile-icon-placeholder svg {
  opacity: 0.85;
}

.system-tile-icon-placeholder span {
  font-size: 11px;
  font-weight: 700;
}

.system-tile-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  backdrop-filter: blur(6px);
  z-index: 4;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.system-tile-badge.ok {
  background: rgba(34, 150, 80, 0.92);
  color: #fff;
}

.system-tile-badge.warn {
  background: rgba(220, 140, 40, 0.92);
  color: #fff;
}

.system-tile-badge.bad {
  background: rgba(214, 70, 80, 0.92);
  color: #fff;
}

.system-tile-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0 2px 2px;
}

.system-tile-category {
  font-size: 11.5px;
  color: #8c97b0;
  font-weight: 600;
  margin-bottom: 2px;
}

.system-tile-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #151c3a;
  line-height: 1.4;
  margin-bottom: 8px;
  min-height: 36px;
}

.system-tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed #edf1f8;
}

.system-tile-price {
  font-family: Manrope, sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--sky);
}

.system-tile-cart-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 8px;
  background: #eef3ff;
  color: var(--sky);
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid #d7e2ff;
}

/* هيكل العمود الجانبي الموحد للسلة ولوحة طلبات التطبيق */
.system-pos-side-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.system-pos-side-tabs {
  display: flex;
  gap: 6px;
  background: #eef3fb;
  padding: 5px;
  border-radius: 13px;
}

.pos-side-tab-pill {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: #556285;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pos-side-tab-pill.active {
  background: #ffffff;
  color: #151d3b;
  box-shadow: 0 2px 8px rgba(18, 25, 60, 0.08);
}

.pos-pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
  background: #dce4f7;
  color: #324068;
}

.pos-pill-count.pulse {
  background: #e1552a;
  color: #fff;
  animation: appPulse 1.8s infinite;
}

@keyframes appPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.18);
  }
}

.system-pos-side-cards {
  display: flex;
  flex-direction: column;
}

.system-pos-side-cards aside.is-collapsed-tab {
  display: none !important;
}

/* سلة المشتريات التفاعلية POS Cart */
.system-cart {
  position: sticky;
  top: 20px;
  background: #ffffff;
  border: 2px solid #d0daf3;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 32px -4px rgba(18, 25, 60, 0.10), 0 2px 8px rgba(18, 25, 60, 0.04);
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.system-cart:hover,
.system-cart:focus-within {
  border-color: #9cb5fa;
  box-shadow: 0 14px 38px -4px rgba(75, 113, 255, 0.16);
}

.system-cart .system-panel-head {
  border-bottom: 1.5px solid #edf1fb;
  padding-bottom: 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.system-cart .system-panel-head h2 {
  font-size: 16.5px;
  font-weight: 800;
  color: #141b3a;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.pos-cart-clear-btn {
  background: #fdf2f2;
  color: #d6493f;
  border: 1px solid #f9d2cf;
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.pos-cart-clear-btn:hover {
  background: #fde8e7;
  color: #b83229;
}

.pos-cart-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 290px;
  overflow-y: auto;
  padding-right: 2px;
  margin: 10px 0;
}

.pos-cart-line-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: #f8faff;
  border: 1px solid #e7ecf7;
  border-radius: 10px;
  transition: border-color 0.15s ease;
}

.pos-cart-line-item:hover {
  border-color: #c7d5f8;
}

.pos-cart-line-main {
  flex: 1;
  min-width: 0;
}

.pos-cart-line-name {
  font-size: 13px;
  font-weight: 700;
  color: #172146;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.pos-cart-line-price {
  font-size: 11.5px;
  color: #7b88a8;
  font-weight: 600;
}

.pos-cart-line-stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #ffffff;
  border: 1px solid #d4def3;
  border-radius: 8px;
  padding: 2px;
}

.pos-cart-line-stepper button {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: #f0f4fc;
  color: #1c274c;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  padding: 0;
}

.pos-cart-line-stepper button:hover {
  background: var(--sky);
  color: #fff;
}

.pos-cart-line-stepper span {
  min-width: 22px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 800;
  color: #151d3b;
}

.pos-cart-line-total {
  font-size: 13.5px;
  font-weight: 800;
  color: #172146;
  font-family: Manrope, sans-serif;
  min-width: 50px;
  text-align: left;
}

.pos-cart-line-delete {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.pos-cart-line-delete:hover {
  background: #fee2e2;
  color: #dc2626;
}

.pos-cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 40px 14px;
  color: #8c97b2;
}

.pos-cart-empty svg {
  opacity: 0.5;
}

.pos-cart-empty p {
  font-size: 13.5px;
  font-weight: 700;
  margin: 0;
  color: #4b587d;
}

.pos-cart-empty small {
  font-size: 12px;
  color: #8c97b2;
}

.pos-cart-summary-box {
  border-top: 1.5px dashed #e2e8f5;
  padding-top: 14px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pos-cart-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.pos-cart-total-label {
  font-size: 14px;
  font-weight: 700;
  color: #4b587d;
}

.pos-cart-total-amount {
  font-size: 24px;
  font-weight: 800;
  color: #12193c;
  font-family: Manrope, sans-serif;
}

.pos-checkout-trigger-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pos-checkout-trigger-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
  filter: brightness(1.06);
}

.pos-checkout-trigger-btn:disabled {
  background: #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
  color: #64748b;
}

.pos-cart-details-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  margin-top: 4px;
  background: none;
  border: none;
  padding: 0;
}

.pos-cart-details-toggle:hover {
  color: var(--sky);
}

/* ألسنة التبديل الجانبية لنقطة البيع (السلة / فواتير اليوم / طلبات التطبيق) */
.system-pos-side-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  background: #f1f4fa;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid #e1e7f5;
}

.pos-side-tab-pill {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 4px;
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: #687494;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pos-side-tab-pill:hover {
  color: var(--sky);
}

.pos-side-tab-pill.active {
  background: #ffffff;
  color: #151d3b;
  box-shadow: 0 2px 8px rgba(18, 25, 60, 0.08);
}

.pos-pill-count {
  background: #e2e8f5;
  color: #334155;
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  font-family: Manrope, sans-serif;
}

.pos-side-tab-pill.active .pos-pill-count {
  background: var(--sky);
  color: #ffffff;
}

.pos-pill-count.pulse {
  background: #ef4444;
  color: #ffffff;
  animation: pulse 1.5s infinite;
}

.is-collapsed-tab {
  display: none !important;
}

/* لوحة فواتير ومبيعات اليوم المكتملة */
.system-today-invoices {
  position: sticky;
  top: 20px;
  background: #ffffff;
  border: 2px solid #d0daf3;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 32px -4px rgba(18, 25, 60, 0.10), 0 2px 8px rgba(18, 25, 60, 0.04);
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 380px;
  max-height: calc(100vh - 100px);
}

.system-today-invoices:hover {
  border-color: #9cb5fa;
  box-shadow: 0 14px 38px -4px rgba(75, 113, 255, 0.16);
}

.system-today-invoices .system-panel-head {
  border-bottom: 1.5px solid #edf1fb;
  padding-bottom: 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.system-today-invoices .system-panel-head h2 {
  font-size: 16px;
  font-weight: 800;
  color: #141b3a;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.today-invoices-badge {
  font-size: 11.5px;
  font-weight: 800;
  color: #1e40af;
  background: #e0edff;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: Manrope, sans-serif;
}

.today-invoices-summary-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #f0f7ff, #e8f2fe);
  border: 1.5px solid #c7dcfd;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.today-invoices-summary-banner .stat-label {
  font-size: 11.5px;
  color: #5a6e92;
  font-weight: 600;
  display: block;
}

.today-invoices-summary-banner .stat-value {
  font-size: 16px;
  font-weight: 800;
  color: #1e40af;
  font-family: Manrope, sans-serif;
}

.today-invoices-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
  padding-left: 2px;
  padding-right: 2px;
}

.today-invoice-card {
  border: 1.5px solid #e2e8f7;
  border-radius: 12px;
  background: #fbfcfe;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s ease;
}

.today-invoice-card:hover {
  border-color: #b8cbfc;
  box-shadow: 0 4px 12px rgba(22, 33, 76, 0.06);
}

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

.today-invoice-num {
  font-size: 13px;
  font-weight: 800;
  color: #1e293b;
  font-family: Manrope, sans-serif;
}

.today-invoice-time {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 600;
}

.today-invoice-cust {
  font-size: 12px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 5px;
}

.today-invoice-items {
  background: #f1f5f9;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11.5px;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.today-invoice-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
}

.today-invoice-total {
  font-size: 14px;
  font-weight: 800;
  color: var(--sky, #2563eb);
  font-family: Manrope, sans-serif;
}

.today-invoice-reprint-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
  transition: all 0.15s ease;
}

.today-invoice-reprint-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  transform: translateY(-1px);
}

/* نافذة إدارة الفئات والتصنيفات */
.category-mgmt-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  margin-top: 14px;
  padding-left: 2px;
  padding-right: 2px;
}

.category-mgmt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #fbfcfe;
  border: 1.5px solid #e2e8f7;
  border-radius: 12px;
  transition: all 0.15s ease;
}

.category-mgmt-row:hover {
  border-color: #b8cbfc;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(18, 25, 60, 0.05);
}

.category-mgmt-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-mgmt-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #eef4ff;
  color: var(--sky, #2563eb);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.category-mgmt-name {
  font-size: 14px;
  font-weight: 800;
  color: #151d3b;
}

.category-mgmt-badge {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  background: #e2e8f0;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: Manrope, sans-serif;
}

.category-mgmt-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.category-add-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px;
  background: #f1f5f9;
  border-radius: 12px;
  margin-bottom: 8px;
}

.category-add-input {
  flex: 1;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: #ffffff;
}

.category-add-input:focus {
  border-color: var(--sky);
}

/* لوحة تأكيد طلبات المتدربين من التطبيق */
.system-app-orders {
  position: sticky;
  top: 20px;
  background: #ffffff;
  border: 2px solid #d0daf3;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 32px -4px rgba(18, 25, 60, 0.10), 0 2px 8px rgba(18, 25, 60, 0.04);
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 380px;
  max-height: calc(100vh - 100px);
}

.system-app-orders:hover {
  border-color: #9cb5fa;
  box-shadow: 0 14px 38px -4px rgba(75, 113, 255, 0.16);
}

.system-app-orders .system-panel-head {
  border-bottom: 1.5px solid #edf1fb;
  padding-bottom: 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.system-app-orders .system-panel-head h2 {
  font-size: 16px;
  font-weight: 800;
  color: #141b3a;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.app-orders-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.app-orders-btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #d9e2f5;
  background: #f7f9fd;
  color: #4b587d;
  transition: all 0.15s ease;
}

.app-orders-btn-pill:hover {
  background: #eef3ff;
  color: var(--sky);
  border-color: #b9ccfb;
}

.app-orders-tabs-row {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  background: #f1f4fa;
  padding: 4px;
  border-radius: 10px;
}

.app-orders-tab-btn {
  flex: 1;
  text-align: center;
  padding: 6px 4px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: #687494;
  cursor: pointer;
  transition: all 0.15s ease;
}

.app-orders-tab-btn.active {
  background: #ffffff;
  color: #151d3b;
  box-shadow: 0 2px 6px rgba(18, 25, 60, 0.08);
}

.app-orders-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex: 1;
  padding-left: 2px;
  padding-right: 2px;
}

.app-order-card {
  border: 1.5px solid #e2e8f7;
  border-radius: 14px;
  background: #fbfcfe;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.app-order-card:hover {
  border-color: #b8cbfc;
  box-shadow: 0 4px 14px rgba(22, 33, 76, 0.06);
}

.app-order-card.is-pending {
  border-color: #fed7aa;
  background: #fffdfa;
}

.app-order-card.is-confirmed {
  border-color: #bbf7d0;
  background: #fafdfb;
}

.app-order-card.is-rejected {
  border-color: #fecaca;
  background: #fefafa;
}

.app-order-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.app-order-num {
  font-size: 13px;
  font-weight: 800;
  color: #172146;
  font-family: Manrope, sans-serif;
}

.app-order-time {
  font-size: 11.5px;
  color: #8c97b2;
  font-weight: 600;
}

.app-order-member-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid #eef2f9;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #2a3456;
}

.app-order-member-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #eef3ff;
  color: var(--sky);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-order-items-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
}

.app-order-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #4a5574;
}

.app-order-item-name {
  font-weight: 600;
}

.app-order-notes {
  font-size: 12px;
  color: #8c6b2d;
  background: #fef9ed;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 6px 10px;
  line-height: 1.4;
}

.app-order-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px dashed #e5ebf8;
  padding-top: 8px;
  margin-top: 2px;
}

.app-order-total {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  color: #586482;
}

.app-order-total strong {
  font-size: 15px;
  color: #172146;
  font-family: Manrope, sans-serif;
  font-weight: 800;
}

.app-order-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.app-order-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.app-order-btn.confirm {
  background: #2f9f61;
  color: #fff;
  box-shadow: 0 2px 6px rgba(47, 159, 97, 0.25);
}

.app-order-btn.confirm:hover:not(:disabled) {
  background: #25834f;
  transform: translateY(-1px);
}

.app-order-btn.reject {
  background: #fdf2f2;
  color: #d6493f;
  border: 1px solid #f9d2cf;
}

.app-order-btn.reject:hover:not(:disabled) {
  background: #fde8e7;
  color: #b83229;
}

.app-order-btn.print {
  background: #f1f4fb;
  color: #384569;
  border: 1px solid #d4def3;
}

.app-order-btn.print:hover:not(:disabled) {
  background: #e5ecfa;
  color: #1d2849;
}

.app-orders-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 36px 16px;
  color: #8c97b2;
  font-size: 13px;
}

.app-orders-empty svg {
  opacity: 0.5;
  margin-bottom: 4px;
}

/* نافذة التشيك أوت والدفع المنبثقة Checkout Payment Modal */
/* إخفاء أسهم الزيادة والنقصان في كافة حقول الأرقام داخل نقطة البيع والنافذة */
.system-pos input[type="number"]::-webkit-outer-spin-button,
.system-pos input[type="number"]::-webkit-inner-spin-button,
.pos-checkout-backdrop input[type="number"]::-webkit-outer-spin-button,
.pos-checkout-backdrop input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

.system-pos input[type="number"],
.pos-checkout-backdrop input[type="number"] {
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}

/* نافذة التشيك أوت والدفع المنبثقة Checkout Payment Modal */
.pos-checkout-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 17, 43, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: posFadeIn 0.18s ease-out;
}

@keyframes posFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.pos-checkout-dialog {
  background: #ffffff;
  border-radius: 20px;
  width: 100%;
  max-width: 500px;
  min-height: 560px;
  box-shadow: 0 24px 60px rgba(10, 15, 45, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: posScaleUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes posScaleUp {
  from {
    transform: scale(0.96);
    opacity: 0;
  }

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

.pos-checkout-header {
  padding: 16px 22px;
  border-bottom: 1.5px solid #edf1fb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pos-checkout-header h3 {
  font-size: 17px;
  font-weight: 800;
  color: #141b3a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pos-checkout-close {
  background: #f1f4fb;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  transition: all 0.15s ease;
}

.pos-checkout-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.pos-checkout-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  overflow-y: auto;
}

.pos-checkout-banner {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #ffffff;
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pos-checkout-due-label {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

.pos-checkout-due-sub {
  font-size: 12px;
  color: #cbd5e1;
}

.pos-checkout-due-amount {
  font-size: 28px;
  font-weight: 800;
  color: #38bdf8;
  font-family: Manrope, sans-serif;
  line-height: 1.1;
}

.pos-checkout-method-tabs {
  display: flex;
  gap: 8px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
}

.pos-checkout-method-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: 13.5px;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pos-checkout-method-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* شبكة أزرار فئات الكاش المتساوية تماماً في الحجم */
.pos-quick-bills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.pos-quick-bill-btn {
  height: 40px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1.5px solid #d4def3;
  background: #ffffff;
  font-size: 13px;
  font-weight: 800;
  color: #334155;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.15s ease;
  font-family: Manrope, sans-serif;
  user-select: none;
}

.pos-quick-bill-btn:hover {
  border-color: #3b82f6;
  color: #2563eb;
  background: #eff6ff;
}

.pos-quick-bill-btn.exact {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.pos-quick-bill-btn.exact:hover {
  background: #dbeafe;
}

.pos-quick-bill-btn.clear {
  background: #fff1f2;
  color: #e11d48;
  border-color: #fecdd3;
}

.pos-quick-bill-btn.clear:hover {
  background: #ffe4e6;
}

/* بطاقات المبالغ (المستلم والباقي) متطابقة الحجم تماماً */
.pos-amounts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pos-amount-card {
  border: 1.5px solid #d4def3;
  border-radius: 14px;
  padding: 10px 14px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  height: 78px;
  justify-content: center;
}

.pos-amount-card.interactive:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.pos-amount-card.readonly {
  background: #f8faff;
}

.pos-amount-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
}

.pos-amount-input-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.pos-amount-input {
  border: none !important;
  background: transparent !important;
  outline: none !important;
  font-family: Manrope, sans-serif !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

.pos-amount-unit {
  font-size: 12px;
  font-weight: 800;
  color: #8c9bb5;
  user-select: none;
}

.pos-amount-display {
  font-family: Manrope, sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #15803d;
  line-height: 1.2;
}

/* شريط التنبيه والحساب اللحظي للباقي */
.pos-change-box {
  padding: 13px 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.pos-change-box.ok {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  color: #15803d;
}

.pos-change-box.warn {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  color: #b91c1c;
}

.pos-change-box strong {
  font-size: 18px;
  font-family: Manrope, sans-serif;
  font-weight: 800;
}

/* صندوق الدفع بالبطاقة الإلكترونية (مطابق بالارتفاع لقسم الكاش لمنع قفز الحجم) */
.pos-card-placeholder-box {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 14px;
  padding: 24px 20px;
  color: #166534;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  min-height: 220px;
}

.pos-checkout-footer {
  padding: 16px 22px;
  border-top: 1.5px solid #edf1fb;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pos-checkout-submit-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: #16a34a;
  color: #ffffff;
  border: none;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
  transition: all 0.15s ease;
}

.pos-checkout-submit-btn:hover:not(:disabled) {
  background: #15803d;
  transform: translateY(-1px);
}

.pos-checkout-submit-btn:disabled {
  background: #cbd5e1 !important;
  color: #64748b !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  transform: none !important;
}

.system-cart .system-panel-head {
  border-bottom: 1px solid #f0f2f7;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.system-cart-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f2f7;
}

.system-cart-line strong {
  font-size: 13px;
  color: #27314e;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-cart-line span {
  font-family: Manrope, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #151c3a;
}

.system-qty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.system-qty button {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f8f9fe;
  color: #27314e;
  font-size: 14px;
  font-weight: bold;
  display: grid;
  place-items: center;
  transition: all 0.12s ease;
}

.system-qty button:hover {
  background: var(--sky-soft);
  border-color: #c7d2ff;
  color: var(--sky);
}

.system-qty span {
  font-family: Manrope, sans-serif;
  font-size: 13px;
  font-weight: 800;
  min-width: 18px;
  text-align: center;
}

.system-cart * {
  box-sizing: border-box;
}

.system-cart label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #4a5470;
  min-width: 0;
  width: 100%;
}

.system-cart select,
.system-cart input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  height: 42px;
  border: 1px solid #e0e5f0;
  border-radius: 10px;
  background: #fbfcff;
  padding: 0 12px;
  font-family: inherit;
  font-size: 13px;
  color: #1b2440;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.system-cart select:focus,
.system-cart input:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(88, 129, 245, 0.15);
  background: #fff;
}

.system-cart input:disabled {
  background: #f4f6fb;
  color: #556285;
  border-color: #e4e9f3;
  cursor: not-allowed;
  font-weight: 700;
}

.system-cart .system-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 10px;
  width: 100%;
  min-width: 0;
}

.quick-cash-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 10px;
  width: 100%;
  min-width: 0;
}

.quick-cash-btn {
  padding: 8px 0;
  border: 1px solid #e0e5f0;
  border-radius: 8px;
  background: #f8f9fe;
  color: #3b4668;
  font-family: Manrope, sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 0;
}

.quick-cash-btn:hover {
  background: var(--sky-soft);
  color: var(--sky);
  border-color: #c7d2ff;
}

.system-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #f4f6fc;
  border: 1px solid #e8ecf6;
}

.system-total span:first-child {
  font-size: 15px;
  font-weight: 700;
  color: #3b4668;
}

.system-total span:last-child {
  font-family: Manrope, sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--sky);
}

/* ============================================================================
   بطاقات الأجهزة (Equipment Cards)
   ============================================================================ */

.system-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.system-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(16, 21, 55, 0.04), 0 8px 20px -6px rgba(16, 21, 55, 0.07);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.system-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px -6px rgba(30, 41, 84, 0.16);
}

.system-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 800;
  color: #151c3a;
}

.system-card p {
  margin: 0 0 12px;
  color: #8f97ae;
  font-size: 13px;
}

.system-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f0f2f7;
}

.system-price {
  font-family: Manrope, sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--sky);
}

.system-card.equipment-card {
  padding: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 18px !important;
}

.equipment-card-image-wrap {
  width: 100%;
  height: 150px;
  background: #f8fafc;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #edf2f7;
}

.equipment-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.28s ease;
}

.system-card.equipment-card:hover .equipment-card-img {
  transform: scale(1.05);
}

.equipment-card-img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
  color: #94a3b8;
  gap: 6px;
}

.equipment-card-img-placeholder span {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}

.equipment-card-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.equipment-card-body h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 800;
  color: #151c3a;
}

.equipment-card-body p {
  margin: 0 0 10px;
  color: #8f97ae;
  font-size: 13px;
}

.equipment-upload-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  position: relative;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.equipment-upload-dropzone:hover {
  border-color: #3b82f6 !important;
  background: #f0f7ff !important;
}

/* ============================================================================
   بطاقات الكلاسات والأنشطة (Class Cards & Roster Grid)
   ============================================================================ */

.class-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 14px;
}

.class-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(16, 21, 55, 0.04), 0 8px 20px -6px rgba(16, 21, 55, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
  position: relative;
}

.class-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px -6px rgba(30, 41, 84, 0.14);
  border-color: #cbd5e1;
}

.class-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.class-card-title-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.class-card-title-group h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #151c3a;
}

.class-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.class-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
}

.class-card-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.class-card-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
}

.class-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #475569;
}

.class-meta-row svg {
  color: #64748b;
  flex-shrink: 0;
}

.class-meta-row strong {
  color: #1e293b;
}

.class-occupancy-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.class-occupancy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
}

.class-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
  gap: 10px;
}

.class-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  cursor: pointer;
  transition: all 0.18s ease;
}

.class-card:hover .class-view-btn {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}

/* Modal details styling */
.class-roster-overview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
  background: #f8fafc;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #edf2f7;
}

.class-roster-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.class-roster-metric span {
  font-size: 11.5px;
  color: #64748b;
}

.class-roster-metric strong {
  font-size: 13.5px;
  color: #1e293b;
}

.class-member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #edf2f7;
  border-radius: 12px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.class-member-item:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

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

.class-member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #2563eb;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.class-member-details {
  display: flex;
  flex-direction: column;
}

.class-member-details strong {
  font-size: 13.5px;
  color: #1e293b;
}

.class-member-details span {
  font-size: 11.5px;
  color: #64748b;
  font-family: Manrope, monospace;
}

/* بطاقات الجلسات الخاصة والفعاليات */
.session-finance-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  text-align: center;
}

.session-finance-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.session-finance-item span {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

.session-finance-item strong {
  font-size: 13.5px;
  font-weight: 800;
  color: #1e293b;
  font-family: Manrope, sans-serif;
}

.event-winner-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px solid #fde68a;
  border-radius: 12px;
}

.event-winner-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #fef3c7;
  color: #b45309;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ============================================================================
   بطاقات المفقودات والمعثورات (Lost & Found Cards)
   ============================================================================ */

.lost-found-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

.lost-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(16, 21, 55, 0.04), 0 8px 20px -6px rgba(16, 21, 55, 0.07);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.lost-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px -6px rgba(30, 41, 84, 0.14);
  border-color: #cbd5e1;
}

.lost-card.is-delivered {
  background: #fbfcfd;
  border-color: #e2e8f0;
}

.lost-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lost-card-ref {
  font-family: Manrope, monospace;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  padding: 3px 9px;
  border-radius: 8px;
  letter-spacing: 0.04em;
  direction: ltr;
}

.lost-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.lost-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lost-card-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #151c3a;
  line-height: 1.35;
}

.lost-card-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #64748b;
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: 10px;
  border-right: 3px solid #cbd5e1;
  word-break: break-word;
}

.lost-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-top: 4px;
}

.lost-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #475569;
  min-width: 0;
}

.lost-meta-item.full-width {
  grid-column: 1 / -1;
}

.lost-meta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8b93ad;
  flex-shrink: 0;
}

.lost-meta-val {
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lost-card-delivery-info {
  margin-top: 4px;
  padding: 8px 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #166534;
  font-weight: 600;
}

.lost-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid #f0f2f7;
}

.lost-card-btn-claim {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.22);
}

.lost-card-btn-claim:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.32);
}

.lost-card-btn-details {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  background: #f8f9fd;
  color: #475569;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.lost-card-btn-details:hover {
  background: #edf1f8;
  color: #1e293b;
}

.lf-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 700;
}

.lf-type-pill.found {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.lf-type-pill.lost {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

/* --- Lost & Found Searchable Dropdown --- */
.lost-searchable-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lost-searchable-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.lost-searchable-input {
  width: 100% !important;
  height: 44px !important;
  padding: 0 42px 0 14px !important;
  border: 1px solid #dfe4ef !important;
  border-radius: 11px !important;
  background: #fbfcff !important;
  color: #151c3a !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  font-family: inherit !important;
  outline: none !important;
  box-sizing: border-box !important;
  direction: rtl !important;
  text-align: right !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease !important;
}

.lost-searchable-input:focus {
  border-color: #3b82f6 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12) !important;
}

.lost-searchable-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: #64748b;
  transition: transform 0.2s ease;
}

.lost-searchable-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  max-height: 230px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #dfe4ef;
  border-radius: 12px;
  box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.14), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
  z-index: 10000;
  direction: rtl;
}

.lost-member-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.12s ease;
}

.lost-member-option:hover {
  background: #eff6ff;
}

.lost-member-option:last-child {
  border-bottom: none;
}

.lost-member-option-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
}

.lost-member-option-phone {
  font-size: 12px;
  color: #64748b;
  font-family: monospace;
  direction: ltr;
}

.lost-member-empty {
  padding: 12px 14px;
  font-size: 13px;
  color: #64748b;
  text-align: center;
}

.lost-empty-panel {
  text-align: center;
  padding: 42px 24px;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.lost-empty-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.lost-empty-panel h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #1e293b;
}

.lost-empty-panel p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  max-width: 320px;
}

/* دليل الحسابات COA Tree */
.system-account-tree {
  display: grid;
  gap: 6px;
}

.system-account.acc-row {
  display: grid;
  grid-template-columns: 1fr 120px 90px 140px 90px;
  align-items: center;
  padding: 11px 16px;
  border-top: 1px solid #f0f2f7;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.system-account.acc-row:hover {
  background: #f8f9fd;
}

.system-account b {
  font: 700 14px Manrope, sans-serif;
}

/* شريط التقدم Progress */
.system-progress-list {
  display: grid;
  gap: 11px;
}

.system-progress-row {
  display: grid;
  grid-template-columns: 140px minmax(80px, 1fr) 90px;
  gap: 10px;
  align-items: center;
  color: #68728b;
  font-size: 13px;
}

.system-progress {
  height: 8px;
  border-radius: 9px;
  background: #edf0f6;
  overflow: hidden;
}

.system-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sky), #785cf5);
}

.system-progress-row b {
  text-align: left;
  color: #26304d;
  font: 700 13px Manrope, sans-serif;
}

/* تقييم النجوم */
.rating-stars {
  display: inline-flex;
  gap: 3px;
  font-size: 16px;
  color: #e8a541;
}

/* نافذة الحوار الموحدة System Form Modal */
.system-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 22, 49, 0.42);
  backdrop-filter: blur(3px);
}

.system-dialog {
  position: fixed;
  z-index: 10001;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 25px 65px rgba(15, 22, 49, 0.24);
}

.system-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.system-dialog-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.system-dialog-head .eyebrow {
  margin: 0 0 3px;
  font-size: 13px;
  color: #8f97ae;
}

.system-dialog-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #788198;
  font-size: 18px;
  cursor: pointer;
}

.system-form {
  display: grid;
  gap: 14px;
}

.system-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #4a5470;
}

.system-form input,
.system-form select {
  height: 42px;
  border: 1px solid #e0e5f0;
  border-radius: 10px;
  background: #fbfcff;
  padding: 0 12px;
  font-size: 14px;
  outline-color: var(--sky);
}

.system-form textarea {
  min-height: 80px;
  border: 1px solid #e0e5f0;
  border-radius: 10px;
  background: #fbfcff;
  padding: 10px 12px;
  font-size: 14px;
  outline-color: var(--sky);
  resize: vertical;
}

.system-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.system-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.danger-button {
  border: 1px solid #ffd6d9;
  border-radius: 10px;
  background: #fff0f1;
  color: #d65363;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}

.danger-button:hover {
  background: #ffe3e6;
  border-color: #fca5a5;
}

/* منطقة رفع الصور File Upload Zone */
.system-file-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border: 2px dashed #cfd7e6;
  border-radius: 14px;
  background: #f8faff;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  margin-top: 4px;
  min-height: 110px;
}

.system-file-drop:hover {
  border-color: var(--sky);
  background: #f0f4ff;
}

.system-file-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #626e8c;
}

.system-file-preview svg {
  color: var(--sky);
}

.system-file-preview p {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: #27314e;
}

.system-file-preview small {
  font-size: 11.5px;
  color: #8a94ac;
}

.system-file-img-preview {
  max-width: 100%;
  max-height: 150px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(16, 21, 55, 0.1);
}

.system-file-remove-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 8px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #fca5a5;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.15s ease;
}

.system-file-remove-btn:hover {
  background: #fecaca;
  color: #991b1b;
}

/* بطاقة تفاصيل الصنف / المنتج */
.product-detail-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: right;
}

.product-detail-img-wrap {
  width: 100%;
  max-height: 240px;
  border-radius: 14px;
  overflow: hidden;
  background: #f4f6fa;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
}

.product-detail-img-wrap img {
  width: 100%;
  height: 100%;
  max-height: 240px;
  object-fit: cover;
}

.product-detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.product-detail-stat {
  background: #f8faff;
  border: 1px solid #e2e8f5;
  border-radius: 12px;
  padding: 10px 14px;
}

.product-detail-stat span {
  font-size: 11.5px;
  color: #7b87a0;
  display: block;
}

.product-detail-stat strong {
  font-size: 15.5px;
  color: #172146;
  font-weight: 800;
  display: block;
  margin-top: 3px;
}

/* تنسيق أزرار تفاصيل الصنف المتناسقة */
.product-detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid #edf1f8;
  flex-wrap: wrap;
}

.product-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-detail-edit,
.btn-detail-delete,
.btn-detail-close,
.btn-detail-add {
  height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.btn-detail-edit {
  background: #f0f4ff;
  color: #3b5bdb;
  border: 1px solid #d0deff;
}

.btn-detail-edit:hover {
  background: #e2ecff;
  border-color: #b5ceff;
  transform: translateY(-1px);
}

.btn-detail-delete {
  background: #fff0f1;
  color: #d63031;
  border: 1px solid #ffd1d5;
}

.btn-detail-delete:hover {
  background: #ffe3e6;
  border-color: #fca5a5;
  transform: translateY(-1px);
}

.btn-detail-close {
  background: #f4f6fa;
  color: #556285;
  border: 1px solid #e1e6f0;
}

.btn-detail-close:hover {
  background: #e8ecf4;
  color: #27314e;
}

.btn-detail-add {
  background: var(--sky, #4b71ff);
  color: #ffffff;
  border: 1px solid var(--sky, #4b71ff);
  font-weight: 800;
  padding: 0 20px;
  box-shadow: 0 4px 12px rgba(75, 113, 255, 0.25);
}

.btn-detail-add:hover:not(:disabled) {
  background: #395bd9;
  border-color: #395bd9;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(75, 113, 255, 0.35);
}

.btn-detail-add:disabled {
  background: #cbd2e1;
  border-color: #cbd2e1;
  color: #7b87a0;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* منشئ الوصفات والمكونات Recipe Builder */
.recipe-builder {
  background: #f8faff;
  border: 1px solid #e2e8f5;
  border-radius: 14px;
  padding: 14px;
  margin-top: 10px;
  text-align: right;
}

.recipe-builder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.recipe-builder-head h4 {
  margin: 0;
  font-size: 13.5px;
  color: #172146;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.recipe-builder-head small {
  font-size: 11.5px;
  color: #7b87a0;
}

.recipe-row {
  display: grid;
  grid-template-columns: 1fr 120px 38px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.recipe-row select,
.recipe-row input {
  height: 38px !important;
  font-size: 13px !important;
  border-radius: 8px !important;
}

.recipe-remove-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #fff0f1;
  color: #d63031;
  border: 1px solid #ffd1d5;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 15px;
  font-weight: bold;
  transition: all 0.15s ease;
}

.recipe-remove-btn:hover {
  background: #ffe3e6;
  border-color: #fca5a5;
}

.recipe-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #edf2ff;
  color: #3b5bdb;
  border: 1px dashed #bac8ff;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  transition: all 0.15s ease;
}

.recipe-add-btn:hover {
  background: #dbe4ff;
  border-color: #748ffc;
}

.product-ingredients-list {
  background: #f8faff;
  border: 1px solid #e2e8f5;
  border-radius: 12px;
  padding: 12px;
  margin-top: 4px;
  text-align: right;
}

.product-ingredients-list h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #3b486a;
  font-weight: 700;
}

.product-ingredient-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #dce4f2;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12.5px;
  color: #172146;
  margin: 3px 4px 3px 0;
}

.product-ingredient-tag strong {
  color: var(--sky, #4b71ff);
}

/* مراجعة التغييرات وتأكيد الحذف Change Summary & Delete Confirmation */
.change-summary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8faff;
  border: 1px solid #e2e8f5;
  border-radius: 12px;
  padding: 14px;
  margin: 12px 0;
  text-align: right;
}

.change-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed #e4e9f5;
}

.change-summary-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.change-field {
  font-size: 13px;
  font-weight: 700;
  color: #3b486a;
}

.change-diff {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  direction: ltr;
}

.change-diff del {
  color: #d6493f;
  background: #fdeceb;
  padding: 2px 6px;
  border-radius: 6px;
  text-decoration: line-through;
}

.change-diff ins {
  color: #2f9f61;
  background: #eaf8f0;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
}

.change-arrow {
  color: #8f97ae;
  font-weight: bold;
}

.danger-confirm-card {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 12px;
  padding: 14px;
  margin: 12px 0;
  color: #c53030;
  text-align: right;
}

.danger-confirm-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: #9b2c2c;
  font-weight: 800;
}

.danger-confirm-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

/* مؤشر التحميل Spinner */
.system-loading {
  display: grid;
  place-items: center;
  min-height: 180px;
  text-align: center;
  color: #8f97ae;
}

.system-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid #e4e9f5;
  border-top-color: var(--sky);
  border-radius: 50%;
  animation: systemSpin 0.8s linear infinite;
  margin-bottom: 10px;
}

@keyframes systemSpin {
  to {
    transform: rotate(360deg);
  }
}

/* كاش الجرد اليومي Daily Audit & Cash Closing */
.audit-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.audit-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0f4ff;
  color: #3b5bdb;
  border: 1px solid #cddcff;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.audit-back-btn:hover {
  background: #e0ebff;
  border-color: #a8c4ff;
}

.audit-days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.audit-day-card {
  background: #ffffff;
  border: 1px solid var(--line, #e2e8f5);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 4px 14px rgba(16, 21, 55, 0.04);
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  text-align: right;
}

.audit-day-card:hover {
  transform: translateY(-2px);
  border-color: #c7d8ff;
  box-shadow: 0 8px 24px rgba(75, 113, 255, 0.12);
}

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

.audit-day-card-date {
  font-size: 15px;
  font-weight: 800;
  color: #172146;
}

.audit-day-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: #f8faff;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #edf1fa;
}

.audit-day-stat-item span {
  font-size: 11.5px;
  color: #7b87a0;
  display: block;
}

.audit-day-stat-item strong {
  font-size: 14.5px;
  color: #172146;
  font-weight: 800;
  display: block;
  margin-top: 2px;
}

.audit-day-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #edf2ff;
  color: #3b5bdb;
  border: none;
  border-radius: 8px;
  padding: 8px;
  font-size: 12.5px;
  font-weight: 700;
  width: 100%;
  transition: all 0.15s ease;
}

.audit-day-card:hover .audit-day-view-btn {
  background: #3b5bdb;
  color: #fff;
}

/* الأصناف المباعة في اليوم Sold Items Progress */
.audit-sold-panel {
  background: #ffffff;
  border: 1px solid var(--line, #e2e8f5);
  border-radius: 18px;
  padding: 20px;
  margin: 18px 0;
  text-align: right;
}

.audit-sold-panel h3 {
  margin: 0 0 14px;
  font-size: 15px;
  color: #172146;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.audit-item-bar-row {
  margin-bottom: 14px;
}

.audit-item-bar-row:last-child {
  margin-bottom: 0;
}

.audit-item-bar-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 13.5px;
}

.audit-item-name {
  color: #1a2238;
  font-weight: 700;
}

.audit-item-name small {
  color: #7b87a0;
  font-weight: 600;
  margin-right: 4px;
}

.audit-item-total {
  font-weight: 800;
  color: #2f9f61;
}

.audit-progress-track {
  width: 100%;
  height: 10px;
  background: #eef2f8;
  border-radius: 6px;
  overflow: hidden;
}

.audit-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3fa96b, #2f9f61);
  border-radius: 6px;
  transition: width 0.4s ease;
}

.audit-order-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.audit-order-row:hover {
  background: #f8fafc;
}

.audit-order-row.expanded {
  background: #f1f5f9;
}

.audit-order-subrow td {
  background: #f8fafc;
}

.audit-order-subrow .audit-subcard {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.audit-order-subrow .audit-subcard:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* التجاوب */
@media (max-width: 1024px) {
  .system-pos {
    grid-template-columns: 1fr;
  }

  .system-cart {
    position: static;
  }

  .system-grid.two,
  .system-grid.three {
    grid-template-columns: 1fr;
  }

  .system-tabs {
    display: flex;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
    scrollbar-width: thin;
    scroll-padding-inline: 4px;
  }
}

@media (max-width: 760px) {
  .system-page {
    min-width: 0;
    max-width: 100%;
  }

  .system-tiles {
    grid-template-columns: repeat(2, 1fr);
  }

  .system-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .system-form-grid {
    grid-template-columns: 1fr;
  }

  .audit-days-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   المحاسبة — أنماط الرسوم البيانية والفواتير والإشعارات والمساعد الذكي
   ============================================================================ */

/* الرسوم البيانية ذات المحاور (Chart with Axis) */
.chart-with-axis {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 14px;
  margin-top: 10px;
  position: relative;
  width: 100%;
}

.chart-axis {
  position: relative;
  width: 75px;
  flex: 0 0 75px;
  text-align: right;
  height: 130px;
}

.chart-axis span {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
  white-space: nowrap;
  font-family: Manrope, sans-serif;
  font-size: 11px;
  color: #8b93ad;
  line-height: 1;
}

.chart-axis .chart-axis-zero {
  font-weight: 700;
  color: #64748b;
}

.chart-svg-wrap {
  flex: 1 1 0%;
  min-width: 0;
  position: relative;
  width: 100%;
}

.chart-svg-wrap svg {
  width: 100%;
  height: 130px;
  display: block;
  overflow: visible;
}

.chart-x-labels {
  position: relative;
  height: 22px;
  margin-top: 8px;
  font-family: Manrope, sans-serif;
  font-size: 11px;
  color: #8b93ad;
  direction: ltr !important;
  width: 100%;
}

.chart-x-labels span {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: Manrope, sans-serif;
  font-size: 10.5px;
  color: #8b93ad;
}

/* صفحة الفاتورة — أنيميشن الطباعة الحرارية */
.invpage-box {
  position: fixed;
  z-index: 501;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #f5f6f8;
  border-radius: 22px;
  width: min(440px, 94vw);
  max-width: 440px;
  padding: 32px 26px 30px;
  box-shadow: 0 40px 80px -20px rgba(20, 30, 70, 0.35);
  color: #151c3a;
  max-height: 92vh;
  overflow-y: auto;
  text-align: right;
}

.invpage-x {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(21, 28, 58, 0.06);
  border: none;
  color: #69738d;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
}

.invpage-x:hover {
  background: rgba(21, 28, 58, 0.12);
  color: #151c3a;
}

.invpage-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.invpage-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(145deg, #5376ff, #785cf5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}

.invpage-brand {
  font-weight: 800;
  letter-spacing: 1px;
  font-size: 15px;
  color: #151c3a;
}

.invpage-sub {
  font-size: 13px;
  color: #8b93ad;
  margin-top: 2px;
}

.invpage-body {
  background: #fff;
  border: 1px solid var(--line, #e2e8f5);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.invpage-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 13.5px;
  color: #69738d;
}

.invpage-row b {
  color: #151c3a;
  font-weight: 600;
}

.invpage-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px dashed #d8dce3;
  font-size: 14px;
  color: #151c3a;
}

.invpage-total b {
  font-family: Manrope, sans-serif;
  font-size: 18px;
  color: #4b71ff;
  direction: ltr;
  unicode-bidi: isolate;
}

.invpage-printer-zone {
  position: relative;
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.invpage-printer {
  width: 150px;
  height: 34px;
  background: linear-gradient(145deg, #2a3050, #151c3a);
  border-radius: 8px;
  position: relative;
  z-index: 2;
  box-shadow: 0 6px 14px rgba(20, 30, 70, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8ea0ff;
  font-size: 16px;
}

.invpage-printer-slot {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  background: #0f1330;
  border-radius: 2px;
}

.invpage-receipt {
  width: 150px;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.95s cubic-bezier(0.22, 0.85, 0.28, 1.05);
  position: relative;
  z-index: 1;
  margin-top: -2px;
}

.invpage-receipt.printing,
.invpage-receipt.printed {
  max-height: 340px;
}

.invpage-receipt-inner {
  background: #fdfdfb;
  box-shadow: 0 12px 26px rgba(20, 30, 70, 0.22);
  padding: 16px 12px 22px;
  font-family: Manrope, monospace;
  font-size: 12px;
  color: #151c3a;
  clip-path: polygon(0 0, 100% 0, 100% 96%, 95% 100%, 90% 96%, 85% 100%, 80% 96%, 75% 100%, 70% 96%, 65% 100%, 60% 96%, 55% 100%, 50% 96%, 45% 100%, 40% 96%, 35% 100%, 30% 96%, 25% 100%, 20% 96%, 15% 100%, 10% 96%, 5% 100%, 0 96%);
}

.invpage-r-brand {
  font-weight: 800;
  text-align: center;
  letter-spacing: 1px;
  font-size: 13px;
}

.invpage-r-sub {
  text-align: center;
  font-size: 11px;
  color: #8b93ad;
  margin-top: 2px;
  margin-bottom: 10px;
}

.invpage-r-line {
  border-top: 1px dashed #ccc;
  margin: 8px 0;
}

.invpage-r-row {
  display: flex;
  justify-content: space-between;
  margin: 4px 0;
  gap: 8px;
}

.invpage-r-row span:last-child {
  direction: ltr;
  unicode-bidi: isolate;
}

.invpage-r-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  margin-top: 6px;
}

.invpage-r-total span:last-child {
  direction: ltr;
  unicode-bidi: isolate;
}

.invpage-r-barcode {
  height: 26px;
  margin-top: 12px;
  background: repeating-linear-gradient(90deg, #151c3a 0 2px, transparent 2px 5px);
}

.invpage-r-check {
  text-align: center;
  margin-top: 10px;
  color: #2f9f61;
  font-weight: 700;
  font-size: 12.5px;
  opacity: 0;
  animation: invpageCheckIn 0.4s ease 0.05s forwards;
}

@keyframes invpageCheckIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.invpage-dl-btn {
  margin-top: 26px;
  width: 100%;
  background: #151c3a;
  border: none;
  color: #fff;
  border-radius: 12px;
  padding: 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: filter 0.15s;
}

.invpage-dl-btn:hover:not(:disabled) {
  filter: brightness(1.15);
}

.invpage-dl-btn:disabled {
  opacity: 0.75;
  cursor: default;
}

/* مركز الإشعارات Bell & Panel */
.notif-bell-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #d65363;
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(214, 83, 99, 0.4);
}

.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 320px;
  background: #ffffff;
  border: 1px solid var(--line, #e2e8f5);
  border-radius: 16px;
  box-shadow: 0 16px 36px -6px rgba(20, 30, 70, 0.22);
  z-index: 500;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: right;
}

.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f2f7;
}

.notif-panel-head strong {
  font-size: 14px;
  color: #151c3a;
}

.notif-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: #f8f9fe;
  border-radius: 12px;
  border: 1px solid #e8ecf6;
}

.notif-form[hidden],
#ai-fab[hidden] {
  display: none !important;
}

.notif-form label {
  font-size: 12px;
  font-weight: 600;
  color: #56617c;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notif-form input,
.notif-form textarea {
  width: 100%;
  border: 1px solid #e0e5f0;
  border-radius: 8px;
  background: #fff;
  padding: 6px 10px;
  font-size: 12.5px;
  outline: none;
  font-family: inherit;
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border: 1px solid #edf0f6;
  border-radius: 10px;
  background: #fbfcff;
  transition: all 0.15s ease;
}

.notif-item:hover {
  background: #f4f6fc;
}

.notif-item.late {
  border-color: #f4bfc6;
  background: #fff8f8;
}

.notif-item-main {
  flex: 1;
  min-width: 0;
}

.notif-item-main strong {
  display: block;
  font-size: 13px;
  color: #172146;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-item-main p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: #7b87a0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-item-date {
  font-size: 11px;
  color: #8b93ad;
  display: block;
  margin-top: 2px;
}

.notif-item.late .notif-item-date {
  color: #d65363;
  font-weight: 700;
}

/* المساعد الذكي AI Assistant Widget */
.ai-fab {
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 9000;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, #5376ff, #785cf5);
  color: #fff;
  box-shadow: 0 10px 24px rgba(83, 118, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ai-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 14px 30px rgba(83, 118, 255, 0.6);
}

.ai-drawer-wrap {
  position: fixed;
  inset: 0;
  z-index: 9500;
}

.ai-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 22, 49, 0.32);
  backdrop-filter: blur(2px);
}

.ai-drawer {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  max-height: 100vh;
  width: min(400px, 92vw);
  background: #f8f9fd;
  box-shadow: 12px 0 40px rgba(15, 22, 49, 0.22);
  display: flex;
  flex-direction: column;
  padding: 22px 20px 0;
  gap: 16px;
  overflow: hidden;
  animation: aiDrawerIn 0.25s ease;
  text-align: right;
}

@keyframes aiDrawerIn {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0);
  }
}

.ai-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.ai-drawer-topics {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-topic-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line, #e2e8f5);
  background: #fff;
  font-size: 13.5px;
  font-weight: 700;
  color: #2a3050;
  cursor: pointer;
  transition: 0.15s;
}

.ai-topic-btn:hover:not(:disabled) {
  border-color: #c7d2ff;
  background: #fbfcff;
}

.ai-topic-btn.active {
  background: #1c254a;
  color: #fff;
  border-color: #1c254a;
}

.ai-topic-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.ai-topic-btn span {
  flex: 1;
  text-align: start;
}

.ai-topic-cd {
  font-size: 11.5px;
  font-weight: 600;
  opacity: 0.75;
  white-space: nowrap;
}

.ai-drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 22px;
}

.ai-insight-result {
  margin-top: 12px;
  background: #fff;
  border: 1px solid var(--line, #e2e8f5);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  line-height: 1.8;
  font-size: 13.5px;
  color: #2a3050;
}

.ai-insight-result p {
  margin: 0;
}

/* صندوق التنبيه / الإرشاد Hint */
.hint-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f0f4ff;
  border: 1px solid #cddcff;
  color: #3858cc;
  font-size: 13px;
  line-height: 1.6;
}

.hint-box p {
  margin: 0;
}

/* ============================================================================
 * موديول واتساب النادي (WhatsApp Integration Styling)
 * ============================================================================ */
.wa-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wa-status-card {
  background: #ffffff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 4px 18px -4px rgba(16, 21, 55, 0.05);
}

.wa-status-connected {
  border-color: #bbf7d0;
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

.wa-status-offline {
  border-color: #fed7aa;
  background: linear-gradient(135deg, #fffaf5 0%, #ffffff 100%);
}

.wa-qr-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: #ffffff;
  border: 2px dashed #25d366;
  border-radius: 20px;
  text-align: center;
  max-width: 380px;
  margin: 0 auto;
  box-shadow: 0 10px 30px -10px rgba(37, 211, 102, 0.2);
}

.wa-qr-img {
  width: 220px;
  height: 220px;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  border: 1px solid #edf2f7;
  margin: 14px 0;
  object-fit: contain;
}

.wa-qr-spinner {
  width: 220px;
  height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border-radius: 14px;
  margin: 14px 0;
  color: #64748b;
  gap: 12px;
}

.wa-chat-bubble {
  background: #dcf8c6;
  color: #111b21;
  padding: 12px 16px;
  border-radius: 14px 14px 2px 14px;
  max-width: 85%;
  font-size: 13.5px;
  line-height: 1.6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
  margin-top: 8px;
  white-space: pre-wrap;
  font-family: inherit;
}

.wa-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 11px;
  color: #667781;
  margin-top: 4px;
}

.wa-bubble-meta span.checks {
  color: #53bdeb;
  font-weight: bold;
}

.wa-template-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.wa-template-card {
  background: #ffffff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s ease;
}

.wa-template-card:hover {
  border-color: #25d366;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -6px rgba(37, 211, 102, 0.15);
}

.wa-btn-whatsapp {
  background: #25d366 !important;
  border-color: #25d366 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wa-btn-whatsapp:hover {
  background: #20bd5a !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -4px rgba(37, 211, 102, 0.4);
}

/* ============================================================================
 * موديول واتساب النادي (WhatsApp Integration Styling)
 * ============================================================================ */

/* تثبيت الهيكل الخارجي وحاوية الصفحة لمنع أي سكرول رأسي وضمان ظهور صندوق الإرسال بالكامل */
body:has(.has-whatsapp),
body:has(.is-whatsapp),
body.has-whatsapp-active {
  height: 100vh !important;
  height: 100dvh !important;
  overflow: hidden !important;
}

.shell:has(.is-whatsapp),
.shell.has-whatsapp {
  height: calc(100vh - 32px) !important;
  height: calc(100dvh - 32px) !important;
  max-height: calc(100vh - 32px) !important;
  max-height: calc(100dvh - 32px) !important;
  margin: 16px !important;
  overflow: hidden !important;
  grid-template-rows: 100% !important;
}

.shell.has-whatsapp .sidebar {
  height: calc(100vh - 32px) !important;
  height: calc(100dvh - 32px) !important;
  max-height: calc(100vh - 32px) !important;
  max-height: calc(100dvh - 32px) !important;
  overflow-y: auto !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(148, 163, 184, 0.28) transparent !important;
}
.shell.has-whatsapp .sidebar::-webkit-scrollbar {
  width: 4px !important;
}
.shell.has-whatsapp .sidebar::-webkit-scrollbar-track {
  background: transparent !important;
}
.shell.has-whatsapp .sidebar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28) !important;
  border-radius: 999px !important;
}
.shell.has-whatsapp .sidebar:hover::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.5) !important;
}

.shell.has-whatsapp #system-page,
.content.system-page.is-whatsapp,
#system-page.is-whatsapp {
  padding: 22px 24px 24px 24px !important;
  margin: 0 !important;
  height: calc(100vh - 48px) !important;
  max-height: calc(100vh - 48px) !important;
  min-height: 0 !important;
  width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

/* إخفاء الزر العائم عند تشغيل واتساب لمنع التداخل */
body.has-whatsapp-active #ai-fab,
body:has(.has-whatsapp) #ai-fab {
  display: none !important;
}

.wa-hub-root {
  width: 100%;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  position: relative;
  background: transparent;
  font-family: inherit;
  margin: 0;
  padding: 0;
  box-sizing: border-box !important;
}

/* تخطيط مساحة العمل الرئيسية بـ 3 أعمدة (صندوق الرسائل + المحادثة + المشترك) */
.wa-hub-workspace {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 380px 1fr 285px;
  background: #ffffff;
  overflow: hidden;
  border: 1px solid #edf1f8;
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(16, 21, 55, 0.06);
}

.wa-hub-workspace.crm-collapsed {
  grid-template-columns: 380px 1fr 0px;
}

.wa-hub-workspace.is-subview {
  grid-template-columns: 1fr;
}

.wa-hub-workspace>* {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

/* 1. صندوق الوارد وقائمة المحادثات (Conversation Inbox) */
.wa-hub-inbox {
  background: #ffffff;
  border-left: 1px solid #edf1f8;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  min-width: 0;
}

.wa-hub-inbox-header {
  padding: 10px 12px 8px 12px;
  border-bottom: 1px solid #edf1f8;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  background: #ffffff;
}

.wa-inbox-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.wa-inbox-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
  color: #151c3a;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

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

.wa-hub-search-input-wrap {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
}

.wa-search-clear-btn {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: #e2e8f0;
  border: none;
  color: #475569;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  z-index: 10;
}

.wa-search-clear-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

.wa-hub-search-input-wrap.has-value .wa-search-clear-btn,
.wa-hub-search-input-wrap:focus-within .wa-search-clear-btn {
  display: flex;
}

.wa-hub-search-input-wrap .wa-search-icon {
  position: absolute;
  right: 10px;
  color: #94a3b8;
  pointer-events: none;
}

.wa-hub-search-input-wrap input {
  width: 100%;
  padding: 7px 30px 7px 30px;
  border-radius: 9px;
  border: 1px solid #d9e1f0;
  background: #f8fafc;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.wa-hub-search-input-wrap input::-webkit-search-cancel-button,
.wa-hub-search-input-wrap input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.wa-hub-search-input-wrap input:focus {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.wa-hub-btn-icon {
  height: 29px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid #d9e1f0;
  background: #ffffff;
  color: #4a5472;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 21, 55, 0.04);
  transition: all 0.18s ease;
  flex-shrink: 0;
  font-family: inherit;
  white-space: nowrap;
}

.wa-hub-btn-icon:hover {
  background: #f5f8ff;
  color: #182246;
  border-color: #c0cde6;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(16, 21, 55, 0.08);
}

.wa-hub-btn-icon.primary {
  background: #182246;
  border-color: #182246;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(24, 34, 70, 0.2);
}

.wa-hub-btn-icon.primary:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.wa-hub-filters-row {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 4px 5px;
  background: #f1f5f9;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: inset 0 1px 2px rgba(16, 21, 55, 0.03);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

.wa-hub-filters-row::-webkit-scrollbar {
  display: none;
}

.wa-hub-filter-pill {
  flex: 0 0 auto;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  user-select: none;
}

.wa-hub-filter-pill:hover:not(.active) {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.wa-hub-filter-pill.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
}

.wa-pill-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1.5px 5.5px;
  border-radius: 8px;
  background: #e2e8f0;
  color: #334155;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.16s ease;
}

.wa-hub-filter-pill.active .wa-pill-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.wa-pill-badge.unread {
  background: #ef4444;
  color: #ffffff;
}

.wa-hub-filter-pill.active .wa-pill-badge.unread {
  background: #ffffff;
  color: #dc2626;
}

.wa-conversation-sync-state {
  min-height: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #64748b;
  font-size: 10.5px;
  line-height: 1;
  transition: color 0.2s ease;
}

.wa-conversation-sync-state.is-refreshing {
  color: #2563eb;
}

.wa-conversation-sync-state.is-error {
  color: #b91c1c;
}

.wa-sync-icon-slot {
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wa-conversation-sync-state button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.wa-inline-spinner {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.8px solid #cbd5e1;
  border-top-color: #2563eb;
  display: inline-block;
  animation: waSpin 0.85s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes waSpin {
  to {
    transform: rotate(360deg);
  }
}

.wa-feed-state {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #64748b;
  text-align: center;
  padding: 28px;
  box-sizing: border-box;
}

.wa-feed-state strong {
  color: #334155;
  font-size: 12.5px;
}

.wa-feed-error,
.wa-feed-error strong {
  color: #b91c1c;
}

.wa-hub-chat-list {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.wa-hub-chat-row {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid #f1f5f9;
  border-right: 3.5px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  background: #ffffff;
}

.wa-hub-chat-row:hover {
  background: #f8fafc;
}

.wa-hub-chat-row.active {
  background: #eff6ff;
  border-right-color: #2563eb;
}

.wa-hub-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #182246 0%, #2563eb 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 2px 5px rgba(24, 34, 70, 0.15);
}

.wa-hub-chat-avatar.has-member {
  background: linear-gradient(135deg, #065f46 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 2px 5px rgba(5, 150, 105, 0.2);
}

.wa-hub-chat-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.wa-hub-chat-avatar-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.wa-hub-chat-wa-name {
  font-size: 10px;
  color: #059669;
  font-weight: 600;
  display: inline-block;
  margin-right: 4px;
}

.wa-hub-chat-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wa-hub-chat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.wa-hub-chat-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #151c3a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-hub-chat-time {
  font-size: 10px;
  color: #94a3b8;
  white-space: nowrap;
}

.wa-hub-chat-mid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.wa-hub-chat-snippet {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.wa-hub-chat-unread {
  background: #2563eb;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  border-radius: 8.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.wa-hub-chat-bottom {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
}

.wa-hub-badge-member {
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 5px;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
}

.wa-hub-badge-member.active {
  background: #dcfce7;
  color: #15803d;
}

.wa-hub-badge-member.expired {
  background: #fee2e2;
  color: #b91c1c;
}

.wa-hub-badge-tag {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  background: #e0e7ff;
  color: #3730a3;
  font-weight: 500;
}

.wa-hub-chat-row-archive-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.wa-hub-chat-row:hover .wa-hub-chat-row-archive-btn,
.wa-hub-chat-row.active .wa-hub-chat-row-archive-btn,
.wa-hub-chat-row-archive-btn.is-archived {
  opacity: 1;
}

.wa-hub-chat-row-archive-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}

.wa-hub-chat-row-archive-btn.is-archived {
  color: #2563eb;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.wa-hub-chat-row-archive-btn.is-archived:hover {
  background: #dbeafe;
  color: #1d4ed8;
}

/* 2. نافذة المحادثة النشطة (Active Chat Area) */
.wa-hub-chat-area {
  display: grid !important;
  grid-template-rows: 52px minmax(0, 1fr) auto !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  background: #f8fafc url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='0.8' fill='%2394a3b8' fill-opacity='0.15'/%3E%3C/svg%3E");
  position: relative !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.wa-hub-empty-state {
  grid-row: 1 / -1 !important;
  grid-column: 1 / -1 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  height: 100% !important;
  min-height: 100% !important;
  color: #64748b;
  text-align: center;
  padding: 32px 20px;
  box-sizing: border-box;
  margin: auto !important;
}

.wa-hub-empty-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}

.wa-hub-empty-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px 0;
}

.wa-hub-empty-desc {
  font-size: 13px;
  color: #64748b;
  max-width: 320px;
  margin: 0;
  line-height: 1.6;
}

.wa-hub-chat-header {
  grid-row: 1;
  flex-shrink: 0;
  height: 52px;
  min-height: 52px;
  max-height: 52px;
  padding: 8px 14px;
  background: linear-gradient(180deg, #f0f7ff 0%, #e6f1fe 100%);
  border-bottom: 1px solid #c7ddfc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #0f2942;
  box-sizing: border-box;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.05);
}

.wa-hub-chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wa-hub-chat-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wa-hub-head-btn {
  height: 32px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid #d9e1f0;
  background: #ffffff;
  color: #4a5472;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.18s ease;
  font-family: inherit;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(16, 21, 55, 0.04);
}

.wa-hub-head-btn:hover {
  background: #f5f8ff;
  border-color: #c0cde6;
  color: #182246;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(16, 21, 55, 0.08);
}

.wa-hub-head-btn.active {
  background: #182246;
  color: #ffffff;
  border-color: #182246;
  box-shadow: 0 2px 6px rgba(24, 34, 70, 0.2);
}

.wa-chat-head-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid #d9e1f0;
  background: #ffffff;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
  padding: 0;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(16, 21, 55, 0.04);
}

.wa-chat-head-close-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.15);
}

.wa-head-sep {
  width: 1px;
  height: 18px;
  background: #e2e8f0;
  margin: 0 3px;
  flex-shrink: 0;
}

.wa-chat-menu-wrap {
  position: relative;
  display: inline-flex;
}

.wa-chat-more-dropdown {
  position: absolute;
  top: 38px;
  left: 0;
  width: 195px;
  background: #ffffff;
  border: 1px solid #d9e1f0;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(16, 21, 55, 0.14);
  z-index: 1000;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  animation: waFadeIn 0.15s ease-out;
}

.wa-chat-dropdown-item {
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: right;
  transition: all 0.12s ease;
  font-family: inherit;
}

.wa-chat-dropdown-item:hover {
  background: #f1f5f9;
  color: #182246;
}

.wa-chat-dropdown-divider {
  height: 1px;
  background: #edf1f8;
  margin: 3px 0;
}

.wa-hub-message-feed {
  grid-row: 2;
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scroll-behavior: auto !important;
  overflow-anchor: auto;
  box-sizing: border-box;
}

.wa-hub-date-separator {
  align-self: center;
  background: #ffffff;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(16, 21, 55, 0.04);
  margin: 6px 0;
}

/* فقاعات الرسائل والملاحظات الداخلية */
.wa-msg {
  max-width: 72%;
  padding: 7px 12px 5px 12px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.45;
  position: relative;
  word-break: break-word;
  display: flex;
  flex-direction: column;
  transition: all 0.15s ease;
}

.wa-msg.in {
  align-self: flex-start;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-top-right-radius: 2px;
  box-shadow: 0 2px 6px rgba(16, 21, 55, 0.04);
}

.wa-msg.out {
  align-self: flex-end;
  background: #eff6ff;
  color: #0f172a;
  border: 1px solid #bfdbfe;
  border-top-left-radius: 2px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.06);
}

/* ملاحظة داخلية للموظفين فقط */
.wa-msg.internal-note {
  align-self: center;
  background: #fefce8;
  border: 1px solid #fef08a;
  color: #713f12;
  max-width: 85%;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(202, 138, 4, 0.07);
  padding: 8px 14px;
}

.wa-note-badge {
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
  color: #854d0e;
  background: rgba(254, 240, 138, 0.65);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #fde047;
}

.wa-msg-content-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.wa-msg-text {
  white-space: pre-wrap;
  flex: 1;
}

.wa-msg-footer {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9.5px;
  color: #64748b;
  margin-right: auto;
  align-self: flex-end;
}

.wa-msg-checks {
  color: #2563eb;
  font-weight: bold;
}

.wa-msg-quoted {
  background: rgba(37, 99, 235, 0.06);
  border-right: 3px solid #2563eb;
  padding: 4px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 11px;
}

.wa-quoted-author {
  font-weight: 700;
  color: #008069;
  display: block;
}

.wa-quoted-text {
  color: #54656f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.wa-msg-media-wrap {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 4px;
  max-width: 280px;
  cursor: pointer;
  position: relative;
  background: rgba(0, 0, 0, 0.05);
  display: block;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wa-msg-media-wrap:hover {
  transform: scale(1.01);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.wa-msg-image {
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  transition: filter 0.15s ease;
}

.wa-msg-media-wrap:hover .wa-msg-image {
  filter: brightness(0.92);
}

.wa-msg-media-zoom-hint {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.15s ease;
  pointer-events: none;
}

.wa-msg-media-wrap:hover .wa-msg-media-zoom-hint {
  opacity: 1;
  transform: translateY(0);
}

/* مشغل الرسائل الصوتية والفويس المطور (Advanced WhatsApp Voice Note Player) */
.wa-msg-audio-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  width: 280px;
  max-width: 100%;
  user-select: none;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  transition: all 0.2s ease;
}

.wa-msg.out .wa-msg-audio-player {
  background: rgba(238, 246, 255, 0.85);
  border-color: rgba(37, 99, 235, 0.15);
}

.wa-msg-audio-player.is-playing {
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.18);
  border-color: #86efac;
}

.wa-msg.out .wa-msg-audio-player.is-playing {
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.18);
  border-color: #93c5fd;
}

.wa-audio-play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #25d366;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 7px rgba(37, 211, 102, 0.35);
  padding: 0;
}

.wa-msg.out .wa-audio-play-btn {
  background: #2563eb;
  box-shadow: 0 2px 7px rgba(37, 99, 235, 0.35);
}

.wa-audio-play-btn:hover {
  transform: scale(1.08);
}

.wa-audio-play-btn:active {
  transform: scale(0.94);
}

.wa-msg-audio-player.is-playing .wa-audio-play-btn {
  animation: waAudioPlayPulse 1.8s infinite;
}

@keyframes waAudioPlayPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4);
  }

  70% {
    box-shadow: 0 0 0 8px rgba(37, 211, 102, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

.wa-msg.out .wa-msg-audio-player.is-playing .wa-audio-play-btn {
  animation: waAudioPlayPulseBlue 1.8s infinite;
}

@keyframes waAudioPlayPulseBlue {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
  }

  70% {
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

.wa-audio-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* أعمدة الموجات الصوتية الشبيهة بالواتساب الرسمي (Waveform Bars) */
.wa-audio-waveform-wrap {
  width: 100%;
  height: 24px;
  display: flex;
  align-items: center;
  gap: 2.5px;
  cursor: pointer;
  padding: 2px 0;
  box-sizing: border-box;
}

.wa-audio-wave-bar {
  flex: 1;
  background: #cbd5e1;
  border-radius: 2px;
  min-width: 2px;
  transition: background 0.12s ease, transform 0.15s ease;
}

.wa-audio-wave-bar.played {
  background: #25d366;
}

.wa-msg.out .wa-audio-wave-bar.played {
  background: #2563eb;
}

.wa-msg-audio-player.is-playing .wa-audio-wave-bar.played {
  animation: waWaveformBounce 1.2s ease-in-out infinite alternate;
}

@keyframes waWaveformBounce {
  0% {
    transform: scaleY(0.85);
  }

  100% {
    transform: scaleY(1.15);
  }
}

.wa-audio-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: #64748b;
  font-weight: 700;
  padding: 0 2px;
}

.wa-audio-mic-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #059669;
}

.wa-msg.out .wa-audio-mic-badge {
  color: #2563eb;
}

/* مشغل وعارض مقاطع الفيديو والصور - مقاس موحد */
.wa-msg-video-wrap,
.wa-msg-media-wrap {
  width: 280px;
  max-width: 100%;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 6px;
  position: relative;
  background: #0f172a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.wa-msg-video,
.wa-msg-image {
  width: 100%;
  max-height: 260px;
  display: block;
  object-fit: cover;
  border-radius: 11px;
}

/* اسم المرسل داخل المجموعات */
.wa-group-sender-name {
  font-size: 11px;
  font-weight: 800;
  color: #0284c7;
  margin-bottom: 3px;
  display: block;
}

/* شارة اسم الموظف في الرسائل الصادرة */
.wa-msg-staff-sender-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
  padding: 1px 6px;
  border-radius: 5px;
  margin-bottom: 4px;
  border: 1px solid rgba(16, 185, 129, 0.22);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
}

/* عرض ملصقات الواتساب */
.wa-msg.sticker-msg {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 2px !important;
}

.wa-msg-sticker-wrap {
  max-width: 130px;
  max-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wa-msg-sticker {
  width: 100%;
  height: auto;
  max-width: 130px;
  max-height: 130px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.12));
}

/* شريط تسجيل الصوت المباشر في المحرر - تصميم راقٍ وأنيق ومريح للعين */
.wa-recording-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 14px;
  margin: 6px 12px 10px 12px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  animation: waRecSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.wa-rec-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.wa-rec-pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #ffffff;
  border: 1px solid #fecaca;
  border-radius: 20px;
  box-shadow: 0 1px 4px rgba(239, 68, 68, 0.1);
}

.wa-rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  animation: waPulse 1.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.wa-rec-mic-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ef4444;
}

@keyframes waPulse {
  0% {
    transform: scale(0.9);
    opacity: 0.7;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  }

  70% {
    transform: scale(1.15);
    opacity: 1;
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }

  100% {
    transform: scale(0.9);
    opacity: 0.7;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.wa-rec-timer {
  font-size: 13px;
  font-weight: 800;
  color: #b91c1c;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  direction: ltr;
  letter-spacing: 0.5px;
}

/* أمواج صوتية متحركة تحاكي التسجيل الحي */
.wa-rec-live-waveform {
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
  height: 18px;
  padding: 0 2px;
}

.wa-rec-live-bar {
  width: 2.5px;
  height: 6px;
  border-radius: 3px;
  background: #ef4444;
  opacity: 0.85;
  animation: waLiveWave 1s ease-in-out infinite alternate;
}

.wa-rec-live-bar:nth-child(1) {
  height: 7px;
  animation-delay: 0.05s;
}

.wa-rec-live-bar:nth-child(2) {
  height: 14px;
  animation-delay: 0.25s;
}

.wa-rec-live-bar:nth-child(3) {
  height: 9px;
  animation-delay: 0.12s;
}

.wa-rec-live-bar:nth-child(4) {
  height: 16px;
  animation-delay: 0.35s;
}

.wa-rec-live-bar:nth-child(5) {
  height: 8px;
  animation-delay: 0.18s;
}

.wa-rec-live-bar:nth-child(6) {
  height: 13px;
  animation-delay: 0.4s;
}

.wa-rec-live-bar:nth-child(7) {
  height: 11px;
  animation-delay: 0.22s;
}

.wa-rec-live-bar:nth-child(8) {
  height: 6px;
  animation-delay: 0.3s;
}

@keyframes waLiveWave {
  0% {
    transform: scaleY(0.4);
    opacity: 0.5;
  }

  50% {
    transform: scaleY(1.2);
    opacity: 1;
  }

  100% {
    transform: scaleY(0.6);
    opacity: 0.7;
  }
}

.wa-rec-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-rec-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.wa-rec-cancel-btn {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.18s ease;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.wa-rec-cancel-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
  transform: translateY(-1px);
}

.wa-rec-send-btn {
  border: none;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6.5px 15px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.32);
}

.wa-rec-send-btn:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.42);
}

.wa-rec-send-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* شريط معاينة الصورة قبل الإرسال في المحرر */
.wa-pending-media-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  animation: waFadeIn 0.15s ease;
}

.wa-pending-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.wa-pending-name {
  font-size: 12px;
  color: #334155;
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-pending-cancel-btn {
  border: none;
  background: #e2e8f0;
  color: #64748b;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.15s;
}

.wa-pending-cancel-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* نافذة عارض الصور المكبرة الاحترافي (Lightbox Modal) */
.wa-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: waFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.wa-lightbox-overlay.closing {
  animation: waFadeOut 0.15s ease forwards;
}

.wa-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
}

.wa-lightbox-content {
  position: relative;
  z-index: 2;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7);
  animation: waZoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.wa-lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.wa-lightbox-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
}

.wa-lightbox-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wa-lightbox-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.wa-lightbox-btn:hover {
  background: #25d366;
  border-color: #25d366;
  color: #ffffff;
}

.wa-lightbox-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wa-lightbox-close:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
}

.wa-lightbox-body {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  min-width: 280px;
  min-height: 200px;
  max-height: calc(88vh - 54px);
  overflow: auto;
}

.wa-lightbox-img {
  max-width: 86vw;
  max-height: calc(82vh - 54px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

/* 3. شريط الكتابة والمحرر الذكي (Smart Composer) */
.wa-hub-composer {
  grid-row: 3;
  flex-shrink: 0;
  background: #ffffff;
  padding: 8px 12px;
  border-top: 1px solid #edf1f8;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  z-index: 10;
  box-shadow: 0 -2px 10px rgba(16, 21, 55, 0.03);
  box-sizing: border-box;
}

.wa-hub-composer-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.wa-tpl-dropdown-wrap {
  position: relative;
  display: inline-flex;
}

.wa-tpl-trigger-btn {
  height: 26px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.wa-tpl-trigger-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}

.wa-tpl-trigger-btn:active {
  transform: scale(0.97);
}

.wa-tpl-trigger-arrow {
  font-size: 10px;
  transition: transform 0.15s ease;
  color: #3b82f6;
  margin-top: -1px;
}

.wa-tpl-dropdown-wrap.is-open .wa-tpl-trigger-arrow {
  transform: rotate(180deg);
}

.wa-tpl-dropdown-popup {
  position: absolute;
  bottom: 82px;
  right: 12px;
  width: 350px;
  max-width: calc(100% - 24px);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
  z-index: 999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: waFadeIn 0.15s ease-out;
}

.wa-emoji-picker {
  position: absolute;
  bottom: 82px;
  right: 12px;
  width: 330px;
  max-width: calc(100% - 24px);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
  z-index: 999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: waFadeIn 0.15s ease-out;
}

.wa-emoji-picker-header {
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: #1e293b;
}

.wa-emoji-cats {
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  overflow-x: auto;
}

.wa-emoji-cat-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
}

.wa-emoji-cat-btn.active,
.wa-emoji-cat-btn:hover {
  background: #25d366;
  color: #ffffff;
  border-color: #25d366;
}

.wa-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  padding: 8px;
  max-height: 180px;
  overflow-y: auto;
  font-size: 18px;
  text-align: center;
}

.wa-emoji-item {
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: transform 0.1s, background 0.1s;
  user-select: none;
}

.wa-emoji-item:hover {
  background: #f1f5f9;
  transform: scale(1.2);
}

.wa-popup-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.1s;
}

.wa-popup-close-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

.wa-tpl-popup-head {
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wa-tpl-popup-manage-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #2563eb;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.12s ease;
  font-family: inherit;
}

.wa-tpl-popup-manage-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.wa-tpl-popup-search-wrap {
  padding: 6px 10px;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
}

.wa-tpl-popup-search-wrap input {
  width: 100%;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  font-size: 11.5px;
  font-family: inherit;
  outline: none;
  background: #f8fafc;
  box-sizing: border-box;
}

.wa-tpl-popup-search-wrap input:focus {
  background: #ffffff;
  border-color: #2563eb;
}

.wa-tpl-popup-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wa-tpl-popup-item {
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.12s ease;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wa-tpl-popup-item:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.wa-tpl-popup-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.wa-tpl-popup-item-title {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.wa-tpl-popup-cat-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
  background: #e0f2fe;
  color: #0369a1;
}

.wa-tpl-popup-item-snippet {
  margin: 0;
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-composer-tools-sep {
  width: 1px;
  height: 16px;
  background: #cbd5e1;
  margin: 0 2px;
  flex-shrink: 0;
}

.wa-chat-assign-select {
  height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid #d9e1f0;
  background: #ffffff;
  color: #182246;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(16, 21, 55, 0.04);
  transition: all 0.18s ease;
}

.wa-chat-assign-select:hover {
  background: #f5f8ff;
  border-color: #c0cde6;
}

.wa-chat-assign-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.wa-hub-composer-tools::-webkit-scrollbar {
  display: none;
}

.wa-hub-composer-tools::-webkit-scrollbar {
  display: none;
}

.wa-var-badge {
  background: #f8fafc;
  border: 1px solid #d9e1f0;
  border-radius: 8px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  user-select: none;
  box-shadow: 0 1px 2px rgba(16, 21, 55, 0.03);
}

.wa-var-badge:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.12);
}

.wa-note-mode-toggle {
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  padding: 3px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
  user-select: none;
}

.wa-note-mode-toggle:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.wa-note-mode-toggle.is-active,
.wa-note-mode-toggle:has(input:checked) {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.15);
}

.wa-hub-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.wa-hub-input-row .wa-hub-btn-icon {
  height: 40px;
  width: 40px;
  padding: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  color: #64748b;
}

.wa-hub-input-row .wa-hub-btn-icon:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.wa-hub-input-row .wa-hub-btn-icon:active {
  transform: translateY(0);
}

.wa-hub-textarea {
  flex: 1;
  min-height: 40px;
  max-height: 180px;
  padding: 9px 14px;
  border-radius: 11px;
  border: 1.5px solid #d9e1f0;
  background: #ffffff;
  font-size: 13px;
  font-family: inherit;
  color: #151c3a;
  resize: none;
  outline: none;
  line-height: 1.5;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  box-sizing: border-box;
  box-shadow: inset 0 1px 2px rgba(16, 21, 55, 0.03);
}

.wa-hub-textarea:focus {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.12), inset 0 1px 2px rgba(16, 21, 55, 0.02);
}

.wa-hub-composer.is-note-mode .wa-hub-textarea {
  background: #fffbeb;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3.5px rgba(245, 158, 11, 0.14);
  color: #78350f;
}

.wa-hub-send-btn {
  height: 40px;
  padding: 0 18px;
  border-radius: 11px;
  border: none;
  background: #182246;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 3px 10px rgba(24, 34, 70, 0.22);
  transition: all 0.18s ease;
  font-family: inherit;
  flex-shrink: 0;
}

.wa-hub-send-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.28);
}

.wa-hub-composer.is-note-mode .wa-hub-send-btn,
.wa-hub-send-btn.note-mode {
  background: #d97706;
  box-shadow: 0 3px 10px rgba(217, 119, 6, 0.22);
}

.wa-hub-composer.is-note-mode .wa-hub-send-btn:hover,
.wa-hub-send-btn.note-mode:hover {
  background: #b45309;
}

/* منتقي الإيموجي المنبثق */
.wa-emoji-picker {
  position: absolute;
  bottom: 85px;
  right: 12px;
  width: 290px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: waFadeIn 0.15s ease-out;
}

.wa-emoji-picker-header {
  padding: 6px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
}

.wa-emoji-cats {
  display: flex;
  overflow-x: auto;
  padding: 4px 6px;
  gap: 3px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}

.wa-emoji-cat-btn {
  border: none;
  background: transparent;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  color: #64748b;
}

.wa-emoji-cat-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.wa-emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.wa-emoji-item {
  font-size: 18px;
  text-align: center;
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.1s, background 0.1s;
}

.wa-emoji-item:hover {
  background: #f1f5f9;
  transform: scale(1.2);
}

/* 4. لوحة معلومات المشترك (Member CRM Panel) */
.wa-hub-crm-panel {
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  transition: width 0.2s ease;
}

.wa-hub-crm-panel.collapsed {
  display: none;
}

.wa-hub-crm-header {
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.wa-hub-crm-header.unregistered {
  background: #f8fafc;
  border-bottom: 1px solid #fed7aa;
}

.wa-hub-crm-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 6px;
}

.wa-hub-crm-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.wa-hub-crm-avatar.status-active {
  border: 2.5px solid #22c55e;
}

.wa-hub-crm-avatar.status-expired {
  border: 2.5px solid #ef4444;
}

.wa-hub-crm-avatar.unregistered {
  background: #64748b;
  border: 2px dashed #94a3b8;
  color: #f8fafc;
}

.wa-hub-crm-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #ffffff;
}

.wa-hub-crm-status-dot.active {
  background: #22c55e;
}

.wa-hub-crm-status-dot.expired {
  background: #ef4444;
}

.wa-hub-crm-status-dot.unregistered {
  background: #f59e0b;
}

.wa-hub-crm-name {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 2px 0;
}

.wa-crm-name-edit-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid #d9e1f0;
  background: #ffffff;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(16, 21, 55, 0.04);
}

.wa-crm-name-edit-icon:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #2563eb;
  transform: scale(1.1);
}

.wa-hub-crm-code-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.wa-hub-crm-code {
  background: #e2e8f0;
  color: #334155;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}

.wa-hub-crm-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
}

.wa-hub-crm-badge.active {
  background: #dcfce7;
  color: #15803d;
}

.wa-hub-crm-badge.expired {
  background: #fee2e2;
  color: #b91c1c;
}

.wa-hub-crm-badge.unregistered {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.wa-hub-crm-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wa-hub-crm-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  padding: 8px 10px;
}

.wa-hub-crm-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.wa-hub-crm-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
}

.wa-hub-crm-label {
  color: #64748b;
}

.wa-hub-crm-val {
  font-weight: 600;
  color: #0f172a;
}

.wa-hub-crm-val.phone-val {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #2563eb;
  padding: 1px 4px;
  border-radius: 4px;
  transition: all 0.12s;
}

.wa-hub-crm-val.phone-val:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.wa-hub-crm-val.highlight-tier {
  background: #eff6ff;
  color: #1d4ed8;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.wa-hub-crm-unregistered-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: #92400e;
  font-size: 11px;
}

.wa-hub-crm-unregistered-banner .banner-icon {
  color: #d97706;
  flex-shrink: 0;
  margin-top: 1px;
}

.wa-hub-crm-unregistered-banner .banner-text strong {
  display: block;
  font-size: 11.5px;
  color: #78350f;
  margin-bottom: 2px;
}

.wa-hub-crm-unregistered-banner .banner-text p {
  margin: 0;
  line-height: 1.45;
}

.wa-crm-register-btn {
  background: #16a34a !important;
  border-color: #16a34a !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 9px 12px !important;
  justify-content: center;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.25);
  transition: all 0.15s ease;
}

.wa-crm-register-btn:hover {
  background: #15803d !important;
  border-color: #15803d !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.35);
}

.wa-hub-crm-empty {
  padding: 48px 16px;
  text-align: center;
  color: #64748b;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  justify-content: center;
  height: 100%;
}

.wa-hub-crm-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.wa-hub-crm-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
}

/* 5. واجهات الأقسام المخصصة (Dedicated Views) */
.wa-hub-full-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  height: 100%;
  min-height: 0;
  position: relative;
}

.wa-hub-subview-padding {
  padding: 18px 24px;
  height: 100%;
  overflow-y: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.wa-hub-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.wa-hub-view-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wa-hub-view-desc {
  font-size: 11.5px;
  color: #64748b;
  margin: 2px 0 0 0;
}

/* بطاقات القوالب الحديثة */
.wa-hub-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.wa-hub-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: transform 0.15s, box-shadow 0.15s;
}

.wa-hub-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.wa-hub-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.wa-hub-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.wa-hub-card-body {
  font-size: 11.5px;
  color: #475569;
  line-height: 1.45;
  background: #f8fafc;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
  white-space: pre-wrap;
  flex: 1;
}

/* شريط إدراج المتغيرات في محرر القوالب والرسائل */
.wa-tpl-variables-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
}

.wa-tpl-var-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.wa-tpl-var-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.12s ease;
  font-family: inherit;
}

.wa-tpl-var-chip:hover {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.15);
}

.wa-tpl-var-chip:active {
  transform: scale(0.97);
}

.wa-tpl-preview-card {
  background: #efeae2 url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23000000' fill-opacity='0.04' fill-rule='evenodd'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
  border-radius: 10px;
  padding: 12px;
  border: 1px solid #d1d7db;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wa-tpl-bubble-preview {
  background: #ffffff;
  border-radius: 8px 0px 8px 8px;
  padding: 8px 12px;
  max-width: 90%;
  font-size: 12px;
  line-height: 1.5;
  color: #111b21;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  white-space: pre-wrap;
  word-break: break-word;
  align-self: flex-start;
}

/* القائمة الفرعية لأقسام واتساب النادي في الشريط الجانبي */
.nav-group-whatsapp {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item-parent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  font: inherit;
  text-align: right;
  cursor: pointer;
}

.nav-item-parent:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.nav-arrow {
  color: #94a3b8;
  transition: transform 0.2s ease;
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-group-whatsapp.expanded .nav-arrow {
  transform: rotate(-90deg);
}

.nav-submenu {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding-right: 18px;
  margin-top: 2px;
  margin-bottom: 4px;
}

.nav-group-whatsapp.expanded .nav-submenu {
  display: flex;
}

.nav-subitem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  transition: all 0.15s ease;
}

.nav-subitem:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.nav-subitem.active {
  background: #e0f2fe;
  color: #0284c7;
  font-weight: 700;
}

.nav-subitem svg {
  flex-shrink: 0;
}

/* 6. نافذة الإعدادات الشاملة المحدثة والمثبتة (Fixed-Size Settings Dialog) */
.wa-settings-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: waFadeIn 0.2s ease-out;
  padding: 16px;
  box-sizing: border-box;
}

.wa-settings-modal-dialog {
  width: min(960px, calc(100vw - 32px));
  height: min(720px, calc(100dvh - 32px));
  max-width: 960px;
  max-height: 720px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  display: grid;
  grid-template-rows: 56px minmax(0, 1fr) 56px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  box-sizing: border-box;
}

.wa-settings-modal-head {
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.wa-settings-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wa-settings-modal-body-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  background: #f8fafc;
}

.wa-settings-modal-body-grid>* {
  min-height: 0;
  max-height: 100%;
}

.wa-settings-sidebar-nav {
  background: #f8fafc;
  border-left: 1px solid #e2e8f0;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
}

.wa-settings-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #475569;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: right;
  width: 100%;
  font-family: inherit;
  transition: all 0.12s ease;
}

.wa-settings-nav-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.wa-settings-nav-btn.active {
  background: #0f172a;
  color: #ffffff;
  font-weight: 700;
}

.wa-settings-pane,
.wa-settings-content-panel {
  background: #ffffff;
  padding: 20px 24px;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wa-settings-modal-foot {
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

.wa-settings-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wa-settings-card-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.wa-settings-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wa-settings-field-label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.wa-settings-input {
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid #cbd5e1;
  font-size: 12px;
  font-family: inherit;
  background: #ffffff;
}

/* 7. نافذة نجاح تغيير كلمة المرور والتوزيع عبر الواتساب Centered Password Success Modal */
.wa-pass-success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(5px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: waFadeIn 0.2s ease-out;
  padding: 16px;
}

.wa-pass-success-dialog {
  width: min(480px, calc(100vw - 32px));
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 25px 65px rgba(15, 23, 42, 0.35);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
  border: 1px solid #e2e8f0;
  box-sizing: border-box;
}

.wa-pass-cred-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: right;
}

.wa-pass-cred-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.wa-pass-cred-label {
  color: #64748b;
  font-weight: 600;
}

.wa-pass-cred-val {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

/* متجاوب مع الشاشات المختلفة */
@media (max-width: 1100px) {
  .shell.has-whatsapp {
    grid-template-columns: 220px minmax(0, 1fr) !important;
    grid-template-rows: 100% !important;
  }

  .shell.has-whatsapp .sidebar {
    position: relative;
    width: auto;
    height: 100% !important;
    max-height: 100% !important;
    border-left: 1px solid rgba(225, 229, 240, 0.78);
    border-bottom: 0;
  }

  .wa-hub-workspace {
    grid-template-columns: 320px 1fr 0px;
  }

  .wa-hub-crm-panel {
    display: none;
  }

  .wa-settings-modal-body-grid {
    grid-template-columns: 180px minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .shell.has-whatsapp {
    display: flex !important;
    flex-direction: row !important;
    grid-template-columns: 68px minmax(0, 1fr) !important;
  }

  .shell.has-whatsapp .sidebar {
    flex: 0 0 68px;
    width: 68px;
    min-width: 68px;
    padding: 14px 8px 12px;
  }

  .shell.has-whatsapp #system-page {
    flex: 1 1 auto;
    width: auto !important;
  }

  .shell.has-whatsapp .sidebar-collapse-btn {
    display: none;
  }

  .shell.has-whatsapp .brand {
    justify-content: center;
  }

  .shell.has-whatsapp .brand span:not(.brand-mark),
  .shell.has-whatsapp .brand .brand-text,
  .shell.has-whatsapp .sidebar-search-trigger .search-trigger-text,
  .shell.has-whatsapp .sidebar-search-trigger .search-trigger-kbd,
  .shell.has-whatsapp .sidebar-user-card .user-details,
  .shell.has-whatsapp .sidebar-logout-btn .logout-text,
  .shell.has-whatsapp .sidebar-sync-row span:not(.sync-dot),
  .shell.has-whatsapp .sidebar-brand-credit,
  .shell.has-whatsapp .nav-item span:not(.nav-ic),
  .shell.has-whatsapp .nav-arrow,
  .shell.has-whatsapp .nav-subitem span {
    display: none;
  }

  .shell.has-whatsapp .sidebar-search-trigger,
  .shell.has-whatsapp .nav-item,
  .shell.has-whatsapp .nav-subitem {
    justify-content: center;
    padding-inline: 8px;
  }

  .shell.has-whatsapp .nav-submenu {
    margin: 2px 0 0;
    padding: 0;
  }

  .shell.has-whatsapp .nav-subitem-badge {
    display: none;
  }

  .wa-hub-workspace {
    grid-template-columns: 1fr;
  }

  .wa-hub-inbox {
    display: flex;
  }

  .wa-hub-chat-area {
    display: none;
  }

  .wa-hub-workspace.chat-active .wa-hub-inbox {
    display: none;
  }

  .wa-hub-workspace.chat-active .wa-hub-chat-area {
    display: flex;
  }

  .wa-settings-modal-dialog {
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
  }

  .wa-settings-modal-body-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
}

/* 7. شارة وتصميم قفل صفحة الحملات الجماعية مع المعاينة الضبابية (Bulk Campaigns Locked Preview & Overlay) */
.nav-subitem-badge {
  margin-right: auto;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.nav-subitem.active .nav-subitem-badge {
  background: #bae6fd;
  color: #0369a1;
  border-color: #7dd3fc;
}

/* حاوية صفحة الحملات الجماعية */
.wa-campaigns-view-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

/* واجهة الحملات الأصلية في الخلفية مع التأثير الضبابي وقفل التفاعل */
.wa-campaigns-locked-content {
  width: 100%;
  height: 100%;
  min-height: 100%;
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  box-sizing: border-box;
  filter: blur(5px);
  opacity: 0.52;
  pointer-events: none;
  user-select: none;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

.nav-submenu[hidden] {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.wa-campaigns-locked-content :is(button, input, select, textarea):disabled {
  opacity: 1;
  cursor: default;
}

/* واجهة الحملات النشطة عند التفعيل */
.wa-campaigns-active-content {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 20px 24px;
  box-sizing: border-box;
}

/* طبقة الغطاء التوضيحي المنفصلة فوق واجهة الحملات فقط */
.wa-campaigns-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(2px);
  overflow-y: auto;
}

.wa-campaigns-overlay-card {
  width: 100%;
  max-width: 720px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 12px 36px -4px rgba(15, 23, 42, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
  padding: 26px 24px;
  box-sizing: border-box;
  margin: auto;
  animation: waFadeIn 0.25s ease-out;
  position: relative;
  z-index: 55;
  max-height: calc(100% - 8px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.wa-cs-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
}

.wa-cs-icon-wrapper {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #bbf7d0;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.12);
}

.wa-cs-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

.wa-cs-title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 8px;
}

.wa-cs-desc {
  font-size: 13px;
  line-height: 1.65;
  color: #334155;
  max-width: 640px;
  margin: 0 auto;
}

.wa-cs-subdesc {
  font-size: 12px;
  line-height: 1.6;
  color: #64748b;
  max-width: 640px;
  margin: 8px auto 0;
}

.wa-cs-features-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 14px;
  margin-bottom: 20px;
}

.wa-cs-features-title {
  font-size: 13px;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wa-cs-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 14px;
}

@media (max-width: 768px) {
  .wa-cs-features-grid {
    grid-template-columns: 1fr;
  }

  .wa-campaigns-overlay-card {
    padding: 18px 14px;
    max-height: 85vh;
    overflow-y: auto;
  }
}

.wa-cs-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #334155;
}

.wa-cs-check-icon {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.wa-cs-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
  flex-wrap: wrap;
}

.wa-cs-footer .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: 12px;
  cursor: pointer;
}

.wa-cs-locked-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {

  .wa-campaigns-overlay-card,
  .wa-campaigns-locked-content {
    animation: none;
    transition: none;
  }
}



/* ========================================================================== */
/* WhatsApp Automation Control Plane                                           */
/* ========================================================================== */
.wa-auto-page {
  --auto-ink: #10152b;
  --auto-navy: #182246;
  --auto-blue: #4b71ff;
  --auto-green: #25d366;
  --auto-amber: #e8a541;
  --auto-danger: #d65363;
  padding: 14px 18px;
  color: var(--auto-ink);
  background:
    radial-gradient(circle at 88% 4%, rgb(37 211 102 / 8%), transparent 24rem),
    radial-gradient(circle at 4% 18%, rgb(75 113 255 / 8%), transparent 22rem),
    #f7f9fc;
  min-height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
}

.wa-auto-command,
.wa-auto-security,
.wa-auto-rules-panel,
.wa-auto-editor,
.wa-auto-history {
  border: 1px solid #dfe5f1;
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 8px 24px rgb(24 34 70 / 4%);
  backdrop-filter: blur(16px);
}

.wa-auto-command {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-radius: 14px;
}

.wa-auto-kicker,
.wa-auto-editor-head p {
  margin: 0 0 3px;
  color: var(--auto-blue);
  font: 800 9px/1 Manrope, sans-serif;
  letter-spacing: .12em;
}

.wa-auto-command h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -.02em;
  font-weight: 800;
}

.wa-auto-command p:not(.wa-auto-kicker) {
  margin: 2px 0 0;
  color: #65708d;
  font-size: 11px;
}

.wa-auto-command-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wa-auto-command-actions button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  font-size: 11px;
}

.wa-auto-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #dfe5f1;
  border-radius: 999px;
  background: #fff;
  color: #68728b;
  font-size: 10.5px;
  font-weight: 800;
}

.wa-auto-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--auto-danger);
}

.wa-auto-live.is-ready i {
  background: var(--auto-green);
  box-shadow: 0 0 0 4px rgb(37 211 102 / 12%);
  animation: wa-auto-pulse 1.8s ease-out infinite;
}

.wa-auto-security {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 11px;
}

.wa-auto-security.is-ready {
  border-color: rgb(37 211 102 / 38%);
}

.wa-auto-security.is-blocked {
  border-color: rgb(214 83 99 / 42%);
  background: #fff8f8;
}

.wa-auto-security-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #edf2ff;
  color: var(--auto-blue);
}

.wa-auto-security.is-ready .wa-auto-security-icon {
  background: #eafaf0;
  color: #128544;
}

.wa-auto-security.is-blocked .wa-auto-security-icon {
  background: #ffebed;
  color: var(--auto-danger);
}

.wa-auto-security strong {
  font-size: 11.5px;
}

.wa-auto-security p {
  margin: 1px 0 0;
  color: #6e7891;
  font-size: 10px;
}

.wa-auto-security code {
  direction: ltr;
  unicode-bidi: isolate;
  font: 700 9.5px Manrope, monospace;
  color: #43506f;
}

.wa-auto-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0;
}

.wa-auto-metrics article {
  position: relative;
  overflow: hidden;
  padding: 8px 12px;
  border: 1px solid #e0e5ef;
  border-radius: 11px;
  background: #fff;
}

.wa-auto-metrics article::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  bottom: 0;
  width: 34%;
  height: 3px;
  border-radius: 4px;
  background: var(--auto-blue);
}

.wa-auto-metrics article:nth-child(2)::after {
  background: var(--auto-amber);
}

.wa-auto-metrics article:nth-child(3)::after,
.wa-auto-metrics article:nth-child(4)::after {
  background: var(--auto-green);
}

.wa-auto-metrics article.is-danger::after {
  background: var(--auto-danger);
}

.wa-auto-metrics span {
  display: block;
  color: #778097;
  font-size: 9.5px;
  font-weight: 700;
}

.wa-auto-metrics strong {
  display: block;
  margin-top: 2px;
  color: var(--auto-navy);
  font: 800 17px/1.1 Manrope, sans-serif;
}

.wa-auto-metrics small {
  color: #9299aa;
  font-size: 10px;
}

.wa-auto-trace {
  display: grid;
  grid-template-columns: minmax(105px, 1fr) 20px minmax(105px, 1fr) 20px minmax(105px, 1fr) 20px minmax(105px, 1fr);
  align-items: center;
  margin-bottom: 8px;
  padding: 5px 10px;
  border: 1px solid #dfe5f1;
  border-radius: 11px;
  background: #111831;
  color: #fff;
}

.wa-auto-trace>i {
  height: 1px;
  background: linear-gradient(90deg, #405179, var(--auto-green));
}

.wa-auto-trace-node {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 7px;
  align-items: center;
  padding: 3px 5px;
}

.wa-auto-trace-node>span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 6px;
  background: #263254;
  color: #9db0e8;
}

.wa-auto-trace-node.is-active>span {
  background: rgb(37 211 102 / 16%);
  color: var(--auto-green);
}

.wa-auto-trace-node strong {
  font-size: 10px;
}

.wa-auto-trace-node small {
  color: #8f9ab8;
  font-size: 8.5px;
}

.wa-auto-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.wa-auto-layout.has-editor {
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, .85fr);
}

.wa-auto-rules-panel,
.wa-auto-editor,
.wa-auto-history {
  border-radius: 14px;
}

.wa-auto-rules-panel {
  padding: 12px 14px;
}

.wa-auto-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.wa-auto-section-head h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 800;
}

.wa-auto-section-head p {
  margin: 2px 0 0;
  color: #7a8398;
  font-size: 10px;
}

.wa-auto-section-head>span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf1fb;
  color: #53617f;
  font: 800 9.5px Manrope, sans-serif;
}

.wa-auto-rule-list {
  display: grid;
  gap: 6px;
}

.wa-auto-rule {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: auto;
  padding: 7px 11px;
  border: 1px solid #e1e6f0;
  border-radius: 11px;
  background: #fff;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.wa-auto-rule:hover {
  transform: translateY(-1px);
  border-color: #bbc8ea;
  box-shadow: 0 6px 18px rgb(24 34 70 / 5%);
}

.wa-auto-rule.is-disabled {
  background: #fafbfe;
}

.wa-auto-rule-state {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #798196;
  font-size: 10px;
  font-weight: 800;
}

.wa-auto-rule-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a5adbd;
}

.wa-auto-rule.is-enabled .wa-auto-rule-pulse {
  background: var(--auto-green);
  box-shadow: 0 0 0 4px rgb(37 211 102 / 12%);
}

.wa-auto-rule-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wa-auto-rule-title h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
}

.wa-auto-protected {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 5px;
  border-radius: 5px;
  background: #eef2fb;
  color: #63708f;
  font-size: 8px;
  font-weight: 800;
}

.wa-auto-rule-copy p {
  margin: 2px 0 4px;
  color: #7a8398;
  font-size: 10px;
  line-height: 1.3;
}

.wa-auto-rule-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.wa-auto-rule-meta span,
.wa-auto-rule-meta code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #f3f5fa;
  color: #65708b;
  font-size: 8px;
}

.wa-auto-rule-meta code {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: Manrope, monospace;
}

.wa-auto-rule-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.wa-auto-rule-actions button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9.5px;
  padding: 4px 7px;
}

.wa-auto-state-btn {
  min-width: 40px;
  padding: 4px 6px;
  border: 1px solid #d9dfea;
  border-radius: 7px;
  background: #fff;
  color: #53617f;
  cursor: pointer;
  font: 800 9.5px Alexandria, sans-serif;
}

.wa-auto-state-btn[aria-pressed="true"] {
  border-color: rgb(214 83 99 / 35%);
  color: #b23d50;
}

.wa-auto-editor {
  position: sticky;
  top: 8px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  border-radius: 14px;
}

.wa-auto-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #e1e6f0;
  background: #111831;
  color: #fff;
}

.wa-auto-editor-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.wa-auto-editor-head .dialog-close {
  color: #fff;
}

.wa-auto-editor form {
  display: grid;
  gap: 7px;
  padding: 11px;
}

.wa-auto-editor label {
  display: grid;
  gap: 3px;
  color: #4c5874;
  font-size: 9.5px;
  font-weight: 800;
}

.wa-auto-template-group {
  display: grid;
  gap: 4px;
}

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

.wa-auto-vars-tip {
  color: var(--auto-blue);
  font-size: 8.5px;
  font-weight: 700;
}

.wa-auto-vars-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px 6px;
  background: #f0f3fa;
  border-radius: 9px;
  border: 1px solid #dce3f0;
  max-height: 120px;
  overflow-y: auto;
}

.wa-var-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #ccd6e8;
  color: #233050;
  font: 700 9px Alexandria, sans-serif;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.wa-var-chip:hover {
  background: #e6edfc;
  border-color: var(--auto-blue);
  color: var(--auto-blue);
  transform: translateY(-1px);
}

.wa-var-chip:active,
.wa-var-chip.is-inserted {
  background: #25d366 !important;
  border-color: #25d366 !important;
  color: #ffffff !important;
  transform: scale(0.96);
}

.wa-var-chip span {
  font-size: 9.5px;
}

.wa-auto-editor input,
.wa-auto-editor select,
.wa-auto-editor textarea,
.wa-auto-filters select {
  width: 100%;
  border: 1px solid #dce2ed;
  border-radius: 8px;
  background: #fff;
  color: #182246;
  padding: 6px 8px;
  font: 600 10.5px Alexandria, sans-serif;
  outline: none;
}

.wa-auto-editor textarea {
  resize: vertical;
  line-height: 1.6;
  min-height: 65px;
}

.wa-auto-editor input:focus-visible,
.wa-auto-editor select:focus-visible,
.wa-auto-editor textarea:focus-visible,
.wa-auto-state-btn:focus-visible {
  border-color: var(--auto-blue);
  box-shadow: 0 0 0 3px rgb(75 113 255 / 14%);
}

.wa-auto-form-row,
.wa-auto-test-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.wa-auto-condition {
  margin: 0;
  padding: 7px;
  border: 1px dashed #d8dfeb;
  border-radius: 9px;
}

.wa-auto-condition legend {
  padding: 0 4px;
  color: #69748f;
  font-size: 8.5px;
  font-weight: 800;
}

.wa-auto-test-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: 7px;
  border-top: 1px dashed #dce2ed;
}

.wa-auto-variable-note {
  margin: -2px 0 0;
  color: #737e98;
  font-size: 8.5px;
}

.wa-auto-variable-note code {
  direction: ltr;
  unicode-bidi: isolate;
  color: var(--auto-blue);
}

.wa-auto-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.wa-auto-editor-actions button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  font-size: 10.5px;
}

.wa-auto-preview {
  margin: 0 11px 11px;
  padding: 9px;
  border: 1px solid #cfe8d8;
  border-radius: 10px;
  background: #f3fbf6;
}

.wa-auto-preview>div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.wa-auto-preview pre {
  margin: 6px 0;
  white-space: pre-wrap;
  font: 600 10px/1.6 Alexandria, sans-serif;
  color: #293653;
}

.wa-auto-preview small {
  color: #6e7890;
  font-size: 9px;
}

.wa-auto-history {
  margin-top: 10px;
  padding: 12px 14px;
}

.wa-auto-filters {
  display: flex;
  gap: 6px;
}

.wa-auto-filters select {
  width: auto;
  min-width: 125px;
  padding-block: 5px;
  font-size: 10.5px;
}

.wa-auto-history-table {
  overflow-x: auto;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid #e2e7f0;
  border-radius: 11px;
}

.wa-auto-history table {
  width: 100%;
  border-collapse: collapse;
  min-width: 850px;
  font-size: 10px;
}

.wa-auto-history th {
  padding: 6px 9px;
  background: #f4f6fa;
  color: #6e7890;
  text-align: right;
  font-size: 9px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.wa-auto-history td {
  padding: 6px 9px;
  border-top: 1px solid #edf0f5;
  color: #4f5b76;
}

.wa-auto-history td code {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: Manrope, monospace;
}

.wa-auto-empty {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 20px;
  color: #7d869b;
  text-align: center;
}

.wa-auto-empty strong {
  color: #3a4765;
  font-size: 12px;
}

.wa-auto-empty p {
  margin: 0;
  font-size: 10px;
}

@keyframes wa-auto-pulse {
  0% {
    box-shadow: 0 0 0 0 rgb(37 211 102 / 34%);
  }

  70% {
    box-shadow: 0 0 0 6px rgb(37 211 102 / 0%);
  }

  100% {
    box-shadow: 0 0 0 0 rgb(37 211 102 / 0%);
  }
}

@media (max-width: 1180px) {

  .wa-auto-layout,
  .wa-auto-layout.has-editor {
    grid-template-columns: 1fr;
  }

  .wa-auto-editor {
    position: static;
    max-height: none;
  }

  .wa-auto-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .wa-auto-page {
    padding: 10px;
  }

  .wa-auto-command,
  .wa-auto-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .wa-auto-security {
    grid-template-columns: auto 1fr;
  }

  .wa-auto-security code {
    grid-column: 2;
  }

  .wa-auto-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wa-auto-trace {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .wa-auto-trace>i {
    width: 1px;
    height: 12px;
    margin-inline-start: 20px;
  }

  .wa-auto-rule {
    grid-template-columns: 1fr;
  }

  .wa-auto-rule-actions {
    justify-content: flex-end;
  }

  .wa-auto-form-row,
  .wa-auto-test-fields {
    grid-template-columns: 1fr;
  }

  .wa-auto-filters {
    width: 100%;
    flex-direction: column;
  }

  .wa-auto-filters select {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wa-auto-live.is-ready i {
    animation: none;
  }

  .wa-auto-rule {
    transition: none;
  }
}

/* تأكيدات المحاسبة تبقى فوق نموذج الحركة من دون فقد قيم الحقول. */
.accounting-confirm-layer {
  position: fixed;
  inset: 0;
  z-index: 520;
}

.accounting-confirm-layer .system-modal-backdrop {
  z-index: 520;
}

.accounting-confirm-dialog {
  z-index: 521;
  width: min(560px, 92vw);
}

.accounting-confirm-content {
  display: grid;
  gap: 16px;
}

.confirm-section-title {
  display: block;
  margin-bottom: 6px;
  color: #56617c;
  font-size: 13px;
  font-weight: 700;
}

.accounting-confirm-content .history-list {
  display: grid;
  gap: 6px;
}

.accounting-confirm-content .history-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid #edf0f6;
  border-radius: 10px;
  background: #fbfcff;
  font-size: 12px;
}

.accounting-saved-actions {
  flex-wrap: wrap;
}

.accounting-saved-actions>* {
  justify-content: center;
}

.accounting-row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.receipt-preview-dialog {
  position: fixed;
  z-index: 501;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(900px, 92vw);
  max-height: 88vh;
}

.receipt-preview-dialog img {
  max-width: 100%;
  max-height: 76vh;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(15, 22, 49, .28);
  object-fit: contain;
}

.receipt-preview-close {
  justify-self: end;
  background: #fff;
}

@media (max-width: 720px) {
  .notif-panel {
    position: fixed;
    inset: 76px 12px auto;
    width: auto;
    max-height: calc(100vh - 92px);
  }

  .accounting-saved-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .accounting-row-actions {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {

  .invpage-receipt,
  .ai-fab {
    transition: none !important;
    animation: none !important;
  }
}

/* ============================================================================
 * أنماط قسم المحاسبة المتقدمة — استجابة كاملة، إدارة المرفقات، وتفاصيل الفواتير
 * ============================================================================ */
.accounting-page {
  width: 100%;
  min-height: 100vh;
  padding: 24px 30px;
  background: radial-gradient(circle at 12% 16%, rgba(220, 234, 255, 0.5) 0%, transparent 42%),
    radial-gradient(circle at 88% 84%, rgba(230, 240, 255, 0.6) 0%, transparent 46%),
    #f4f7fc;
  min-width: 0;
}

.accounting-container {
  width: 100%;
  max-width: 1480px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.accounting-workspace-card {
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  box-shadow: 0 12px 36px -6px rgba(24, 39, 75, 0.05), 0 2px 10px -2px rgba(24, 39, 75, 0.02);
  padding: 24px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.accounting-tab-btn {
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #5e6884;
  box-shadow: 0 2px 6px rgba(20, 30, 60, 0.02);
}

.accounting-tab-btn:hover {
  background: #ffffff;
  color: #151c3a;
  border-color: #dfe5f2;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(20, 30, 60, 0.06);
}

.accounting-tab-btn.active {
  background: #151c3a !important;
  color: #ffffff !important;
  border-color: #151c3a !important;
  box-shadow: 0 6px 18px rgba(21, 28, 58, 0.18) !important;
  transform: translateY(0);
}

/* بطاقات المؤشرات المالية الزجاجية الملونة */
.kpi-card-glass {
  padding: 18px 20px;
  border-radius: 20px;
  position: relative;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card-glass:hover {
  transform: translateY(-2px);
}

.kpi-card-glass.income {
  background: rgba(240, 253, 244, 0.72);
  border: 1px solid rgba(167, 243, 208, 0.75);
  box-shadow: 0 8px 20px -4px rgba(22, 101, 52, 0.04);
}

.kpi-card-glass.expense {
  background: rgba(254, 243, 199, 0.62);
  border: 1px solid rgba(253, 230, 138, 0.75);
  box-shadow: 0 8px 20px -4px rgba(180, 83, 9, 0.04);
}

.kpi-card-glass.salary {
  background: rgba(245, 243, 255, 0.72);
  border: 1px solid rgba(233, 213, 255, 0.75);
  box-shadow: 0 8px 20px -4px rgba(126, 34, 206, 0.04);
}

.kpi-card-glass.profit {
  background: rgba(254, 242, 242, 0.72);
  border: 1px solid rgba(254, 202, 202, 0.75);
  box-shadow: 0 8px 20px -4px rgba(185, 28, 28, 0.04);
}

.kpi-glass-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.kpi-glass-icon.income {
  background: rgba(220, 252, 231, 0.9);
  color: #16a34a;
}

.kpi-glass-icon.expense {
  background: rgba(254, 243, 199, 0.9);
  color: #d97706;
}

.kpi-glass-icon.salary {
  background: rgba(243, 232, 255, 0.9);
  color: #9333ea;
}

.kpi-glass-icon.profit {
  background: rgba(254, 226, 226, 0.9);
  color: #ef4444;
}

/* شريط الفلترة الزجاجي */
.accounting-date-bar {
  padding: 14px 22px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 16px -2px rgba(20, 35, 75, 0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

/* ألواح النظام الزجاجية */
.system-panel,
.panel {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 8px 24px -4px rgba(20, 35, 75, 0.03);
}

/* جداول الحركات والفواتير مع قابلية النقر على السطر بالكامل */
.member-row[data-inv-row] {
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.member-row[data-inv-row]:hover {
  background: #f4f7ff !important;
}

/* رفع ومرفقات الحركات المالية الموحدة — صندوق بارز وواضح */
.attachment-uploader-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.attachment-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 20px;
  border: 2px dashed #5376ff;
  border-radius: 16px;
  background: #f4f7ff;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(83, 118, 255, 0.05);
}

.attachment-dropzone:hover,
.attachment-dropzone.dragover {
  border-color: #3b5cb8;
  background: #eef3ff;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(83, 118, 255, 0.12);
}

.attachment-drop-icon-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #4f46e5;
  display: grid;
  place-items: center;
  margin-bottom: 2px;
  transition: transform 0.2s ease;
}

.attachment-dropzone:hover .attachment-drop-icon-circle {
  transform: scale(1.08);
}

.attachment-drop-main-title {
  font-size: 15px;
  font-weight: 800;
  color: #151c3a;
  display: block;
}

.attachment-browse-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  border-radius: 999px;
  background: #5376ff;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(83, 118, 255, 0.28);
  transition: all 0.15s ease;
}

.attachment-dropzone:hover .attachment-browse-btn {
  background: #3b5cb8;
}

.attachment-drop-hint {
  font-size: 12px;
  font-weight: 600;
  color: #69738d;
}

.attachment-selected-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 16px;
  background: #f4f8ff;
  border: 1.5px solid #a5b4fc;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.08);
}

.attachment-card-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.attachment-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid #c7d2fe;
}

.attachment-file-icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: #fee2e2;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.attachment-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.attachment-card-name {
  font-size: 13.5px;
  font-weight: 800;
  color: #151c3a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-card-size {
  font-size: 12px;
  font-weight: 600;
  color: #16a34a;
}

.attachment-remove-btn {
  padding: 7px 14px;
  border-radius: 10px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid #fca5a5;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.attachment-remove-btn:hover {
  background: #fecaca;
}

/* بطاقة مرفقات داخل تفاصيل الفاتورة */
.invpage-attachment-section {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.invpage-att-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #69738d;
}

.invpage-att-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f5;
  transition: all 0.2s ease;
}

.invpage-att-card.img-card {
  cursor: pointer;
}

.invpage-att-card.img-card:hover {
  border-color: #5376ff;
  box-shadow: 0 4px 12px rgba(83, 118, 255, 0.12);
}

.invpage-att-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #e2e8f5;
}

.invpage-file-badge {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #fee2e2;
  color: #dc2626;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.invpage-att-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.invpage-att-info strong {
  font-size: 13px;
  color: #151c3a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invpage-att-info small {
  font-size: 11px;
  color: #5376ff;
}

/* نافذة تأكيد صرف الراتب المحسّنة */
.salary-confirm-dialog {
  max-width: 620px;
  width: min(620px, 94vw);
}

.salary-confirm-head-name {
  font-size: 26px;
  font-weight: 800;
  color: #151c3a;
  margin-top: 4px;
}

.salary-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0;
}

.salary-metric-card {
  background: #f8faff;
  border: 1px solid #dfe6f5;
  border-radius: 14px;
  padding: 16px;
  text-align: right;
}

.salary-metric-label {
  font-size: 14px;
  font-weight: 600;
  color: #69738d;
  display: block;
}

.salary-metric-val {
  font-family: Manrope, sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #151c3a;
  display: block;
  margin-top: 4px;
}

.salary-section-box {
  background: #ffffff;
  border: 1px solid #e2e8f5;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.salary-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #151c3a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.salary-compact-empty {
  font-size: 13px;
  color: #8b93ad;
  margin: 0;
  padding: 6px 0;
}

/* توحيد حقول الإدخال والقوائم المنسدلة في المحاسبة */
.system-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13.5px;
  font-weight: 700;
  color: #151c3a;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  text-align: right;
  direction: rtl;
}

.system-form input,
.system-form select,
.system-form textarea {
  height: 44px;
  padding: 0 14px;
  border: 1px solid #dfe4ef;
  border-radius: 11px;
  background: #fbfcff;
  color: #151c3a;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  text-align: right;
  direction: rtl;
}

.system-form input:focus,
.system-form select:focus,
.system-form textarea:focus {
  border-color: #5376ff;
  box-shadow: 0 0 0 3px rgba(83, 118, 255, 0.12);
  background: #ffffff;
}

.system-form input[disabled] {
  background: #f1f4fa;
  color: #8b94ac;
  cursor: not-allowed;
}

/* نافذة تسجيل الحركات المالية بنسب متناسقة وبدون سكرول */
.tx-registration-dialog {
  width: min(740px, 95vw) !important;
  max-height: 98vh !important;
  overflow: visible !important;
  padding: 26px 32px !important;
}

.tx-registration-dialog .system-form label {
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  direction: rtl;
  width: 100%;
  box-sizing: border-box;
}

.tx-registration-dialog .system-form input,
.tx-registration-dialog .system-form select {
  height: 42px;
  padding: 0 14px;
  font-size: 13.5px;
  border-radius: 10px;
  text-align: right;
  direction: rtl;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .system-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   CUSTOM DATE PICKER POPUP (RTL, 1:1 CALENDAR DESIGN)
   ============================================================ */
.custom-datepicker-popup {
  position: absolute;
  z-index: 100000;
  background: #ffffff;
  border: 1px solid #eef2f8;
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14), 0 4px 12px rgba(15, 23, 42, 0.06);
  width: 286px;
  padding: 18px;
  direction: ltr;
  font-family: Alexandria, Manrope, system-ui, -apple-system, sans-serif;
  user-select: none;
  animation: dpFadeIn 0.15s ease-out;
}

@keyframes dpFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

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

.custom-datepicker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.custom-datepicker-title {
  font-weight: 800;
  font-size: 15px;
  color: #1e293b;
  font-family: Alexandria, sans-serif;
}

.custom-datepicker-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}

.custom-datepicker-nav-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}

.custom-datepicker-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  font-family: Alexandria, sans-serif;
}

.custom-datepicker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.custom-datepicker-day {
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-family: Manrope, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.12s ease;
  border: 1.5px solid transparent;
  background: transparent;
}

.custom-datepicker-day:hover:not(.empty):not(.disabled) {
  background: #f0f4ff;
  color: #4361ee;
}

.custom-datepicker-day.outside.empty {
  visibility: hidden;
  pointer-events: none;
}

.custom-datepicker-day.selected {
  background: transparent;
  border: 1.5px solid #4361ee !important;
  color: #1e293b;
  font-weight: 800;
  border-radius: 9px;
}

.custom-datepicker-day.today:not(.selected) {
  border: 1.5px solid #cbd5e1;
  color: #4361ee;
  font-weight: 700;
  border-radius: 9px;
}

.custom-datepicker-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.custom-datepicker-footer button {
  padding: 6px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  font-family: Alexandria, sans-serif;
  cursor: pointer;
  transition: all 0.12s ease;
}

.custom-datepicker-today-btn {
  background: #ffffff;
  color: #4361ee;
  border: 1px solid #c7d2fe;
}

.custom-datepicker-today-btn:hover {
  background: #eef2ff;
}

.custom-datepicker-close-btn {
  background: #ffffff;
  color: #4361ee;
  border: 1px solid #c7d2fe;
}

.custom-datepicker-close-btn:hover {
  background: #eef2ff;
}

/* ============================================================
   5-STEP ONBOARDING WIZARD & REBUILD STYLING
   ============================================================ */
.onboarding-stepper-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0 0 24px;
  padding: 0 10px;
  position: relative;
}

.onboarding-step-item {
  display: flex;
  align-items: center;
  position: relative;
}

.onboarding-step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f0f3fa;
  color: #8b93ad;
  display: grid;
  place-items: center;
  font-family: Manrope, sans-serif;
  font-weight: 800;
  font-size: 14px;
  transition: all 0.2s ease;
  z-index: 2;
  border: 2px solid #ffffff;
}

.onboarding-step-item.active .onboarding-step-circle {
  background: #536fff;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(83, 111, 255, 0.35);
}

.onboarding-step-item.completed .onboarding-step-circle {
  background: #edf2ff;
  color: #536fff;
}

.onboarding-step-connector {
  width: 60px;
  height: 2px;
  background: #e2e8f5;
  margin: 0 4px;
  transition: background 0.2s ease;
}

.onboarding-step-item.completed+.onboarding-step-item .onboarding-step-connector,
.onboarding-step-connector.filled {
  background: #536fff;
}

/* Custom Phone Input with Jordan Prefix */
.phone-jordan-group {
  display: flex;
  align-items: stretch;
  direction: ltr;
  gap: 0;
  border: 1px solid #dfe4ef;
  border-radius: 12px;
  background: #fbfcff;
  overflow: hidden;
  height: 46px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.phone-jordan-group:focus-within {
  border-color: #536fff;
  box-shadow: 0 0 0 3px rgba(83, 111, 255, 0.12);
  background: #ffffff;
}

.phone-jordan-prefix {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: #f0f3fa;
  color: #495473;
  font-family: Manrope, sans-serif;
  font-weight: 700;
  font-size: 13px;
  border-right: 1px solid #dfe4ef;
  user-select: none;
  flex-shrink: 0;
}

.phone-jordan-prefix .flag-code {
  font-size: 12px;
  color: #151c3a;
}

.phone-jordan-input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  padding: 0 12px !important;
  font-family: Manrope, sans-serif !important;
  font-size: 14.5px !important;
  font-weight: 600 !important;
  color: #151c3a !important;
  outline: none !important;
  height: 100% !important;
  box-shadow: none !important;
}

/* Email Verification Feedback */
.email-valid-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #2f9f61;
  margin-top: 4px;
}

/* Payment Methods Grid */
.payment-methods-grid-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 10px 0 16px;
}

.payment-method-select-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
  border-radius: 14px;
  border: 1.5px solid #e1e6f0;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  min-height: 94px;
}

.payment-method-select-card:hover {
  border-color: #b8c8ff;
  background: #f8faff;
  transform: translateY(-1px);
}

.payment-method-select-card.selected {
  border-color: #536fff;
  background: #f0f4ff;
  box-shadow: 0 0 0 3px rgba(83, 111, 255, 0.14);
}

.payment-method-img {
  width: 44px;
  height: 32px;
  object-fit: contain;
  display: block;
}

.payment-method-name {
  font-size: 13px;
  font-weight: 800;
  color: #151c3a;
}

/* Delivery Method Cards */
.delivery-methods-grid-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 10px 0 16px;
}

.delivery-method-select-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 10px 8px;
  border-radius: 12px;
  border: 1.5px solid #e1e6f0;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
  min-height: 74px;
}

.delivery-method-select-card:hover {
  border-color: #b8c8ff;
  background: #f8faff;
  transform: translateY(-1px);
}

.delivery-method-select-card.selected {
  border-color: #536fff;
  background: #f0f4ff;
  box-shadow: 0 0 0 3px rgba(83, 111, 255, 0.14);
}

.delivery-method-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
}

.delivery-channel-logo {
  display: block;
  object-fit: contain;
  transition: transform 0.18s ease;
}

.delivery-method-select-card:hover .delivery-channel-logo {
  transform: scale(1.08);
}

.delivery-method-icon {
  font-size: 20px;
  display: grid;
  place-items: center;
}

.delivery-method-label {
  font-size: 13px;
  font-weight: 800;
  color: #151c3a;
}

/* Review Summary Card in Step 5 */
.onboarding-review-box {
  background: #ffffff;
  border: 1px solid #e1e6f0;
  border-radius: 18px;
  padding: 18px 20px;
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.review-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  padding: 4px 0;
}

.review-summary-row .rev-label {
  color: #7985a3;
  font-weight: 600;
}

.review-summary-row .rev-val {
  color: #151c3a;
  font-weight: 800;
}

.review-divider {
  height: 1px;
  background: #eef2fa;
  margin: 6px 0;
}

.review-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}

.review-total-row .rev-total-val {
  font-family: Manrope, sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #536fff;
}

/* ============================================================
   SUPPLIERS SECTION ENHANCED STYLING
   ============================================================ */
.suppliers-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.suppliers-search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.suppliers-search-box input {
  width: 100%;
  height: 46px;
  padding: 10px 42px 10px 14px;
  border-radius: 12px;
  border: 1px solid #dfe4ef;
  background: #fbfcff;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: all 0.15s ease;
}

.suppliers-search-box input:focus {
  border-color: #536fff;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(83, 111, 255, 0.12);
}

.suppliers-search-box .search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #8e97b0;
  font-size: 17px;
  pointer-events: none;
}

.supplier-row-interactive {
  cursor: pointer;
  transition: background 0.15s ease;
}

.supplier-row-interactive:hover {
  background: #f8f9fe !important;
}

/* معالج إضافة عضو فريق جديد (Staff Onboarding Wizard) */
.staff-wizard-dialog {
  max-width: 580px !important;
  width: 100%;
}

.staff-wizard-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0 0 18px;
  padding: 0 10px;
}

.staff-wizard-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 12px;
  padding: 9px 14px;
  margin-bottom: 14px;
}

.staff-wizard-step-header-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.staff-wizard-step-header-badge {
  font-size: 11px;
  font-weight: 700;
  background: #e0e7ff;
  color: #4338ca;
  padding: 2px 9px;
  border-radius: 20px;
}

.staff-wizard-kind-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.staff-wizard-kind-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
}

.staff-wizard-kind-card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.staff-wizard-kind-card.active {
  border-color: #536fff;
  background: #f5f7ff;
  box-shadow: 0 4px 14px rgba(83, 111, 255, 0.12);
}

.staff-wizard-kind-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #64748b;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.staff-wizard-kind-card.active .staff-wizard-kind-icon {
  background: #536fff;
  color: #ffffff;
}

.staff-wizard-kind-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 2px;
}

.staff-wizard-kind-desc {
  font-size: 11.5px;
  color: #64748b;
}

.staff-wizard-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.staff-wizard-step[hidden] {
  display: none !important;
}

.staff-wizard-summary-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  margin-top: 8px;
}

.staff-wizard-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 12px;
}

.staff-wizard-summary-name {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin-top: 2px;
}

.staff-wizard-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

.staff-wizard-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.staff-wizard-summary-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

.staff-wizard-summary-value {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}

@media (max-width: 600px) {
  .payment-methods-grid-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .delivery-methods-grid-cards {
    grid-template-columns: 1fr;
  }

  .onboarding-stepper-connector {
    width: 28px;
  }
}

/* System Modal Host Container */
#system-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: block;
}

#system-modal[hidden] {
  display: none !important;
}

.member-modal {
  position: fixed;
  z-index: 10005 !important;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.member-modal[hidden] {
  display: none !important;
}

.member-modal:not([hidden]) {
  display: grid !important;
  z-index: 10005 !important;
}

.custom-phone-group {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  border: 1px solid #dfe4ef;
  border-radius: 11px;
  background: #fbfcff;
  height: 46px;
  overflow: hidden;
  transition: all 0.15s ease;
  direction: ltr !important;
}

.custom-phone-group:focus-within {
  border-color: #536fff;
  box-shadow: 0 0 0 3px rgba(83, 111, 255, 0.12);
  background: #ffffff;
}

.custom-phone-prefix,
.custom-phone-group .custom-phone-select,
.custom-phone-select {
  display: flex !important;
  align-items: center !important;
  gap: 6px;
  width: auto !important;
  min-width: 105px !important;
  max-width: 130px !important;
  flex: 0 0 auto !important;
  padding: 0 10px !important;
  background: #f1f4f9 !important;
  border: none !important;
  border-right: 1px solid #dfe4ef !important;
  border-radius: 0 !important;
  font-family: Manrope, sans-serif !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #151c3a !important;
  height: 100% !important;
  outline: none !important;
  cursor: pointer !important;
  direction: ltr !important;
  transition: background 0.15s ease;
  appearance: auto !important;
  -webkit-appearance: auto !important;
}

.custom-phone-select:hover {
  background: #e8ecf4 !important;
}

.custom-phone-select:focus {
  background: #e2e8f0 !important;
}

.custom-phone-group .custom-phone-input,
.custom-phone-input {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: 100% !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  font-family: Manrope, sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  padding: 0 12px !important;
  height: 100% !important;
  color: #151c3a !important;
  direction: ltr !important;
}

/* صفحة الفاتورة — أنيميشن الطباعة الحرارية والمودال المعتمد */
.invpage-box {
  position: fixed;
  z-index: 10001;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  border-radius: 24px;
  width: min(480px, 94vw);
  max-width: 480px;
  padding: 28px 24px 24px;
  box-shadow: 0 30px 70px -10px rgba(15, 22, 49, 0.3);
  color: #151c3a;
  max-height: 92vh;
  overflow-y: auto;
  text-align: right;
}

/* ============================================================================
 * مركز التقارير والتحميل المباشر لملفات PDF (Reports Center & Direct PDF)
 * ============================================================================ */
.reports-page {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.reports-container,
.reports-hub-wrapper {
  width: 100%;
  max-width: 1500px;
  margin-inline: auto;
  padding: 0 0 40px;
  box-sizing: border-box;
}

.reports-header {
  margin-bottom: 24px;
  text-align: right;
}

.reports-eyebrow {
  margin: 0 0 4px 0;
  color: #9098ae;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.reports-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  color: #151c3a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.reports-title-dot {
  color: #f59e0b;
  font-size: 20px;
  line-height: 1;
  display: inline-block;
}

.reports-grid,
.reports-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1300px) {

  .reports-grid,
  .reports-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (max-width: 980px) {

  .reports-grid,
  .reports-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 640px) {

  .reports-grid,
  .reports-cards-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.report-card {
  min-width: 0;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  padding: 24px 22px;
  background: #ffffff;
  border: 1px solid #e3e7f1;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(26, 35, 67, 0.05);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-sizing: border-box;
  text-align: right;
}

.report-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(26, 35, 67, 0.08);
  border-color: #cbd5e1;
}

.report-card-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 14px;
  width: 100%;
  box-sizing: border-box;
}

.report-icon,
.report-card-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  max-width: 42px;
  min-height: 42px;
  max-height: 42px;
  flex: 0 0 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-sizing: border-box;
}

.report-icon svg,
.report-card-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.report-title,
.report-card-title {
  font-size: 16.5px;
  font-weight: 700;
  color: #1b2440;
  margin: 0 0 8px 0;
  text-align: right;
  line-height: 1.4;
}

.report-desc,
.report-card-desc {
  font-size: 14px;
  line-height: 1.65;
  color: #8e97b0;
  margin: 0 0 20px 0;
  min-height: 42px;
  text-align: right;
}

.report-card-actions {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.report-btn-pdf {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  background: #1b254e;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(27, 37, 78, 0.12);
  transition: all 0.18s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  text-decoration: none;
  padding: 0 8px;
}

.report-btn-pdf:hover:not(:disabled) {
  background: #222e5e;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(27, 37, 78, 0.2);
}

.report-btn-pdf:focus-visible {
  outline: 2px solid #4b71ff;
  outline-offset: 2px;
}

.report-btn-pdf:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  background: #283359;
  transform: none;
  box-shadow: none;
}

.report-btn-csv {
  width: 100%;
  min-height: 42px;
  border: 1.5px solid #e2e8f0;
  border-radius: 11px;
  background: #f8fafc;
  color: #1e293b;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: all 0.18s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  text-decoration: none;
  padding: 0 8px;
}

.report-btn-csv:hover:not(:disabled) {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.report-btn-csv:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
}

.report-btn-csv:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  background: #f1f5f9;
  transform: none;
  box-shadow: none;
}

.report-download-button,
.report-card-btn {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 11px;
  background: #1b254e;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(28, 37, 74, 0.12);
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  text-decoration: none;
}

.report-download-button:hover:not(:disabled),
.report-card-btn:hover:not(:disabled) {
  background: #222e5e;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(28, 37, 74, 0.18);
}

.report-download-button:focus-visible,
.report-card-btn:focus-visible {
  outline: 2px solid #4b71ff;
  outline-offset: 2px;
}

.report-download-button:disabled,
.report-card-btn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  background: #283359;
  transform: none;
  box-shadow: none;
}

.report-btn-pdf .btn-spinner,
.report-btn-csv .btn-spinner,
.report-download-button .btn-spinner,
.report-card-btn .btn-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: repSpin 0.7s linear infinite;
  display: inline-block;
}

@keyframes repSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Off-screen PDF Template Staging */
.pdf-staging-container {
  position: fixed;
  left: -99999px;
  top: 0;
  width: 1100px;
  background: #ffffff;
  color: #151c3a;
  padding: 36px 40px;
  font-family: Alexandria, Cairo, 'Segoe UI', Tahoma, sans-serif;
  direction: rtl;
  box-sizing: border-box;
}

/* ============================================================================
 * نظام الإشعارات والـ SMS الشامل (Notifications & SMS Center)
/* ============================================================================
 * نظام الإشعارات والـ SMS وإدارة Web Push الشامل (Ultra Gym Notification Center)
 * ============================================================================ */
.notif-wrapper {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

.notif-grid-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 16px;
  align-items: start;
  width: 100%;
}

@media (max-width: 1020px) {
  .notif-grid-layout {
    grid-template-columns: 1fr;
  }
}

/* ── NOTIFICATION STUDIO PANEL (Modern Unified Dispatcher) ─────────────── */
.notif-studio-panel {
  background: var(--panel-solid, #ffffff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(16, 21, 55, 0.04), 0 10px 28px -10px rgba(16, 21, 55, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.notif-studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.notif-studio-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink, #10152b);
}

.notif-studio-badge {
  font-size: 10px;
  font-weight: 800;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.2px;
}

/* Quick Templates Bar */
.notif-studio-templates {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--line, #e2e8f0);
}

.notif-studio-tpl-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-soft, #4a5470);
  white-space: nowrap;
  flex-shrink: 0;
}

.notif-quick-chips {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: thin;
  flex: 1;
}

.notif-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 7px;
  border: 1px solid var(--line, #e2e8f0);
  background: #ffffff;
  color: var(--ink-soft, #4a5470);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
}

.notif-quick-btn:hover {
  background: #182246;
  border-color: #182246;
  color: #ffffff;
  transform: translateY(-1px);
}

/* 2-Column Split: Audience (Right) & Destination/Composer (Left) */
.notif-studio-columns {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 12px;
  align-items: start;
}

@media (max-width: 1080px) {
  .login-split {
    grid-template-columns: 1.2fr 1fr;
    max-width: 1020px;
    height: auto;
    min-height: 600px;
  }
  .login-brand-col {
    padding: 26px 28px 22px;
  }
  .brand-headline {
    font-size: 32px;
  }
  .login-wire-hero-img {
    max-height: 210px;
    width: clamp(180px, 22vw, 260px);
  }
  .brand-wire-band {
    min-height: 42px;
    max-height: 65px;
  }
  .login-form-col {
    padding: 34px 30px;
  }
}

@media (max-width: 860px) {
  .login-portal {
    padding: 16px 12px;
    align-items: flex-start;
    overflow-y: auto;
  }
  .login-cinematic-bg {
    display: none;
  }
  .login-split {
    grid-template-columns: 1fr;
    max-width: 460px;
    height: auto;
    min-height: auto;
    border-radius: 24px;
    margin: 16px auto;
  }
  .login-brand-col {
    display: none;
  }
  .login-form-col {
    padding: 26px 22px 30px;
  }
  .login-mobile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 24px 20px;
    margin: -26px -22px 22px -22px;
    background: linear-gradient(165deg, #02101b 0%, #041827 50%, #05213a 100%);
    border-bottom: 1px solid rgba(45, 208, 239, 0.12);
    border-radius: 24px 24px 0 0;
    position: relative;
    overflow: hidden;
  }
  .login-mobile-logo-wrap {
    max-width: 240px;
    width: 100%;
    display: flex;
    justify-content: center;
  }
  .login-mobile-logo {
    width: 100%;
    height: auto;
    max-height: 85px;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(45, 208, 239, 0.18));
  }
  .login-mobile-tag {
    font-size: 11px;
    font-weight: 700;
    color: #7ee5ff;
    background: rgba(45, 208, 239, 0.07);
    border: 1px solid rgba(45, 208, 239, 0.15);
    padding: 3px 12px;
    border-radius: 16px;
    letter-spacing: 0.3px;
  }
}

@media (max-width: 430px) {
  .login-portal {
    padding: 6px;
  }
  .login-form-col {
    padding: 18px 14px 24px;
  }
  .login-mobile-header {
    margin: -18px -14px 18px -14px;
    padding: 18px 12px;
  }
  .login-title {
    font-size: 26px;
  }
  .login-card {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-split,
  .login-wire-hero-img,
  .login-wire-band-svg,
  .wire-pulse-group circle,
  .login-outer-cable,
  .login-ambient-light,
  .login-shell-spotlight,
  .login-ambient-halo,
  .login-logo-aura {
    animation: none !important;
    transition: none !important;
  }
  .auth-spinner,
  .btn-spinner {
    animation-duration: 2s !important;
  }
}

@media (max-width: 768px) {
  .shell.has-whatsapp {
    display: flex !important;
    flex-direction: row !important;
    grid-template-columns: 68px minmax(0, 1fr) !important;
  }

  .shell.has-whatsapp .sidebar {
    flex: 0 0 68px;
    width: 68px;
    min-width: 68px;
    padding: 14px 8px 12px;
  }

  .shell.has-whatsapp #system-page {
    flex: 1 1 auto;
    width: auto !important;
  }

  .shell.has-whatsapp .sidebar-collapse-btn {
    display: none;
  }

  .shell.has-whatsapp .brand {
    justify-content: center;
  }

  .shell.has-whatsapp .brand span:not(.brand-mark),
  .shell.has-whatsapp .brand .brand-text,
  .shell.has-whatsapp .sidebar-search-trigger .search-trigger-text,
  .shell.has-whatsapp .sidebar-search-trigger .search-trigger-kbd,
  .shell.has-whatsapp .sidebar-user-card .user-details,
  .shell.has-whatsapp .sidebar-logout-btn .logout-text,
  .shell.has-whatsapp .sidebar-sync-row span:not(.sync-dot),
  .shell.has-whatsapp .sidebar-brand-credit,
  .shell.has-whatsapp .nav-item span:not(.nav-ic),
  .shell.has-whatsapp .nav-arrow,
  .shell.has-whatsapp .nav-subitem span {
    display: none;
  }

  .shell.has-whatsapp .sidebar-search-trigger,
  .shell.has-whatsapp .nav-item,
  .shell.has-whatsapp .nav-subitem {
    justify-content: center;
    padding-inline: 8px;
  }

  .shell.has-whatsapp .nav-submenu {
    margin: 2px 0 0;
    padding: 0;
  }

  .shell.has-whatsapp .nav-subitem-badge {
    display: none;
  }

  .wa-hub-workspace {
    grid-template-columns: 1fr;
  }

  .wa-hub-inbox {
    display: flex;
  }

  .wa-hub-chat-area {
    display: none;
  }

  .wa-hub-workspace.chat-active .wa-hub-inbox {
    display: none;
  }

  .wa-hub-workspace.chat-active .wa-hub-chat-area {
    display: flex;
  }

  .wa-settings-modal-dialog {
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
  }

  .wa-settings-modal-body-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
}

/* 7. شارة وتصميم قفل صفحة الحملات الجماعية مع المعاينة الضبابية (Bulk Campaigns Locked Preview & Overlay) */
.nav-subitem-badge {
  margin-right: auto;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.nav-subitem.active .nav-subitem-badge {
  background: #bae6fd;
  color: #0369a1;
  border-color: #7dd3fc;
}

/* حاوية صفحة الحملات الجماعية */
.wa-campaigns-view-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

/* واجهة الحملات الأصلية في الخلفية مع التأثير الضبابي وقفل التفاعل */
.wa-campaigns-locked-content {
  width: 100%;
  height: 100%;
  min-height: 100%;
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  box-sizing: border-box;
  filter: blur(5px);
  opacity: 0.52;
  pointer-events: none;
  user-select: none;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

.nav-submenu[hidden] {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.wa-campaigns-locked-content :is(button, input, select, textarea):disabled {
  opacity: 1;
  cursor: default;
}

/* واجهة الحملات النشطة عند التفعيل */
.wa-campaigns-active-content {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 20px 24px;
  box-sizing: border-box;
}

/* طبقة الغطاء التوضيحي المنفصلة فوق واجهة الحملات فقط */
.wa-campaigns-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(2px);
  overflow-y: auto;
}

.wa-campaigns-overlay-card {
  width: 100%;
  max-width: 720px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 12px 36px -4px rgba(15, 23, 42, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
  padding: 26px 24px;
  box-sizing: border-box;
  margin: auto;
  animation: waFadeIn 0.25s ease-out;
  position: relative;
  z-index: 55;
  max-height: calc(100% - 8px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.wa-cs-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
}

.wa-cs-icon-wrapper {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #bbf7d0;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.12);
}

.wa-cs-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

.wa-cs-title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 8px;
}

.wa-cs-desc {
  font-size: 13px;
  line-height: 1.65;
  color: #334155;
  max-width: 640px;
  margin: 0 auto;
}

.wa-cs-subdesc {
  font-size: 12px;
  line-height: 1.6;
  color: #64748b;
  max-width: 640px;
  margin: 8px auto 0;
}

.wa-cs-features-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 14px;
  margin-bottom: 20px;
}

.wa-cs-features-title {
  font-size: 13px;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wa-cs-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 14px;
}

@media (max-width: 768px) {
  .wa-cs-features-grid {
    grid-template-columns: 1fr;
  }

  .wa-campaigns-overlay-card {
    padding: 18px 14px;
    max-height: 85vh;
    overflow-y: auto;
  }
}

.wa-cs-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #334155;
}

.wa-cs-check-icon {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.wa-cs-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
  flex-wrap: wrap;
}

.wa-cs-footer .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: 12px;
  cursor: pointer;
}

.wa-cs-locked-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {

  .wa-campaigns-overlay-card,
  .wa-campaigns-locked-content {
    animation: none;
    transition: none;
  }
}



/* ========================================================================== */
/* WhatsApp Automation Control Plane                                           */
/* ========================================================================== */
.wa-auto-page {
  --auto-ink: #10152b;
  --auto-navy: #182246;
  --auto-blue: #4b71ff;
  --auto-green: #25d366;
  --auto-amber: #e8a541;
  --auto-danger: #d65363;
  padding: 14px 18px;
  color: var(--auto-ink);
  background:
    radial-gradient(circle at 88% 4%, rgb(37 211 102 / 8%), transparent 24rem),
    radial-gradient(circle at 4% 18%, rgb(75 113 255 / 8%), transparent 22rem),
    #f7f9fc;
  min-height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
}

.wa-auto-command,
.wa-auto-security,
.wa-auto-rules-panel,
.wa-auto-editor,
.wa-auto-history {
  border: 1px solid #dfe5f1;
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 8px 24px rgb(24 34 70 / 4%);
  backdrop-filter: blur(16px);
}

.wa-auto-command {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-radius: 14px;
}

.wa-auto-kicker,
.wa-auto-editor-head p {
  margin: 0 0 3px;
  color: var(--auto-blue);
  font: 800 9px/1 Manrope, sans-serif;
  letter-spacing: .12em;
}

.wa-auto-command h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -.02em;
  font-weight: 800;
}

.wa-auto-command p:not(.wa-auto-kicker) {
  margin: 2px 0 0;
  color: #65708d;
  font-size: 11px;
}

.wa-auto-command-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wa-auto-command-actions button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  font-size: 11px;
}

.wa-auto-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #dfe5f1;
  border-radius: 999px;
  background: #fff;
  color: #68728b;
  font-size: 10.5px;
  font-weight: 800;
}

.wa-auto-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--auto-danger);
}

.wa-auto-live.is-ready i {
  background: var(--auto-green);
  box-shadow: 0 0 0 4px rgb(37 211 102 / 12%);
  animation: wa-auto-pulse 1.8s ease-out infinite;
}

.wa-auto-security {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 11px;
}

.wa-auto-security.is-ready {
  border-color: rgb(37 211 102 / 38%);
}

.wa-auto-security.is-blocked {
  border-color: rgb(214 83 99 / 42%);
  background: #fff8f8;
}

.wa-auto-security-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #edf2ff;
  color: var(--auto-blue);
}

.wa-auto-security.is-ready .wa-auto-security-icon {
  background: #eafaf0;
  color: #128544;
}

.wa-auto-security.is-blocked .wa-auto-security-icon {
  background: #ffebed;
  color: var(--auto-danger);
}

.wa-auto-security strong {
  font-size: 11.5px;
}

.wa-auto-security p {
  margin: 1px 0 0;
  color: #6e7891;
  font-size: 10px;
}

.wa-auto-security code {
  direction: ltr;
  unicode-bidi: isolate;
  font: 700 9.5px Manrope, monospace;
  color: #43506f;
}

.wa-auto-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0;
}

.wa-auto-metrics article {
  position: relative;
  overflow: hidden;
  padding: 8px 12px;
  border: 1px solid #e0e5ef;
  border-radius: 11px;
  background: #fff;
}

.wa-auto-metrics article::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  bottom: 0;
  width: 34%;
  height: 3px;
  border-radius: 4px;
  background: var(--auto-blue);
}

.wa-auto-metrics article:nth-child(2)::after {
  background: var(--auto-amber);
}

.wa-auto-metrics article:nth-child(3)::after,
.wa-auto-metrics article:nth-child(4)::after {
  background: var(--auto-green);
}

.wa-auto-metrics article.is-danger::after {
  background: var(--auto-danger);
}

.wa-auto-metrics span {
  display: block;
  color: #778097;
  font-size: 9.5px;
  font-weight: 700;
}

.wa-auto-metrics strong {
  display: block;
  margin-top: 2px;
  color: var(--auto-navy);
  font: 800 17px/1.1 Manrope, sans-serif;
}

.wa-auto-metrics small {
  color: #9299aa;
  font-size: 10px;
}

.wa-auto-trace {
  display: grid;
  grid-template-columns: minmax(105px, 1fr) 20px minmax(105px, 1fr) 20px minmax(105px, 1fr) 20px minmax(105px, 1fr);
  align-items: center;
  margin-bottom: 8px;
  padding: 5px 10px;
  border: 1px solid #dfe5f1;
  border-radius: 11px;
  background: #111831;
  color: #fff;
}

.wa-auto-trace>i {
  height: 1px;
  background: linear-gradient(90deg, #405179, var(--auto-green));
}

.wa-auto-trace-node {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 7px;
  align-items: center;
  padding: 3px 5px;
}

.wa-auto-trace-node>span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 6px;
  background: #263254;
  color: #9db0e8;
}

.wa-auto-trace-node.is-active>span {
  background: rgb(37 211 102 / 16%);
  color: var(--auto-green);
}

.wa-auto-trace-node strong {
  font-size: 10px;
}

.wa-auto-trace-node small {
  color: #8f9ab8;
  font-size: 8.5px;
}

.wa-auto-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.wa-auto-layout.has-editor {
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, .85fr);
}

.wa-auto-rules-panel,
.wa-auto-editor,
.wa-auto-history {
  border-radius: 14px;
}

.wa-auto-rules-panel {
  padding: 12px 14px;
}

.wa-auto-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.wa-auto-section-head h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 800;
}

.wa-auto-section-head p {
  margin: 2px 0 0;
  color: #7a8398;
  font-size: 10px;
}

.wa-auto-section-head>span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf1fb;
  color: #53617f;
  font: 800 9.5px Manrope, sans-serif;
}

.wa-auto-rule-list {
  display: grid;
  gap: 6px;
}

.wa-auto-rule {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: auto;
  padding: 7px 11px;
  border: 1px solid #e1e6f0;
  border-radius: 11px;
  background: #fff;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.wa-auto-rule:hover {
  transform: translateY(-1px);
  border-color: #bbc8ea;
  box-shadow: 0 6px 18px rgb(24 34 70 / 5%);
}

.wa-auto-rule.is-disabled {
  background: #fafbfe;
}

.wa-auto-rule-state {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #798196;
  font-size: 10px;
  font-weight: 800;
}

.wa-auto-rule-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a5adbd;
}

.wa-auto-rule.is-enabled .wa-auto-rule-pulse {
  background: var(--auto-green);
  box-shadow: 0 0 0 4px rgb(37 211 102 / 12%);
}

.wa-auto-rule-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wa-auto-rule-title h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
}

.wa-auto-protected {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 5px;
  border-radius: 5px;
  background: #eef2fb;
  color: #63708f;
  font-size: 8px;
  font-weight: 800;
}

.wa-auto-rule-copy p {
  margin: 2px 0 4px;
  color: #7a8398;
  font-size: 10px;
  line-height: 1.3;
}

.wa-auto-rule-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.wa-auto-rule-meta span,
.wa-auto-rule-meta code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #f3f5fa;
  color: #65708b;
  font-size: 8px;
}

.wa-auto-rule-meta code {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: Manrope, monospace;
}

.wa-auto-rule-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.wa-auto-rule-actions button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9.5px;
  padding: 4px 7px;
}

.wa-auto-state-btn {
  min-width: 40px;
  padding: 4px 6px;
  border: 1px solid #d9dfea;
  border-radius: 7px;
  background: #fff;
  color: #53617f;
  cursor: pointer;
  font: 800 9.5px Alexandria, sans-serif;
}

.wa-auto-state-btn[aria-pressed="true"] {
  border-color: rgb(214 83 99 / 35%);
  color: #b23d50;
}

.wa-auto-editor {
  position: sticky;
  top: 8px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  border-radius: 14px;
}

.wa-auto-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #e1e6f0;
  background: #111831;
  color: #fff;
}

.wa-auto-editor-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.wa-auto-editor-head .dialog-close {
  color: #fff;
}

.wa-auto-editor form {
  display: grid;
  gap: 7px;
  padding: 11px;
}

.wa-auto-editor label {
  display: grid;
  gap: 3px;
  color: #4c5874;
  font-size: 9.5px;
  font-weight: 800;
}

.wa-auto-template-group {
  display: grid;
  gap: 4px;
}

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

.wa-auto-vars-tip {
  color: var(--auto-blue);
  font-size: 8.5px;
  font-weight: 700;
}

.wa-auto-vars-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px 6px;
  background: #f0f3fa;
  border-radius: 9px;
  border: 1px solid #dce3f0;
  max-height: 120px;
  overflow-y: auto;
}

.wa-var-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #ccd6e8;
  color: #233050;
  font: 700 9px Alexandria, sans-serif;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.wa-var-chip:hover {
  background: #e6edfc;
  border-color: var(--auto-blue);
  color: var(--auto-blue);
  transform: translateY(-1px);
}

.wa-var-chip:active,
.wa-var-chip.is-inserted {
  background: #25d366 !important;
  border-color: #25d366 !important;
  color: #ffffff !important;
  transform: scale(0.96);
}

.wa-var-chip span {
  font-size: 9.5px;
}

.wa-auto-editor input,
.wa-auto-editor select,
.wa-auto-editor textarea,
.wa-auto-filters select {
  width: 100%;
  border: 1px solid #dce2ed;
  border-radius: 8px;
  background: #fff;
  color: #182246;
  padding: 6px 8px;
  font: 600 10.5px Alexandria, sans-serif;
  outline: none;
}

.wa-auto-editor textarea {
  resize: vertical;
  line-height: 1.6;
  min-height: 65px;
}

.wa-auto-editor input:focus-visible,
.wa-auto-editor select:focus-visible,
.wa-auto-editor textarea:focus-visible,
.wa-auto-state-btn:focus-visible {
  border-color: var(--auto-blue);
  box-shadow: 0 0 0 3px rgb(75 113 255 / 14%);
}

.wa-auto-form-row,
.wa-auto-test-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.wa-auto-condition {
  margin: 0;
  padding: 7px;
  border: 1px dashed #d8dfeb;
  border-radius: 9px;
}

.wa-auto-condition legend {
  padding: 0 4px;
  color: #69748f;
  font-size: 8.5px;
  font-weight: 800;
}

.wa-auto-test-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: 7px;
  border-top: 1px dashed #dce2ed;
}

.wa-auto-variable-note {
  margin: -2px 0 0;
  color: #737e98;
  font-size: 8.5px;
}

.wa-auto-variable-note code {
  direction: ltr;
  unicode-bidi: isolate;
  color: var(--auto-blue);
}

.wa-auto-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.wa-auto-editor-actions button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  font-size: 10.5px;
}

.wa-auto-preview {
  margin: 0 11px 11px;
  padding: 9px;
  border: 1px solid #cfe8d8;
  border-radius: 10px;
  background: #f3fbf6;
}

.wa-auto-preview>div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.wa-auto-preview pre {
  margin: 6px 0;
  white-space: pre-wrap;
  font: 600 10px/1.6 Alexandria, sans-serif;
  color: #293653;
}

.wa-auto-preview small {
  color: #6e7890;
  font-size: 9px;
}

.wa-auto-history {
  margin-top: 10px;
  padding: 12px 14px;
}

.wa-auto-filters {
  display: flex;
  gap: 6px;
}

.wa-auto-filters select {
  width: auto;
  min-width: 125px;
  padding-block: 5px;
  font-size: 10.5px;
}

.wa-auto-history-table {
  overflow-x: auto;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid #e2e7f0;
  border-radius: 11px;
}

.wa-auto-history table {
  width: 100%;
  border-collapse: collapse;
  min-width: 850px;
  font-size: 10px;
}

.wa-auto-history th {
  padding: 6px 9px;
  background: #f4f6fa;
  color: #6e7890;
  text-align: right;
  font-size: 9px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.wa-auto-history td {
  padding: 6px 9px;
  border-top: 1px solid #edf0f5;
  color: #4f5b76;
}

.wa-auto-history td code {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: Manrope, monospace;
}

.wa-auto-empty {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 20px;
  color: #7d869b;
  text-align: center;
}

.wa-auto-empty strong {
  color: #3a4765;
  font-size: 12px;
}

.wa-auto-empty p {
  margin: 0;
  font-size: 10px;
}

@keyframes wa-auto-pulse {
  0% {
    box-shadow: 0 0 0 0 rgb(37 211 102 / 34%);
  }

  70% {
    box-shadow: 0 0 0 6px rgb(37 211 102 / 0%);
  }

  100% {
    box-shadow: 0 0 0 0 rgb(37 211 102 / 0%);
  }
}

@media (max-width: 1180px) {

  .wa-auto-layout,
  .wa-auto-layout.has-editor {
    grid-template-columns: 1fr;
  }

  .wa-auto-editor {
    position: static;
    max-height: none;
  }

  .wa-auto-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .wa-auto-page {
    padding: 10px;
  }

  .wa-auto-command,
  .wa-auto-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .wa-auto-security {
    grid-template-columns: auto 1fr;
  }

  .wa-auto-security code {
    grid-column: 2;
  }

  .wa-auto-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wa-auto-trace {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .wa-auto-trace>i {
    width: 1px;
    height: 12px;
    margin-inline-start: 20px;
  }

  .wa-auto-rule {
    grid-template-columns: 1fr;
  }

  .wa-auto-rule-actions {
    justify-content: flex-end;
  }

  .wa-auto-form-row,
  .wa-auto-test-fields {
    grid-template-columns: 1fr;
  }

  .wa-auto-filters {
    width: 100%;
    flex-direction: column;
  }

  .wa-auto-filters select {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wa-auto-live.is-ready i {
    animation: none;
  }

  .wa-auto-rule {
    transition: none;
  }
}

/* تأكيدات المحاسبة تبقى فوق نموذج الحركة من دون فقد قيم الحقول. */
.accounting-confirm-layer {
  position: fixed;
  inset: 0;
  z-index: 520;
}

.accounting-confirm-layer .system-modal-backdrop {
  z-index: 520;
}

.accounting-confirm-dialog {
  z-index: 521;
  width: min(560px, 92vw);
}

.accounting-confirm-content {
  display: grid;
  gap: 16px;
}

.confirm-section-title {
  display: block;
  margin-bottom: 6px;
  color: #56617c;
  font-size: 13px;
  font-weight: 700;
}

.accounting-confirm-content .history-list {
  display: grid;
  gap: 6px;
}

.accounting-confirm-content .history-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid #edf0f6;
  border-radius: 10px;
  background: #fbfcff;
  font-size: 12px;
}

.accounting-saved-actions {
  flex-wrap: wrap;
}

.accounting-saved-actions>* {
  justify-content: center;
}

.accounting-row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.receipt-preview-dialog {
  position: fixed;
  z-index: 501;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(900px, 92vw);
  max-height: 88vh;
}

.receipt-preview-dialog img {
  max-width: 100%;
  max-height: 76vh;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(15, 22, 49, .28);
  object-fit: contain;
}

.receipt-preview-close {
  justify-self: end;
  background: #fff;
}

@media (max-width: 720px) {
  .notif-panel {
    position: fixed;
    inset: 76px 12px auto;
    width: auto;
    max-height: calc(100vh - 92px);
  }

  .accounting-saved-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .accounting-row-actions {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {

  .invpage-receipt,
  .ai-fab {
    transition: none !important;
    animation: none !important;
  }
}

/* ============================================================================
 * أنماط قسم المحاسبة المتقدمة — استجابة كاملة، إدارة المرفقات، وتفاصيل الفواتير
 * ============================================================================ */
.accounting-page {
  width: 100%;
  min-height: 100vh;
  padding: 24px 30px;
  background: radial-gradient(circle at 12% 16%, rgba(220, 234, 255, 0.5) 0%, transparent 42%),
    radial-gradient(circle at 88% 84%, rgba(230, 240, 255, 0.6) 0%, transparent 46%),
    #f4f7fc;
  min-width: 0;
}

.accounting-container {
  width: 100%;
  max-width: 1480px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.accounting-workspace-card {
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  box-shadow: 0 12px 36px -6px rgba(24, 39, 75, 0.05), 0 2px 10px -2px rgba(24, 39, 75, 0.02);
  padding: 24px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.accounting-tab-btn {
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #5e6884;
  box-shadow: 0 2px 6px rgba(20, 30, 60, 0.02);
}

.accounting-tab-btn:hover {
  background: #ffffff;
  color: #151c3a;
  border-color: #dfe5f2;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(20, 30, 60, 0.06);
}

.accounting-tab-btn.active {
  background: #151c3a !important;
  color: #ffffff !important;
  border-color: #151c3a !important;
  box-shadow: 0 6px 18px rgba(21, 28, 58, 0.18) !important;
  transform: translateY(0);
}

/* بطاقات المؤشرات المالية الزجاجية الملونة */
.kpi-card-glass {
  padding: 18px 20px;
  border-radius: 20px;
  position: relative;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card-glass:hover {
  transform: translateY(-2px);
}

.kpi-card-glass.income {
  background: rgba(240, 253, 244, 0.72);
  border: 1px solid rgba(167, 243, 208, 0.75);
  box-shadow: 0 8px 20px -4px rgba(22, 101, 52, 0.04);
}

.kpi-card-glass.expense {
  background: rgba(254, 243, 199, 0.62);
  border: 1px solid rgba(253, 230, 138, 0.75);
  box-shadow: 0 8px 20px -4px rgba(180, 83, 9, 0.04);
}

.kpi-card-glass.salary {
  background: rgba(245, 243, 255, 0.72);
  border: 1px solid rgba(233, 213, 255, 0.75);
  box-shadow: 0 8px 20px -4px rgba(126, 34, 206, 0.04);
}

.kpi-card-glass.profit {
  background: rgba(254, 242, 242, 0.72);
  border: 1px solid rgba(254, 202, 202, 0.75);
  box-shadow: 0 8px 20px -4px rgba(185, 28, 28, 0.04);
}

.kpi-glass-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.kpi-glass-icon.income {
  background: rgba(220, 252, 231, 0.9);
  color: #16a34a;
}

.kpi-glass-icon.expense {
  background: rgba(254, 243, 199, 0.9);
  color: #d97706;
}

.kpi-glass-icon.salary {
  background: rgba(243, 232, 255, 0.9);
  color: #9333ea;
}

.kpi-glass-icon.profit {
  background: rgba(254, 226, 226, 0.9);
  color: #ef4444;
}

/* شريط الفلترة الزجاجي */
.accounting-date-bar {
  padding: 14px 22px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 16px -2px rgba(20, 35, 75, 0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

/* ألواح النظام الزجاجية */
.system-panel,
.panel {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 8px 24px -4px rgba(20, 35, 75, 0.03);
}

/* جداول الحركات والفواتير مع قابلية النقر على السطر بالكامل */
.member-row[data-inv-row] {
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.member-row[data-inv-row]:hover {
  background: #f4f7ff !important;
}

/* رفع ومرفقات الحركات المالية الموحدة — صندوق بارز وواضح */
.attachment-uploader-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.attachment-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 20px;
  border: 2px dashed #5376ff;
  border-radius: 16px;
  background: #f4f7ff;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(83, 118, 255, 0.05);
}

.attachment-dropzone:hover,
.attachment-dropzone.dragover {
  border-color: #3b5cb8;
  background: #eef3ff;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(83, 118, 255, 0.12);
}

.attachment-drop-icon-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #4f46e5;
  display: grid;
  place-items: center;
  margin-bottom: 2px;
  transition: transform 0.2s ease;
}

.attachment-dropzone:hover .attachment-drop-icon-circle {
  transform: scale(1.08);
}

.attachment-drop-main-title {
  font-size: 15px;
  font-weight: 800;
  color: #151c3a;
  display: block;
}

.attachment-browse-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  border-radius: 999px;
  background: #5376ff;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(83, 118, 255, 0.28);
  transition: all 0.15s ease;
}

.attachment-dropzone:hover .attachment-browse-btn {
  background: #3b5cb8;
}

.attachment-drop-hint {
  font-size: 12px;
  font-weight: 600;
  color: #69738d;
}

.attachment-selected-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 16px;
  background: #f4f8ff;
  border: 1.5px solid #a5b4fc;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.08);
}

.attachment-card-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.attachment-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid #c7d2fe;
}

.attachment-file-icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: #fee2e2;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.attachment-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.attachment-card-name {
  font-size: 13.5px;
  font-weight: 800;
  color: #151c3a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-card-size {
  font-size: 12px;
  font-weight: 600;
  color: #16a34a;
}

.attachment-remove-btn {
  padding: 7px 14px;
  border-radius: 10px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid #fca5a5;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.attachment-remove-btn:hover {
  background: #fecaca;
}

/* بطاقة مرفقات داخل تفاصيل الفاتورة */
.invpage-attachment-section {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.invpage-att-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #69738d;
}

.invpage-att-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f5;
  transition: all 0.2s ease;
}

.invpage-att-card.img-card {
  cursor: pointer;
}

.invpage-att-card.img-card:hover {
  border-color: #5376ff;
  box-shadow: 0 4px 12px rgba(83, 118, 255, 0.12);
}

.invpage-att-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #e2e8f5;
}

.invpage-file-badge {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #fee2e2;
  color: #dc2626;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.invpage-att-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.invpage-att-info strong {
  font-size: 13px;
  color: #151c3a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invpage-att-info small {
  font-size: 11px;
  color: #5376ff;
}

/* نافذة تأكيد صرف الراتب المحسّنة */
.salary-confirm-dialog {
  max-width: 620px;
  width: min(620px, 94vw);
}

.salary-confirm-head-name {
  font-size: 26px;
  font-weight: 800;
  color: #151c3a;
  margin-top: 4px;
}

.salary-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0;
}

.salary-metric-card {
  background: #f8faff;
  border: 1px solid #dfe6f5;
  border-radius: 14px;
  padding: 16px;
  text-align: right;
}

.salary-metric-label {
  font-size: 14px;
  font-weight: 600;
  color: #69738d;
  display: block;
}

.salary-metric-val {
  font-family: Manrope, sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #151c3a;
  display: block;
  margin-top: 4px;
}

.salary-section-box {
  background: #ffffff;
  border: 1px solid #e2e8f5;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.salary-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #151c3a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.salary-compact-empty {
  font-size: 13px;
  color: #8b93ad;
  margin: 0;
  padding: 6px 0;
}

/* توحيد حقول الإدخال والقوائم المنسدلة في المحاسبة */
.system-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13.5px;
  font-weight: 700;
  color: #151c3a;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  text-align: right;
  direction: rtl;
}

.system-form input,
.system-form select,
.system-form textarea {
  height: 44px;
  padding: 0 14px;
  border: 1px solid #dfe4ef;
  border-radius: 11px;
  background: #fbfcff;
  color: #151c3a;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  text-align: right;
  direction: rtl;
}

.system-form input:focus,
.system-form select:focus,
.system-form textarea:focus {
  border-color: #5376ff;
  box-shadow: 0 0 0 3px rgba(83, 118, 255, 0.12);
  background: #ffffff;
}

.system-form input[disabled] {
  background: #f1f4fa;
  color: #8b94ac;
  cursor: not-allowed;
}

/* نافذة تسجيل الحركات المالية بنسب متناسقة وبدون سكرول */
.tx-registration-dialog {
  width: min(740px, 95vw) !important;
  max-height: 98vh !important;
  overflow: visible !important;
  padding: 26px 32px !important;
}

.tx-registration-dialog .system-form label {
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  direction: rtl;
  width: 100%;
  box-sizing: border-box;
}

.tx-registration-dialog .system-form input,
.tx-registration-dialog .system-form select {
  height: 42px;
  padding: 0 14px;
  font-size: 13.5px;
  border-radius: 10px;
  text-align: right;
  direction: rtl;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .system-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   CUSTOM DATE PICKER POPUP (RTL, 1:1 CALENDAR DESIGN)
   ============================================================ */
.custom-datepicker-popup {
  position: absolute;
  z-index: 100000;
  background: #ffffff;
  border: 1px solid #eef2f8;
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14), 0 4px 12px rgba(15, 23, 42, 0.06);
  width: 286px;
  padding: 18px;
  direction: ltr;
  font-family: Alexandria, Manrope, system-ui, -apple-system, sans-serif;
  user-select: none;
  animation: dpFadeIn 0.15s ease-out;
}

@keyframes dpFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

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

.custom-datepicker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.custom-datepicker-title {
  font-weight: 800;
  font-size: 15px;
  color: #1e293b;
  font-family: Alexandria, sans-serif;
}

.custom-datepicker-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}

.custom-datepicker-nav-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}

.custom-datepicker-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  font-family: Alexandria, sans-serif;
}

.custom-datepicker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.custom-datepicker-day {
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-family: Manrope, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.12s ease;
  border: 1.5px solid transparent;
  background: transparent;
}

.custom-datepicker-day:hover:not(.empty):not(.disabled) {
  background: #f0f4ff;
  color: #4361ee;
}

.custom-datepicker-day.outside.empty {
  visibility: hidden;
  pointer-events: none;
}

.custom-datepicker-day.selected {
  background: transparent;
  border: 1.5px solid #4361ee !important;
  color: #1e293b;
  font-weight: 800;
  border-radius: 9px;
}

.custom-datepicker-day.today:not(.selected) {
  border: 1.5px solid #cbd5e1;
  color: #4361ee;
  font-weight: 700;
  border-radius: 9px;
}

.custom-datepicker-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.custom-datepicker-footer button {
  padding: 6px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  font-family: Alexandria, sans-serif;
  cursor: pointer;
  transition: all 0.12s ease;
}

.custom-datepicker-today-btn {
  background: #ffffff;
  color: #4361ee;
  border: 1px solid #c7d2fe;
}

.custom-datepicker-today-btn:hover {
  background: #eef2ff;
}

.custom-datepicker-close-btn {
  background: #ffffff;
  color: #4361ee;
  border: 1px solid #c7d2fe;
}

.custom-datepicker-close-btn:hover {
  background: #eef2ff;
}

/* ============================================================
   5-STEP ONBOARDING WIZARD & REBUILD STYLING
   ============================================================ */
.onboarding-stepper-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0 0 24px;
  padding: 0 10px;
  position: relative;
}

.onboarding-step-item {
  display: flex;
  align-items: center;
  position: relative;
}

.onboarding-step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f0f3fa;
  color: #8b93ad;
  display: grid;
  place-items: center;
  font-family: Manrope, sans-serif;
  font-weight: 800;
  font-size: 14px;
  transition: all 0.2s ease;
  z-index: 2;
  border: 2px solid #ffffff;
}

.onboarding-step-item.active .onboarding-step-circle {
  background: #536fff;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(83, 111, 255, 0.35);
}

.onboarding-step-item.completed .onboarding-step-circle {
  background: #edf2ff;
  color: #536fff;
}

.onboarding-step-connector {
  width: 60px;
  height: 2px;
  background: #e2e8f5;
  margin: 0 4px;
  transition: background 0.2s ease;
}

.onboarding-step-item.completed+.onboarding-step-item .onboarding-step-connector,
.onboarding-step-connector.filled {
  background: #536fff;
}

/* Custom Phone Input with Jordan Prefix */
.phone-jordan-group {
  display: flex;
  align-items: stretch;
  direction: ltr;
  gap: 0;
  border: 1px solid #dfe4ef;
  border-radius: 12px;
  background: #fbfcff;
  overflow: hidden;
  height: 46px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.phone-jordan-group:focus-within {
  border-color: #536fff;
  box-shadow: 0 0 0 3px rgba(83, 111, 255, 0.12);
  background: #ffffff;
}

.phone-jordan-prefix {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: #f0f3fa;
  color: #495473;
  font-family: Manrope, sans-serif;
  font-weight: 700;
  font-size: 13px;
  border-right: 1px solid #dfe4ef;
  user-select: none;
  flex-shrink: 0;
}

.phone-jordan-prefix .flag-code {
  font-size: 12px;
  color: #151c3a;
}

.phone-jordan-input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  padding: 0 12px !important;
  font-family: Manrope, sans-serif !important;
  font-size: 14.5px !important;
  font-weight: 600 !important;
  color: #151c3a !important;
  outline: none !important;
  height: 100% !important;
  box-shadow: none !important;
}

/* Email Verification Feedback */
.email-valid-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #2f9f61;
  margin-top: 4px;
}

/* Payment Methods Grid */
.payment-methods-grid-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 10px 0 16px;
}

.payment-method-select-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
  border-radius: 14px;
  border: 1.5px solid #e1e6f0;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  min-height: 94px;
}

.payment-method-select-card:hover {
  border-color: #b8c8ff;
  background: #f8faff;
  transform: translateY(-1px);
}

.payment-method-select-card.selected {
  border-color: #536fff;
  background: #f0f4ff;
  box-shadow: 0 0 0 3px rgba(83, 111, 255, 0.14);
}

.payment-method-img {
  width: 44px;
  height: 32px;
  object-fit: contain;
  display: block;
}

.payment-method-name {
  font-size: 13px;
  font-weight: 800;
  color: #151c3a;
}

/* Delivery Method Cards */
.delivery-methods-grid-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 10px 0 16px;
}

.delivery-method-select-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 10px 8px;
  border-radius: 12px;
  border: 1.5px solid #e1e6f0;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
  min-height: 74px;
}

.delivery-method-select-card:hover {
  border-color: #b8c8ff;
  background: #f8faff;
  transform: translateY(-1px);
}

.delivery-method-select-card.selected {
  border-color: #536fff;
  background: #f0f4ff;
  box-shadow: 0 0 0 3px rgba(83, 111, 255, 0.14);
}

.delivery-method-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
}

.delivery-channel-logo {
  display: block;
  object-fit: contain;
  transition: transform 0.18s ease;
}

.delivery-method-select-card:hover .delivery-channel-logo {
  transform: scale(1.08);
}

.delivery-method-icon {
  font-size: 20px;
  display: grid;
  place-items: center;
}

.delivery-method-label {
  font-size: 13px;
  font-weight: 800;
  color: #151c3a;
}

/* Review Summary Card in Step 5 */
.onboarding-review-box {
  background: #ffffff;
  border: 1px solid #e1e6f0;
  border-radius: 18px;
  padding: 18px 20px;
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.review-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  padding: 4px 0;
}

.review-summary-row .rev-label {
  color: #7985a3;
  font-weight: 600;
}

.review-summary-row .rev-val {
  color: #151c3a;
  font-weight: 800;
}

.review-divider {
  height: 1px;
  background: #eef2fa;
  margin: 6px 0;
}

.review-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}

.review-total-row .rev-total-val {
  font-family: Manrope, sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #536fff;
}

/* ============================================================
   SUPPLIERS SECTION ENHANCED STYLING
   ============================================================ */
.suppliers-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.suppliers-search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.suppliers-search-box input {
  width: 100%;
  height: 46px;
  padding: 10px 42px 10px 14px;
  border-radius: 12px;
  border: 1px solid #dfe4ef;
  background: #fbfcff;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: all 0.15s ease;
}

.suppliers-search-box input:focus {
  border-color: #536fff;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(83, 111, 255, 0.12);
}

.suppliers-search-box .search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #8e97b0;
  font-size: 17px;
  pointer-events: none;
}

.supplier-row-interactive {
  cursor: pointer;
  transition: background 0.15s ease;
}

.supplier-row-interactive:hover {
  background: #f8f9fe !important;
}

@media (max-width: 600px) {
  .payment-methods-grid-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .delivery-methods-grid-cards {
    grid-template-columns: 1fr;
  }

  .onboarding-stepper-connector {
    width: 28px;
  }
}

/* System Modal Host Container */
#system-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: block;
}

#system-modal[hidden] {
  display: none !important;
}

.member-modal {
  position: fixed;
  z-index: 10005 !important;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.member-modal[hidden] {
  display: none !important;
}

.member-modal:not([hidden]) {
  display: grid !important;
  z-index: 10005 !important;
}

.custom-phone-group {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  border: 1px solid #dfe4ef;
  border-radius: 11px;
  background: #fbfcff;
  height: 46px;
  overflow: hidden;
  transition: all 0.15s ease;
  direction: ltr !important;
}

.custom-phone-group:focus-within {
  border-color: #536fff;
  box-shadow: 0 0 0 3px rgba(83, 111, 255, 0.12);
  background: #ffffff;
}

.custom-phone-prefix,
.custom-phone-group .custom-phone-select,
.custom-phone-select {
  display: flex !important;
  align-items: center !important;
  gap: 6px;
  width: auto !important;
  min-width: 105px !important;
  max-width: 130px !important;
  flex: 0 0 auto !important;
  padding: 0 10px !important;
  background: #f1f4f9 !important;
  border: none !important;
  border-right: 1px solid #dfe4ef !important;
  border-radius: 0 !important;
  font-family: Manrope, sans-serif !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #151c3a !important;
  height: 100% !important;
  outline: none !important;
  cursor: pointer !important;
  direction: ltr !important;
  transition: background 0.15s ease;
  appearance: auto !important;
  -webkit-appearance: auto !important;
}

.custom-phone-select:hover {
  background: #e8ecf4 !important;
}

.custom-phone-select:focus {
  background: #e2e8f0 !important;
}

.custom-phone-group .custom-phone-input,
.custom-phone-input {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: 100% !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  font-family: Manrope, sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  padding: 0 12px !important;
  height: 100% !important;
  color: #151c3a !important;
  direction: ltr !important;
}

/* صفحة الفاتورة — أنيميشن الطباعة الحرارية والمودال المعتمد */
.invpage-box {
  position: fixed;
  z-index: 10001;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  border-radius: 24px;
  width: min(480px, 94vw);
  max-width: 480px;
  padding: 28px 24px 24px;
  box-shadow: 0 30px 70px -10px rgba(15, 22, 49, 0.3);
  color: #151c3a;
  max-height: 92vh;
  overflow-y: auto;
  text-align: right;
}

/* ============================================================================
 * مركز التقارير والتحميل المباشر لملفات PDF (Reports Center & Direct PDF)
 * ============================================================================ */
.reports-page {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.reports-container,
.reports-hub-wrapper {
  width: 100%;
  max-width: 1500px;
  margin-inline: auto;
  padding: 0 0 40px;
  box-sizing: border-box;
}

.reports-header {
  margin-bottom: 24px;
  text-align: right;
}

.reports-eyebrow {
  margin: 0 0 4px 0;
  color: #9098ae;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.reports-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  color: #151c3a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.reports-title-dot {
  color: #f59e0b;
  font-size: 20px;
  line-height: 1;
  display: inline-block;
}

.reports-grid,
.reports-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1300px) {

  .reports-grid,
  .reports-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (max-width: 980px) {

  .reports-grid,
  .reports-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 640px) {

  .reports-grid,
  .reports-cards-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.report-card {
  min-width: 0;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  padding: 24px 22px;
  background: #ffffff;
  border: 1px solid #e3e7f1;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(26, 35, 67, 0.05);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-sizing: border-box;
  text-align: right;
}

.report-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(26, 35, 67, 0.08);
  border-color: #cbd5e1;
}

.report-card-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 14px;
  width: 100%;
  box-sizing: border-box;
}

.report-icon,
.report-card-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  max-width: 42px;
  min-height: 42px;
  max-height: 42px;
  flex: 0 0 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-sizing: border-box;
}

.report-icon svg,
.report-card-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.report-title,
.report-card-title {
  font-size: 16.5px;
  font-weight: 700;
  color: #1b2440;
  margin: 0 0 8px 0;
  text-align: right;
  line-height: 1.4;
}

.report-desc,
.report-card-desc {
  font-size: 14px;
  line-height: 1.65;
  color: #8e97b0;
  margin: 0 0 20px 0;
  min-height: 42px;
  text-align: right;
}

.report-card-actions {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.report-btn-pdf {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  background: #1b254e;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(27, 37, 78, 0.12);
  transition: all 0.18s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  text-decoration: none;
  padding: 0 8px;
}

.report-btn-pdf:hover:not(:disabled) {
  background: #222e5e;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(27, 37, 78, 0.2);
}

.report-btn-pdf:focus-visible {
  outline: 2px solid #4b71ff;
  outline-offset: 2px;
}

.report-btn-pdf:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  background: #283359;
  transform: none;
  box-shadow: none;
}

.report-btn-csv {
  width: 100%;
  min-height: 42px;
  border: 1.5px solid #e2e8f0;
  border-radius: 11px;
  background: #f8fafc;
  color: #1e293b;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: all 0.18s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  text-decoration: none;
  padding: 0 8px;
}

.report-btn-csv:hover:not(:disabled) {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.report-btn-csv:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
}

.report-btn-csv:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  background: #f1f5f9;
  transform: none;
  box-shadow: none;
}

.report-download-button,
.report-card-btn {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 11px;
  background: #1b254e;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(28, 37, 74, 0.12);
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  text-decoration: none;
}

.report-download-button:hover:not(:disabled),
.report-card-btn:hover:not(:disabled) {
  background: #222e5e;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(28, 37, 74, 0.18);
}

.report-download-button:focus-visible,
.report-card-btn:focus-visible {
  outline: 2px solid #4b71ff;
  outline-offset: 2px;
}

.report-download-button:disabled,
.report-card-btn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  background: #283359;
  transform: none;
  box-shadow: none;
}

.report-btn-pdf .btn-spinner,
.report-btn-csv .btn-spinner,
.report-download-button .btn-spinner,
.report-card-btn .btn-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: repSpin 0.7s linear infinite;
  display: inline-block;
}

@keyframes repSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Off-screen PDF Template Staging */
.pdf-staging-container {
  position: fixed;
  left: -99999px;
  top: 0;
  width: 1100px;
  background: #ffffff;
  color: #151c3a;
  padding: 36px 40px;
  font-family: Alexandria, Cairo, 'Segoe UI', Tahoma, sans-serif;
  direction: rtl;
  box-sizing: border-box;
}

/* ============================================================================
 * نظام الإشعارات والـ SMS الشامل (Notifications & SMS Center)
/* ============================================================================
 * نظام الإشعارات والـ SMS وإدارة Web Push الشامل (Ultra Gym Notification Center)
 * ============================================================================ */
.notif-wrapper {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

.notif-grid-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 16px;
  align-items: start;
  width: 100%;
}

@media (max-width: 1020px) {
  .notif-grid-layout {
    grid-template-columns: 1fr;
  }
}

/* ── NOTIFICATION STUDIO PANEL (Modern Unified Dispatcher) ─────────────── */
.notif-studio-panel {
  background: var(--panel-solid, #ffffff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(16, 21, 55, 0.04), 0 10px 28px -10px rgba(16, 21, 55, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.notif-studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.notif-studio-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink, #10152b);
}

.notif-studio-badge {
  font-size: 10px;
  font-weight: 800;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.2px;
}

/* Quick Templates Bar */
.notif-studio-templates {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--line, #e2e8f0);
}

.notif-studio-tpl-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-soft, #4a5470);
  white-space: nowrap;
  flex-shrink: 0;
}

.notif-quick-chips {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: thin;
  flex: 1;
}

.notif-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 7px;
  border: 1px solid var(--line, #e2e8f0);
  background: #ffffff;
  color: var(--ink-soft, #4a5470);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
}

.notif-quick-btn:hover {
  background: #182246;
  border-color: #182246;
  color: #ffffff;
  transform: translateY(-1px);
}

/* 2-Column Split: Audience (Right) & Destination/Composer (Left) */
.notif-studio-columns {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 12px;
  align-items: start;
}

@media (max-width: 860px) {
  .notif-studio-columns {
    grid-template-columns: 1fr;
  }
}

.notif-studio-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.notif-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.notif-section-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink, #10152b);
}

/* 4-Item Segmented Audience Tabs */
.notif-audience-segment {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
}

.notif-aud-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--ink-soft, #4a5470);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.16s ease;
  font-family: inherit;
  white-space: nowrap;
}

.notif-aud-btn:hover {
  color: var(--ink, #10152b);
  background: rgba(255, 255, 255, 0.7);
}

.notif-aud-btn.active {
  background: #182246;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(24, 34, 70, 0.2);
}

.notif-aud-count {
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.08);
  font-weight: 800;
}

.notif-aud-btn.active .notif-aud-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.notif-aud-count.alert {
  color: #dc2626;
  background: #fee2e2;
}

.notif-aud-btn.active .notif-aud-count.alert {
  color: #ffffff;
  background: #ef4444;
}

/* Member Picker */
.notif-member-picker-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
}

.notif-search-container {
  position: relative;
  width: 100%;
}

.notif-search-container input {
  width: 100%;
  padding: 7px 30px 7px 10px;
  border: 1px solid var(--line, #cbd5e1);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  background: #ffffff;
  color: #10152b;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}

.notif-search-container input:focus {
  border-color: #182246;
  box-shadow: 0 0 0 2px rgba(24, 34, 70, 0.1);
}

.notif-search-icon-pos {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.notif-member-list-box {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.notif-member-card-item,
.notif-member-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: all 0.14s ease;
  gap: 10px;
  box-sizing: border-box;
}

.notif-member-card-item:last-child,
.notif-member-row-item:last-child {
  border-bottom: none;
}

.notif-member-card-item:hover,
.notif-member-row-item:hover {
  background: #f8fafc;
}

.notif-member-card-item.active,
.notif-member-row-item.active,
.notif-member-row-item.selected {
  background: #f0f4ff;
}

.notif-member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #e2e8f0;
  color: #182246;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-member-card-item.active .notif-member-avatar {
  background: #182246;
  color: #ffffff;
}

.notif-member-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.notif-member-top-row,
.notif-member-top-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}

.notif-member-name {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink, #10152b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-member-days-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.notif-member-days-badge.active {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.notif-member-days-badge.warning {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.notif-member-days-badge.expired {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.notif-member-sub-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-member-tier {
  font-weight: 700;
  color: #334155;
}

.notif-member-phone {
  font-family: monospace;
  font-size: 10px;
  color: #64748b;
  direction: ltr;
}

.notif-sel-indicator {
  color: #182246;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 4px;
}

.notif-audience-alert {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.notif-audience-alert.expired {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.notif-audience-alert.custom {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.notif-audience-alert.all {
  background: #f8fafc;
  border: 1px solid var(--line, #e2e8f0);
  color: var(--ink-soft, #4a5470);
}

/* Destinations Grid styled in notifications section below */

/* Composer Inputs */
.notif-composer-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notif-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink, #10152b);
  background: #ffffff;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}

.notif-textarea {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink, #10152b);
  background: #ffffff;
  outline: none;
  font-family: inherit;
  resize: none;
  box-sizing: border-box;
}

.notif-input:focus,
.notif-textarea:focus {
  border-color: #182246;
  box-shadow: 0 0 0 2px rgba(24, 34, 70, 0.08);
}

.notif-char-badge {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--muted, #77809c);
  font-family: monospace;
}

/* Studio Footer CTA */
.notif-studio-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.notif-target-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: #f8fafc;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
  flex: 1;
  min-width: 0;
}

.notif-summary-icon {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-summary-texts {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.notif-summary-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted, #77809c);
}

.notif-summary-val {
  font-size: 11px;
  font-weight: 800;
  color: var(--ink, #10152b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-btn-dispatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 9px;
  border: none;
  background: linear-gradient(135deg, #182246 0%, #0f172a 100%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(24, 34, 70, 0.22);
  transition: all 0.16s ease;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}

.notif-btn-dispatch:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(24, 34, 70, 0.3);
  background: linear-gradient(135deg, #202d5c 0%, #182246 100%);
}

.notif-btn-dispatch:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* History Card & Timeline */
.notif-history-card {
  background: var(--panel-solid, #ffffff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 20px;
  padding: 16px 20px;
  box-shadow: 0 1px 2px rgba(16, 21, 55, 0.03);
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.notif-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.notif-history-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink, #10152b);
}

.notif-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notif-history-item {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line, #e2e8f0);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: all 0.15s ease;
}

.notif-history-item:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.notif-history-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.notif-hist-badge-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.notif-hist-badge {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
}

.notif-hist-badge.dest {
  background: #eff6ff;
  color: #2563eb;
}

.notif-hist-badge.target {
  background: #f1f5f9;
  color: var(--ink, #10152b);
}

.notif-hist-meta-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.notif-hist-time {
  font-size: 10px;
  color: var(--muted, #77809c);
  font-family: monospace;
}

.notif-hist-status.ok {
  font-size: 10px;
  font-weight: 800;
  color: #059669;
  background: #ecfdf5;
  padding: 1px 5px;
  border-radius: 4px;
}

.notif-history-item-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink, #10152b);
}

.notif-history-item-msg {
  font-size: 11px;
  color: var(--ink-soft, #4a5470);
  line-height: 1.35;
}

.notif-empty-state {
  padding: 18px;
  text-align: center;
  color: var(--muted, #77809c);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* ============================================================================
 * REGISTERED DEVICES STUDIO & GRID STYLES
 * ============================================================================ */
/* ============================================================================
 * REGISTERED DEVICES STUDIO & MEMBER-GROUPED GRID STYLES
 * ============================================================================ */
.notif-devices-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.notif-devices-card {
  background: var(--panel-solid, #ffffff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(16, 21, 55, 0.04);
}

.notif-devices-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid #f1f5f9;
}

.notif-devices-title-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.notif-devices-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 900;
  color: var(--ink, #10152b);
}

.notif-devices-sub {
  font-size: 12px;
  color: var(--muted, #77809c);
}

.notif-devices-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Section Title Headers */
.notif-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.notif-section-title h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.notif-section-icon-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-section-count {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  background: #f1f5f9;
  padding: 3px 10px;
  border-radius: 999px;
}

/* Admin Devices Section */
.notif-admin-section {
  margin-top: 18px;
}

.notif-admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.notif-admin-device-card {
  background: #ffffff;
  border: 1.5px solid #3b82f6;
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  box-shadow: 0 4px 14px -2px rgba(59, 130, 246, 0.12);
  transition: all 0.2s ease;
}

.notif-admin-device-card:hover {
  box-shadow: 0 8px 20px -4px rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
}

.notif-admin-dev-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notif-admin-dev-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-admin-dev-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.notif-admin-dev-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-admin-dev-name {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.notif-admin-dev-tag {
  font-size: 10px;
  font-weight: 800;
  color: #1e40af;
  background: #dbeafe;
  padding: 2px 7px;
  border-radius: 6px;
}

.notif-admin-dev-os {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
}

.notif-admin-dev-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.notif-admin-dev-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.notif-admin-empty {
  padding: 20px;
  text-align: center;
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

/* Trainees / Member Groups Grid */
.notif-member-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.notif-member-group-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.notif-member-group-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 10px 24px -6px rgba(15, 23, 42, 0.1);
  transform: translateY(-2px);
}

.notif-member-group-header {
  background: #f8fafc;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #edf2f7;
}

.notif-member-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notif-member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1e293b, #334155);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-member-texts {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.notif-member-name {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
}

.notif-member-sub {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

.notif-member-device-count-badge {
  font-size: 10px;
  font-weight: 800;
  color: #4338ca;
  background: #e0e7ff;
  padding: 3px 8px;
  border-radius: 6px;
}

/* Devices Sublist inside Member Card */
.notif-member-devices-sublist {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notif-member-device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  transition: background 0.15s ease;
}

.notif-member-device-row:hover {
  background: #f1f5f9;
}

.notif-member-dev-info-col {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notif-dev-row-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-dev-row-details {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.notif-dev-row-name {
  font-size: 12.5px;
  font-weight: 800;
  color: #1e293b;
}

.notif-dev-row-os {
  font-size: 10.5px;
  font-weight: 600;
  color: #64748b;
}

.notif-member-dev-meta-col {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notif-dev-row-status-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.notif-dev-date-seen {
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
}

.notif-devices-empty-state {
  padding: 42px 20px;
  text-align: center;
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.notif-empty-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.notif-device-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
}

.notif-device-status-badge.active {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.notif-device-status-badge.standby {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.notif-device-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  animation: notifPulse 2s infinite;
}

@keyframes notifPulse {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(0.85);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.notif-btn-ping {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 7px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: var(--ink, #10152b);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.notif-btn-ping:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #2563eb;
}

/* ============================================================================
 * SMART NOTIFICATION CARDS & AUTOMATION STYLES
 * ============================================================================ */
.notif-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.notif-stat-card {
  background: var(--panel-solid, #ffffff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(16, 21, 55, 0.04);
  transition: all 0.2s ease;
}

.notif-stat-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(16, 21, 55, 0.06);
}

.notif-stat-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.notif-stat-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted, #64748b);
}

.notif-stat-value {
  font-size: 20px;
  font-weight: 900;
  color: var(--ink, #10152b);
  font-family: Manrope, sans-serif;
  letter-spacing: -0.5px;
}

.notif-stat-sub {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted, #94a3b8);
}

.notif-stat-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-step-card {
  background: var(--panel-solid, #ffffff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(16, 21, 55, 0.03);
  margin-bottom: 14px;
  transition: border-color 0.15s ease;
}

.notif-step-card:hover {
  border-color: #cbd5e1;
}

.notif-step-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.notif-step-badge-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #eff6ff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: Manrope, sans-serif;
}

.notif-step-title-text {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink, #10152b);
}

/* 4 Cards Architecture Layout */
.notif-cards-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.notif-audience-segment {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.notif-aud-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line, #e2e8f0);
  background: #ffffff;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink, #10152b);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.notif-aud-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.notif-aud-btn.active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.notif-aud-count {
  padding: 1px 6px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  font-size: 10.5px;
  font-weight: 800;
}

.notif-aud-count.active-cnt {
  background: #ecfdf5;
  color: #047857;
}

.notif-aud-count.alert {
  background: #fef2f2;
  color: #b91c1c;
}

.notif-audience-alert {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.5;
}

.notif-audience-alert.all {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.notif-audience-alert.custom {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.notif-audience-alert.expired {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #9f1239;
}

.notif-member-picker-box {
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}

.notif-search-container {
  position: relative;
  padding: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.notif-search-container input {
  width: 100%;
  padding: 8px 32px 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 12px;
  box-sizing: border-box;
  font-family: inherit;
}

.notif-search-icon-pos {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.notif-member-list-box {
  max-height: 180px;
  overflow-y: auto;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notif-member-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.notif-member-row-item:hover {
  background: #f8fafc;
}

.notif-member-row-item.selected {
  background: #eff6ff;
}

.notif-member-row-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-member-avatar.active {
  background: #2563eb;
  color: #ffffff;
}

.notif-member-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.notif-member-top-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.notif-member-days-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
}

.notif-member-days-badge.active {
  background: #ecfdf5;
  color: #047857;
}

.notif-member-days-badge.warning {
  background: #fffbeb;
  color: #b45309;
}

.notif-member-days-badge.expired {
  background: #fef2f2;
  color: #b91c1c;
}

.notif-member-sub-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #64748b;
}

.notif-sel-indicator {
  color: #2563eb;
  display: flex;
  align-items: center;
}

/* Destination Choices Grid */
.notif-dest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.notif-dest-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 11px;
  border: 1.5px solid var(--line, #e2e8f0);
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: right;
  position: relative;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  min-height: 56px;
}

.notif-dest-btn:hover {
  border-color: #93c5fd;
  background: #f8faff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.notif-dest-btn.active {
  border-color: #2563eb !important;
  background: #f0f7ff !important;
  box-shadow: 0 0 0 1.5px #2563eb, 0 4px 14px rgba(37, 99, 235, 0.12) !important;
}

/* Individual Icon Styles & Soft Pastel Badges */
.notif-dest-btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

/* Themed Pastel Badges for each destination */
.notif-dest-btn-icon.dest-icon-home {
  background: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}
.notif-dest-btn.active .notif-dest-btn-icon.dest-icon-home {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.notif-dest-btn-icon.dest-icon-profile {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}
.notif-dest-btn.active .notif-dest-btn-icon.dest-icon-profile {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
}

.notif-dest-btn-icon.dest-icon-activities {
  background: #fff7ed;
  color: #ea580c;
  border-color: #fed7aa;
}
.notif-dest-btn.active .notif-dest-btn-icon.dest-icon-activities {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.35);
}

.notif-dest-btn-icon.dest-icon-store {
  background: #f5f3ff;
  color: #7c3aed;
  border-color: #ddd6fe;
}
.notif-dest-btn.active .notif-dest-btn-icon.dest-icon-store {
  background: #7c3aed;
  color: #ffffff;
  border-color: #7c3aed;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}

.notif-dest-btn-icon.dest-icon-attendance {
  background: #f0fdfa;
  color: #0d9488;
  border-color: #99f6e4;
}
.notif-dest-btn.active .notif-dest-btn-icon.dest-icon-attendance {
  background: #0d9488;
  color: #ffffff;
  border-color: #0d9488;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.35);
}

.notif-dest-btn-icon.dest-icon-custom {
  background: #f8fafc;
  color: #475569;
  border-color: #e2e8f0;
}
.notif-dest-btn.active .notif-dest-btn-icon.dest-icon-custom {
  background: #334155;
  color: #ffffff;
  border-color: #334155;
  box-shadow: 0 2px 8px rgba(51, 65, 85, 0.35);
}

/* General fallback for active icon if specific class not matched */
.notif-dest-btn.active .notif-dest-btn-icon:not([class*="dest-icon-"]) {
  background: #2563eb;
  color: #ffffff;
}

.notif-dest-btn-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: visible;
  min-width: 0;
  flex: 1;
}

.notif-dest-name {
  font-size: 11.5px;
  font-weight: 750;
  color: #0f172a;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
}

.notif-dest-btn.active .notif-dest-name {
  color: #0f172a !important;
  font-weight: 800 !important;
}

.notif-dest-sub {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
  transition: color 0.2s ease;
}

/* CRITICAL FIX: Ensure active subtitle has clear, rich contrast and NEVER disappears or turns white */
.notif-dest-btn.active .notif-dest-sub {
  color: #1e40af !important;
  font-weight: 700 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.notif-dest-check {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.25);
  animation: notifCheckPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}

@keyframes notifCheckPop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Automation Variable Badges */
.notif-var-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  color: #1d4ed8;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.05);
}

.notif-var-tag:hover {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #1e40af;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.15);
}

.notif-var-tag:active {
  transform: translateY(0);
  background: #bfdbfe;
}

.notif-var-tag-key {
  font-family: monospace;
  font-weight: 800;
  color: #1e40af;
  direction: ltr;
}

.notif-var-tag-label {
  font-size: 10.5px;
  color: #2563eb;
  font-weight: 600;
}

/* Quick Chips & Badges */
.notif-quick-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.notif-quick-btn {
  padding: 3px 9px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.notif-quick-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #f8fafc;
}

.notif-char-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted, #64748b);
  background: #f1f5f9;
  padding: 2px 7px;
  border-radius: 6px;
}

/* Target Summary & Prominent Dispatch Button */
.notif-target-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.notif-summary-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-summary-texts {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.notif-summary-label {
  font-size: 10.5px;
  color: var(--muted, #64748b);
  font-weight: 700;
}

.notif-summary-val {
  font-size: 12px;
  color: var(--ink, #10152b);
  font-weight: 800;
}

.notif-btn-dispatch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transition: all 0.15s ease;
  font-family: inherit;
}

.notif-btn-dispatch:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.notif-btn-dispatch:active {
  transform: translateY(0);
}

/* SMS Automations Grid */
.notif-automations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.notif-auto-card {
  background: var(--panel-solid, #ffffff);
  border: 1.5px solid var(--line, #e2e8f0);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(16, 21, 55, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: all 0.2s ease;
  position: relative;
}

.notif-auto-card.active {
  border-color: #3b82f6;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.08);
}

.notif-auto-card.inactive {
  background: #fafafa;
  border-color: #e2e8f0;
  opacity: 0.88;
}

.notif-auto-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.notif-auto-head-info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.notif-auto-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-auto-card.active .notif-auto-icon-box {
  background: #2563eb;
  color: #ffffff;
}

.notif-auto-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink, #10152b);
  margin-bottom: 4px;
}

.notif-auto-badge-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  display: inline-block;
}

.notif-auto-card.active .notif-auto-badge-pill {
  background: #ecfdf5;
  color: #047857;
}

/* Custom High-Performance iOS-Style Toggle Switch */
.notif-toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
  direction: ltr !important;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  vertical-align: middle;
}

.notif-toggle-switch input[type="checkbox"] {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.notif-toggle-slider {
  position: absolute;
  inset: 0;
  background-color: #cbd5e1;
  transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 999px;
  pointer-events: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.notif-toggle-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), width 0.15s ease;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 1px rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

.notif-toggle-switch input[type="checkbox"]:checked+.notif-toggle-slider {
  background-color: #10b981;
}

.notif-toggle-switch input[type="checkbox"]:checked+.notif-toggle-slider::before {
  transform: translateX(22px);
}

.notif-toggle-switch:active .notif-toggle-slider::before {
  width: 23px;
}

.notif-auto-desc {
  font-size: 11.5px;
  color: var(--muted, #64748b);
  line-height: 1.5;
}

.notif-auto-tpl-preview {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 11.5px;
  line-height: 1.6;
  color: #1e293b;
  position: relative;
}

.notif-auto-tpl-preview::before {
  content: "نص الرسالة المرسلة:";
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  margin-bottom: 4px;
}

.notif-auto-vars-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.notif-var-tag {
  font-family: monospace;
  font-size: 10.5px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #dbeafe;
}

.notif-auto-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
}

.notif-auto-btn-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: var(--ink, #10152b);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.notif-auto-btn-edit:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #f8fafc;
}

.notif-auto-btn-test {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.notif-auto-btn-test:hover {
  background: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}

/* Edit Template Modal */
.notif-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.notif-modal-content {
  background: #ffffff;
  border-radius: 18px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notif-modal-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
}

.notif-modal-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink, #10152b);
}

.notif-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notif-modal-footer {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
}

/* ============================================================================
 * LUXURY PHONE MOCKUP & NOTIFICATION PREVIEW STYLES (iOS / Android Ultra Realistic)
 * ============================================================================ */
.phone-preview-card {
  background: var(--panel-solid, #ffffff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(16, 21, 55, 0.03), 0 10px 24px -8px rgba(16, 21, 55, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.phone-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 2px;
}

.phone-preview-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink, #10152b);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Phone Outer Chassis */
.phone-mockup-frame {
  width: 318px;
  height: 610px;
  background: #000000;
  border: 7px solid #1e293b;
  border-radius: 46px;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
  margin: 0 auto;
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
}

/* Phone Top Status Bar */
.phone-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px 4px 18px;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  position: relative;
  z-index: 10;
  background: transparent;
  direction: ltr;
}

.phone-status-time {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.2px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

/* Dynamic Island */
.phone-island {
  width: 80px;
  height: 20px;
  background: #000000;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.phone-island-camera {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0f172a;
  border: 1px solid #1e293b;
}

.phone-island-sensor {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #090d16;
}

.phone-status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #ffffff;
  font-size: 11px;
}

.phone-cellular-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 10px;
}

.phone-cellular-bars i {
  width: 2px;
  background: #ffffff;
  border-radius: 0.5px;
}

.phone-cellular-bars i:nth-child(1) {
  height: 3px;
}

.phone-cellular-bars i:nth-child(2) {
  height: 5px;
}

.phone-cellular-bars i:nth-child(3) {
  height: 7.5px;
}

.phone-cellular-bars i:nth-child(4) {
  height: 10px;
}

/* Phone Screen Container */
.phone-screen-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  height: 100%;
}

/* ── LOCKSCREEN VIEW (Web Push) ─────────────────────────────────────────── */
.phone-lockscreen-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: radial-gradient(circle at 50% 12%, #1e293b 0%, #090d16 60%, #05070c 100%);
  position: relative;
  padding: 8px 14px 10px 14px;
  height: 100%;
  box-sizing: border-box;
}

.phone-lock-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  color: #ffffff;
}

.phone-lock-clock {
  font-size: 48px;
  font-weight: 300;
  color: #ffffff;
  letter-spacing: -1.5px;
  line-height: 1;
  margin: 0 0 3px 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.phone-lock-date {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.2px;
  text-align: center;
  margin-bottom: 14px;
}

/* ── REBUILT PUSH NOTIFICATION CARD (Native iOS Arabic Style) ──────────── */
.phone-notif-card {
  width: 100%;
  box-sizing: border-box;
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 12px 14px;
  display: block;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  text-align: right !important;
  direction: rtl !important;
  animation: notifFadeIn 0.25s ease;
}

.phone-notif-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  direction: rtl !important;
  margin-bottom: 6px !important;
}

.phone-notif-brand {
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
  direction: rtl !important;
}

.phone-notif-logo {
  width: 18px !important;
  height: 18px !important;
  border-radius: 4px !important;
  object-fit: cover !important;
  background: #ffffff !important;
  padding: 1px !important;
  flex-shrink: 0 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) !important;
}

.phone-notif-name {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  color: rgba(255, 255, 255, 0.95) !important;
  letter-spacing: 0.1px !important;
  text-align: right !important;
}

.phone-notif-time {
  font-size: 10px !important;
  color: rgba(255, 255, 255, 0.55) !important;
  font-weight: 500 !important;
  text-align: left !important;
}

.phone-notif-body-wrap {
  display: block !important;
  width: 100% !important;
  text-align: right !important;
  direction: rtl !important;
}

.phone-notif-title {
  display: block !important;
  width: 100% !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  line-height: 1.35 !important;
  text-align: right !important;
  direction: rtl !important;
  margin: 0 0 4px 0 !important;
  padding: 0 !important;
  word-break: break-word !important;
}

.phone-notif-text {
  display: block !important;
  width: 100% !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.88) !important;
  line-height: 1.45 !important;
  text-align: right !important;
  direction: rtl !important;
  margin: 0 !important;
  padding: 0 !important;
  white-space: pre-line !important;
  word-break: break-word !important;
}

/* Lockscreen Bottom Buttons (Phone on Left, Camera on Right) */
.phone-lock-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 4px 10px;
  margin-top: auto;
  direction: ltr;
}

.phone-quick-circle-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}

.phone-quick-circle-btn:hover {
  transform: scale(1.06);
}

/* ── SMS MESSAGES VIEW ─────────────────────────────────────────────────── */
.phone-sms-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #000000;
  height: 100%;
  box-sizing: border-box;
}

.phone-sms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  direction: ltr;
}

.phone-sms-header-left {
  display: flex;
  align-items: center;
  gap: 2px;
  color: #3b82f6;
  font-size: 11.5px;
  font-weight: 700;
  cursor: default;
}

.phone-sms-contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.phone-sms-contact-name {
  font-size: 12.5px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.phone-sms-contact-sub {
  font-size: 9.5px;
  color: #94a3b8;
  margin-top: 1px;
}

.phone-sms-chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  overflow-y: auto;
  direction: rtl;
}

.phone-sms-date-pill {
  align-self: center;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 2px 10px;
  font-size: 9.5px;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 10px;
  direction: rtl;
}

.sms-bubble-live {
  background: #22c55e;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 14px 14px 3px 14px;
  font-size: 11px;
  line-height: 1.45;
  box-shadow: 0 3px 10px rgba(34, 197, 94, 0.2);
  white-space: pre-wrap;
  word-break: break-word;
  animation: notifFadeIn 0.25s ease;
  align-self: flex-start;
  width: fit-content;
  max-width: 84%;
  box-sizing: border-box;
  display: inline-flex;
  flex-direction: column;
}

.sms-bubble-text {
  word-break: break-word;
  line-height: 1.45;
  font-size: 11px;
  font-weight: 500;
}

.sms-bubble-meta {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.85);
  text-align: right;
  direction: rtl;
  margin-top: 3px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  align-self: flex-start;
}

.sms-bubble-check {
  font-size: 10px;
  font-weight: 700;
}

.phone-sms-footer-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 12px;
  background: #111827;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.phone-sms-input-fake {
  flex: 1;
  height: 28px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  padding: 0 10px;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
}

/* Phone Home Indicator */
.phone-home-indicator {
  width: 100px;
  height: 4px;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 10px;
  margin: 6px auto 4px auto;
  flex-shrink: 0;
  z-index: 10;
}

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

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

.notif-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line, #e2e8f0);
  background: #f8fafc;
  color: var(--ink, #10152b);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.notif-chip:hover {
  background: var(--sky-soft, #eaf0ff);
  border-color: #cbd5e1;
  color: #1d4ed8;
  transform: translateY(-1px);
}

.notif-template-btn {
  padding: 7px 14px;
  border-radius: 9px;
  border: 1px solid var(--line, #e2e8f0);
  background: #ffffff;
  color: var(--ink-soft, #4a5470);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
}

.notif-template-btn:hover {
  background: var(--sky-soft, #eaf0ff);
  border-color: #cbd5e1;
  color: var(--ink, #10152b);
}

/* History Log Cards */
.notif-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notif-history-row {
  background: #ffffff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.18s ease;
}

.notif-history-row:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.notif-history-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ============================================================================
 * إدارة الصلاحيات والأدوار (Permissions Management Redesign - Gym System Tokens)
 * ============================================================================ */
.permissions-page {
  width: 100%;
  min-width: 0;
}

.permissions-container {
  width: 100%;
  max-width: 1500px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px clamp(18px, 3vw, 36px) 48px;
}

/* Page Header */
.permissions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.permissions-header-titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.permissions-eyebrow {
  font-size: 14px;
  font-weight: 600;
  color: #8e97b0;
  margin: 0;
}

.permissions-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.permissions-title {
  font-size: clamp(25px, 2.5vw, 30px);
  font-weight: 800;
  color: #151c3a;
  margin: 0;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.permissions-title-icon {
  color: #e8a541;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.perm-refresh-btn {
  height: 42px;
  padding-inline: 14px;
  border: 1px solid #dfe4ef;
  border-radius: 10px;
  background: #ffffff;
  color: #5f6985;
  font-weight: 600;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.perm-refresh-btn:hover {
  background: #f8f9fd;
  border-color: #cfd6e6;
  color: #18213d;
}

/* Live Permission Simulator Card */
.permission-simulator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  background: #fbfcff;
  border: 1px solid #e1e6f0;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(21, 28, 58, 0.03);
  flex-wrap: wrap;
}

.simulator-info {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 280px;
  flex: 1 1 auto;
}

.simulator-shield {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 11px;
  background: #1b2545;
  color: #ffffff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.simulator-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

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

.simulator-title {
  font-size: 16.5px;
  font-weight: 700;
  color: #151c3a;
  margin: 0;
}

.simulator-badge {
  padding: 5px 9px;
  border-radius: 999px;
  background: #edf0f7;
  color: #59647d;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.simulator-badge.active-sim {
  background: #eaf1ff;
  color: #536fff;
  font-weight: 700;
}

.simulator-desc {
  margin: 0;
  font-size: 12.5px;
  color: #8e97b0;
  line-height: 1.7;
}

.simulator-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  justify-content: flex-end;
}

.simulator-label {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  flex-shrink: 0;
}

.simulator-select-wrap {
  position: relative;
  width: 340px;
  min-width: 290px;
  max-width: 100%;
}

.simulator-select {
  height: 44px;
  width: 100%;
  padding: 0 14px 0 38px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #18213d;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  direction: rtl;
  text-align: right;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.simulator-select:hover {
  border-color: #94a3b8;
}

.simulator-select:focus {
  outline: none;
  border-color: #536fff;
  box-shadow: 0 0 0 3px rgba(83, 111, 255, 0.12);
}

.simulator-chevron {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.simulator-exit-btn {
  height: 45px;
  padding: 0 14px;
  background: #fff4f4;
  border: 1px solid #f3d2d2;
  border-radius: 10px;
  color: #d65363;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.simulator-exit-btn:hover {
  background: #fdecec;
  border-color: #ebb8b8;
}

/* Segmented Tabs */
.permissions-tabs {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  margin-bottom: 2px;
  flex-wrap: wrap;
}

.permissions-tab-btn {
  height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  background: #ffffff;
  color: #65708a;
  border: 1px solid #dfe4ef;
}

.permissions-tab-btn:hover {
  background: #f8f9fd;
  color: #151c3a;
  border-color: #cfd6e6;
}

.permissions-tab-btn.active {
  background: #151c3a;
  color: #ffffff;
  border-color: #151c3a;
  box-shadow: 0 4px 12px rgba(21, 28, 58, 0.12);
}

/* Main Permissions Workspace */
.permissions-workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

/* Roles Panel */
.perm-roles-panel {
  background: #ffffff;
  border: 1px solid #e1e6f0;
  border-radius: 16px;
  padding: 12px;
  position: sticky;
  top: 20px;
  box-shadow: 0 6px 18px rgba(21, 28, 58, 0.03);
}

.perm-roles-panel-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #18213d;
  padding: 4px 6px 10px;
  border-bottom: 1px solid #edf0f5;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  white-space: nowrap;
}

.perm-roles-count-badge {
  background: #f1f5f9;
  color: #475569;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.perm-roles-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.perm-role-card {
  min-height: 72px;
  padding: 12px 13px;
  border: 1px solid #e5e8f1;
  border-radius: 11px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.perm-role-card:hover {
  border-color: #cbd5e6;
  background: #fbfcff;
}

.perm-role-card.active {
  border: 1.5px solid #536fff;
  background: #f2f5ff;
  box-shadow: 0 0 0 2px rgba(83, 111, 255, 0.05);
}

.perm-role-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

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

.perm-role-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.perm-role-name {
  font-size: 13px;
  font-weight: 700;
  color: #18213d;
}

.perm-role-card.active .perm-role-name {
  color: #536fff;
}

.perm-role-badge-primary {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #eaf1ff;
  color: #536fff;
  font-weight: 800;
}

.perm-role-desc {
  margin: 0;
  font-size: 11.5px;
  color: #8e97b0;
  line-height: 1.4;
}

/* Permission Matrix Main Wrap */
.perm-matrix-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.perm-matrix-header {
  background: #ffffff;
  border: 1px solid #e1e6f0;
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 6px 18px rgba(21, 28, 58, 0.03);
}

.perm-matrix-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.perm-matrix-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.perm-matrix-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #151c3a;
}

.perm-matrix-role-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f0f3f9;
  color: #59647d;
}

.perm-matrix-desc {
  margin: 0;
  font-size: 12px;
  color: #8e97b0;
  line-height: 1.5;
}

.perm-matrix-stats {
  font-size: 11.5px;
  font-weight: 700;
  color: #536fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.perm-save-btn {
  height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  background: #151c3a;
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 150px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(21, 28, 58, 0.12);
}

.perm-add-role-full-btn {
  width: 100%;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  background: #f0f7ff;
  color: #2563eb;
  border: 1px dashed #93c5fd;
  font-weight: 700;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
  white-space: nowrap;
  margin-bottom: 10px;
}

.perm-add-role-full-btn:hover:not(:disabled) {
  background: #dbeafe;
  border-color: #3b82f6;
  border-style: solid;
  color: #1d4ed8;
}

.perm-add-role-full-btn.btn-locked {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #94a3b8;
}

.perm-add-role-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  font-weight: 700;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.perm-add-role-btn:hover:not(:disabled) {
  background: #dbeafe;
  color: #1d4ed8;
}

.perm-delete-role-btn {
  height: 42px;
  padding: 0 15px;
  border-radius: 10px;
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
  font-weight: 700;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.perm-delete-role-btn:hover:not(:disabled) {
  background: #ffe4e6;
  color: #be123c;
  border-color: #fda4af;
}

.perm-save-btn:hover:not(:disabled) {
  background: #202b58;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(21, 28, 58, 0.18);
}

.perm-save-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.perm-admin-note {
  font-size: 12px;
  color: #536fff;
  font-weight: 700;
  background: #f2f5ff;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid #dce4ff;
}

/* Permission Modules Grid */
.permission-modules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

@media (min-width: 1750px) {
  .permission-modules-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.permission-module {
  min-width: 0;
  background: #ffffff;
  border: 1px solid #e1e6f0;
  border-radius: 15px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 18px rgba(21, 28, 58, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.permission-module:hover {
  border-color: #cbd5e6;
  box-shadow: 0 8px 22px rgba(21, 28, 58, 0.07);
}

.perm-module-head {
  background: #ffffff;
  padding: 14px;
  border-bottom: 1px solid #edf0f5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.perm-module-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.perm-module-title-group {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.perm-module-icon-badge {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 9px;
  background: #f4f6fa;
  color: #151c3a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.perm-module-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #18213d;
  line-height: 1.25;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
}

.perm-module-title bdi {
  font-size: 12px;
  font-weight: 500;
  color: #8e97b0;
}

.perm-module-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.perm-count-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 7px;
  border-radius: 7px;
  background: #f0f3f9;
  color: #64708b;
  white-space: nowrap;
}

.perm-count-badge.is-all {
  background: #f0faf4;
  color: #248b52;
  border: 1px solid #ccebd8;
  font-weight: 700;
}

.perm-count-badge.is-some {
  background: #eaf1ff;
  color: #4f6ee8;
  border: 1px solid #d4e2ff;
  font-weight: 700;
}

.perm-viewonly-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 6px;
  background: #edf1f8;
  color: #4f6ee8;
  white-space: nowrap;
}

.perm-module-desc {
  font-size: 12px;
  color: #9199ad;
  line-height: 1.5;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.perm-bulk-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.perm-bulk-grant {
  height: 32px;
  padding: 0 10px;
  background: #f0faf4;
  color: #248b52;
  border: 1px solid #ccebd8;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.perm-bulk-grant:hover {
  background: #e5f7ec;
  border-color: #b7e3c8;
}

.perm-bulk-deny {
  height: 32px;
  padding: 0 10px;
  background: #fff4f4;
  color: #c94747;
  border: 1px solid #f3d2d2;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.perm-bulk-deny:hover {
  background: #fdecec;
  border-color: #ebb8b8;
}

/* Permission Rows & Switch */
.perm-module-body {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  flex: 1;
}

.permission-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid #edf0f5;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
}

.permission-row:hover:not(.is-locked) {
  background: #f8fafc;
}

.permission-row.is-active {
  background: #fbfcff;
}

.permission-row.is-locked {
  opacity: 0.68;
  cursor: not-allowed;
  background: #f8fafc;
}

.perm-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.permission-type {
  min-width: 44px;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.permission-type.type-view {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.permission-type.type-create {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.permission-type.type-edit {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.permission-type.type-delete {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.permission-type.type-special {
  background: #faf5ff;
  color: #6d28d9;
  border: 1px solid #e9d5ff;
}

.perm-action-label {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.4;
  word-break: normal;
  white-space: normal;
}

.permission-row.is-locked .perm-action-label {
  color: #64748b;
}

.perm-view-info-icon {
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  margin-right: 4px;
  cursor: help;
}

.perm-row-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.perm-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2.5px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.perm-status-badge.is-on {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.perm-status-badge.is-off {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.perm-lock-notice {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2.5px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  white-space: nowrap;
}

/* Custom Accessible Toggle Switch */
.permission-toggle {
  width: 44px;
  height: 24px;
  min-width: 44px;
  border-radius: 999px;
  background: #e2e8f0;
  border: 1.5px solid #cbd5e1;
  position: relative;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  flex-shrink: 0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.permission-toggle:hover:not(.is-locked) {
  background: #cbd5e1;
  border-color: #94a3b8;
}

.permission-toggle:focus-visible {
  box-shadow: 0 0 0 2px #536fff, 0 0 0 4px rgba(83, 111, 255, 0.25);
}

.permission-toggle.is-on {
  background: #16a34a;
  border-color: #15803d;
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.15), 0 2px 4px rgba(22, 163, 74, 0.25);
}

.permission-toggle.is-locked {
  opacity: 0.45;
  cursor: not-allowed;
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.permission-toggle-knob {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  position: absolute;
  top: 1.5px;
  right: 2px;
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22), 0 1px 1px rgba(0, 0, 0, 0.1);
}

.permission-toggle.is-on .permission-toggle-knob {
  transform: translateX(-20px);
}

/* Users Tab Custom Overrides Styles */
.user-override-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  gap: 12px;
  transition: all 0.15s ease;
}

.user-override-row.has-override {
  background: #fbfcff;
  border-color: #536fff;
  box-shadow: 0 0 0 1px rgba(83, 111, 255, 0.12);
}

.user-override-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.user-override-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #18213d;
  line-height: 1.4;
  word-break: normal;
  white-space: normal;
}

.user-override-tag {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  background: #536fff;
  color: #ffffff;
  flex-shrink: 0;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.user-override-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.user-override-actions {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.override-btn {
  height: 28px;
  padding: 0 9px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid #dfe4ef;
  background: #ffffff;
  color: #64748b;
  cursor: pointer;
  transition: all 0.12s ease;
}

.override-btn:hover {
  background: #f8f9fd;
  color: #18213d;
}

.override-btn.btn-allow.is-active {
  background: #2f9f61;
  color: #ffffff;
  border-color: #2f9f61;
}

.override-btn.btn-deny.is-active {
  background: #d65363;
  color: #ffffff;
  border-color: #d65363;
}

.override-btn.btn-reset {
  color: #8e97b0;
  font-size: 12px;
  padding: 0 7px;
}

.override-effective-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.override-effective-pill.is-allowed {
  background: #f0faf4;
  color: #248b52;
}

.override-effective-pill.is-denied {
  background: #fff4f4;
  color: #c94747;
}

.override-effective-pill.is-locked {
  background: #f0f3f9;
  color: #64748b;
}

/* Unsaved Changes Floating Modal */
.perm-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100010;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  animation: permFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.perm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.perm-modal-card {
  position: relative;
  z-index: 2;
  background: #ffffff;
  border-radius: 20px;
  padding: 28px 24px 24px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(226, 232, 240, 0.9);
  direction: rtl;
  animation: permScaleUp 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

@keyframes permScaleUp {
  from { transform: scale(0.92) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.perm-modal-icon-wrap {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #d97706;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.15);
}

.perm-modal-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.perm-modal-desc {
  margin: 0 0 22px;
  font-size: 13.5px;
  color: #64748b;
  line-height: 1.6;
}

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

.perm-modal-btn {
  flex: 1;
  height: 42px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  font-family: inherit;
  white-space: nowrap;
}

.perm-modal-btn-stay {
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

.perm-modal-btn-stay:hover {
  background: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.25);
}

.perm-modal-btn-danger {
  background: #fff1f2;
  color: #e11d48;
  border-color: #fecdd3;
}

.perm-modal-btn-danger:hover {
  background: #ffe4e6;
  border-color: #fda4af;
  color: #be123c;
  transform: translateY(-1px);
}

/* Locked Action Buttons */
.btn-locked,
button.btn-locked,
.soft-button.btn-locked,
.primary-button.btn-locked,
.danger-button.btn-locked {
  cursor: not-allowed !important;
  opacity: 0.65 !important;
  pointer-events: auto !important;
}

.btn-locked svg,
button.btn-locked svg {
  flex-shrink: 0;
}

/* Responsive Media Queries */
@media (max-width: 1280px) {
  .permissions-workspace {
    grid-template-columns: 240px minmax(0, 1fr);
  }
}

@media (max-width: 1024px) {
  .permissions-workspace {
    grid-template-columns: 1fr;
  }
  .perm-roles-panel {
    position: static;
  }
  .perm-roles-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
  }
}

@media (max-width: 860px) {
  .permission-simulator {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .simulator-controls {
    justify-content: stretch;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .simulator-select-wrap {
    width: 100%;
    min-width: 0;
  }
  .permission-modules-grid {
    grid-template-columns: 1fr;
  }
  .permissions-tab-btn {
    padding: 0 12px;
    font-size: 12px;
  }
  .perm-matrix-header {
    flex-direction: column;
    align-items: stretch;
  }
  .perm-save-btn {
    width: 100%;
  }
}

/* Legacy & Special Type Tags for backward compatibility */
.permission-type.type-pos { background: #e0f2fe; color: #0369a1; }
.permission-type.type-main { background: #ede9fe; color: #4338ca; }
.perm-type-tag.tag-main { background: #ede9fe; color: #4338ca; }
.perm-type-tag.tag-pos { background: #e0f2fe; color: #0369a1; }
.perm-type-tag.tag-view { background: #dbeafe; color: #1d4ed8; }
.perm-type-tag.tag-create { background: #dcfce7; color: #15803d; }
.perm-type-tag.tag-edit { background: #fef3c7; color: #b45309; }
.perm-type-tag.tag-delete { background: #fee2e2; color: #b91c1c; }
.perm-type-tag.tag-special { background: #f3e8ff; color: #7e22ce; }

/* زر عائم للخروج من محاكي الصلاحيات (Floating Simulator Exit Button) */
.sim-exit-fab {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 9999px;
  background: #0f172a;
  color: #f8fafc;
  border: 1.5px solid #ef4444;
  box-shadow: 0 10px 25px -3px rgba(239, 68, 68, 0.35), 0 4px 6px -4px rgba(15, 23, 42, 0.4);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  animation: simFabSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sim-exit-fab:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #b91c1c;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 28px -2px rgba(220, 38, 38, 0.5);
}

.sim-exit-fab:active {
  transform: translateY(0) scale(0.98);
}

.sim-fab-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: simPulse 1.8s infinite;
}

.sim-exit-fab:hover .sim-fab-dot {
  background: #ffffff;
}

@keyframes simPulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

@keyframes simFabSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

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

.sim-fab-text {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sim-fab-text small {
  color: #cbd5e1;
  font-weight: 500;
  font-size: 12px;
}

.sim-exit-fab:hover .sim-fab-text small {
  color: #fee2e2;
}

body.has-sim-active #ai-fab {
  bottom: 84px !important;
}

/* ============================================================================
 * WhatsApp Analytics & Reports Center Styles (Ultra-Modern Executive UI)
 * ============================================================================ */
.wa-reports-container {
  padding: 24px 28px;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.wa-reports-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line, #e2e8f0);
}

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

.wa-reports-title-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
  flex-shrink: 0;
}

.wa-reports-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.3px;
}

.wa-reports-subtitle {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

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

/* KPI Cards Grid */
.wa-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.wa-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.wa-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
  border-color: #cbd5e1;
}

.wa-kpi-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wa-kpi-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wa-kpi-icon-wrap.blue {
  background: #eff6ff;
  color: #2563eb;
}

.wa-kpi-icon-wrap.green {
  background: #ecfdf5;
  color: #059669;
}

.wa-kpi-icon-wrap.purple {
  background: #f5f3ff;
  color: #7c3aed;
}

.wa-kpi-icon-wrap.amber {
  background: #fffbeb;
  color: #d97706;
}

.wa-kpi-icon-wrap.teal {
  background: #f0fdfa;
  color: #0d9488;
}

.wa-kpi-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.wa-kpi-tag.positive {
  background: #ecfdf5;
  color: #065f46;
}

.wa-kpi-tag.neutral {
  background: #f1f5f9;
  color: #475569;
}

.wa-kpi-tag.info {
  background: #eff6ff;
  color: #1e40af;
}

.wa-kpi-value-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wa-kpi-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
}

.wa-kpi-value {
  font-size: 28px;
  font-weight: 900;
  color: #0f172a;
  font-family: inherit;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.wa-kpi-progress {
  width: 100%;
  height: 5px;
  background: #f1f5f9;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 4px;
}

.wa-kpi-progress-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease;
}

.wa-kpi-progress-bar.green {
  background: linear-gradient(90deg, #10b981, #059669);
}

.wa-kpi-subtext {
  font-size: 11.5px;
  color: #94a3b8;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

/* Delivery Rate Analytics Banner Card */
.wa-rate-banner {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px 24px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wa-rate-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.wa-rate-banner-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wa-rate-metrics {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.wa-rate-metric-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #334155;
}

.wa-rate-metric-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wa-rate-metric-dot.delivered {
  background: #10b981;
}

.wa-rate-metric-dot.failed {
  background: #ef4444;
}

.wa-rate-metric-dot.direct {
  background: #3b82f6;
}

.wa-rate-metric-dot.auto {
  background: #8b5cf6;
}

.wa-rate-segmented-bar {
  display: flex;
  width: 100%;
  height: 8px;
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
  gap: 2px;
}

.wa-rate-seg {
  height: 100%;
  transition: width 0.5s ease;
}

.wa-rate-seg.delivered {
  background: #10b981;
}

.wa-rate-seg.failed {
  background: #ef4444;
}

/* Reports Table Panel */
.wa-reports-table-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.wa-reports-table-toolbar {
  padding: 16px 22px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background: #ffffff;
}

.wa-reports-table-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wa-reports-table-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
  color: #0f172a;
}

.wa-reports-count-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  background: #f1f5f9;
  color: #475569;
}

.wa-reports-table-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wa-reports-search-box {
  position: relative;
  min-width: 250px;
}

.wa-reports-search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.wa-reports-search-input {
  width: 100%;
  padding: 8px 36px 8px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  font-family: inherit;
  background: #f8fafc;
  color: #0f172a;
  outline: none;
  transition: all 0.2s ease;
}

.wa-reports-search-input:focus {
  background: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.wa-reports-filter-select {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wa-reports-filter-select:focus {
  background: #ffffff;
  border-color: #3b82f6;
}

/* Modern Data Table */
.wa-modern-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 520px;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f8fafc;
}

.wa-modern-table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.wa-modern-table-wrap::-webkit-scrollbar-track {
  background: #f8fafc;
}

.wa-modern-table-wrap::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.wa-modern-table-wrap::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.wa-modern-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 12.5px;
}

.wa-modern-table thead th {
  background: #f8fafc;
  padding: 13px 18px;
  font-weight: 800;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: -0.1px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.wa-modern-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
}

.wa-modern-table tbody tr:hover {
  background: #f8fafc;
}

.wa-modern-table tbody td {
  padding: 13px 18px;
  vertical-align: middle;
  color: #1e293b;
}

.wa-phone-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wa-phone-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.wa-phone-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wa-phone-num {
  font-family: monospace, sans-serif;
  font-weight: 700;
  font-size: 12px;
  direction: ltr;
  text-align: right;
  color: #0f172a;
}

.wa-phone-member-name {
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
}

/* Badges and Tags */
.wa-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.wa-type-badge.direct {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
}

.wa-type-badge.auto {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ede9fe;
}

.wa-msg-snippet-cell {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #334155;
  font-size: 12.5px;
}

.wa-media-type-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.wa-media-type-tag.voice {
  background: #ecfeff;
  color: #0e7490;
  border: 1px solid #cffafe;
}

.wa-media-type-tag.image {
  background: #fdf2f8;
  color: #be185d;
  border: 1px solid #fce7f3;
}

.wa-media-type-tag.video {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #ffedd5;
}

.wa-time-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.wa-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.wa-status-badge.delivered {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.wa-status-badge.failed {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.wa-status-badge.pending {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* ==========================================================================
   RBAC Access Denied & Read-Only Simulation Badges
   ========================================================================== */
.access-denied-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
  padding: 40px 20px;
  width: 100%;
}

.access-denied-card {
  max-width: 520px;
  width: 100%;
  background: #ffffff;
  border: 1px solid #fee2e2;
  border-radius: 16px;
  padding: 36px 28px;
  text-align: center;
  box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.08), 0 8px 10px -6px rgba(239, 68, 68, 0.04);
}

.access-denied-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px auto;
  border-radius: 50%;
  background: #fef2f2;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 8px #fff5f5;
}

.access-denied-title {
  font-size: 20px;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 10px 0;
}

.access-denied-desc {
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
  margin: 0 0 20px 0;
}

.access-denied-note {
  font-size: 12px;
  font-weight: 600;
  color: #b91c1c;
  background: #fff1f2;
  border: 1px dashed #fecdd3;
  padding: 10px 14px;
  border-radius: 8px;
}

.sim-readonly-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  font-size: 11.5px;
  font-weight: 700;
  vertical-align: middle;
  margin-right: 8px;
}

/* ============================================================================
   سجل العقود (Contracts Log Styles)
   ============================================================================ */
.contracts-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
}
.contracts-status-badge.active {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.contracts-status-badge.expiring {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.contracts-status-badge.expired {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ============================================================================
   إدارة الباقات (Packages Management Module)
   ============================================================================ */

.pkg-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.pkg-card {
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.pkg-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.1), 0 8px 10px -6px rgba(37, 99, 235, 0.04);
  border-color: #cbd5e1;
}

.pkg-filters .pkg-filter-btn {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pkg-filters .pkg-filter-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.pkg-filters .pkg-filter-btn.active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #2563eb;
  font-weight: 700;
}

.pkg-analytics-panel {
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.pkg-bar-item {
  transition: background 0.15s ease;
}

.pkg-bar-item:hover {
  background: #f8fafc;
  border-radius: 8px;
  padding: 4px 8px;
  margin: -4px -8px;
}

/* ============================================================================
   بوابة تسجيل الدخول ونظام المصادقة الآمن (Authentication & Login Portal — NASAQ Executive Brand Experience)
   ============================================================================ */

/* إخفاء العناصر التي تحمل خاصية hidden بشكل قاطع */
[hidden],
.auth-loading-overlay[hidden],
.login-portal[hidden] {
  display: none !important;
}

/* شاشة التحقق الأولي من الجلسة */
.auth-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at 50% 40%, #081329 0%, #030712 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  backdrop-filter: blur(8px);
}

.auth-loading-spinner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.auth-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(45, 208, 239, 0.15);
  border-top-color: #2dd0ef;
  animation: authSpin 0.85s linear infinite;
  box-shadow: 0 0 20px rgba(45, 208, 239, 0.22);
}

@keyframes authSpin {
  to { transform: rotate(360deg); }
}

.auth-loading-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
}

.auth-loading-brand .brand-sub {
  color: #2dd0ef;
  font-weight: 700;
  margin-right: 4px;
}

.auth-loading-text {
  font-size: 13.5px;
  color: #94a3b8;
  margin: 0;
}

/* ═══════════════════ حركات الظهور الانسيابية ═══════════════════ */
@keyframes shellIntroFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes logoIntroFade {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ═══════════════════ حاوية البوابة العامة والبيئة الكاملة (Full-Screen Atmospheric Environment) ═══════════════════ */
.login-portal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vh, 36px) clamp(14px, 2.5vw, 28px);
  background:
    radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.55) 0%, transparent 62%),
    radial-gradient(circle at 14% 18%, rgba(45, 205, 235, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 86% 82%, rgba(15, 70, 125, 0.11) 0%, transparent 48%),
    radial-gradient(ellipse at 50% 50%, transparent 45%, rgba(160, 185, 210, 0.08) 100%),
    #EAF3F7;
  box-sizing: border-box;
  overflow: hidden;
}

/* ═══════════════════ الطبقات الخلفية التقنية الشاملة (Full-Screen Atmosphere Infrastructure) ═══════════════════ */
.login-cinematic-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* شبكة تقنية هندسية خافتة تغطي الشاشة الخارجية بالكامل */
.login-outer-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(14, 116, 144, 0.022) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(14, 116, 144, 0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0.95) 45%, transparent 85%);
  mask-image: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0.95) 45%, transparent 85%);
}

/* كابل خلفي فيزيائي بعيد واحد ناعم يمر خلف الصدفة */
.login-outer-cable {
  position: absolute;
  inset: -5%;
  width: 110%;
  height: 110%;
  opacity: 1;
  animation: outerCableGentleDrift 45s ease-in-out infinite alternate;
}

@keyframes outerCableGentleDrift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-5px, 4px); }
}

/* إضاءة محيطية واسعة غير متناظرة */
.login-ambient-light {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(130px);
}

.login-ambient-cyan {
  width: 580px;
  height: 480px;
  top: -12%;
  right: 4%;
  background: radial-gradient(circle, rgba(45, 205, 235, 0.14) 0%, transparent 70%);
}

.login-ambient-blue {
  width: 540px;
  height: 440px;
  bottom: -10%;
  left: 5%;
  background: radial-gradient(circle, rgba(15, 70, 125, 0.10) 0%, transparent 70%);
}

/* كشاف إدماج الصدفة لتركيز الانتباه عليها */
.login-shell-spotlight {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1060px;
  height: 640px;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.70) 0%, rgba(45, 205, 235, 0.06) 50%, transparent 75%);
  filter: blur(120px);
  pointer-events: none;
}

/* ظل أرضي خافت يمنح الصدفة استقراراً فيزيائياً في المشهد */
.login-shell-floor-shadow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 44px));
  width: min(1280px, 88vw);
  height: 120px;
  background: radial-gradient(ellipse at center, rgba(12, 35, 65, 0.13) 0%, transparent 70%);
  filter: blur(48px);
  pointer-events: none;
}

/* نويز دقيق كحبيبات سينمائية فاخرة */
.login-noise-grain {
  position: absolute;
  inset: 0;
  opacity: 0.012;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* ═══════════════════ صدفة تسجيل الدخول الفاخرة (Executive Shell: 58% Brand / 42% Login) ═══════════════════ */
.login-split {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr);
  width: min(1320px, 92vw);
  max-width: 1320px;
  height: min(760px, calc(100dvh - 70px));
  min-height: min(620px, calc(100dvh - 32px));
  background: #ffffff;
  border-radius: 28px;
  border: 1px solid rgba(226, 232, 240, 0.90);
  box-shadow:
    0 34px 100px rgba(12, 35, 65, 0.15),
    0 10px 30px rgba(12, 35, 65, 0.06),
    0 0 0 1px rgba(0, 0, 0, 0.02);
  overflow: hidden;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  animation: shellIntroFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ═══════════════════ عمود الهوية البصرية (Brand Column — 58% Width) ═══════════════════ */
.login-brand-col {
  background:
    radial-gradient(ellipse at 50% 24%, rgba(45, 208, 239, 0.06) 0%, transparent 45%),
    radial-gradient(ellipse at 80% 88%, rgba(16, 48, 94, 0.05) 0%, transparent 45%),
    linear-gradient(165deg, #020b14 0%, #031524 50%, #052238 100%);
  color: #ffffff;
  padding: 30px 44px 26px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
}

/* 1. الطبقة الزخرفية المستقلة تماماً (Brand Decoration Layer — Absolute Only) */
.brand-decoration {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

/* شبكة تقنية خافتة مقنعة شعاعياً */
.login-tech-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(45, 208, 239, 0.015) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(45, 208, 239, 0.015) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, transparent 15%, rgba(0,0,0,0.25) 35%, rgba(0,0,0,1) 65%);
  mask-image: radial-gradient(ellipse at 50% 30%, transparent 15%, rgba(0,0,0,0.25) 35%, rgba(0,0,0,1) 65%);
}

/* هالة إضاءة الشعار المحكومة */
.login-ambient-halo {
  position: absolute;
  top: 24%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 440px;
  height: 440px;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(40, 200, 235, 0.12) 0%,
    rgba(22, 95, 145, 0.035) 40%,
    transparent 72%
  );
  pointer-events: none;
  filter: blur(28px);
}

/* 2. شبكة المحتوى الحقيقية الموزعة بانسيابية (Brand Content Flow) */
.brand-content {
  position: relative;
  z-index: 10;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Row 1: شارة المنصة في الأعلى */
.brand-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 28px;
  margin: 0;
  padding: 0;
}

.login-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(45, 208, 239, 0.06);
  border: 1px solid rgba(45, 208, 239, 0.16);
  padding: 4px 13px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(160, 236, 240, 0.90);
  width: fit-content;
  letter-spacing: 0.3px;
  margin: 0;
}

/* Row 2: منطقة الشعار المرنة (Logo Safe Zone) */
.brand-logo-zone {
  min-height: 105px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  min-width: 0;
}

.login-logo-aura {
  position: absolute;
  inset: -15px;
  background: radial-gradient(
    ellipse at center,
    rgba(40, 200, 235, 0.12) 0%,
    rgba(22, 95, 145, 0.04) 40%,
    transparent 72%
  );
  pointer-events: none;
  filter: blur(18px);
}

.login-wire-hero-img {
  width: clamp(210px, 23vw, 320px);
  max-width: 85%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  filter:
    drop-shadow(0 14px 25px rgba(0, 0, 0, 0.25))
    drop-shadow(0 0 25px rgba(45, 208, 239, 0.08));
  user-select: none;
  position: relative;
  z-index: 1;
  animation: logoIntroFade 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}

/* Row 3: العنوان الرئيسي المصغر والأنيق (Headline Safe Zone) */
.brand-headline {
  font-size: clamp(20px, 1.75vw, 25px);
  font-weight: 800;
  line-height: 1.35;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.3px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  max-width: 100%;
}

.brand-headline span {
  color: #28c4e6;
  background: linear-gradient(135deg, #7ee5ff 0%, #28c4e6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

/* Row 4: النص المساند */
.brand-desc {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.70);
  margin: 0;
  font-weight: 500;
  max-width: 440px;
}

/* Row 5: شريط الكابل البصري الممتد من الطرف إلى الطرف (Full-Bleed Edge-to-Edge Hero Wire) */
.brand-wire-band {
  position: relative;
  width: calc(100% + 88px);
  margin-left: -44px;
  margin-right: -44px;
  min-height: 48px;
  max-height: 60px;
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  pointer-events: none;
  margin-top: 2px;
  margin-bottom: 2px;
}

.login-wire-band-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* تصميم الكابل الفيزيائي ثلاثي الطبقات */
.wire-stroke {
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.wire-glow {
  stroke: #28c4e6;
  stroke-width: 14px;
  opacity: 0.08;
  filter: blur(4px);
}

.wire-shadow {
  stroke: #01080f;
  stroke-width: 11px;
  opacity: 0.40;
}

.wire-main {
  stroke: #28c4e6;
  stroke-width: 7.5px;
}

.wire-highlight {
  stroke: rgba(210, 250, 255, 0.55);
  stroke-width: 2px;
}

.wire-pulse-group circle {
  opacity: 0.95;
}

/* Row 6: بطاقات الميزات التنفيذية الخفيفة أسفل الكابل */
.brand-features {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 470px;
  margin: 0;
}

.brand-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  width: 100%;
  box-sizing: border-box;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.brand-feature:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(45, 208, 239, 0.15);
}

.login-feature-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(45, 208, 239, 0.06);
  border: 1px solid rgba(45, 208, 239, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2dd0ef;
  flex-shrink: 0;
}

.brand-feature-content strong,
.login-feature-content strong {
  display: block;
  font-size: 14px;
  color: #ffffff;
  font-weight: 700;
  line-height: 1.3;
}

.brand-feature-content small,
.login-feature-content small {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 1px;
}

/* Row 7: شريط حالة الاتصال والتوثيق في الأسفل */
.brand-status {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 20px;
  margin: 0;
  padding-top: 2px;
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(203, 213, 225, 0.50);
  letter-spacing: 0.3px;
}

.brand-status svg {
  color: #28c4e6;
  opacity: 0.70;
}

/* ═══════════════════ عمود تسجيل الدخول الهادئ والفاخر (Login Column — 42% Width) ═══════════════════ */
.login-form-col {
  padding: clamp(36px, 4.5vh, 52px) clamp(36px, 4vw, 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  position: relative;
  box-sizing: border-box;
  min-height: 0;
  overflow-y: auto;
}

.login-mobile-header {
  display: none;
}

.login-card {
  width: 100%;
  max-width: 410px;
  margin-top: -6px;
}

/* رأس النموذج مع الإيقاع البصري الدقيق */
.login-card-header {
  margin-bottom: 32px;
}

.login-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  font-size: 12px;
  font-weight: 700;
  color: #087d99;
  letter-spacing: 0.3px;
  margin-bottom: 12px;
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(44, 200, 230, 0.10);
  border: 1px solid rgba(44, 200, 230, 0.20);
  box-sizing: border-box;
}

.login-eyebrow svg {
  color: #087d99;
}

.login-title {
  font-size: clamp(34px, 2.5vw, 40px);
  font-weight: 800;
  color: #10182d;
  margin: 0 0 8px 0;
  letter-spacing: -0.6px;
  line-height: 1.1;
}

.login-subtitle {
  font-size: 14.5px;
  color: #64748b;
  margin: 0;
  line-height: 1.7;
  max-width: 370px;
}

/* ═══════════════════ رسائل التنبيه والقفل المؤقت ═══════════════════ */
.login-alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 18px;
  border: 1px solid transparent;
}

.login-alert.danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.login-alert.warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.login-alert.success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.login-alert.info {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0369a1;
}

.login-lockout-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: #fff1f2;
  border: 1.5px solid #fecdd3;
  border-radius: 14px;
  margin-bottom: 20px;
  color: #9f1239;
}

.lockout-icon {
  flex-shrink: 0;
  color: #e11d48;
  margin-top: 2px;
}

.lockout-info h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 800;
  color: #881337;
}

.lockout-info p {
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #9f1239;
}

.lockout-countdown-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.7);
  padding: 6px 12px;
  border-radius: 8px;
  width: fit-content;
}

.lockout-countdown {
  font-family: monospace;
  font-size: 16px;
  font-weight: 900;
  color: #e11d48;
  direction: ltr;
}

.lockout-hint {
  display: block;
  font-size: 11px;
  color: #be123c;
  margin-top: 8px;
}

/* ═══════════════════ حقول النموذج وأزرار الإدخال (52px Rhythm) ═══════════════════ */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

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

.login-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  color: #273249;
}

.login-label svg {
  color: #0e7490;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  font-size: 14.5px;
  font-family: inherit;
  color: #172038;
  background: #f7f9fc;
  border: 1px solid #dce4ed;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-sizing: border-box;
}

.login-input:hover {
  border-color: #cbd5e1;
  background: #ffffff;
}

.login-input:focus {
  border-color: #28c4e6;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(40, 196, 230, 0.09);
}

.login-input-ltr {
  direction: ltr;
  text-align: left;
}

.login-input.is-invalid {
  border-color: #f87171 !important;
  background: #fffdfd;
}

.login-input.is-invalid:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12) !important;
}

/* زر إظهار / إخفاء كلمة المرور */
.password-toggle-btn {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease, background 0.15s ease;
  z-index: 2;
}

.password-toggle-btn:hover {
  color: #0e7490;
  background: rgba(14, 116, 144, 0.08);
}

.login-input-wrap .login-input-ltr {
  padding-left: 48px;
}

/* ═══════════════════ زر تسجيل الدخول التنفيذي ═══════════════════ */
.login-actions {
  margin-top: 6px;
}

.login-submit-btn {
  width: 100%;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  color: #ffffff;
  background: linear-gradient(135deg, #0a1737 0%, #123263 100%);
  border: 1px solid rgba(40, 196, 230, 0.18);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 10px 24px rgba(12, 35, 75, 0.15);
}

.login-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #28c4e6;
  box-shadow:
    0 14px 28px rgba(12, 35, 75, 0.22),
    0 0 16px rgba(40, 196, 230, 0.18);
}

.login-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.login-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #2dd0ef;
  animation: authSpin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
}

/* ═══════════════════ تذييل بطاقة الدخول الموزون ═══════════════════ */
.login-card-foot {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  text-align: center;
}

.login-security-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #0e7490;
}

.login-security-tag svg {
  color: #0e7490;
}

.login-support-note {
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.5;
}

/* ═══════════════════ استجابة الشاشات القصيرة (1366x768 & 1280x720) ═══════════════════ */
@media (max-height: 820px) and (min-width: 861px) {
  .login-split {
    height: min(670px, calc(100dvh - 36px));
    min-height: min(550px, calc(100dvh - 20px));
  }
  .login-brand-col {
    padding: 22px 34px 18px;
  }
  .brand-content {
    gap: 8px;
  }
  .brand-logo-zone {
    min-height: 80px;
  }
  .login-wire-hero-img {
    max-height: 150px;
    width: clamp(160px, 19vw, 240px);
  }
  .brand-headline {
    font-size: 20px;
  }
  .brand-desc {
    font-size: 12px;
    line-height: 1.5;
  }
  .brand-wire-band {
    width: calc(100% + 68px);
    margin-left: -34px;
    margin-right: -34px;
    min-height: 38px;
    max-height: 48px;
    height: 42px;
  }
  .brand-features {
    gap: 5px;
  }
  .brand-feature {
    padding: 7px 10px;
  }
  .brand-feature-content strong,
  .login-feature-content strong {
    font-size: 13px;
  }
  .brand-feature-content small,
  .login-feature-content small {
    font-size: 11px;
  }
  .login-form-col {
    padding: 28px 40px;
  }
  .login-card-header {
    margin-bottom: 20px;
  }
  .login-title {
    font-size: 32px;
  }
  .login-form {
    gap: 14px;
  }
  .login-input {
    height: 46px;
  }
  .login-submit-btn {
    height: 46px;
    font-size: 15px;
  }
  .login-card-foot {
    margin-top: 16px;
    padding-top: 10px;
  }
}

@media (max-height: 690px) and (min-width: 861px) {
  .login-split {
    height: calc(100dvh - 20px);
    min-height: 490px;
  }
  .login-brand-col {
    padding: 16px 26px 14px;
  }
  .brand-content {
    gap: 6px;
  }
  .login-wire-hero-img {
    max-height: 110px;
    width: clamp(130px, 15vw, 180px);
  }
  .brand-headline {
    font-size: 18px;
  }
  .brand-desc {
    display: none;
  }
  .brand-wire-band {
    width: calc(100% + 52px);
    margin-left: -26px;
    margin-right: -26px;
    min-height: 28px;
    max-height: 38px;
    height: 32px;
  }
  .login-form-col {
    padding: 18px 28px;
  }
  .login-input {
    height: 42px;
  }
  .login-submit-btn {
    height: 42px;
  }
}

/* ═══════════════════ تقليل الحركة عند تفضيل المستخدم (Prefers Reduced Motion) ═══════════════════ */
@media (prefers-reduced-motion: reduce) {
  .login-split,
  .login-wire-hero-img,
  .login-outer-cable,
  .wire-pulse-group circle {
    animation: none !important;
    transition: none !important;
  }
}


/* ويدجت الموظف في الشريط العلوي */
.user-profile-widget {
  position: relative;
  display: flex;
  align-items: center;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 30px;
  padding: 4px 12px 4px 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.user-profile-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: right;
  line-height: 1.2;
}

.user-name {
  font-size: 12.5px;
  font-weight: 800;
  color: #0f172a;
}

.user-role-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 2px;
}

.chevron-ic {
  color: #94a3b8;
  transition: transform 0.2s ease;
}

.user-profile-btn[aria-expanded="true"] .chevron-ic {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 1000;
  min-width: 270px;
  max-width: 320px;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-dropdown-header {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: right;
}

.user-dropdown-header strong {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.user-menu-role {
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  padding: 2px 8px;
  border-radius: 6px;
  align-self: flex-start;
  margin: 1px 0;
}

.user-dropdown-header small {
  font-size: 12px;
  color: #64748b;
  direction: ltr;
  text-align: right;
}

.user-dropdown-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 4px 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  background: none;
  border: none;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  text-align: right;
  transition: all 0.15s ease;
}

.user-dropdown-item:hover {
  background: #f8fafc;
  color: #0f172a;
}

.user-dropdown-item.danger {
  color: #dc2626;
}

.user-dropdown-item.danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}

/* بطاقة الموظف في أسفل الشريط الجانبي */
.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 12px;
  margin-bottom: 0;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.sidebar-user-card .user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #1e293b;
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-user-card .user-details {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.sidebar-user-card .user-name {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-card .user-role {
  font-size: 11px;
  font-weight: 700;
  color: #475569 !important;
}

.sidebar-logout-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #ef4444;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  transition: all 0.18s ease;
  width: 100%;
  box-sizing: border-box;
}

.sidebar-logout-btn .logout-ic {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  flex-shrink: 0;
}

.sidebar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.18);
  color: #dc2626;
}

.sidebar-sync-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  padding: 2px 4px;
  width: 100%;
}

/* حالة القفل لعناصر القائمة الجانبية (Locked Nav Items) */
.nav-item.item-locked {
  opacity: 0.62 !important;
  cursor: not-allowed !important;
  position: relative;
}

.nav-item.item-locked:hover {
  background: rgba(241, 245, 249, 0.6) !important;
  color: #64748b !important;
}

.nav-item.item-locked .nav-lock-badge {
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  opacity: 0.85;
}

/* تبويب إدارة حسابات الدخول في الصلاحيات */
.auth-accounts-tab {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}

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

.auth-stat-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-stat-icon.blue { background: #eff6ff; color: #2563eb; }
.auth-stat-icon.green { background: #f0fdf4; color: #16a34a; }
.auth-stat-icon.amber { background: #fffbeb; color: #d97706; }
.auth-stat-icon.red { background: #fef2f2; color: #dc2626; }

.auth-stat-card div strong {
  display: block;
  font-size: 20px;
  font-weight: 900;
  color: #0f172a;
}

.auth-stat-card div small {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.auth-accounts-table-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.auth-table-head-bar {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
  gap: 12px;
}

.auth-table-head-bar h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.auth-accounts-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 13px;
}

.auth-accounts-table th {
  background: #f8fafc;
  padding: 12px 16px;
  color: #475569;
  font-weight: 800;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.auth-accounts-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.auth-accounts-table tr:hover td {
  background: #fbfcfe;
}

.auth-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
}

.auth-status-badge.active { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.auth-status-badge.locked { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.auth-status-badge.disabled { background: #fef2f2; color: #dc2626; border: 1px solid #fecdd3; }

.auth-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.auth-action-btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.auth-action-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.auth-action-btn.unlock-btn {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.auth-action-btn.unlock-btn:hover {
  background: #ffedd5;
}

.auth-action-btn.danger-btn {
  color: #dc2626;
}

.auth-action-btn.danger-btn:hover {
  background: #fef2f2;
  border-color: #fecdd3;
}

@media (max-width: 860px) {
  .login-portal {
    padding: 16px 12px;
    align-items: flex-start;
    overflow-y: auto;
  }
  .login-split {
    grid-template-columns: 1fr;
    max-width: 440px;
    width: 100%;
    height: auto;
    min-height: 0;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(12, 35, 65, 0.15);
  }
  .login-brand-col {
    display: none;
  }
  .login-mobile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 20px 20px;
    background: linear-gradient(165deg, #020b14 0%, #031524 50%, #052238 100%);
    border-radius: 24px 24px 0 0;
    position: relative;
    overflow: hidden;
    min-height: 190px;
    box-sizing: border-box;
  }
  .login-mobile-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
      linear-gradient(to right, rgba(45, 208, 239, 0.02) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(45, 208, 239, 0.02) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
  }
  .login-mobile-header::after {
    content: "";
    position: absolute;
    bottom: -15px;
    left: 10%;
    right: 10%;
    height: 30px;
    border-top: 2px solid #28c4e6;
    border-radius: 50%;
    opacity: 0.35;
    pointer-events: none;
  }
  .login-mobile-logo-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .login-mobile-logo {
    width: 190px;
    max-width: 80%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4)) drop-shadow(0 0 16px rgba(45, 208, 239, 0.1));
  }
  .login-mobile-tag {
    position: relative;
    z-index: 1;
    font-size: 11px;
    font-weight: 700;
    color: rgba(160, 236, 240, 0.9);
    background: rgba(45, 208, 239, 0.08);
    border: 1px solid rgba(45, 208, 239, 0.18);
    padding: 3px 12px;
    border-radius: 20px;
  }
  .login-form-col {
    padding: 24px 20px 28px;
    border-radius: 0 0 24px 24px;
  }
  .login-card {
    max-width: 100%;
    margin-top: 0;
  }
  .login-card-header {
    margin-bottom: 22px;
  }
  .login-title {
    font-size: 28px;
  }
  .login-subtitle {
    font-size: 13.5px;
  }
  .login-input {
    height: 50px;
  }
  .login-submit-btn {
    height: 50px;
  }
}

@media (max-width: 768px) {
  .pkg-cards-grid {
    grid-template-columns: 1fr;
  }
  .pkg-bar-item {
    grid-template-columns: 120px 1fr 70px !important;
    gap: 8px !important;
  }
}

/* ============================================================================
 * الملف الشخصي المتكامل للموظف (Ultra Gym Employee Self-Profile)
 * ============================================================================ */
.self-profile-page {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.self-profile-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.self-profile-eyebrow {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 2px;
}

.self-profile-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.self-profile-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sp-btn {
  height: 38px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.sp-btn-primary {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.sp-btn-primary:hover {
  background: #1d4ed8;
}

.sp-btn-secondary {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #334155;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.sp-btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

/* Hero Identity Card */
.self-profile-hero {
  background: #ffffff;
  border: 1px solid #e1e6f0;
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.sp-hero-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.sp-avatar {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(30, 41, 59, 0.16);
}

.sp-hero-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 240px;
}

.sp-hero-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sp-hero-name {
  font-size: 19px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.sp-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sp-status-badge.is-active {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.sp-status-badge.is-suspended {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.sp-hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sp-hero-role {
  font-size: 12px;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #dbeafe;
}

.sp-hero-id {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  font-family: inherit;
}

.sp-hero-contact {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 2px;
  font-size: 12px;
  color: #475569;
  flex-wrap: wrap;
}

.sp-contact-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sp-contact-item svg {
  color: #94a3b8;
  flex-shrink: 0;
}

.sp-email-val,
.sp-phone-val {
  direction: ltr;
  unicode-bidi: embed;
  font-weight: 600;
}

/* Quick KPI Bar */
.sp-kpis-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.sp-kpi-card {
  background: #ffffff;
  border: 1px solid #e1e6f0;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.02);
}

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

.sp-kpi-icon.blue { background: #eff6ff; color: #2563eb; }
.sp-kpi-icon.green { background: #f0fdf4; color: #16a34a; }
.sp-kpi-icon.cyan { background: #ecfeff; color: #0891b2; }
.sp-kpi-icon.amber { background: #fffbeb; color: #d97706; }
.sp-kpi-icon.purple { background: #faf5ff; color: #7c3aed; }

.sp-kpi-content {
  min-width: 0;
  flex: 1;
}

.sp-kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-kpi-value {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  display: block;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Profile Navigation Side Menu & Layout */
.self-profile-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
}

.sp-sidebar-nav {
  position: sticky;
  top: 16px;
  z-index: 10;
}

.sp-sidebar-card {
  background: #ffffff;
  border: 1px solid #e1e6f0;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 3px 14px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sp-sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 6px 8px;
  border-bottom: 1px solid #edf0f5;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.sp-sidebar-header svg {
  color: #2563eb;
  stroke: #2563eb;
}

.sp-nav-groups {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

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

.sp-nav-group-title {
  font-size: 10.5px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 6px 2px;
}

.sp-nav-group-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sp-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  text-align: right;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  position: relative;
}

.sp-nav-item:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
  transform: translateX(-2px);
}

.sp-nav-item.active {
  background: linear-gradient(135deg, #eff6ff 0%, #f0f7ff 100%);
  border-color: #bfdbfe;
  color: #1d4ed8;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.08);
}

.sp-nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
  color: #475569;
}

.sp-nav-icon svg {
  stroke: currentColor;
  width: 15px;
  height: 15px;
}

.sp-nav-item:hover .sp-nav-icon {
  background: #e2e8f0;
  color: #0f172a;
}

.sp-nav-item.active .sp-nav-icon {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.sp-nav-item.active .sp-nav-icon svg {
  stroke: #ffffff;
}

.sp-nav-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.sp-nav-label {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-nav-desc {
  font-size: 10.5px;
  color: #64748b;
  margin-top: 1px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-nav-item.active .sp-nav-desc {
  color: #3b82f6;
}

.sp-nav-arrow {
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.sp-nav-item:hover .sp-nav-arrow {
  color: #64748b;
  transform: translateX(-2px);
}

.sp-nav-item.active .sp-nav-arrow {
  color: #2563eb;
}

.sp-sidebar-footer {
  padding-top: 8px;
  margin-top: 2px;
  border-top: 1px solid #edf0f5;
}

.sp-sidebar-user-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #eef2f6;
}

.sp-mini-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
  flex-shrink: 0;
}

.sp-mini-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sp-mini-name {
  font-size: 11.5px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-mini-sub {
  font-size: 10.5px;
  color: #64748b;
}

.sp-main-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Panels */
.sp-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: spFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.sp-card {
  background: #ffffff;
  border: 1px solid #e1e6f0;
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
}

.sp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf0f5;
}

.sp-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Grids */
.sp-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.sp-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.sp-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.sp-info-item {
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sp-info-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
}

.sp-info-val {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
}

/* Attendance Month Bar & Calendar */
.sp-att-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.sp-month-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sp-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

.sp-cal-header-day {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  padding: 6px 0;
}

.sp-cal-cell {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.15s ease;
}

.sp-cal-cell.is-present {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.sp-cal-cell.is-leave {
  background: #faf5ff;
  border-color: #e9d5ff;
}

.sp-cal-cell.is-weekend {
  background: #f8fafc;
  opacity: 0.7;
}

.sp-cal-num {
  font-size: 13px;
  font-weight: 800;
  color: #1e293b;
}

.sp-cal-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  text-align: center;
  display: block;
}

.sp-cal-cell.is-present .sp-cal-tag {
  background: #dcfce7;
  color: #15803d;
}

.sp-cal-cell.is-leave .sp-cal-tag {
  background: #f3e8ff;
  color: #7c3aed;
}

/* Tables */
.sp-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

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

.sp-table th {
  background: #f8fafc;
  padding: 12px 14px;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.sp-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf0f5;
  color: #1e293b;
  vertical-align: middle;
}

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

.sp-table tr:hover td {
  background: #fbfcfe;
}

/* Badges */
.sp-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.sp-badge.green { background: #f0fdf4; color: #15803d; }
.sp-badge.red { background: #fef2f2; color: #dc2626; }
.sp-badge.amber { background: #fffbeb; color: #d97706; }
.sp-badge.blue { background: #eff6ff; color: #2563eb; }
.sp-badge.purple { background: #faf5ff; color: #7c3aed; }
.sp-badge.gray { background: #f1f5f9; color: #475569; }

/* Empty state */
.sp-empty {
  text-align: center;
  padding: 36px 20px;
  color: #94a3b8;
  font-size: 13.5px;
  font-weight: 600;
}

.sp-empty svg {
  margin-bottom: 8px;
  color: #cbd5e1;
}

/* Responsive */
@media (max-width: 1200px) {
  .sp-kpis-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .sp-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .self-profile-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .sp-sidebar-nav {
    position: static;
  }
  .sp-nav-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (max-width: 860px) {
  .self-profile-page {
    padding: 16px;
  }
  .sp-kpis-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sp-grid-2,
  .sp-grid-3 {
    grid-template-columns: 1fr;
  }
  .sp-calendar-grid {
    gap: 4px;
  }
  .sp-cal-cell {
    min-height: 48px;
    padding: 4px;
  }
}

@media (max-width: 580px) {
  .sp-kpis-grid {
    grid-template-columns: 1fr;
  }
  .sp-hero-identity {
    flex-direction: column;
    align-items: flex-start;
  }
  .sp-nav-groups {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .sp-nav-desc {
    display: none;
  }
}
/* ============================================================================
 * بانر ونافذة اقتراح تثبيت تطبيق النظام PWA Install Prompt Banner
 * ============================================================================ */
.pwa-install-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100000;
  max-width: 480px;
  width: calc(100% - 48px);
  animation: pwaSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}

@keyframes pwaSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pwa-install-card {
  position: relative;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(81, 219, 244, 0.28);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.65), 0 0 35px rgba(81, 219, 244, 0.12);
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #f8fafc;
}

.pwa-close-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pwa-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.pwa-install-content {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.pwa-app-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #0f172a;
  border: 1.5px solid rgba(81, 219, 244, 0.4);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(81, 219, 244, 0.25);
}

.pwa-app-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.pwa-text-wrap {
  flex: 1;
  min-width: 0;
}

.pwa-title-row {
  margin-bottom: 6px;
}

.pwa-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 4px;
}

.pwa-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.35;
}

.pwa-desc {
  margin: 0 0 10px 0;
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.5;
}

.pwa-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pwa-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
}

.pwa-pill svg {
  color: #38bdf8;
}

.pwa-ios-guide {
  margin-top: 10px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px dashed rgba(56, 189, 248, 0.3);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 11.5px;
  color: #e0f2fe;
  line-height: 1.5;
}

.pwa-actions-row {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pwa-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pwa-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

.pwa-btn-primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border: none;
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  transition: all 0.2s ease;
}

.pwa-btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.55);
}

@media (max-width: 640px) {
  .pwa-install-banner {
    bottom: 12px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
  }
  .pwa-install-card {
    padding: 16px;
    gap: 12px;
  }
  .pwa-app-icon-wrap {
    width: 48px;
    height: 48px;
  }
}
