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

:root {
  
  --bg-dark: #030712;
  --card-bg: rgba(17, 24, 39, 0.65);
  --card-border: rgba(255, 255, 255, 0.08);
  --input-bg: rgba(3, 7, 18, 0.6);
  --input-border: rgba(255, 255, 255, 0.1);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --title-gradient: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
  

  

  --input-focus: #06b6d4; /* Vibrant Cyan */
  --primary-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --button-hover-gradient: linear-gradient(135deg, #0891b2 0%, #2563eb 100%);
  --error-color: #ef4444;
  --success-color: #10b981;
  --accent-gold: #fbbf24;
  --font-family: 'Cairo', 'Tajawal', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) rgba(0, 0, 0, 0.1);
}

.light-theme * {
  scrollbar-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.05);
}

/* Global Custom Scrollbar Styling for Webkit Browsers */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--input-focus, #06b6d4);
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Light Theme Scrollbars */
.light-theme ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.light-theme ::-webkit-scrollbar-thumb:hover {
  background: var(--input-focus, #06b6d4);
  border: 2px solid transparent;
  background-clip: padding-box;
}


body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  direction: rtl; /* RTL direction for Arabic user interface */
  padding: 40px 10px;
}

/* Premium Glowing Blob Background Animation */
.background-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  animation: float-blob 20s infinite alternate ease-in-out;
}

.blob-1 {
  top: -10%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: #06b6d4;
  animation-duration: 25s;
}

.blob-2 {
  bottom: -15%;
  right: -5%;
  width: 600px;
  height: 600px;
  background: #3b82f6;
  animation-duration: 30s;
  animation-delay: -5s;
}

.blob-3 {
  top: 40%;
  left: 50%;
  width: 400px;
  height: 400px;
  background: #8b5cf6; /* Indigo */
  animation-duration: 22s;
  animation-delay: -10s;
}

@keyframes float-blob {
  0% {
    transform: translate(0px, 0px) scale(1);
  }
  33% {
    transform: translate(50px, -50px) scale(1.08);
  }
  66% {
    transform: translate(-30px, 60px) scale(0.95);
  }
  100% {
    transform: translate(0px, 0px) scale(1);
  }
}

/* Glassmorphic Container */
.login-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 460px;
  padding: 20px;
  perspective: 1000px;
}

.login-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  -webkit-backdrop-filter: blur(25px);
  backdrop-filter: blur(25px);
  border-radius: 24px;
  padding: 40px 35px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4),
              0 0 40px rgba(6, 182, 212, 0.05);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  transform: translateY(0);
}

.login-card:hover {
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5),
              0 0 50px rgba(6, 182, 212, 0.1);
  transform: translateY(-5px);
}

/* Logo and Header Styling */
.login-header {
  text-align: center;
  margin-bottom: 35px;
}

.logo-wrapper {
  width: 90px;
  height: 90px;
  margin: 0 auto 15px auto;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(59, 130, 246, 0.2) 100%);
  border: 2px solid rgba(255, 255, 255, 0.1);
  padding: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
  transition: transform 0.5s ease;
}

.logo-wrapper:hover {
  transform: rotate(360deg) scale(1.05);
}

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

.login-header h1 {
  font-size: 26px;
  font-weight: 700;
  background: var(--title-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.login-header p {
  font-size: 14px;
  color: var(--text-muted);
}

/* Input Fields Styling */
.form-group {
  position: relative;
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  transition: color 0.3s ease;
  padding-right: 5px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper i {
  position: absolute;
  right: 16px;
  color: var(--text-muted);
  font-size: 18px;
  transition: color 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.input-wrapper #birthdayIcon,
.input-wrapper #kickOffIcon,
.input-wrapper i.clickable-calendar,
.input-wrapper button.clickable-calendar {
  color: var(--text-main) !important;
  cursor: pointer;
  pointer-events: auto;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

.light-theme input[type="date"]::-webkit-calendar-picker-indicator,
.light-theme input[type="month"]::-webkit-calendar-picker-indicator {
  filter: invert(0);
}

.form-input {
  width: 100%;
  padding: 14px 48px 14px 16px; /* Spacious padding for icons */
  font-size: 15px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 14px;
  color: var(--text-main);
  outline: none;
  font-family: var(--font-family);
  transition: all 0.3s ease;
}

.form-input:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.25),
              inset 0 0 10px rgba(6, 182, 212, 0.05);
  background: rgba(3, 7, 18, 0.8);
}

.form-input:focus + i {
  color: var(--input-focus);
  transform: scale(1.1);
}

/* Custom Select Styling to override default browser dropdown arrow with a beautiful SVG chevron */
select.form-input {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: left 16px center !important;
  background-size: 16px !important;
  padding-left: 40px !important;
  padding-right: 16px !important; /* Left alignment for icon, standard padding for right */
  cursor: pointer;
}

/* Global input-wrapper button styling (e.g. for Date Pickers, Item Pickers, Code Generators) */
.input-wrapper button {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--input-focus, #8b5cf6);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 0;
  transition: color 0.2s ease, transform 0.2s ease;
}

.input-wrapper button:hover {
  color: #a78bfa;
  transform: translateY(-50%) scale(1.1);
}

.input-wrapper button:active {
  transform: translateY(-50%) scale(0.95);
}

/* Button & Actions Styling */
.btn-submit {
  width: 100%;
  padding: 15px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-family);
  color: #ffffff;
  background: var(--primary-gradient);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.btn-submit:hover {
  background: var(--button-hover-gradient);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.45);
  transform: translateY(-2px);
}

.btn-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.3);
}

.btn-submit::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(45deg);
  transition: transform 0.5s ease;
  pointer-events: none;
  opacity: 0;
}

.btn-submit:hover::after {
  opacity: 1;
  transform: translate(50%, 50%) rotate(45deg);
}

/* Alerts and Notifications */
.alert-toast {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  z-index: 99999;
  background: rgba(239, 68, 110, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.3);
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
  border-radius: 12px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
  opacity: 0;
  pointer-events: none;
}

.alert-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.alert-toast.error {
  background: rgba(220, 38, 38, 0.95);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fff;
  box-shadow: 0 10px 40px rgba(220, 38, 38, 0.45), 0 0 20px rgba(220, 38, 38, 0.2);
}

.alert-toast.success {
  background: rgba(16, 185, 129, 0.95);
  border-color: rgba(16, 185, 129, 0.4);
  color: #fff;
  box-shadow: 0 10px 40px rgba(16, 185, 129, 0.45), 0 0 20px rgba(16, 185, 129, 0.2);
}

.alert-toast-icon {
  font-size: 20px;
}

.alert-toast-message {
  font-size: 14px;
  font-weight: 500;
}

/* Spinner Loader */
.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

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

/* Responsive Styles */
@media (max-width: 480px) {
  .login-card {
    padding: 30px 20px;
    border-radius: 20px;
  }
  
  .login-header h1 {
    font-size: 22px;
  }
}

/* Mockup Dashboards styling */
.dashboard-container {
  max-width: 1200px;
  width: 90%;
  margin: 40px auto;
  z-index: 10;
}

.dashboard-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  -webkit-backdrop-filter: blur(25px);
  backdrop-filter: blur(25px);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 20px;
  margin-bottom: 30px;
}

.dashboard-title {
  display: flex;
  align-items: center;
  gap: 15px;
}

.dashboard-title h1 {
  font-size: 28px;
  background: var(--title-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.user-badge {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--input-focus);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
}

.btn-logout {
  padding: 10px 20px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
  cursor: pointer;
  font-family: var(--font-family);
  transition: all 0.3s ease;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.dashboard-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.stat-card {
  background: rgba(3, 7, 18, 0.4);
  border: 1px solid var(--input-border);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: rgba(6, 182, 212, 0.3);
  transform: translateY(-3px);
}

.stat-card h3 {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 10px;
}

.stat-card p {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
}

/* Theme Toggle Button Styles */
.btn-theme-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
}

.btn-theme-toggle:hover {
  transform: scale(1.1) rotate(15deg);
  border-color: var(--input-focus);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.35);
}

.btn-theme-toggle:active {
  transform: scale(0.95);
}

.btn-theme-toggle-header {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 16px;
  transition: all 0.3s ease;
}

.btn-theme-toggle-header:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--input-focus);
  color: var(--input-focus);
  transform: scale(1.05);
}

.btn-theme-toggle-header:active {
  transform: scale(0.95);
}

/* Light Theme tweaks to ensure maximum readability */
.light-theme {
  --bg-dark: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #475569;
}

.light-theme .login-card,
.light-theme .dashboard-card {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08),
              0 0 40px rgba(6, 182, 212, 0.02);
}

.light-theme .form-input {
  color: #0f172a;
}

.light-theme .form-input:focus {
  background: #ffffff;
}

.light-theme .stat-card {
  background: rgba(255, 255, 255, 0.7);
}

/* Module Cards Styling */
.module-card {
  background: rgba(3, 7, 18, 0.4);
  border: 1px solid var(--input-border);
  border-radius: 20px;
  padding: 28px 20px;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.module-card:hover {
  border-color: var(--input-focus);
  transform: translateY(-6px);
  box-shadow: 0 15px 30px rgba(6, 182, 212, 0.15),
              0 0 20px rgba(6, 182, 212, 0.05);
  background: rgba(3, 7, 18, 0.65);
}

.module-card .module-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(6, 182, 212, 0.08);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 26px;
  color: var(--input-focus);
  margin-bottom: 15px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.module-card:hover .module-icon {
  transform: scale(1.1) rotate(5deg);
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 5px 15px rgba(6, 182, 212, 0.4);
}

.module-card h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0;
  transition: color 0.3s ease;
}

.module-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Locked Card Style for restricted permissions */
.module-card.locked-card {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(85%) blur(0.2px);
  border-color: rgba(255, 255, 255, 0.04);
  background: rgba(15, 23, 42, 0.15);
  pointer-events: none; /* Disables clicking and interactions */
}

.module-card.locked-card:hover {
  transform: none !important;
  box-shadow: none !important;
  border-color: rgba(255, 255, 255, 0.04) !important;
}

.module-card.locked-card .module-icon {
  background: rgba(255, 255, 255, 0.02) !important;
  color: var(--text-muted) !important;
  box-shadow: none !important;
}

.locked-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Light Theme tweaks for Module Cards */
.light-theme .module-card {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(0, 0, 0, 0.07);
}

.light-theme .module-card:hover {
  background: #ffffff;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.06);
}

.light-theme .module-card.locked-card {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.04);
  opacity: 0.5;
}

.light-theme .locked-badge {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.06);
  color: #475569;
}

/* User Management Table Styles */
.table-container {
  width: 100%;
  overflow-x: auto;
  margin-top: 25px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: rgba(3, 7, 18, 0.2);
}

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

.custom-table th {
  background: rgba(255, 255, 255, 0.02);
  padding: 16px 20px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--card-border);
}

.custom-table td {
  padding: 16px 20px;
  color: var(--text-main);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

.custom-table tr:last-child td {
  border-bottom: none;
}

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

/* Action buttons */
.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  transition: all 0.2s ease;
  margin-left: 5px;
}

/* Ensure action cells and icons are always side-by-side in one row without wrapping */
.custom-table td:last-child {
  white-space: nowrap !important;
  text-align: center;
  min-width: 105px !important;
}

/* Fallback selector targeting any td with .btn-icon */
.custom-table td:has(.btn-icon) {
  white-space: nowrap !important;
  min-width: 105px !important;
}

.btn-edit {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.2);
}

.btn-edit:hover {
  background: #2563eb;
  color: #ffffff;
  transform: translateY(-2px);
}

.btn-delete {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.2);
}

.btn-delete:hover {
  background: #dc2626;
  color: #ffffff;
  transform: translateY(-2px);
}

/* Permission badges in Table */
.perm-indicator-container {
  display: flex;
  gap: 6px;
}

.perm-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 11px;
  position: relative;
}

.perm-indicator.active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.perm-indicator.inactive {
  background: rgba(255, 255, 255, 0.02);
  color: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* Modal Popup Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 95%;
  max-width: 580px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 30px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  transform: translateY(-50px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.show .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 20px;
  color: #ffffff;
  font-weight: 700;
}

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.btn-close-modal:hover {
  color: #ffffff;
  transform: scale(1.1);
}

/* Permissions Selection Grid */
.permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 10px;
  margin-bottom: 25px;
}

.perm-checkbox-card {
  background: rgba(3, 7, 18, 0.3);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
}

.perm-checkbox-card:hover {
  border-color: rgba(6, 182, 212, 0.3);
  background: rgba(3, 7, 18, 0.55);
}

.perm-checkbox-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--input-focus);
  cursor: pointer;
}

.perm-checkbox-card label {
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0;
}

.perm-checkbox-card.checked {
  border-color: var(--input-focus);
  background: rgba(6, 182, 212, 0.08);
}

/* Light Theme tweaks */
.light-theme .table-container {
  background: rgba(255, 255, 255, 0.5);
}

.light-theme .custom-table th {
  background: rgba(0, 0, 0, 0.02);
}

.light-theme .custom-table tr:hover td {
  background: rgba(0, 0, 0, 0.01);
}

.light-theme .perm-checkbox-card {
  background: rgba(255, 255, 255, 0.8);
}

.light-theme .perm-checkbox-card:hover {
  background: #ffffff;
}

.light-theme .perm-checkbox-card.checked {
  background: rgba(6, 182, 212, 0.05);
}

.light-theme .modal-header h2 {
  color: #0f172a;
}

.light-theme .btn-close-modal:hover {
  color: #0f172a;
}

.light-theme .perm-indicator.inactive {
  background: rgba(0, 0, 0, 0.03);
  color: rgba(0, 0, 0, 0.2);
  border-color: rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   Assets Module Custom Styles
   ========================================================================== */

/* Scrollable Table for Assets Module after 10 records */
.scrollable-assets {
  max-height: 480px;
  overflow-y: auto;
  border-bottom: 2px solid var(--card-border);
}

.scrollable-assets::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.scrollable-assets::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.scrollable-assets::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  transition: background 0.3s ease;
}

.scrollable-assets::-webkit-scrollbar-thumb:hover {
  background: var(--input-focus);
}

.light-theme .scrollable-assets::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
}

.light-theme .scrollable-assets::-webkit-scrollbar-thumb:hover {
  background: var(--input-focus);
}

/* Group headers in Assets Table */
.group-header-row td {
  background: rgba(6, 182, 212, 0.08) !important;
  color: var(--input-focus) !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  padding: 14px 20px !important;
  border-right: 4px solid var(--input-focus);
  letter-spacing: 0.5px;
}

.light-theme .group-header-row td {
  background: rgba(6, 182, 212, 0.04) !important;
}

/* Summary Row styling */
.summary-row td {
  font-weight: 700 !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border-top: 2px solid var(--card-border) !important;
  color: var(--text-main) !important;
  border-bottom: 2px solid var(--card-border) !important;
}

.light-theme .summary-row td {
  background: rgba(0, 0, 0, 0.01) !important;
}

/* Dynamic form animation classes */
.dynamic-field-group {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Overlapping Thumbnails Gallery in Assets Table */
.asset-thumbnail-gallery {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
}

.asset-thumbnail {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid var(--card-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  cursor: zoom-in;
  transition: all 0.3s ease;
  margin-left: -12px;
}

.asset-thumbnail:first-child {
  margin-left: 0;
}

.asset-thumbnail:hover {
  transform: scale(1.15) translateY(-2px);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
  border-color: var(--input-focus);
}

/* Image preview grid in the Modal form */
.image-preview-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  margin-top: 10px;
  margin-bottom: 20px;
}

.preview-image-card {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.preview-image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-remove-preview-image {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.85);
  border: none;
  color: white;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.btn-remove-preview-image:hover {
  background: #ef4444;
  transform: scale(1.1);
}

/* Lightbox Modal (Full screen image slider) */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 7, 18, 0.95);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  z-index: 2500;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content-card {
  position: relative;
  max-width: 90%;
  max-height: 85%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  object-fit: contain;
}

.btn-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
}

.btn-lightbox-nav:hover {
  background: var(--primary-gradient);
  border-color: var(--input-focus);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

.btn-lightbox-prev {
  right: -70px;
}

.btn-lightbox-next {
  left: -70px;
}

@media (max-width: 768px) {
  .btn-lightbox-prev {
    right: 10px;
  }
  .btn-lightbox-next {
    left: 10px;
  }
  .btn-lightbox-nav {
    background: rgba(0, 0, 0, 0.6);
  }
}

.btn-lightbox-close {
  position: absolute;
  top: -60px;
  left: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
}

.btn-lightbox-close:hover {
  background: #ef4444;
  border-color: #ef4444;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.lightbox-counter {
  position: absolute;
  bottom: -45px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  background: rgba(0,0,0,0.4);
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
}

/* Delegates Module Styles */
.agent-thumbnail-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.agent-thumbnail-circle-placeholder {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 16px;
}

.light-theme .agent-thumbnail-circle-placeholder {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
}

#progressBarFill {
  border-radius: 4px;
}

/* Scrollable Table for Delegates Module after 20 records */
.scrollable-delegates {
  max-height: 720px;
  overflow-y: auto;
  border-bottom: 2px solid var(--card-border);
}

.scrollable-delegates::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.scrollable-delegates::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.scrollable-delegates::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  transition: background 0.3s ease;
}

.scrollable-delegates::-webkit-scrollbar-thumb:hover {
  background: var(--input-focus);
}

.light-theme .scrollable-delegates::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
}

.light-theme .scrollable-delegates::-webkit-scrollbar-thumb:hover {
  background: var(--input-focus);
}

/* Sticky header for scrollable delegates table */
.scrollable-delegates table thead th {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #111827; /* Solid dark color to prevent scrolled text overlap */
  border-bottom: 2px solid var(--card-border);
}

.light-theme .scrollable-delegates table thead th {
  background: #ffffff; /* Solid white color for light theme */
}


/* ==========================================================================
   APP TOPBAR - Fixed Premium Navigation Strip
   ========================================================================== */

.app-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 58px;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: rgba(3, 7, 18, 0.72);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  gap: 12px;
}

.light-theme .app-topbar {
  background: rgba(255, 255, 255, 0.82);
  border-bottom-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.app-topbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.4), rgba(139, 92, 246, 0.3), transparent);
  pointer-events: none;
}

/* Right section: Logo + Theme Toggle */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.topbar-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.18) 0%, rgba(59, 130, 246, 0.18) 100%);
  border: 1.5px solid rgba(6, 182, 212, 0.3);
  padding: 2px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.15);
  transition: transform 0.4s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
  overflow: hidden;
  cursor: pointer;
}

.topbar-logo:hover {
  transform: scale(1.08) rotate(8deg);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.35);
}

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

.topbar-theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 15px;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.topbar-theme-btn:hover {
  background: rgba(6, 182, 212, 0.12);
  border-color: var(--input-focus);
  color: var(--input-focus);
  transform: scale(1.08) rotate(12deg);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.28);
}

.topbar-theme-btn:active { transform: scale(0.94); }

.light-theme .topbar-theme-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

/* Center: Page Title */
.topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  padding: 0 6px;
}

.topbar-page-title {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-family);
  color: var(--text-main);
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  background: var(--title-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Left section: Back + Menu buttons */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.topbar-btn:hover {
  color: #fff;
  border-color: transparent;
  transform: scale(1.06);
  background: var(--primary-gradient);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.topbar-btn:active { transform: scale(0.93); }

.light-theme .topbar-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.09);
}

.light-theme .topbar-btn:hover {
  color: #fff;
  border-color: transparent;
}

/* Body padding to offset fixed bar */
body.has-topbar {
  padding-top: 76px !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
}

/* Responsive */
@media (max-width: 480px) {
  .app-topbar { padding: 0 10px; height: 52px; gap: 8px; }
  .topbar-logo { width: 32px; height: 32px; }
  .topbar-theme-btn, .topbar-btn { width: 32px; height: 32px; font-size: 13px; }
  .topbar-page-title { font-size: 13px; }
  body.has-topbar { padding-top: 66px !important; }
}




