:root {
    --sigma-min-app-width: 1200px;
    --sidebar-width: 340px;
    --bg-body: #f5f7fa;
    --sidebar-bg-start: #2c3e50;
    --sidebar-bg-end: #34495e;
    --sidebar-text: #ffffff;
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    --sidebar-active: rgba(255, 255, 255, 0.15);
    --card-bg: #ffffff;
    --header-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --text-light: #95a5a6;
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-hover: rgba(0, 0, 0, 0.12);
    --input-bg: #f8f9fa;
    --accent-color: #3498db;
    --accent-hover: #2ecc71;
}

html.dark-mode,
body.dark-mode {
    --bg-body: #0f1419;
    --sidebar-bg-start: #1a1d29;
    --sidebar-bg-end: #15171f;
    --sidebar-text: #e8e8e8;
    --sidebar-hover: rgba(255, 255, 255, 0.05);
    --sidebar-active: rgba(255, 255, 255, 0.1);
    --card-bg: #1a1f2e;
    --header-bg: #1a1f2e;
    --text-primary: #e8e8e8;
    --text-secondary: #a8b2c0;
    --text-light: #6b7280;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.5);
    --input-bg: #252a38;
    --accent-color: #3b82f6;
    --accent-hover: #10b981;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-body);
  direction: rtl;
  overflow-x: hidden;
  transition: background 0.3s ease;
}

/* Sidebar */
.sidebar {
  position: fixed;
  right: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, var(--sidebar-bg-start) 0%, var(--sidebar-bg-end) 100%);
  color: var(--sidebar-text);
  overflow-y: auto;
  z-index: 1000;
  transition: transform 0.3s ease, background 0.3s ease;
  box-shadow: -2px 0 10px var(--shadow);
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.sidebar.hidden {
  transform: translateX(var(--sidebar-width));
}

.brand {
  display: block;
  width: 100%;
  font-size: 22px;
  font-weight: bold;
  padding: 18px 16px;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  border: none;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease;
}

.brand:hover {
  background: rgba(255, 255, 255, 0.12);
}

.brand:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: -2px;
}

.menu {
  padding: 15px 0;
}

.menu-section {
  margin-bottom: 10px;
}

.section-toggle {
  width: 100%;
  padding: 9px 16px;
  background: var(--sidebar-hover);
  border: none;
  color: var(--sidebar-text);
  text-align: right;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s;
  position: relative;
  border-right: 3px solid transparent;
}

.section-toggle::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: 20px;
  transition: transform 0.3s;
}

.section-toggle.active::after {
  transform: rotate(180deg);
}

.section-toggle:hover {
  background: var(--sidebar-active);
  border-right-color: var(--accent-color);
}

.section-toggle.active {
  background: var(--sidebar-active);
  border-right-color: var(--accent-color);
}

.section-list {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  background: rgba(0, 0, 0, 0.1);
}

.section-list.active {
  max-height: 2000px;
}

.section-list li {
  margin: 0;
}

.section-list a {
  display: flex;
  align-items: center;
  padding: 7px 16px 7px 36px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 10px;
  line-height: 1.35;
  transition: all 0.3s;
  border-right: 3px solid transparent;
}

.section-list a:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text);
  border-right-color: var(--accent-hover);
  padding-right: 45px;
}

.section-list .icon {
  margin-left: 8px;
  font-size: 10px;
  opacity: 0.8;
}

/* Nested sections */
.section-list .section-toggle {
  padding-right: 36px;
  font-size: 11px;
  font-weight: 500;
}

.section-list .section-list .section-toggle {
  padding-right: 52px;
  font-size: 10px;
}

.section-list .section-list a {
  padding-right: 60px;
}

.section-list .section-list .section-list a {
  padding-right: 72px;
  font-size: 10px;
}

/* أيقونات Font Awesome داخل الروابط: لا ترث Segoe من الرابط */
.section-list a .icon,
.section-list a [class^='fa-'],
.section-list a [class*=' fa-'] {
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 10px;
}

/* Main Content */
.main-content {
  margin-right: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-right 0.3s ease;
}

.main-content.expanded {
  margin-right: 0;
}

/* Header */
.header {
  background: var(--header-bg);
  padding: 15px 30px;
  box-shadow: 0 2px 10px var(--border-color);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.menu-toggle {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-primary);
  transition: color 0.3s;
}

.menu-toggle:hover {
  color: var(--accent-color);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-right: auto;
}

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

/* Session labels (company/sector) */
.session-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
}

.session-info .label {
  color: var(--text-secondary);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.session-info .label i {
  color: var(--accent-color);
}

.session-info .value {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
}

.session-info .separator {
  color: var(--text-light);
  margin: 0 4px;
}

/* Session date label */
.session-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.session-date .label {
  color: var(--text-secondary);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.session-date .label i {
  color: var(--accent-color);
}

.session-date .value {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
}

.user-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 15px;
  transition: color 0.3s ease;
}

.user-dropdown {
  position: relative;
}

.user-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  color: var(--text-primary);
  transition: color 0.3s;
}

.user-btn:hover {
  color: var(--accent-color);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 5px 20px var(--shadow);
  padding: 10px 0;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s;
  margin-top: 10px;
  border: 1px solid var(--border-color);
}

.user-dropdown.is-open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.3s;
}

.dropdown-menu a:hover {
  background: var(--input-bg);
}

.dropdown-menu i {
  width: 20px;
}

/* Dashboard */
.dashboard {
  padding: 30px;
}

.page-title {
  font-size: 32px;
  color: var(--text-primary);
  margin-bottom: 30px;
  transition: color 0.3s ease;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 25px;
  display: flex;
  gap: 20px;
  align-items: center;
  box-shadow: 0 5px 15px var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
  border: 1px solid var(--border-color);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px var(--shadow-hover);
}

.stat-icon {
  width: 70px;
  height: 70px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: white;
}

.stat-info h3 {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  transition: color 0.3s ease;
}

.stat-number {
  font-size: 28px;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 5px;
  transition: color 0.3s ease;
}

.stat-change {
  font-size: 12px;
  font-weight: 600;
}

.stat-change.positive {
  color: #27ae60;
}

.stat-change.negative {
  color: #e74c3c;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.chart-card {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 5px 15px var(--shadow);
  transition: background 0.3s ease;
  border: 1px solid var(--border-color);
}

.card-title {
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 20px;
  font-weight: 600;
  transition: color 0.3s ease;
}

.chart-placeholder {
  height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 10px;
  gap: 15px;
}

.chart-placeholder i {
  font-size: 60px;
  color: #95a5a6;
  opacity: 0.5;
}

.chart-placeholder p {
  color: var(--text-secondary);
  font-size: 14px;
  transition: color 0.3s ease;
}

/* Activity Section */
.activity-section {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 5px 15px var(--shadow);
  transition: background 0.3s ease;
  border: 1px solid var(--border-color);
}

.section-title {
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 20px;
  font-weight: 600;
  transition: color 0.3s ease;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.activity-item {
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 15px;
  background: var(--input-bg);
  border-radius: 10px;
  transition: background 0.3s;
}

.activity-item:hover {
  background: var(--border-color);
}

.activity-icon {
  width: 45px;
  height: 45px;
  border-radius: 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
}

.activity-content {
  flex: 1;
}

.activity-title {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 5px;
  transition: color 0.3s ease;
}

.activity-time {
  font-size: 13px;
  color: var(--text-light);
  transition: color 0.3s ease;
}

/* أدوات المظهر في الهيدر */
.header-theme-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 10px;
  margin-right: 0;
}

.theme-toggle,
.theme-picker-open-btn {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px var(--shadow);
  transition: all 0.3s ease;
  padding: 0;
  font-family: inherit;
}

.theme-toggle:hover,
.theme-picker-open-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 5px 15px var(--shadow-hover);
}

.theme-picker-open-btn.is-active,
.theme-picker-open-btn[aria-expanded="true"] {
  border-color: #667eea;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.15) 100%);
  color: #667eea;
}

.theme-toggle i,
.theme-picker-open-btn i {
  transition: transform 0.3s ease;
}

.theme-toggle:hover i,
.theme-picker-open-btn:hover i {
  transform: rotate(12deg);
}

/* شاشة اختيار الثيم — القديمة (theme-screen-card) فقط؛ الـ HUD في sigma-theme-picker.css */
.theme-screen-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: min(88vh, 640px);
  overflow-y: auto;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 20px 50px var(--shadow-hover);
  animation: themeScreenIn 0.25s ease;
}

@keyframes themeScreenIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.theme-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.theme-picker-head-text {
  flex: 1;
  min-width: 0;
}

.theme-picker-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.theme-picker-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
}

.theme-picker-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-picker-close:hover {
  background: rgba(102, 126, 234, 0.12);
  color: var(--text-primary);
}

.theme-picker-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding-inline-end: 4px;
}

.theme-picker-group-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin: 6px 2px 2px;
  padding-top: 4px;
  border-top: 1px solid var(--border-color);
}

.theme-picker-group-title:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.theme-picker-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: right;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.theme-picker-option:hover {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.08);
}

.theme-picker-option.is-active {
  border-color: #667eea;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.18) 0%, rgba(118, 75, 162, 0.12) 100%);
  box-shadow: 0 0 0 1px rgba(102, 126, 234, 0.25);
}

.theme-picker-option-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.theme-picker-option[data-theme="light"] .theme-picker-option-icon {
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
  color: #5c3d00;
}

.theme-picker-option[data-theme="dark"] .theme-picker-option-icon {
  background: linear-gradient(135deg, #434343 0%, #1a1a2e 100%);
  color: #e2e8f0;
}

.theme-picker-option[data-theme="jarvis"] .theme-picker-option-icon {
  background: linear-gradient(135deg, #00e5ff 0%, #004466 100%);
  color: #e8fcff;
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.45);
}

.theme-picker-option[data-theme="ocean"] .theme-picker-option-icon {
  background: linear-gradient(135deg, #38bdf8 0%, #0c4a6e 100%);
  color: #e0f2fe;
}

.theme-picker-option[data-theme="emerald"] .theme-picker-option-icon {
  background: linear-gradient(135deg, #34d399 0%, #065f46 100%);
  color: #ecfdf5;
}

.theme-picker-option[data-theme="amber"] .theme-picker-option-icon {
  background: linear-gradient(135deg, #fbbf24 0%, #b45309 100%);
  color: #fffbeb;
}

.theme-picker-option[data-theme="opera-gx"] .theme-picker-option-icon {
  background: linear-gradient(135deg, #ff2948 0%, #8b0f2a 100%);
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 41, 72, 0.5);
}

.theme-picker-option-preview {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.theme-preview-light {
  background: linear-gradient(145deg, #ffffff 40%, #e8ecf1 100%);
}

.theme-preview-dark {
  background: linear-gradient(145deg, #1a1f2e 30%, #0f1419 100%);
}

.theme-preview-jarvis {
  background:
    linear-gradient(rgba(0, 212, 255, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.15) 1px, transparent 1px),
    linear-gradient(160deg, #061018 0%, #00d4ff 120%);
  background-size: 8px 8px, 8px 8px, 100% 100%;
  border-color: rgba(0, 212, 255, 0.5);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.35);
}

.theme-preview-ocean {
  background: linear-gradient(160deg, #0c1929 0%, #38bdf8 100%);
  border-color: rgba(56, 189, 248, 0.45);
}

.theme-preview-emerald {
  background: linear-gradient(160deg, #0a1410 0%, #10b981 100%);
  border-color: rgba(52, 211, 153, 0.45);
}

.theme-preview-amber {
  background: linear-gradient(160deg, #1a1208 0%, #f59e0b 100%);
  border-color: rgba(251, 191, 36, 0.45);
}

.theme-preview-opera-gx {
  background:
    linear-gradient(135deg, rgba(255, 41, 72, 0.35) 0%, transparent 45%),
    linear-gradient(160deg, #100e14 0%, #ff2948 140%);
  border-color: rgba(255, 41, 72, 0.55);
  box-shadow: 0 0 10px rgba(255, 27, 45, 0.4);
}

.theme-preview-opera-gx-neon {
  background:
    linear-gradient(135deg, rgba(255, 77, 106, 0.5) 0%, transparent 50%),
    linear-gradient(160deg, #0a0610 0%, #ff1b2d 120%);
  border-color: rgba(255, 41, 72, 0.7);
  box-shadow: 0 0 16px rgba(255, 27, 45, 0.55);
}

.theme-preview-opera-gx-void {
  background: linear-gradient(160deg, #050508 0%, #1a0a10 100%);
  border-color: rgba(196, 31, 58, 0.35);
}

.theme-preview-opera-gx-purple {
  background:
    linear-gradient(135deg, rgba(180, 80, 255, 0.4) 0%, rgba(255, 41, 72, 0.25) 60%),
    linear-gradient(160deg, #0c0814 0%, #b450ff 130%);
  border-color: rgba(180, 80, 255, 0.5);
  box-shadow: 0 0 10px rgba(180, 80, 255, 0.3);
}

.theme-picker-option > i.fa-solid {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.theme-picker-option[data-theme-id="light"] > i.fa-solid {
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
  color: #5c3d00;
}

.theme-picker-option[data-theme-id="dark"] > i.fa-solid {
  background: linear-gradient(135deg, #434343 0%, #1a1a2e 100%);
}

.theme-picker-option[data-theme-id="jarvis"] > i.fa-solid {
  background: linear-gradient(135deg, #00e5ff 0%, #004466 100%);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
}

.theme-picker-option[data-theme-id="opera-gx"] > i.fa-solid,
.theme-picker-option[data-theme-id="opera-gx-neon"] > i.fa-solid {
  background: linear-gradient(135deg, #ff2948 0%, #8b0f2a 100%);
  box-shadow: 0 0 10px rgba(255, 41, 72, 0.45);
}

.theme-picker-option[data-theme-id="opera-gx-void"] > i.fa-solid {
  background: linear-gradient(135deg, #3a1520 0%, #0a0a0e 100%);
  color: #c41f3a;
}

.theme-picker-option[data-theme-id="opera-gx-purple"] > i.fa-solid {
  background: linear-gradient(135deg, #b450ff 0%, #ff2948 100%);
}

.theme-picker-option[data-theme-id="ocean"] > i.fa-solid {
  background: linear-gradient(135deg, #38bdf8 0%, #0c4a6e 100%);
}

.theme-picker-option[data-theme-id="emerald"] > i.fa-solid {
  background: linear-gradient(135deg, #34d399 0%, #065f46 100%);
}

.theme-picker-option[data-theme-id="amber"] > i.fa-solid {
  background: linear-gradient(135deg, #fbbf24 0%, #b45309 100%);
}

.theme-picker-option-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.theme-picker-option-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.theme-picker-option-desc {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.3;
}

body.sigma-theme-jarvis .theme-picker-option.is-active {
  border-color: #00d4ff;
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.25);
}

/* Module Content Styles */
#moduleContent {
  animation: fadeIn 0.3s ease-in;
}

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

.back-btn {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.back-btn i {
  font-size: 16px;
}

/* Modal Form Styles */
#moduleContent {
  width: 100%;
  display: block;
}

.modal-form {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 5px 20px var(--shadow);
  border: 1px solid var(--border-color);
  width: 100%;
  overflow-x: auto;
}

.modal-form h2 {
  color: var(--text-primary);
  font-size: 24px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border-color);
}

.title-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: var(--input-bg);
  border-radius: 10px;
  margin-bottom: 25px;
}

.title-info p {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
}

.title-info i {
  color: var(--accent-color);
  font-size: 20px;
}

.db-status {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #27ae60;
  margin-right: 8px;
}

.panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
  padding: 20px;
  background: var(--input-bg);
  border-radius: 10px;
}

/* Panel مع عناصر في سطر واحد */
.panel-inline-items {
  display: flex !important;
  gap: 10px;
  flex-wrap: nowrap;
  align-items: flex-end;
  grid-template-columns: unset !important;
  overflow-x: auto;
}

/* نسخة خاصة: 4 عناصر في كل سطر */
.panel-inline-items.panel-4 {
  flex-wrap: wrap;
  overflow-x: visible;
}
.panel-inline-items.panel-4 .form-group-compact {
  flex: 0 0 calc(25% - 10px);
}

/* تم التراجع عن نسخة 6 عناصر في كل سطر */

/* تنسيق مضغوط للـ form-group */
.form-group-compact {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0;
}

.form-group-compact label {
  font-size: 11px;
  margin-bottom: 0;
  display: block;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form-group-compact input,
.form-group-compact select,
.form-group-compact input[list] {
  width: 100%;
  padding: 8px 6px !important;
  font-size: 12px;
  height: 36px;
}

.form-group-compact .btn {
  width: 100%;
  padding: 8px 6px !important;
  font-size: 11px;
  height: 36px;
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

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

.form-group label {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  transition: color 0.3s ease;
}

/* تأكيد لون النصوص في الوضع الداكن */
body.dark-mode .form-group label {
  color: #ffffff;
}

body.dark-mode .modal-form h2,
body.dark-mode .title-info p,
body.dark-mode .panel-title {
  color: #ffffff;
}

body.dark-mode .form-group input[type="text"],
body.dark-mode .form-group input[type="number"],
body.dark-mode .form-group input[type="date"],
body.dark-mode .form-group input[type="time"],
body.dark-mode .form-group input[type="datetime-local"],
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
  color: #ffffff;
  background: var(--input-bg);
  border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .form-group input::placeholder,
body.dark-mode .form-group textarea::placeholder {
  color: #a8b2c0;
}

body.dark-mode .form-group select option {
  background: #1a1f2e;
  color: #ffffff;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  background: var(--card-bg);
  color: var(--text-primary);
  transition: all 0.3s ease;
  outline: none;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.band-search-group {
  position: relative;
}

.band-search-input {
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  background: var(--card-bg);
  color: var(--text-primary);
  transition: all 0.3s ease;
  outline: none;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  width: 100%;
}

.band-search-input::placeholder {
  color: var(--text-secondary);
}

.band-search-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 2px 8px var(--shadow);
  transform: none;
}

.band-search-group::after {
  display: none;
}

body.dark-mode .band-search-input {
  background: var(--input-bg);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: none;
  color: #ffffff;
}

body.dark-mode .band-search-group::after {
  color: var(--accent-color);
}

/* Ensure select options display full text */
.form-group select option,
.form-group-compact select option {
  padding: 8px;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* تنسيق خاص لحقول التاريخ */
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="datetime-local"] {
  cursor: pointer;
  position: relative;
}

/* تلوين أيقونة التقويم في الوضع الداكن */
.form-group input[type="date"]::-webkit-calendar-picker-indicator,
.form-group input[type="time"]::-webkit-calendar-picker-indicator,
.form-group input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  border-radius: 4px;
  padding: 5px;
  transition: all 0.3s ease;
}

body.dark-mode .form-group input[type="date"]::-webkit-calendar-picker-indicator,
body.dark-mode .form-group input[type="time"]::-webkit-calendar-picker-indicator,
body.dark-mode .form-group input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin-left: 8px;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-start;
  margin-top: 30px;
  padding: 20px;
  background: var(--input-bg);
  border-radius: 10px;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(240, 147, 251, 0.3);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(240, 147, 251, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(67, 233, 123, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(67, 233, 123, 0.4);
}

/* ==================== نظام التابات ====================*/
.tabs-container {
  margin-bottom: 30px;
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 10px var(--shadow);
}

.tabs-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: var(--input-bg);
  padding: 5px;
  border-bottom: 2px solid var(--border-color);
  overflow-x: auto;
}

.tab-btn {
  flex: 1;
  min-width: 150px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.tab-btn:hover {
  background: rgba(102, 126, 234, 0.05);
  color: var(--accent-color);
}

.tab-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom: 3px solid #667eea;
}

.tab-content {
  display: none;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

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

/* الوضع الداكن */
body.dark-mode .tabs-header {
  background: var(--input-bg);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .tab-btn {
  color: #ffffff;
}

body.dark-mode .tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #667eea;
}

body.dark-mode .tab-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(var(--sidebar-width));
  }

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

  .main-content {
    margin-right: 0;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .dashboard {
    padding: 20px;
  }

  .page-title {
    font-size: 24px;
  }
}

/* حاوية الجدول مع scrollbar */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 20px 0;
  border-radius: 10px;
  box-shadow: 0 2px 10px var(--shadow);
}

/* تنسيق scrollbar */
.table-wrapper::-webkit-scrollbar {
  height: 10px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: var(--input-bg);
  border-radius: 10px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* للمتصفحات التي تدعم scrollbar-color */
.table-wrapper {
  scrollbar-width: thin;
  scrollbar-color: #667eea var(--input-bg);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: none;
  margin: 0;
  font-size: 12px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

table thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

table thead tr th {
  color: white;
  padding: 15px 10px;
  text-align: center;
  font-weight: 600;
  font-size: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

table thead tr th:first-child {
  border-right: none;
}

table tbody tr {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

table tbody tr:hover {
  background: var(--input-bg);
  transform: scale(1.01);
  box-shadow: 0 2px 8px var(--shadow);
}

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

table tbody tr td {
  padding: 12px 10px;
  text-align: center;
  color: var(--text-primary);
  border-left: 1px solid var(--border-color);
  transition: color 0.3s ease;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 12px;
}

table tbody tr td:first-child {
  border-right: none;
}

/* تنسيق الأزرار داخل الجدول */
table tbody tr td button,
table tbody tr td .btn {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 12px;
  padding: 6px 12px;
  font-weight: 600;
}

/* تنسيق خاص للخلايا القابلة للنقر */
table .cursor-pointer {
  cursor: pointer;
  user-select: none;
}

table .cursor-pointer:hover {
  background: rgba(102, 126, 234, 0.1);
}

/* عرض الأعمدة */
table .w-30 {
  width: 50px;
  min-width: 50px;
}

table .w-50 {
  width: 80px;
  min-width: 80px;
}

table .w-100 {
  width: 120px;
  min-width: 120px;
}

table .w-200 {
  width: 250px;
  min-width: 250px;
}

table .w-400 {
  width: 500px;
  min-width: 500px;
}

table .w-500 {
  width: 400px;
  min-width: 400px;
}

/* الوضع الداكن للجداول */
body.dark-mode table tbody tr {
  background: var(--card-bg);
}

body.dark-mode table tbody tr:hover {
  background: var(--input-bg);
}

body.dark-mode table tbody tr td {
  color: #ffffff;
  border-left-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode table thead tr th {
  color: #ffffff;
}

/* تنسيق أزرار الحذف في الجدول */
table button {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

table button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

/* تنسيق responsive للجداول */
@media (max-width: 1200px) {
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* ==================== نهاية تنسيقات الجداول ==================== */

.activity-time {
  font-size: 13px;
  color: var(--text-light);
  transition: color 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(var(--sidebar-width));
  }

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

  .main-content {
    margin-right: 0;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .dashboard {
    padding: 20px;
  }

  .page-title {
    font-size: 24px;
  }
}

/* ==================== نظام التابات (Details) ==================== */
.tabs-wrapper {
  margin-bottom: 30px;
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 10px var(--shadow);
}

.tab-buttons {
  display: flex;
  gap: 0;
  background: var(--input-bg);
  border-bottom: 2px solid var(--border-color);
  overflow-x: auto;
}

.tab-button {
  flex: 1;
  min-width: 140px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.tab-button:hover {
  background: rgba(102, 126, 234, 0.05);
  color: var(--accent-color);
}

.tab-button.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom: 3px solid #667eea;
}

.tab-panel {
  display: none;
  padding: 20px;
  animation: slideIn 0.3s ease;
}

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

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

/* الوضع الداكن */
body.dark-mode .tabs-wrapper {
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .tab-buttons {
  background: var(--input-bg);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .tab-button {
  color: #ffffff;
}

body.dark-mode .tab-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .tab-button.active {
  color: #ffffff;
}

/* ==================== نهاية نظام التابات ==================== */

/* موديول ملء الشاشة (مثل تعديل المحطة من القائمة) */
.sigma-fullscreen-module-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
  padding: 0;
  font-family: inherit;
}

.sigma-fullscreen-module-shell {
  width: 100%;
  max-width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--card-bg, #fff);
  box-shadow: 0 -4px 24px var(--shadow, rgba(0, 0, 0, 0.15));
  min-height: 0;
}

body.dark-mode .sigma-fullscreen-module-shell {
  background: var(--card-bg, #1a1f2e);
}

.sigma-fullscreen-module-header {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 8px 56px;
  border-bottom: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
  background: var(--header-bg, var(--card-bg, #fff));
}

.sigma-fullscreen-module-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary, #2c3e50);
  text-align: center;
}

.sigma-fullscreen-module-header-actions {
  position: absolute;
  inset-inline-start: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
}

.sigma-fullscreen-module-minimize,
.sigma-fullscreen-module-close {
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary, #2c3e50);
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.sigma-fullscreen-module-close {
  font-size: 2rem;
}

.sigma-fullscreen-module-minimize {
  font-size: 1rem;
}

.sigma-fullscreen-module-minimize:hover,
.sigma-fullscreen-module-close:hover {
  background: var(--input-bg, #f0f0f0);
  color: var(--accent-color, #3498db);
}

body.dark-mode .sigma-fullscreen-module-minimize:hover,
body.dark-mode .sigma-fullscreen-module-close:hover {
  background: var(--input-bg, #252a38);
}

.sigma-fullscreen-module-overlay--minimized {
  align-items: flex-end;
  justify-content: center;
  padding: 0 12px 14px;
  pointer-events: none;
}

.sigma-fullscreen-module-overlay--minimized .sigma-tech-backdrop,
.sigma-fullscreen-module-overlay--minimized .sigma-jarvis-wall,
.sigma-fullscreen-module-overlay--minimized .sigma-tech-scan-grid {
  display: none;
}

.sigma-fullscreen-module-overlay--minimized .sigma-fullscreen-module-shell {
  flex: 0 0 auto;
  width: min(460px, calc(100vw - 24px));
  max-height: none;
  pointer-events: auto;
  transform: none !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.sigma-fullscreen-module-overlay--minimized .sigma-fullscreen-module-body {
  display: none;
}

.sigma-fullscreen-module-overlay--minimized .sigma-fullscreen-module-header {
  min-height: 48px;
  border-bottom: none;
  cursor: pointer;
}

.sigma-fullscreen-module-overlay--minimized .sigma-fullscreen-module-title {
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 120px);
}

.sigma-fullscreen-module-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.sigma-module-host--fullscreen-overlay {
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  box-sizing: border-box;
}

/* جداول DefulteForm داخل موديول ملء الشاشة — تخطيط القائمتين */
.sigma-fullscreen-module-overlay .contener {
  display: flex;
  gap: 10px;
  width: 100%;
  align-items: flex-start;
  flex-wrap: wrap;
}

.sigma-fullscreen-module-overlay .contener_right,
.sigma-fullscreen-module-overlay .contener_left {
  flex: 1 1 320px;
  min-width: 0;
}

.sigma-fullscreen-module-overlay .view-all-table-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  max-height: min(52vh, 520px);
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
}

.sigma-fullscreen-module-overlay .view-all-table tbody tr:nth-child(even) {
  background-color: #f7fafc;
}

.sigma-fullscreen-module-overlay .view-all-table tbody tr:hover {
  background-color: #edf2f7;
}

/* شاشة الخريطة (استخراج المواقع) — ارتفاع محدد داخل الطبقة */
.sigma-fullscreen-module-body:has(.sigma-map-layout),
.sigma-fullscreen-module-body:has(.sigma-map-screen),
.sigma-fullscreen-module-body:has(.sigma-live-loc-layout) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sigma-fullscreen-module-body:has(.sigma-map-layout) .sigma-module-host--fullscreen-overlay,
.sigma-fullscreen-module-body:has(.sigma-map-screen) .sigma-module-host--fullscreen-overlay,
.sigma-fullscreen-module-body:has(.sigma-live-loc-layout) .sigma-module-host--fullscreen-overlay {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.sigma-fullscreen-module-body:has(.sigma-live-loc-layout) .sigma-live-loc-layout {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

/* مواقع الجوالات — ملء ارتفاع الشاشة (فتح عادي داخل المحتوى، ليس overlay) */
.main-content.sigma-live-loc-page-active {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}

.main-content.sigma-live-loc-page-active .dashboard {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.main-content.sigma-live-loc-page-active .page-title {
  display: none;
}

#moduleContent.sigma-live-loc-active {
  flex: 1 1 auto;
  display: flex !important;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

#moduleContent.sigma-live-loc-active .sigma-module-host {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
}

#moduleContent.sigma-live-loc-active .sigma-live-loc-layout {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

/* استعلام موقع محطة — فتح عادي داخل المحتوى مع بقاء القائمة الجانبية */
.main-content.sigma-map-inline-page-active {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}

.main-content.sigma-map-inline-page-active .dashboard {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.main-content.sigma-map-inline-page-active .page-title {
  display: none;
}

#moduleContent.sigma-map-inline-active {
  flex: 1 1 auto;
  display: flex !important;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

#moduleContent.sigma-map-inline-active .sigma-module-host {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
}

#moduleContent.sigma-map-inline-active .sigma-map-layout {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

/* شاشة الخريطة داخل #moduleContent (Frm_Map — ملء الشاشة، يخفي القائمة) */
#moduleContent.sigma-map-active {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: flex !important;
  flex-direction: column;
  background: var(--card-bg, #fff);
  overflow: hidden;
  margin: 0;
  padding: 0;
  animation: none;
}

#moduleContent.sigma-map-active .sigma-module-host {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

#moduleContent.sigma-map-active .sigma-map-layout {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

/*
 * تقليل المسافات الرأسية (أعلى/أسفل فقط) بنسبة 1/3 = الاحتفاظ بثلثي القيمة الأصلية.
 * ينطبق على شاشة التعديل عند الفتح بملء الشاشة من قائمة القطاع.
 */
.sigma-module-host--fullscreen-overlay .form-container {
  padding-block: calc(10px * 2 / 3);
  padding-inline: 10px;
  margin-bottom: calc(5px * 2 / 3);
}

.sigma-module-host--fullscreen-overlay .form-header {
  padding-block: calc(10px * 2 / 3);
  padding-inline: 10px;
  margin-bottom: calc(5px * 2 / 3);
}

.sigma-module-host--fullscreen-overlay .fields-section {
  row-gap: calc(8px * 2 / 3);
  column-gap: 0;
  padding-block: calc(10px * 2 / 3);
  padding-inline: 10px;
}

.sigma-module-host--fullscreen-overlay .fields-section > .form-row {
  margin-block: 0 !important;
}

.sigma-module-host--fullscreen-overlay .form-toolbar {
  margin-bottom: calc(10px * 2 / 3) !important;
  padding-block: calc(5px * 2 / 3);
  padding-inline: 5px;
}

.sigma-module-host--fullscreen-overlay .status-message,
.sigma-module-host--fullscreen-overlay .message {
  margin-bottom: calc(10px * 2 / 3) !important;
  padding-block: calc(8px * 2 / 3);
  padding-inline: 10px;
}

.sigma-module-host--fullscreen-overlay .section-title {
  margin-bottom: calc(10px * 2 / 3) !important;
  padding-block: calc(5px * 2 / 3);
  padding-inline: 5px;
}

.sigma-module-host--fullscreen-overlay .file-class-unhidden .form-row {
  margin-bottom: calc(5px * 2 / 3) !important;
}

.sigma-module-host--fullscreen-overlay .form-row input,
.sigma-module-host--fullscreen-overlay .form-row select,
.sigma-module-host--fullscreen-overlay .form-row textarea {
  padding-block: calc(5px * 2 / 3);
  padding-inline: 5px;
}

.sigma-module-host--fullscreen-overlay .auth-item {
  padding-block: calc(5px * 2 / 3);
  padding-inline: 8px;
}

.sigma-module-host--fullscreen-overlay .company-select-row {
  margin-bottom: calc(12px * 2 / 3) !important;
}

.sigma-module-host--fullscreen-overlay .image-placeholder {
  margin-bottom: calc(10px * 2 / 3) !important;
}

.sigma-module-host--fullscreen-overlay .attachments-board {
  row-gap: calc(18px * 2 / 3);
  column-gap: 18px;
}

.sigma-module-host--fullscreen-overlay .sections-row {
  column-gap: 18px;
  row-gap: calc(18px * 2 / 3);
}

.sigma-module-host--fullscreen-overlay .section-header.header-red {
  padding-block: calc(14px * 2 / 3);
  padding-inline: 16px;
}

.sigma-module-host--fullscreen-overlay .attachments-board .section-header.header-red {
  padding-block: calc(6px * 2 / 3);
  padding-inline: 10px;
}

.sigma-module-host--fullscreen-overlay .data-table-container-pad {
  padding-block: calc(14px * 2 / 3);
  padding-inline: 14px;
}

.sigma-module-host--fullscreen-overlay .image-upload-container {
  row-gap: calc(14px * 2 / 3);
  column-gap: 0;
}

.sigma-module-host--fullscreen-overlay .image-section {
  padding-block: calc(10px * 2 / 3);
  padding-inline: 10px;
}

/* منع استخدام التطبيق عند تصغير عرض نافذة الحاسوب (العرض فقط — وليس الارتفاع) */
.sigma-app-width-blocker {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 250000;
  background: rgba(0, 0, 0, 0.78);
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  direction: rtl;
  pointer-events: all;
  user-select: none;
}

.sigma-app-width-blocker[hidden] {
  display: none !important;
}

body.sigma-app-width-blocked .sigma-app-width-blocker {
  display: flex;
}

.sigma-app-width-blocker__panel {
  max-width: 460px;
  padding: 28px 32px;
  border-radius: 10px;
  background: rgba(18, 18, 18, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-align: center;
  color: #f9fafb;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.65;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.sigma-app-width-blocker__hint {
  margin: 14px 0 0;
  font-size: 0.92rem;
  font-weight: 400;
  color: #d1d5db;
}

.sigma-app-width-blocker__hint strong {
  font-weight: 700;
  color: #fff;
}

/* ورقة القياس — حجب الصفحة الأم أثناء النافذة المنبثقة (ShowDialog) */
body.sigma-measurement-sheet-modal-open,
body.sigma-measurement-sheet-embed-open {
  overflow: hidden !important;
}

.sigma-measurement-sheet-modal-block {
  position: fixed;
  inset: 0;
  z-index: 2147483645;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.55);
  cursor: default;
}

/* أنماط قديمة للتوافق — لم تُستخدم بعد التحويل لنافذة منبثقة */
#sigma_measurement_sheet_embed_wrap {
  display: none !important;
}
