/* ==========================================================================
   AZH IT HUB - BRANDING & REDESIGN SYSTEM
   Theme: Hospital White, Teal & Orange Accent
   ========================================================================== */

/* --- CSS VARIABLES & TOKENS --- */
:root {
  --primary: #d97706;        /* Orange Accent */
  --primary-hover: #b45309;
  --secondary: #0f766e;      /* Medical Teal */
  --secondary-hover: #0d5c56;
  --dark-bg: #0f172a;        /* Dark Slate for Header/Footer */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;   /* Slate Light */
  --bg-tertiary: #f1f5f9;
  
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --border-color: #e2e8f0;
  --border-radius-sm: 6px;
  --border-radius-md: 10px;
  --border-radius-lg: 16px;
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-hover: 0 20px 30px -10px rgba(15, 118, 110, 0.18);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- ULTRA-FAST HARDWARE ACCELERATION --- */
.action-tile-card, .btn, .stat-card, .app-view, .modal-overlay, .data-table tr, .hero-slide {
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* --- 10-SECOND INTRO VIDEO OVERLAY STYLES --- */
.intro-video-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.intro-video-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.intro-video-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

#intro-video-player {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-sound-toggle {
  background: rgba(15, 118, 110, 0.85);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 20px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(0,0,0,0.5);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sound-toggle:hover {
  background: #d97706;
  border-color: #d97706;
  transform: translateY(-2px);
}

.btn-skip-intro {
  position: relative;
  bottom: auto;
  right: auto;
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(0,0,0,0.5);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-skip-intro:hover {
  background: #0f766e;
  border-color: #0f766e;
  transform: translateY(-2px);
}

/* --- RESET & BASIC STYLES --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--secondary-hover);
}

/* --- GRID & LAYOUT UTILITIES --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.hidden {
  display: none !important;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* --- HEADER & NAVIGATION --- */
.main-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  transition: all 0.25s ease;
}

html[data-theme="dark"] .main-header {
  background: rgba(15, 23, 42, 0.95);
  border-bottom-color: #334155;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.brand-logo-small {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.header-brand-text h2 {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--secondary);
  letter-spacing: -0.02em;
  white-space: nowrap;
  line-height: 1.1;
}

.header-brand-text span {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  align-items: center;
}

.nav-links-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.86rem;
  padding: 8px 14px;
  border-radius: var(--border-radius-sm);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--secondary);
  background-color: var(--bg-tertiary);
}

.nav-link-admin-pill {
  background-color: rgba(15, 118, 110, 0.1);
  color: var(--secondary) !important;
  font-weight: 700;
  border: 1px solid rgba(15, 118, 110, 0.25);
}

.nav-link-admin-pill:hover, .nav-link-admin-pill.active {
  background-color: var(--secondary) !important;
  color: white !important;
}

/* Nav Management Dropdown */
.nav-dropdown-wrapper {
  position: relative;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.86rem;
  padding: 7px 14px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-dropdown-toggle:hover {
  background: var(--bg-tertiary);
  border-color: var(--secondary);
  color: var(--secondary);
}

.nav-dropdown-menu {
  position: absolute;
  top: 42px;
  left: 0;
  min-width: 210px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

html[dir="rtl"] .nav-dropdown-menu {
  left: auto;
  right: 0;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}

.nav-dropdown-item:hover, .nav-dropdown-item.active {
  background-color: var(--bg-tertiary);
  color: var(--secondary);
}

.nav-dropdown-item svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

.nav-dropdown-item:hover svg, .nav-dropdown-item.active svg {
  color: var(--secondary);
}

.header-right-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-icon-round {
  padding: 6px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-round:hover {
  background: var(--bg-tertiary);
  border-color: var(--secondary);
}

.btn-pill-lang {
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-pill-lang:hover {
  background: var(--bg-tertiary);
  color: var(--secondary);
  border-color: var(--secondary);
}

.btn-icon-bell {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.2s ease;
}

.btn-icon-bell:hover {
  background: var(--bg-tertiary);
  color: var(--secondary);
  border-color: var(--secondary);
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-family);
  font-size: 0.925rem;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--secondary);
  color: white;
}
.btn-secondary:hover {
  background-color: var(--secondary-hover);
}

.btn-outline {
  border-color: var(--border-color);
  background-color: transparent;
  color: var(--text-secondary);
}
.btn-outline:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-xs { padding: 4px 8px; font-size: 0.75rem; }
.btn-small { padding: 6px 12px; font-size: 0.825rem; }

/* --- HERO SECTION (EXECUTIVE HEALTHCARE OVERLAYS) --- */
.hero-section {
  position: relative;
  background-image: linear-gradient(135deg, rgba(15, 118, 110, 0.92) 0%, rgba(15, 23, 42, 0.94) 100%), url('hospital_it_hero.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: white;
  padding: 90px 0 110px 0;
  text-align: center;
}

.hero-content {
  max-width: 900px;
  margin: 0 auto;
}

.hero-tagline {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.hero-content h1 {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 18px;
  text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.hero-content p {
  font-size: 1.2rem;
  opacity: 0.95;
  margin-bottom: 40px;
  font-weight: 400;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* --- QUICK ACTIONS TILES (EXECUTIVE GLASS CARDS) --- */
.hero-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
  margin-top: 44px;
}

.action-tile-card {
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius-md);
  padding: 26px 22px;
  text-align: left;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  color: white;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

.action-tile-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.action-tile-card:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

.action-tile-card:hover::before {
  opacity: 1;
}

.tile-icon-box {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--primary), #b45309);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.35);
  transition: transform 0.3s ease;
}

.action-tile-card:hover .tile-icon-box {
  transform: scale(1.08);
}

.action-tile-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.action-tile-card p {
  font-size: 0.825rem;
  opacity: 0.85;
  margin-bottom: 0;
  line-height: 1.5;
}

/* --- HOMEPAGE SLIDESHOW ENHANCEMENTS --- */
.hero-slider-container {
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-slider-container:hover {
  box-shadow: 0 25px 50px rgba(0,0,0,0.4);
}

/* --- METRICS BANNER --- */
.metrics-banner {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  padding: 24px 0;
  margin-top: -35px;
  position: relative;
  z-index: 10;
  border-radius: var(--border-radius-md);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: center;
}

.metric-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-right: 1px solid var(--border-color);
}

.metric-item:last-child {
  border-right: none;
}

.metric-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary);
}

.metric-text h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.metric-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 4px;
}

/* --- SERVICE INFORMATION CARDS --- */
.services-section {
  padding: 60px 0;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.service-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.service-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.service-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 24px;
  flex-grow: 1;
}

/* --- CONTACT SECTION --- */
.contact-section {
  padding: 60px 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 40px;
}

.contact-info-card {
  background-color: var(--secondary);
  color: white;
  padding: 40px;
  border-radius: var(--border-radius-md);
}

.contact-info-card h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.contact-info-card p.subtitle {
  opacity: 0.8;
  font-size: 0.85rem;
  margin-bottom: 30px;
}

.info-item {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  align-items: flex-start;
}

.info-item-icon {
  width: 36px;
  height: 36px;
  background-color: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-item-text h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.info-item-text p {
  font-size: 0.85rem;
  opacity: 0.9;
}

.about-hospital-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 30px;
  border-radius: var(--border-radius-md);
  margin-top: 24px;
  box-shadow: var(--shadow-sm);
}

.about-hospital-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--secondary);
}

.about-hospital-card p {
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- FOOTER --- */
.main-footer {
  background-color: var(--dark-bg);
  color: white;
  padding: 60px 0 30px 0;
  border-top: 1px solid #1e293b;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #38bdf8;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.footer-brand p {
  font-size: 0.8rem;
  opacity: 0.7;
  line-height: 1.5;
}

.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #f1f5f9;
  margin-bottom: 20px;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: #94a3b8;
  font-size: 0.825rem;
}

.footer-links a:hover {
  color: white;
}

.footer-contact-info {
  list-style: none;
}

.footer-contact-info li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.825rem;
  color: #94a3b8;
  margin-bottom: 12px;
}

.footer-contact-info a {
  color: #94a3b8;
}
.footer-contact-info a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #64748b;
}

/* --- FORMS & GENERAL CARD STYLES --- */
.section-title-wrapper {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 40px auto;
}

.section-title-wrapper h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
}

.section-title-wrapper p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 8px;
}

.card-form-wrapper {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 40px;
  box-shadow: var(--shadow-md);
  max-width: 800px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 10px 16px;
  font-family: var(--font-family);
  font-size: 0.875rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--secondary);
  background-color: var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

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

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 24px;
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* --- LOGGED IN STAFF DASHBOARD --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

.stat-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-sm);
}

.stat-card.action-stat-card {
  transition: all 0.2s ease;
}

.stat-card.action-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--secondary);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--border-radius-sm);
  background-color: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon.blue { background-color: rgba(59, 130, 246, 0.1); color: var(--info); }
.stat-icon.green { background-color: rgba(16, 185, 129, 0.1); color: var(--success); }
.stat-icon.orange { background-color: rgba(245, 158, 11, 0.1); color: var(--warning); }

.stat-details h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.stat-details p {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-top: 4px;
}

/* --- TICKETS TABLE & DIRECTORIES --- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.775rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

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

.data-table tbody tr:hover td {
  background-color: var(--bg-secondary);
}

/* --- BADGES --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-primary { background-color: rgba(15, 118, 110, 0.1); color: var(--secondary); }
.badge-success { background-color: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-warning { background-color: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-danger { background-color: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-gray { background-color: rgba(100, 116, 139, 0.1); color: var(--text-muted); }

.badge-pulse {
  background-color: var(--danger);
  color: white;
  animation: pulse-badge 2s infinite;
  padding: 2px 6px;
  font-size: 0.65rem;
  margin-left: 6px;
  border-radius: 10px;
}

@keyframes pulse-badge {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* --- MODAL DIALOGS --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-card {
  width: 100%;
  max-width: 600px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modal-enter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-card-small {
  max-width: 480px;
}

@keyframes modal-enter {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-secondary);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text-muted);
  cursor: pointer;
}
.btn-close-modal:hover {
  color: var(--text-primary);
}

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background-color: var(--bg-primary);
  border-left: 4px solid var(--info);
  border-radius: var(--border-radius-sm);
  padding: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 320px;
  transition: all 0.3s ease;
}

.toast-success { border-left-color: var(--success); }
.toast-danger { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast-content {
  flex-grow: 1;
}

.toast-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.toast-desc {
  font-size: 0.775rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.toast-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}
.toast-close:hover { color: var(--text-primary); }

/* --- PROFILE MENU DROPDOWN --- */
.header-user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  padding: 4px 10px 4px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

html[dir="rtl"] .header-user-profile {
  padding: 4px 14px 4px 10px;
}

.header-user-profile:hover {
  border-color: var(--secondary);
  box-shadow: var(--shadow-sm);
}

.user-profile-info {
  text-align: right;
  max-width: 140px;
}

html[dir="rtl"] .user-profile-info {
  text-align: left;
}

.user-profile-info h4 {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  line-height: 1.2;
}

.user-profile-info span {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  line-height: 1.2;
  margin-top: 2px;
}

.user-avatar-badge {
  position: relative;
}

.user-avatar {
  width: 34px;
  height: 34px;
  background-color: var(--secondary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
}

.profile-dropdown {
  position: absolute;
  top: 48px;
  right: 0;
  width: 220px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
}

.profile-dropdown-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
}

.profile-dropdown-name {
  font-size: 0.875rem;
  font-weight: 700;
}

.profile-dropdown-email {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.profile-dropdown-body {
  padding: 8px 0;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.825rem;
  color: var(--text-secondary);
}

.profile-dropdown-item:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

/* --- LOGIN MODAL & TABS --- */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-primary);
  border-radius: var(--border-radius-md);
  padding: 30px;
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.hospital-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 56px;
  height: 56px;
}

.brand-info h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--secondary);
  letter-spacing: -0.02em;
}

.brand-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.login-body h2 {
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
  margin-bottom: 20px;
}

.login-tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.tab-nav-btn {
  flex: 1;
  background: none;
  border: none;
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 0.775rem;
  padding: 10px 0;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.tab-nav-btn:hover {
  color: var(--text-primary);
}

.tab-nav-btn.active {
  color: var(--secondary);
  border-bottom-color: var(--secondary);
}

.tab-pane {
  display: none;
}

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

.sso-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-sso {
  border: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  width: 100%;
}
.btn-sso:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.icon-sso {
  width: 18px;
  height: 18px;
}

.auth-form-toggles {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.recaptcha-box {
  margin: 15px 0;
  display: flex;
  justify-content: center;
}

.login-divider {
  text-align: center;
  margin: 20px 0;
  position: relative;
}

.login-divider::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  background-color: var(--border-color);
  z-index: 1;
}

.login-divider span {
  background-color: var(--bg-primary);
  padding: 0 10px;
  font-size: 0.725rem;
  font-weight: 700;
  color: var(--text-muted);
  position: relative;
  z-index: 2;
}

.demo-login-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.demo-card {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background-color: var(--bg-secondary);
  transition: all 0.2s ease;
}

.demo-card:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--secondary);
}

.demo-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: rgba(15,118,110,0.1);
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.demo-avatar.admin-av {
  background-color: rgba(217,119,6,0.1);
  color: var(--primary);
}

.demo-details h4 {
  font-size: 0.725rem;
  font-weight: 700;
}

.demo-details p {
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* --- BARCODE GRAPHIC VIEWER --- */
.barcode-graphic-box {
  margin: 24px auto;
  padding: 16px;
  background: white;
  border-radius: 8px;
  display: flex;
  flex-direction: row;
  gap: 24px;
  align-items: center;
  justify-content: center;
  width: fit-content;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

.barcode-canvas {
  max-width: 100%;
  height: 80px;
}

.qr-code-box img {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
}

.barcode-id-text {
  font-family: monospace;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.1em;
  color: var(--text-primary);
}

/* --- ADMIN DASHBOARD CHARTS & TABLES --- */
.admin-row-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.admin-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

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

.admin-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.chart-bar-group {
  margin-bottom: 16px;
}

.chart-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.chart-bar-container {
  height: 8px;
  background-color: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.chart-bar-fill {
  height: 100%;
  background-color: var(--secondary);
  border-radius: 4px;
  width: 0;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.chart-bar-fill.hw { background-color: var(--info); }
.chart-bar-fill.sw { background-color: var(--success); }
.chart-bar-fill.net { background-color: var(--warning); }
.chart-bar-fill.oth { background-color: var(--primary); }

/* --- TICKETS QUEUE CARD LIST & MAIN SPLIT VIEW --- */
.split-view-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  height: calc(100vh - 180px);
}

.split-left-panel {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.panel-header-search {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
}

.panel-cards-scroll {
  flex-grow: 1;
  overflow-y: auto;
  padding: 8px 12px;
}

.ticket-mini-card {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 12px;
  margin-bottom: 10px;
  background-color: var(--bg-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ticket-mini-card:hover {
  background-color: var(--bg-secondary);
}

.ticket-mini-card.active {
  border-color: var(--secondary);
  background-color: rgba(15, 118, 110, 0.05);
}

.mini-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.mini-subject {
  font-size: 0.85rem;
  font-weight: 700;
  margin: 6px 0;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.mini-user {
  color: var(--text-secondary);
  font-weight: 600;
}

.split-right-panel {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  color: var(--text-muted);
  text-align: center;
  padding: 40px;
}

.detail-placeholder svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.detail-scroll-area {
  flex-grow: 1;
  overflow-y: auto;
  padding: 30px;
}

.detail-header-block {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.detail-title-side h2 {
  font-size: 1.4rem;
  font-weight: 800;
}

.detail-meta-row {
  display: flex;
  gap: 16px;
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.detail-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  margin-bottom: 24px;
}

.user-card-avatar {
  width: 42px;
  height: 42px;
  background-color: var(--secondary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.user-card-info h4 {
  font-size: 0.875rem;
  font-weight: 700;
}

.user-card-info p {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.detail-body-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  line-height: 1.6;
  margin-bottom: 30px;
}

/* --- ACTIVITY TIMELINE --- */
.timeline-event {
  border-left: 2px solid var(--border-color);
  margin-left: 10px;
  padding-left: 20px;
  position: relative;
  padding-bottom: 24px;
}

.timeline-event::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--border-color);
}

.timeline-event.event-open::before { background-color: var(--secondary); }
.timeline-event.event-progress::before { background-color: var(--warning); }
.timeline-event.event-closed::before { background-color: var(--success); }
.timeline-event.event-reply::before { background-color: var(--info); }

.event-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.event-actor {
  color: var(--text-primary);
  font-weight: 700;
}

.event-content {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.detail-reply-panel {
  padding: 24px 30px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
}

.canned-responses-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.btn-canned {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  font-size: 0.725rem;
  padding: 4px 10px;
  border-radius: 20px;
  color: var(--text-secondary);
  cursor: pointer;
}
.btn-canned:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--secondary);
}

/* --- AI BOT CHAT WINDOW --- */
.ai-view-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  height: calc(100vh - 180px);
}

.chat-panel {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.chat-messages-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-bubble-row {
  display: flex;
  width: 100%;
}

.chat-bubble-row.agent {
  justify-content: flex-start;
}

.chat-bubble-row.user {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: 70%;
  padding: 12px 18px;
  border-radius: var(--border-radius-md);
  font-size: 0.9rem;
  line-height: 1.5;
}

.chat-bubble-row.agent .chat-bubble {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border-top-left-radius: 2px;
}

.chat-bubble-row.user .chat-bubble {
  background-color: var(--secondary);
  color: white;
  border-top-right-radius: 2px;
}

.chat-input-bar {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  display: flex;
  gap: 12px;
}

.suggestions-sidebar {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.suggestions-sidebar h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--secondary);
}

.suggestion-item {
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}
.suggestion-item:hover {
  background-color: var(--bg-secondary);
  border-color: var(--secondary);
  color: var(--text-primary);
}

/* --- SCANNER MODAL VIEWPORT --- */
.scanner-viewport-simulation {
  position: relative;
  height: 260px;
  background-color: #000000;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-laser-line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--danger);
  box-shadow: 0 0 10px var(--danger);
  animation: laser-sweep 2.5s infinite linear;
  z-index: 10;
}

@keyframes laser-sweep {
  0% { top: 10%; }
  50% { top: 90%; }
  100% { top: 10%; }
}

.scanner-aiming-box {
  width: 200px;
  height: 140px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 100vw rgba(0, 0, 0, 0.6);
  position: absolute;
  z-index: 5;
  border-radius: 8px;
}

.scanner-static-image {
  color: white;
  text-align: center;
  font-size: 0.85rem;
  z-index: 2;
  opacity: 0.7;
}

.scanner-static-image svg {
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  opacity: 0.8;
}

.scanner-sim-card {
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 8px;
  background-color: var(--bg-secondary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}
.scanner-sim-card:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--secondary);
}

/* --- GENERAL VIEW ELEMENT ROUTER --- */
.app-view {
  display: none;
}
.app-view.active {
  display: block;
}

.main-content {
  padding: 40px 0;
  min-height: calc(100vh - 280px);
}

/* --- RESPONSIVENESS MEDIA QUERIES --- */
@media (max-width: 991px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .services-grid {
    grid-template-columns: 1fr;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .admin-row-2 {
    grid-template-columns: 1fr;
  }
  .split-view-container {
    grid-template-columns: 1fr;
    height: auto;
  }
  .ai-view-container {
    grid-template-columns: 1fr;
    height: auto;
  }
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }
  .metric-item {
    border-right: none;
  }
}

@media (max-width: 575px) {
  .hero-content h1 {
    font-size: 2.1rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .form-row-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

.admin-row-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

.chart-report-bar-fill {
  height: 100%;
  border-radius: 4px;
  width: 0;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 992px) {
  .admin-row-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-container {
    height: auto;
    flex-direction: column;
    padding: 16px;
    gap: 12px;
    align-items: center;
  }
  .main-nav {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    justify-content: center;
  }
  .nav-links-group {
    flex-wrap: nowrap;
    gap: 4px;
  }
  .nav-link {
    font-size: 0.825rem;
    padding: 6px 12px;
    white-space: nowrap;
  }
  .header-right-buttons {
    width: 100%;
    justify-content: center;
    gap: 12px;
  }
}

/* ==========================================================================
   RTL (RIGHT-TO-LEFT) LAYOUT SYSTEM FOR ARABIC
   ========================================================================== */
html[dir="rtl"] {
  --font-family: 'Tajawal', system-ui, -apple-system, sans-serif;
}

html[dir="rtl"] body {
  font-family: var(--font-family);
  text-align: right;
}

/* Base structural flips */
html[dir="rtl"] .text-left {
  text-align: right !important;
}

html[dir="rtl"] .text-right {
  text-align: left !important;
}

/* Margin and padding flips */
html[dir="rtl"] .ms-auto {
  margin-right: auto !important;
  margin-left: unset !important;
}

html[dir="rtl"] .me-auto {
  margin-left: auto !important;
  margin-right: unset !important;
}

html[dir="rtl"] .me-2 {
  margin-left: 0.5rem !important;
  margin-right: unset !important;
}

html[dir="rtl"] .ms-2 {
  margin-right: 0.5rem !important;
  margin-left: unset !important;
}

/* Header & Navigation */
html[dir="rtl"] .header-logo {
  margin-right: 0;
  margin-left: auto;
}

html[dir="rtl"] .header-logo svg {
  margin-right: 0;
  margin-left: 12px;
}

html[dir="rtl"] .nav-link-trigger svg {
  margin-right: 0;
  margin-left: 8px;
}

html[dir="rtl"] #btn-language-toggle {
  margin-right: 0 !important;
  margin-left: 8px !important;
}

/* Forms and Inputs */
html[dir="rtl"] .form-group label,
html[dir="rtl"] .form-label {
  display: block;
  text-align: right;
}

html[dir="rtl"] .input-group-text {
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
  border-right: 1px solid var(--border-color);
  border-left: none;
}

html[dir="rtl"] .input-group .form-control {
  border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
}

/* Tables and Lists */
html[dir="rtl"] th, 
html[dir="rtl"] td {
  text-align: right;
}

/* Dashboard and Cards */
html[dir="rtl"] .stat-card-icon,
html[dir="rtl"] .action-stat-icon {
  margin-right: 0;
  margin-left: 16px;
}

html[dir="rtl"] .ticket-timeline-item {
  border-left: none;
  border-right: 2px solid var(--border-color);
  padding-left: 0;
  padding-right: 20px;
  text-align: right;
}

html[dir="rtl"] .ticket-timeline-badge {
  left: unset;
  right: -9px;
}

/* Dropdown positions */
html[dir="rtl"] .notifications-dropdown {
  right: unset !important;
  left: 0 !important;
}

html[dir="rtl"] .user-profile-dropdown {
  right: unset !important;
  left: 0 !important;
}

/* Toast container placement */
html[dir="rtl"] .toast-container {
  right: unset !important;
  left: 20px !important;
}

html[dir="rtl"] .toast-icon {
  margin-right: 0;
  margin-left: 12px;
}

html[dir="rtl"] .toast-close {
  margin-left: 0;
  margin-right: auto;
}

/* Dialog and Modal buttons alignment */
html[dir="rtl"] .modal-footer {
  justify-content: flex-start;
  gap: 12px;
}

html[dir="rtl"] .modal-close {
  right: unset !important;
  left: 20px !important;
}

/* Custom list bullet items */
html[dir="rtl"] ul {
  padding-left: 0;
  padding-right: 20px;
}

/* --- HERO CAROUSEL SLIDER --- */
.hero-slider-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  height: 380px;
  margin: 0 auto;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  background: #000;
}

.hero-slider-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  z-index: 1;
  transition: opacity 0.8s ease-in-out;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
}

.hero-slide.active {
  opacity: 1;
  z-index: 2;
}

.slide-caption {
  padding: 30px;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
  width: 100%;
  color: white;
  text-align: left;
  box-sizing: border-box;
}

.slide-caption h3 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 6px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.slide-caption p {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.9);
  margin: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.slider-btn:hover {
  background: rgba(0,0,0,0.8) !important;
}

.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 0.2s;
}

.slider-dot.active {
  background: var(--primary) !important;
  width: 24px;
  border-radius: 4px;
}

/* --- GALLERY VIEW --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 25px;
  margin-top: 25px;
}

.gallery-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--secondary);
}

.gallery-img-box {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  overflow: hidden;
  background: #f1f5f9;
}

.gallery-img-box img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-card:hover .gallery-img-box img {
  transform: scale(1.05);
}

.gallery-info {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.gallery-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.gallery-info .date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* RTL adaptations */
html[dir="rtl"] .slide-caption {
  text-align: right !important;
}

html[dir="rtl"] .hero-slider-container .prev-btn {
  left: unset !important;
  right: 15px !important;
}

html[dir="rtl"] .hero-slider-container .next-btn {
  right: unset !important;
  left: 15px !important;
}

/* --- DARK THEME STYLING OVERRIDES --- */
html[data-theme="dark"] {
  --bg-primary: #0f172a;        /* Dark Slate */
  --bg-secondary: #1e293b;      /* Slate Card Background */
  --bg-tertiary: #334155;       /* Slate Darker hover */
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --border-color: #334155;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.25), 0 2px 4px -1px rgba(0,0,0,0.15);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -2px rgba(0,0,0,0.2);
}

/* Specific overrides for dark mode cards and components */
html[data-theme="dark"] body {
  background-color: var(--bg-primary) !important;
}

html[data-theme="dark"] .action-tile-card {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
}

html[data-theme="dark"] .admin-card {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
}

html[data-theme="dark"] .stat-card {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
}

html[data-theme="dark"] .form-control {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .form-control:focus {
  border-color: var(--primary) !important;
}

html[data-theme="dark"] .login-card {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
}

html[data-theme="dark"] .modal-overlay {
  background: rgba(15, 23, 42, 0.85) !important;
}

html[data-theme="dark"] .data-table th {
  background: #334155 !important;
  color: #f8fafc !important;
  border-bottom: 2px solid #475569 !important;
}

html[data-theme="dark"] .data-table td {
  border-bottom: 1px solid #334155 !important;
}

html[data-theme="dark"] .data-table tr:hover {
  background: #334155 !important;
}

html[data-theme="dark"] .knowledge-card {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
}

html[data-theme="dark"] .dashboard-grid .stat-card {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
}

html[data-theme="dark"] .toast {
  background: #1e293b !important;
  border: 1px solid #334155 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .chat-bubble.agent {
  background: #1e293b !important;
  color: #cbd5e1 !important;
  border: 1px solid #334155 !important;
}

html[data-theme="dark"] .chat-bubble.user {
  background: var(--secondary) !important;
  color: white !important;
}

html[data-theme="dark"] .chat-input-area {
  background: var(--bg-secondary) !important;
  border-top: 1px solid var(--border-color) !important;
}

html[data-theme="dark"] .chat-input-area input {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] #btn-theme-toggle {
  border-color: #334155 !important;
}

html[data-theme="dark"] #btn-language-toggle {
  border-color: #334155 !important;
}

/* --- ULTRA-FAST HARDWARE ACCELERATION & COMPOSITING --- */
.hero-slide,
.action-tile-card,
.nav-dropdown-menu,
.profile-dropdown,
.modal-content,
.toast,
.gallery-card {
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Smooth micro-interactions */
.action-tile-card {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease !important;
}

.action-tile-card:hover {
  transform: translateY(-4px) translateZ(0) !important;
  box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.04) !important;
}

/* Optimized scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.7);
}

/* ==========================================================================
   COMPLETE MOBILE & TABLET RESPONSIVENESS SUITE (USER SITE & ADMIN PANEL)
   ========================================================================== */

/* --- TABLETS & MEDIUM MOBILE (max-width: 992px) --- */
@media (max-width: 992px) {
  .container {
    padding: 0 16px !important;
  }

  .admin-row-2,
  .dashboard-grid-2,
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 16px !important;
  }

  .admin-toolbar,
  .training-filters,
  .filter-bar {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  .form-row-2,
  .form-row-3 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .hero-slider-container {
    height: 300px !important;
  }

  .action-tiles-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
    gap: 16px !important;
  }
}

/* --- MOBILE PHONES & SMALL TABLETS (max-width: 768px) --- */
@media (max-width: 768px) {
  /* --- 1. Header & Mobile Navigation --- */
  .header-container {
    height: auto !important;
    flex-direction: column !important;
    padding: 10px 14px !important;
    gap: 8px !important;
    align-items: stretch !important;
  }

  .header-logo {
    width: 100% !important;
    justify-content: center !important;
  }

  .header-brand-text {
    text-align: center !important;
  }

  .header-brand-text h2 {
    font-size: 1.05rem !important;
  }

  .header-brand-text span {
    font-size: 0.65rem !important;
  }

  .main-nav {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 4px 0 !important;
    justify-content: flex-start !important;
  }

  .main-nav::-webkit-scrollbar {
    display: none !important;
  }

  .nav-links-group {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    width: max-content !important;
  }

  .nav-link {
    font-size: 0.8rem !important;
    padding: 6px 12px !important;
    white-space: nowrap !important;
  }

  .header-right-buttons {
    width: 100% !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin-top: 2px !important;
  }

  .header-right-buttons .btn {
    padding: 6px 10px !important;
    font-size: 0.78rem !important;
  }

  /* --- 2. Admin Management Mobile Dropdown --- */
  .nav-dropdown-menu {
    position: fixed !important;
    top: 130px !important;
    left: 4% !important;
    right: 4% !important;
    width: 92% !important;
    max-height: 70vh !important;
    overflow-y: auto !important;
    z-index: 2500 !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3) !important;
    border-radius: 12px !important;
    padding: 10px !important;
  }

  .nav-dropdown-item {
    padding: 11px 14px !important;
    font-size: 0.9rem !important;
  }

  /* --- 3. Mobile Section Titles & Toolbars --- */
  .section-title-wrapper {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .section-title-wrapper h2 {
    font-size: 1.3rem !important;
  }

  .section-title-wrapper p {
    font-size: 0.825rem !important;
  }

  .admin-card {
    padding: 14px !important;
    margin-bottom: 16px !important;
  }

  /* Mobile Inputs & Controls */
  .form-control,
  .form-group select,
  .form-group input,
  .form-group textarea {
    font-size: 16px !important; /* Prevents auto-zoom on mobile iOS */
    min-height: 42px !important;
  }

  .admin-toolbar,
  .training-filters,
  .filter-bar,
  .search-filter-box {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
    align-items: stretch !important;
  }

  .admin-toolbar .form-control,
  .admin-toolbar .btn,
  .training-filters .form-control,
  .training-filters .btn,
  .filter-bar .form-control,
  .filter-bar .btn {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* --- 4. Touch-Smooth Responsive Tables --- */
  .table-responsive,
  .table-container,
  .data-table-container,
  .admin-table-wrapper {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 8px !important;
    border: 1px solid var(--border-color) !important;
    margin-bottom: 16px !important;
  }

  .data-table {
    min-width: 650px !important; /* Ensures wide tables scroll smoothly on phone screens */
  }

  .data-table th {
    padding: 10px 10px !important;
    font-size: 0.78rem !important;
    white-space: nowrap !important;
  }

  .data-table td {
    padding: 10px 10px !important;
    font-size: 0.8rem !important;
    white-space: nowrap !important;
  }

  .btn-xs {
    padding: 5px 10px !important;
    font-size: 0.75rem !important;
  }

  /* --- 5. Homepage Tiles & Hero Slider --- */
  .action-tiles-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .action-tile-card {
    padding: 16px !important;
  }

  .hero-slider-container {
    height: 220px !important;
  }

  .slide-caption {
    padding: 16px !important;
  }

  .slide-caption h3 {
    font-size: 1.15rem !important;
  }

  .slide-caption p {
    font-size: 0.8rem !important;
  }

  /* --- 6. Mobile Modals & Popups --- */
  .modal-overlay {
    padding: 10px !important;
    align-items: center !important;
  }

  .modal-card,
  .modal-card-small,
  .login-card {
    width: 95% !important;
    max-width: 100% !important;
    margin: 10px auto !important;
    padding: 16px !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    border-radius: 12px !important;
  }

  .modal-header h3 {
    font-size: 1.1rem !important;
  }

  /* Modal grids collapse to 1 column on mobile */
  .modal-body div[style*="grid-template-columns"],
  #modal-website-qr div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Attendee row layout on small screens */
  .attendee-row {
    grid-template-columns: 1fr 1fr 28px !important;
    gap: 6px !important;
  }

  .attendee-row .att-status {
    grid-column: span 2;
  }

  /* --- 7. Mobile Footer Layout --- */
  .main-footer {
    padding: 30px 0 20px 0 !important;
  }

  .footer-container {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    text-align: center !important;
  }

  .footer-brand,
  .footer-links,
  .footer-contact {
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }

  .footer-links ul {
    padding: 0 !important;
    align-items: center !important;
  }

  .footer-bottom {
    flex-direction: column !important;
    gap: 10px !important;
    text-align: center !important;
  }
}

/* --- SMALL MOBILE PHONES (max-width: 480px) --- */
@media (max-width: 480px) {
  .header-brand-text h2 {
    font-size: 0.95rem !important;
  }

  .stat-card {
    padding: 10px !important;
  }

  .stat-card-number {
    font-size: 1.2rem !important;
  }

  .btn {
    padding: 8px 14px !important;
    font-size: 0.825rem !important;
  }

  .modal-card {
    padding: 12px !important;
  }
}




