/* ==========================================================================
   منصة المخططات | Plans Hub - التصميم المتطور الحديث
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Colors */
  --sidebar-bg: #0b2b39;
  --sidebar-hover: #133e52;
  --sidebar-active: #1a4f68;
  --sidebar-active-glow: #0284c7;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  
  --bg-page: #f4f6f9;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-subtle: #edf2f7;
  
  --text-main: #0f172a;
  --text-sub: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --brand-primary: #0b2b39;
  --brand-accent: #0284c7;
  --brand-accent-hover: #0369a1;
  --brand-green: #10b981;
  --brand-amber: #f59e0b;
  --brand-rose: #f43f5e;
  --brand-indigo: #6366f1;
  
  /* Status Badges */
  --status-approved-bg: #ecfdf5;
  --status-approved-text: #047857;
  --status-approved-border: #a7f3d0;
  
  --status-pending-bg: #fffbeb;
  --status-pending-text: #b45309;
  --status-pending-border: #fde68a;
  
  --status-study-bg: #f0f9ff;
  --status-study-text: #0369a1;
  --status-study-border: #bae6fd;
  
  --status-rejected-bg: #fef2f2;
  --status-rejected-text: #b91c1c;
  --status-rejected-border: #fecaca;
  
  /* Layout */
  --sidebar-width: 250px;
  --header-height: 72px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 2px 8px -2px rgba(15, 23, 42, 0.06), 0 1px 4px -1px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  
  --font-sans: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

/* App Shell Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   Sidebar (قائمة التنقل الجانبية البترولية)
   -------------------------------------------------------------------------- */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  transition: transform 0.3s ease;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.logo-symbol {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.2), rgba(16, 185, 129, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  color: #38bdf8;
  flex-shrink: 0;
}

.logo-text h1 {
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.logo-text p {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: right;
  position: relative;
}

.nav-link svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  color: #64748b;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.nav-link:hover {
  background-color: var(--sidebar-hover);
  color: #ffffff;
}

.nav-link:hover svg {
  color: #38bdf8;
}

.nav-link.active {
  background-color: var(--sidebar-active);
  color: var(--sidebar-text-active);
  font-weight: 700;
}

.nav-link.active svg {
  color: #38bdf8;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  right: 0;
  top: 10%;
  height: 80%;
  width: 4px;
  background-color: #38bdf8;
  border-radius: 4px 0 0 4px;
}

.nav-badge {
  margin-right: auto;
  background: rgba(2, 132, 199, 0.25);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* Sidebar Quick Add Card */
.sidebar-add-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  text-decoration: none;
}

.sidebar-add-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.sidebar-add-texts {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-add-title {
  font-size: 0.80rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  line-height: 1.2;
}

.sidebar-add-sub {
  font-size: 0.68rem;
  color: #64748b;
  margin: 0;
  line-height: 1.2;
}

.sidebar-add-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #d1fae5;
  color: #10b981;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.sidebar-add-card:hover .sidebar-add-icon {
  background: #10b981;
  color: #ffffff;
}

.sidebar-system-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.system-card-text {
  font-size: 0.75rem;
  color: #94a3b8;
}

.system-card-text strong {
  display: block;
  color: #ffffff;
  font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   Main Container & Header
   -------------------------------------------------------------------------- */
.app-main {
  flex: 1;
  margin-right: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-right 0.3s ease;
}

.app-header {
  height: var(--header-height);
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-breadcrumbs {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.crumb-path {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.crumb-path span.divider {
  color: var(--text-light);
  font-size: 0.7rem;
}

.crumb-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.header-user-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-icon-header {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.btn-icon-header:hover {
  background: var(--bg-page);
  color: var(--text-main);
  border-color: #cbd5e1;
}

.btn-icon-header .badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background-color: var(--brand-rose);
  border-radius: 50%;
  border: 2px solid #ffffff;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-profile-badge:hover {
  background: var(--bg-page);
  border-color: var(--border-color);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #0b2b39);
  color: #ffffff;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-info {
  line-height: 1.3;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.user-role {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  color: var(--text-main);
}

/* --------------------------------------------------------------------------
   Main Content Views
   -------------------------------------------------------------------------- */
.app-content {
  padding: 24px 28px 40px;
  flex: 1;
}

.view-panel {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

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

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

/* --------------------------------------------------------------------------
   VIEW 1: لوحة التحكم (DASHBOARD)
   -------------------------------------------------------------------------- */

/* 4 Top KPI Cards */
.kpis-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 140px;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.kpi-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.kpi-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--card-accent, #0284c7);
}

.kpi-stat-card.c-blue::before { background: #0284c7; }
.kpi-stat-card.c-green::before { background: #10b981; }
.kpi-stat-card.c-amber::before { background: #f59e0b; }
.kpi-stat-card.c-rose::before { background: #f43f5e; }

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

.kpi-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
}

.kpi-icon-pill {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.c-blue .kpi-icon-pill { background: #e0f2fe; color: #0284c7; }
.c-green .kpi-icon-pill { background: #d1fae5; color: #10b981; }
.c-amber .kpi-icon-pill { background: #fef3c7; color: #f59e0b; }
.c-rose .kpi-icon-pill { background: #ffe4e6; color: #f43f5e; }

.kpi-body {
  margin: 12px 0 8px;
}

.kpi-number {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  display: inline-block;
}

.kpi-unit {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 6px;
}

.kpi-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  margin-top: 4px;
}

.kpi-link-btn {
  background: transparent;
  border: none;
  color: var(--brand-accent);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  font-family: inherit;
  transition: color 0.15s;
}

.kpi-link-btn:hover {
  color: var(--brand-accent-hover);
  text-decoration: underline;
}

.kpi-badge-trend {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}

/* Middle Section: Donut Chart + Line Chart + Interactive Map */
.dashboard-grid-3 {
  display: grid;
  grid-template-columns: 330px 1.15fr 1.15fr;
  gap: 18px;
  margin-bottom: 24px;
}

.card-white {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

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

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

.card-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.chart-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
}

.btn-chart-tab {
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: inherit;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-chart-tab:hover {
  color: #0f172a;
}

.btn-chart-tab.active {
  background: #ffffff;
  color: #0284c7;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Donut Chart Box */
.donut-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 10px auto;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: 4px 6px;
  border-radius: 6px;
  background: #f8fafc;
}

.legend-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-sub);
  font-weight: 600;
}

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

.legend-val {
  font-weight: 800;
  color: var(--text-main);
}

/* Recent Plans List */
.recent-plans-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recent-plan-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  cursor: pointer;
}

.recent-plan-item:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
  transform: translateX(-3px);
}

.recent-plan-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recent-plan-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.recent-plan-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.recent-plan-time {
  font-size: 0.72rem;
  color: var(--text-light);
  font-weight: 600;
  white-space: nowrap;
}

/* Dashboard Interactive Mini Map */
.dash-map-wrapper {
  position: relative;
  height: 250px;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #f8fafc;
}

#dashMapMini {
  height: 100%;
  width: 100%;
  z-index: 1;
}

.dash-map-badge-overlay {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(4px);
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
  z-index: 400;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.pulse-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4);
  animation: pulseGlow 2s infinite;
}

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

.dash-map-expand-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 400;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: all 0.2s ease;
}

.dash-map-expand-btn:hover {
  background: var(--brand-accent);
  color: #ffffff;
  border-color: var(--brand-accent);
  transform: scale(1.08);
}

/* Bottom 4 Quick Access Cards */
.quick-access-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.quick-action-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.quick-action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: #cbd5e1;
}

.quick-icon-pill {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.quick-action-card.qa-green .quick-icon-pill { background: #d1fae5; color: #10b981; }
.quick-action-card.qa-teal .quick-icon-pill { background: #ccfbf1; color: #0d9488; }
.quick-action-card.qa-amber .quick-icon-pill { background: #fef3c7; color: #f59e0b; }
.quick-action-card.qa-blue .quick-icon-pill { background: #e0f2fe; color: #0284c7; }

.quick-action-texts h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.quick-action-texts p {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   VIEW 2: البحث عن مخطط (SEARCH & PLANS CATALOG)
   -------------------------------------------------------------------------- */
.filter-box-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.filter-box-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-fields-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-field label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-sub);
}

.filter-input, .filter-select {
  height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.86rem;
  font-family: inherit;
  background-color: #f8fafc;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
}

.filter-input:focus, .filter-select:focus {
  background-color: #ffffff;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.filter-actions-bar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
}

.btn-primary-dark {
  background: var(--brand-primary);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 10px 24px;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-primary-dark:hover {
  background: #133e52;
}

.btn-ghost-reset {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ghost-reset:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

/* Filter Box Header & Toggle */
.filter-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.btn-ghost-toggle {
  background: #f8fafc;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-ghost-toggle:hover {
  background: #f1f5f9;
  color: var(--text-main);
  border-color: #cbd5e1;
}

/* Active Filter Banner */
.active-filter-banner {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  animation: fadeIn 0.2s ease-out;
}

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

.filter-banner-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #0284c7;
  color: #ffffff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.filter-banner-text {
  font-size: 0.88rem;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-banner-badge {
  background: #0284c7;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 3px 12px;
  border-radius: 999px;
}

.filter-banner-count {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.filter-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-filter-banner-toggle {
  background: #ffffff;
  color: #0284c7;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-filter-banner-toggle:hover {
  background: #f0f9ff;
  border-color: #0284c7;
}

.btn-filter-banner-clear {
  background: #ef4444;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-filter-banner-clear:hover {
  background: #dc2626;
}

/* Quick Table Search in results header */
.quick-table-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.quick-table-search-wrap svg {
  position: absolute;
  right: 10px;
  color: var(--text-muted);
  pointer-events: none;
}

.quick-table-search-wrap input {
  height: 36px;
  width: 210px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.8rem;
  background: #ffffff;
  outline: none;
  transition: all 0.15s ease;
}

.quick-table-search-wrap input:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
  width: 250px;
}

/* Results Table Card */
.results-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

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

.results-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.results-count-pill {
  background: #e0f2fe;
  color: #0284c7;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
}

.table-responsive,
.table-container {
  overflow-x: auto;
  width: 100%;
}

.plans-modern-table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.84rem;
}

#adminUsersTable th:nth-child(1) { min-width: 180px; }
#adminUsersTable th:nth-child(2) { min-width: 110px; }
#adminUsersTable th:nth-child(3) { min-width: 170px; }
#adminUsersTable th:nth-child(4) { min-width: 150px; }
#adminUsersTable th:nth-child(5) { min-width: 140px; }
#adminUsersTable th:nth-child(6) { min-width: 90px; text-align: center; }
#adminUsersTable th:nth-child(7) { min-width: 100px; text-align: center; }

.plans-modern-table th,
.data-table th {
  background: #f8fafc;
  padding: 12px 18px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.plans-modern-table td,
.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.plans-modern-table tbody tr,
.data-table tbody tr {
  transition: background-color 0.15s ease;
}

.plans-modern-table tbody tr:hover,
.data-table tbody tr:hover {
  background-color: #f8fafc;
}

.plan-id-link {
  font-weight: 800;
  color: var(--brand-accent);
  cursor: pointer;
}

.plan-id-link:hover {
  text-decoration: underline;
}

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-approved {
  background: var(--status-approved-bg);
  color: var(--status-approved-text);
  border: 1px solid var(--status-approved-border);
}

.badge-pending {
  background: var(--status-pending-bg);
  color: var(--status-pending-text);
  border: 1px solid var(--status-pending-border);
}

.badge-study {
  background: var(--status-study-bg);
  color: var(--status-study-text);
  border: 1px solid var(--status-study-border);
}

.badge-rejected {
  background: var(--status-rejected-bg);
  color: var(--status-rejected-text);
  border: 1px solid var(--status-rejected-border);
}

.badge-default {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

/* Action Icons inside table */
.action-icons-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-action-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action-icon:hover {
  background: #f1f5f9;
  color: var(--text-main);
  border-color: #cbd5e1;
}

.btn-action-icon.primary:hover {
  background: var(--brand-accent);
  color: #ffffff;
  border-color: var(--brand-accent);
}

/* Pagination Bar */
.pagination-modern-bar {
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-btn-item {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-sub);
  font-size: 0.82rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.page-btn-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.page-btn-item.active {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

.page-btn-item:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   VIEW 3: الخريطة التفاعلية (INTERACTIVE GIS MAP)
   -------------------------------------------------------------------------- */
.gis-map-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  height: calc(100vh - var(--header-height) - 70px);
  min-height: 600px;
}

.map-sidebar-filter {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.gis-search-wrap {
  position: relative;
}

.gis-search-input {
  width: 100%;
  height: 42px;
  padding: 8px 38px 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.86rem;
  font-family: inherit;
  outline: none;
  background: #f8fafc;
}

.gis-search-input:focus {
  background: #ffffff;
  border-color: var(--brand-accent);
}

.gis-search-icon {
  position: absolute;
  right: 12px;
  top: 12px;
  color: var(--text-muted);
}

.gis-legend-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  background: #f8fafc;
}

.gis-legend-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-sub);
  margin-bottom: 10px;
}

.gis-legend-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gis-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-sub);
}

.gis-color-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex-shrink: 0;
}

.gis-color-swatch.sw-green { background: #10b981; }
.gis-color-swatch.sw-amber { background: #f59e0b; }
.gis-color-swatch.sw-blue { background: #0284c7; }
.gis-color-swatch.sw-red { background: #ef4444; }

.gis-map-canvas-wrap {
  position: relative;
  background-color: #2b3a37;
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(210, 190, 150, 0.18) 0%, rgba(20, 30, 26, 0.88) 100%),
    linear-gradient(to right, rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  isolation: isolate !important;
  z-index: 1 !important;
  height: 100%;
  min-height: 600px;
}

.leaflet-tooltip.polygon-label {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px !important;
  font-weight: 800 !important;
  font-size: 0.72rem !important;
  color: #0b2b39 !important;
  padding: 1px 6px !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
  font-family: inherit !important;
}

#gisMapFull {
  width: 100%;
  height: 100%;
  min-height: 600px;
  z-index: 1 !important;
}

.map-floating-tools {
  position: absolute;
  bottom: 18px;
  left: 18px;
  z-index: 500;
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.btn-map-floating {
  width: 38px;
  height: 38px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: all 0.15s ease;
}

.btn-map-floating:hover {
  background: #f8fafc;
  color: var(--brand-accent);
  transform: translateY(-1px);
}

/* Top Left Lock Control (matches screenshot) */
.gis-top-left-tools {
  position: absolute;
  top: 90px;
  left: 12px;
  z-index: 500;
}

.gis-map-lock-btn {
  width: 38px;
  height: 38px;
  background: #1e40af;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: 1px solid #1e40af;
  border-radius: 10px;
  color: #ffffff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
  position: relative;
  transition: all 0.2s ease;
}

.gis-map-lock-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.45);
}

.gis-map-lock-btn.locked {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
  border-color: #334155;
  box-shadow: 0 3px 8px rgba(0,0,0,0.25);
}

.lock-status-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  border: 1.5px solid #ffffff;
}

/* Top Right Quick Search Pill (matches screenshot) */
.gis-top-right-tools {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 500;
}

.gis-pill-control-btn {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.86rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.gis-pill-control-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gis-search-popover {
  position: absolute;
  top: 46px;
  right: 0;
  width: 300px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  padding: 10px;
  z-index: 600;
}

.gis-search-popover-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.gis-search-popover-input-wrap input {
  width: 100%;
  height: 38px;
  padding: 6px 32px 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.84rem;
  font-family: inherit;
  outline: none;
  background: #f8fafc;
}

.gis-search-popover-input-wrap input:focus {
  background: #ffffff;
  border-color: #0284c7;
}

.btn-clear-qsearch {
  position: absolute;
  left: 8px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 4px;
}

.quick-search-results-list {
  max-height: 220px;
  overflow-y: auto;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quick-search-item {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  transition: background 0.15s ease;
}

.quick-search-item:hover {
  background: #f1f5f9;
}

.quick-search-item strong {
  color: #0f172a;
}

.quick-search-item span {
  color: #64748b;
  font-size: 0.75rem;
}

/* Bottom Right Map Keys Pill (matches screenshot) */
.gis-bottom-right-tools {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 500;
}

.gis-keys-btn {
  padding: 8px 18px;
  font-size: 0.88rem;
}

.gis-keys-popover-card {
  position: absolute;
  bottom: 50px;
  right: 0;
  width: 290px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  padding: 16px;
  z-index: 600;
  animation: fadeInPop 0.2s ease-out;
}

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

.gis-keys-pop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.gis-keys-pop-header h4 {
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
}

.close-keys-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}

.gis-keys-pop-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gis-pop-legend-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 6px;
}

.gis-pop-section-title {
  font-size: 0.90rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px 0;
}

.gis-pop-legend-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gis-pop-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.gis-pop-legend-row:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateX(-2px);
}

.gis-pop-legend-row .status-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
}

.gis-pop-legend-row .gis-color-swatch {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.gis-key-stats {
  margin-top: 6px;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: #475569;
}

.gis-key-stats strong {
  color: #0284c7;
  font-weight: 800;
}

.gis-keys-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.btn-subtle-map {
  flex: 1;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: inherit;
  color: #334155;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.15s ease;
}

.btn-subtle-map:hover {
  background: #e2e8f0;
}

.btn-subtle-map.primary {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.btn-subtle-map.primary:hover {
  background: #0369a1;
}

/* Custom Marker Popup Styling */
.gis-marker-popup {
  font-family: 'Cairo', -apple-system, sans-serif;
  direction: rtl;
  text-align: right;
  min-width: 210px;
  padding: 4px;
}

.popup-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.popup-title-row h4 {
  font-size: 0.92rem;
  font-weight: 800;
  color: #0b2b39;
  margin: 0;
  line-height: 1.3;
}

.popup-info-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: #475569;
  margin-bottom: 10px;
}

.popup-info-grid .lbl {
  color: #64748b;
  margin-left: 4px;
}

.btn-popup-view-detail {
  width: 100%;
  background: #0284c7;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-popup-view-detail:hover {
  background: #0369a1;
}

/* --------------------------------------------------------------------------
   VIEW 4: بطاقة المخطط (PLAN DETAIL CARD)
   -------------------------------------------------------------------------- */
.plan-detail-card-view {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-card);
}

.plan-card-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 18px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
}

.plan-title-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.plan-title-head h2 {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--text-main);
}

.plan-title-head span.plan-name-sub {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 600;
}

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

.btn-pill-action {
  height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-sub);
  font-size: 0.84rem;
  font-weight: 700;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-pill-action:hover {
  background: #f8fafc;
  color: var(--text-main);
  border-color: #cbd5e1;
}

/* Split: Summary Info + Mini GIS Map */
.plan-hero-split {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  margin-bottom: 24px;
}

.plan-info-keyvalue-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 24px;
}

.info-kv-row {
  display: flex;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.86rem;
}

.info-kv-label {
  color: var(--text-muted);
  font-weight: 600;
}

.info-kv-val {
  color: var(--text-main);
  font-weight: 800;
}

.plan-mini-map-box {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  height: 220px;
  min-height: 220px;
  background: #1e293b;
  isolation: isolate !important;
  z-index: 1 !important;
}

#planMiniMap {
  width: 100%;
  height: 100%;
  min-height: 220px;
  z-index: 1 !important;
}

.mini-map-btn-overlay {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(11, 43, 57, 0.92);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 30;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

/* Tabs Navigation */
.plan-detail-tabs-bar {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 20px;
  gap: 8px;
  overflow-x: auto;
}

.tab-btn-link {
  padding: 10px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn-link:hover {
  color: var(--text-main);
}

.tab-btn-link.active {
  color: var(--brand-accent);
  border-bottom-color: var(--brand-accent);
}

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

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

/* Details Section inside tab */
.detail-block-section {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  background: #f8fafc;
  margin-bottom: 16px;
}

.detail-block-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
}

.boundaries-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  font-size: 0.85rem;
}

.boundary-item {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.boundary-item strong {
  color: var(--brand-accent);
  display: inline-block;
  margin-left: 6px;
}

/* --------------------------------------------------------------------------
   VIEW 5: إضافة مخطط جديد (MULTI-STEP WIZARD)
   -------------------------------------------------------------------------- */
.wizard-card-view {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px 36px;
  box-shadow: var(--shadow-card);
  max-width: 960px;
  margin: 0 auto;
}

/* Stepper Bar */
.wizard-stepper-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 34px;
  position: relative;
}

.stepper-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 2;
  flex: 1;
}

.stepper-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

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

.stepper-item.active .stepper-circle {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(11, 43, 57, 0.15);
}

.stepper-item.active .stepper-label {
  color: var(--brand-primary);
  font-weight: 800;
}

.stepper-item.completed .stepper-circle {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.stepper-line {
  position: absolute;
  top: 20px;
  right: 12%;
  left: 12%;
  height: 2px;
  background: var(--border-color);
  z-index: 1;
}

/* Step Form Sections */
.wizard-step-section {
  display: none;
}

.wizard-step-section.active {
  display: block;
}

.form-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

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

.form-field-item.full-width {
  grid-column: span 2;
}

.form-field-item label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-sub);
}

.form-field-item label span.required {
  color: var(--brand-rose);
  margin-right: 2px;
}

.input-ctrl {
  height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.88rem;
  font-family: inherit;
  background-color: #ffffff;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
}

.input-ctrl:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

textarea.input-ctrl {
  height: 90px;
  padding: 12px 14px;
  resize: vertical;
}

.wizard-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

/* --------------------------------------------------------------------------
   Responsive Rules
   -------------------------------------------------------------------------- */
@media (max-width: 1280px) {
  .dashboard-grid-3 {
    grid-template-columns: 1fr 1fr;
  }
  .dashboard-grid-3 > :last-child {
    grid-column: span 2;
  }
}

@media (max-width: 1024px) {
  .app-sidebar {
    transform: translateX(100%);
  }
  .app-sidebar.mobile-open {
    transform: translateX(0);
  }
  .app-main {
    margin-right: 0;
  }
  .mobile-menu-btn {
    display: inline-block;
  }
  .kpis-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid-3 {
    grid-template-columns: 1fr;
  }
  .dashboard-grid-3 > :last-child {
    grid-column: span 1;
  }
  .quick-access-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .filter-fields-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gis-map-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .plan-hero-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .kpis-grid {
    grid-template-columns: 1fr;
  }
  .quick-access-grid {
    grid-template-columns: 1fr;
  }
  .filter-fields-grid {
    grid-template-columns: 1fr;
  }
  .form-grid-2col {
    grid-template-columns: 1fr;
  }
  .form-field-item.full-width {
    grid-column: span 1;
  }
  .app-content {
    padding: 16px;
  }
}

/* --------------------------------------------------------------------------
   Print Stylesheet
   -------------------------------------------------------------------------- */
@media print {
  body {
    background: #ffffff !important;
  }
  .app-sidebar, .app-header, .plan-top-actions, .plan-detail-tabs-bar, .print-hide {
    display: none !important;
  }
  .app-main {
    margin: 0 !important;
  }
  .app-content {
    padding: 0 !important;
  }
  .plan-detail-card-view {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }
}

/* ==========================================================================
   Full Analytics Modal (النافذة المنبثقة للتحليلات الشاملة)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-backdrop.open,
.modal-backdrop.active {
  display: flex;
  opacity: 1;
}

.modal-dialog-full {
  background: #ffffff;
  border-radius: 20px;
  width: 96vw;
  max-width: 1320px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.06);
  transform: scale(0.96);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.open .modal-dialog-full,
.modal-backdrop.active .modal-dialog-full {
  transform: scale(1);
}

.modal-header-custom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-title-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.modal-main-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  line-height: 1.25;
}

.modal-main-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 4px 0 0 0;
}

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

.btn-modal-action {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-modal-action:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-modal-close {
  background: #f1f5f9;
  border: none;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-modal-close:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* Quick KPI ribbon */
.modal-kpi-ribbon {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.modal-kpi-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.76rem;
}

.modal-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.modal-kpi-chip.approved .modal-chip-dot { background: #10b981; }
.modal-kpi-chip.pending .modal-chip-dot { background: #f59e0b; }
.modal-kpi-chip.study .modal-chip-dot { background: #0284c7; }
.modal-kpi-chip.other .modal-chip-dot { background: #ef4444; }

.modal-chip-label {
  color: #64748b;
  font-weight: 600;
}

.modal-chip-val {
  color: #0f172a;
  font-weight: 800;
}

.modal-chip-pct {
  color: #94a3b8;
  font-size: 0.72rem;
}

/* Modal Body */
.modal-body-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  background: #f1f5f9;
}

.modal-charts-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 1100px) {
  .modal-charts-grid-3 {
    grid-template-columns: 1fr;
  }
}

.modal-chart-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.modal-chart-card-header {
  margin-bottom: 12px;
}

.modal-card-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 6px;
}

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

.pill-timeline {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.pill-services {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.modal-chart-card-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.modal-chart-card-sub {
  font-size: 0.73rem;
  color: #64748b;
  margin: 2px 0 0 0;
}

.modal-chart-canvas-box {
  position: relative;
  height: 250px;
  width: 100%;
}

/* Modal Footer */
.modal-footer-custom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.modal-footer-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: #64748b;
}

.modal-footer-btns {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-ghost-secondary {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.btn-ghost-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-primary-accent {
  background: var(--brand-accent);
  border: none;
  color: #ffffff;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.btn-primary-accent:hover {
  background: var(--brand-accent-hover);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
}

/* ==========================================================================
   ROLE-BASED ACCESS CONTROL (RBAC) & HEADER ROLE SWITCHER
   ========================================================================== */
.header-role-switcher {
  display: flex;
  align-items: center;
}

.role-switcher-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  padding: 4px 10px;
  border-radius: 20px;
  transition: all 0.2s ease;
}

.role-switcher-badge:hover {
  border-color: #0284c7;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.15);
}

.role-icon {
  font-size: 0.95rem;
}

.role-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #64748b;
}

.role-select {
  background: transparent;
  border: none;
  font-size: 0.76rem;
  font-weight: 700;
  font-family: inherit;
  color: #0f172a;
  cursor: pointer;
  outline: none;
  padding-left: 4px;
}

/* Permission State Controls */
.perm-hidden {
  display: none !important;
}

.perm-disabled {
  opacity: 0.45 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
}

/* ==========================================================================
   VIEW 6: SYSTEM ADMINISTRATION & GOVERNANCE STYLES
   ========================================================================== */
.admin-header-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: 16px;
  padding: 24px 28px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.18);
  flex-wrap: wrap;
  gap: 16px;
}

.admin-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #38bdf8;
}

.admin-banner-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0;
  color: #ffffff;
}

.admin-banner-sub {
  font-size: 0.82rem;
  color: #94a3b8;
  margin: 6px 0 0 0;
}

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

/* Admin Stat Chips */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.admin-stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.admin-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.admin-stat-icon.users { background: #e0f2fe; color: #0284c7; }
.admin-stat-icon.roles { background: #fef3c7; color: #d97706; }
.admin-stat-icon.plans { background: #ecfdf5; color: #059669; }
.admin-stat-icon.audit { background: #f1f5f9; color: #475569; }

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

.admin-stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.admin-stat-lbl {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
}

/* Admin Tabs */
.admin-nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 12px;
  flex-wrap: wrap;
}

.admin-tab-btn {
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.admin-tab-btn:hover {
  color: #0f172a;
}

.admin-tab-btn.active {
  background: #ffffff;
  color: #0284c7;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.admin-tab-pane {
  display: none;
}

.admin-tab-pane.active {
  display: block;
}

/* Matrix Table */
.matrix-table th, .matrix-table td {
  padding: 12px 14px;
}

.perm-check {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
}

.perm-check.yes {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.perm-check.no {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* Backup Cards */
.admin-backup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

@media (max-width: 900px) {
  .admin-backup-grid {
    grid-template-columns: 1fr;
  }
}

.backup-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
}

.backup-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}

.backup-card-icon.export { background: #e0f2fe; color: #0284c7; }
.backup-card-icon.import { background: #ecfdf5; color: #059669; }
.backup-card-icon.reset { background: #fee2e2; color: #ef4444; }

.backup-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.backup-card-sub {
  font-size: 0.78rem;
  color: #64748b;
  margin: 8px 0 auto 0;
  line-height: 1.5;
}

/* ==========================================================================
   PLAN CONTROL MODAL STYLES
   ========================================================================== */
.modal-dialog-control {
  max-width: 860px;
}

.plan-ctrl-tabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px 0 24px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.plan-ctrl-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.plan-ctrl-tab-btn:hover {
  color: #0284c7;
}

.plan-ctrl-tab-btn.active {
  color: #0284c7;
  border-bottom-color: #0284c7;
}

.plan-ctrl-pane {
  display: none;
}

.plan-ctrl-pane.active {
  display: block;
}

.ctrl-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 650px) {
  .ctrl-form-grid {
    grid-template-columns: 1fr;
  }
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: .25s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  right: 3px;
  bottom: 3px;
  background-color: white;
  transition: .25s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #ef4444;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(-22px);
}

.security-card-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
}

.security-item-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.security-item-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.security-item-sub {
  font-size: 0.74rem;
  color: #64748b;
  margin: 4px 0 0 0;
}

/* Audit Log Timeline */
.plan-audit-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.audit-entry-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.audit-entry-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0284c7;
  margin-top: 5px;
  flex-shrink: 0;
}

.audit-entry-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.audit-entry-header {
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f172a;
}

.audit-entry-details {
  font-size: 0.74rem;
  color: #475569;
}

.audit-entry-time {
  font-size: 0.7rem;
  color: #94a3b8;
}

/* ==========================================================================
   PASSWORD MANAGEMENT & INPUT CONTROLS
   ========================================================================== */
.input-pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-pw-wrap input {
  width: 100%;
  padding-left: 40px !important;
}

.btn-eye-toggle {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  display: grid;
  place-items: center;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.btn-eye-toggle:hover {
  color: #0284c7;
}

.pw-strength-box {
  margin-top: 6px;
}

.pw-meter-track {
  height: 5px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}

.pw-meter-fill {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.pw-meter-fill.weak { width: 33%; background: #ef4444; }
.pw-meter-fill.medium { width: 66%; background: #f59e0b; }
.pw-meter-fill.strong { width: 100%; background: #10b981; }

.pw-meter-hint {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 4px;
}

.badge-pw-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

/* ==========================================================================
   ACCESS DENIED SCREEN (شاشة منع الوصول لعدم توفر الصلاحية)
   ========================================================================== */
.access-denied-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 520px;
  padding: 30px 16px;
}

.access-denied-card {
  max-width: 580px;
  width: 100%;
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid #fed7aa;
  box-shadow: 0 10px 25px -5px rgba(249, 115, 22, 0.1);
  padding: 40px 32px;
  text-align: center;
}

.access-denied-icon {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: #fff7ed;
  color: #ea580c;
  display: grid;
  place-items: center;
  margin: 0 auto 20px auto;
  border: 1px solid #ffedd5;
}

.access-denied-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 10px 0;
}

.access-denied-desc {
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.6;
  margin: 0 0 20px 0;
}

.access-denied-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 24px;
}

.access-denied-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   INTERACTIVE PERMISSION MATRIX STYLES
   ========================================================================== */
.matrix-category-header td {
  background: #f8fafc !important;
  color: #0284c7;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 10px 14px;
  border-top: 2px solid #e2e8f0;
}

.matrix-check-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.matrix-checkbox {
  width: 18px;
  height: 18px;
  accent-color: #0284c7;
  cursor: pointer;
}

.matrix-locked {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==========================================================================
   WEBSITE MODULES MANAGER GRID
   ========================================================================== */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.module-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.module-card:hover {
  border-color: #0284c7;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.08);
}

.module-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.module-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #e0f2fe;
  color: #0284c7;
  display: grid;
  place-items: center;
}

.module-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.module-desc {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.5;
  margin: 8px 0 16px 0;
  flex-grow: 1;
}

.module-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  font-size: 0.74rem;
}

/* ==========================================================================
   SYSTEM SETTINGS FORMS & POLICIES
   ========================================================================== */
.settings-section-title {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px 0;
}

.settings-section-sub {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0 0 16px 0;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .settings-form-grid {
    grid-template-columns: 1fr;
  }
}

.btn-auth-switch {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: all 0.15s ease;
}

.btn-auth-switch:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.demo-users-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.demo-user-pill {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.72rem;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.demo-user-pill:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

/* ==========================================================================
   NEON POSTGRESQL CLOUD DATABASE INTEGRATION STYLES
   ========================================================================== */
.neon-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #022c22 0%, #064e3b 100%);
  border: 1px solid #059669;
  padding: 5px 14px;
  border-radius: 20px;
  color: #a7f3d0;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.2);
}

.neon-status-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.35);
  border-color: #34d399;
}

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

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

.backup-card.neon {
  border-top: 3px solid #059669;
}

.backup-card-icon.neon {
  background: #ecfdf5;
  color: #059669;
}
  transition: all 0.15s;
}

.demo-user-pill:hover {
  background: #e0f2fe;
  color: #0284c7;
  border-color: #38bdf8;
}
