/**
 * Football Academy & Field Rental Management System
 * Pure CSS Modern Design System - RTL & LTR Unified
 */

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

:root {
  /* Brand Color Palette */
  --primary-50: #ecfdf5;
  --primary-100: #d1fae5;
  --primary-500: #10b981;
  --primary-600: #059669;
  --primary-700: #047857;
  --primary-900: #064e3b;

  --accent-gold: #f59e0b;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-purple: #8b5cf6;

  /* Surfaces & Dark Theme Navy */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0b1329;
  --bg-sidebar-hover: #162044;
  --bg-sidebar-active: #10b981;
  --bg-topbar: #ffffff;

  --border-light: #e2e8f0;
  --border-subtle: #edf2f7;

  /* Text Colors */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-white: #ffffff;
  --text-sidebar: #94a3b8;
  --text-sidebar-hover: #ffffff;

  /* Status Colors */
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --info: #0ea5e9;
  --info-bg: #e0f2fe;

  /* Typography */
  --font-arabic: 'Cairo', system-ui, -apple-system, sans-serif;
  --font-english: 'Inter', system-ui, -apple-system, sans-serif;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 15px rgba(16, 185, 129, 0.25);

  /* Layout Measurements */
  --sidebar-width: 270px;
  --topbar-height: 70px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* Semantic Color Aliases for Full Blade Compatibility */
  --color-primary: var(--primary-600);
  --color-primary-hover: var(--primary-700);
  --color-primary-light: var(--primary-50);
  --color-bg-base: #f8fafc;
  --color-bg-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-border-subtle: #f1f5f9;
  --color-text-main: var(--text-primary);
  --color-text-primary: var(--text-primary);
  --color-text-secondary: var(--text-secondary);
  --color-text-muted: var(--text-muted);
  --color-danger: var(--danger);
  --color-danger-bg: var(--danger-bg);
  --color-success: var(--success);
  --color-success-bg: var(--success-bg);
  --color-warning: var(--warning);
  --color-warning-bg: var(--warning-bg);
  --color-info: var(--info);
  --color-info-bg: var(--info-bg);
}

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

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-arabic);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

[dir="ltr"] body {
  font-family: var(--font-english);
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* App Wrapper Layout */
.app-container {
  display: flex;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Sidebar Styles */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  z-index: 50;
  transition: transform 0.3s ease;
  overflow-y: auto;
  border-inline-end: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.35rem;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

.sidebar-brand-text h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.2;
}

.sidebar-brand-text span {
  font-size: 0.75rem;
  color: var(--primary-500);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.nav-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  color: #64748b;
  padding: 0.75rem 0.85rem 0.35rem;
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-md);
  color: var(--text-sidebar);
  font-weight: 500;
  font-size: 0.92rem;
  transition: var(--transition);
}

.nav-item:hover {
  background-color: var(--bg-sidebar-hover);
  color: var(--text-sidebar-hover);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  font-weight: 600;
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.nav-badge {
  margin-inline-start: auto;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  background-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.nav-item.active .nav-badge {
  background-color: rgba(255, 255, 255, 0.25);
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  margin-inline-start: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  background-color: var(--bg-main);
  transition: margin-inline-start 0.3s ease;
}

/* Topbar Navigation */
.topbar {
  height: var(--topbar-height);
  background-color: var(--bg-topbar);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.sidebar-toggle-btn {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
}

.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.page-breadcrumb .current {
  color: var(--text-primary);
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lang-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background-color: var(--bg-main);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
}

.lang-switch-btn:hover {
  background-color: #e2e8f0;
  color: var(--text-primary);
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  background-color: #ffffff;
  cursor: pointer;
  transition: var(--transition);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

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

/* Page Content Container */
.content-body {
  padding: 2rem;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title-box h1 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.page-title-box p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-top: 0.25rem;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Card & Panels */
.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  transition: var(--transition);
  margin-bottom: 1.5rem;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.card-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #ffffff;
}

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

.card-body {
  padding: 1.75rem 2rem;
}

/* Automatic generous padding for forms placed directly inside .card */
.card > form:not(.no-padding) {
  padding: 1.75rem 2rem;
}

.card-body > form {
  padding: 0;
}

.card-footer {
  padding: 1.15rem 1.75rem;
  border-top: 1px solid var(--border-light);
  background-color: #f8fafc;
}

/* Stat Widgets Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: 4px;
  height: 100%;
  background-color: var(--stat-color, var(--primary-500));
}

.stat-card.emerald { --stat-color: #10b981; }
.stat-card.blue { --stat-color: #3b82f6; }
.stat-card.amber { --stat-color: #f59e0b; }
.stat-card.rose { --stat-color: #ef4444; }
.stat-card.purple { --stat-color: #8b5cf6; }

.stat-info .stat-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-info .stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0.25rem 0 0.15rem;
  line-height: 1.1;
}

.stat-info .stat-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
}

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

.stat-card.emerald .stat-icon { --stat-bg: #ecfdf5; --stat-color: #059669; }
.stat-card.blue .stat-icon { --stat-bg: #eff6ff; --stat-color: #2563eb; }
.stat-card.amber .stat-icon { --stat-bg: #fffbeb; --stat-color: #d97706; }
.stat-card.rose .stat-icon { --stat-bg: #fef2f2; --stat-color: #dc2626; }
.stat-card.purple .stat-icon { --stat-bg: #f5f3ff; --stat-color: #7c3aed; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  line-height: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: var(--text-secondary);
  border-color: var(--border-light);
}

.btn-secondary:hover {
  background-color: #e2e8f0;
  color: var(--text-primary);
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

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

.data-table th {
  background-color: #f8fafc;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.9rem;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: var(--transition);
}

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

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

/* Modern Pure CSS Pagination */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem 0.5rem;
}

.pagination-info {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.pagination-info strong {
  color: var(--text-primary);
  font-weight: 700;
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.page-item {
  display: inline-flex;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  user-select: none;
}

.page-link:hover {
  background-color: var(--primary-50);
  border-color: var(--primary-500);
  color: var(--primary-700);
}

.page-item.active .page-link {
  background-color: var(--primary-600);
  border-color: var(--primary-600);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.page-item.disabled .page-link {
  color: #94a3b8;
  background-color: #f8fafc;
  border-color: #e2e8f0;
  cursor: not-allowed;
  pointer-events: none;
}

/* Guard: Constrain any SVGs inside pagination / navigation to prevent giant unstyled arrows */
nav[role="navigation"] svg,
.pagination svg {
  width: 1.25rem !important;
  height: 1.25rem !important;
  max-width: 1.25rem !important;
  max-height: 1.25rem !important;
  display: inline-block !important;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.badge-success { background-color: var(--success-bg); color: #065f46; }
.badge-warning { background-color: var(--warning-bg); color: #92400e; }
.badge-danger { background-color: var(--danger-bg); color: #991b1b; }
.badge-info { background-color: var(--info-bg); color: #075985; }
.badge-secondary { background-color: #f1f5f9; color: #475569; }

.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background-color: currentColor;
}

/* Tabs Component */
.tabs-container {
  margin-bottom: 2rem;
}

.tabs-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs-nav::-webkit-scrollbar {
  display: none;
}

.tab-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.tab-nav-btn:hover {
  color: var(--primary-600);
  background-color: rgba(16, 185, 129, 0.05);
}

.tab-nav-btn.active {
  color: var(--primary-700);
  border-bottom-color: var(--primary-600);
  background-color: #ffffff;
  font-weight: 700;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.02);
}

.tab-pane {
  display: none;
  animation: fadeInTab 0.25s ease;
}

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

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

/* Forms & Input Controls */
.form-group {
  margin-bottom: 1.35rem;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.form-label span[style*="color-danger"],
.form-label span[style*="danger"] {
  color: var(--danger) !important;
  font-weight: 700;
}

.form-control {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-size: 0.925rem;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  background-color: #ffffff;
  color: var(--text-primary);
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.form-control::placeholder {
  color: #94a3b8;
  opacity: 0.9;
}

.form-control:hover {
  border-color: #94a3b8;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-500);
  background-color: #ffffff;
  box-shadow: 0 0 0 3.5px rgba(16, 185, 129, 0.18);
}

textarea.form-control {
  min-height: 95px;
  resize: vertical;
  line-height: 1.6;
}

/* Custom Styled Select with Modern SVG Chevron */
select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23475569'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.9rem center;
  background-size: 1.15rem;
  padding-inline-end: 1rem;
  padding-inline-start: 2.5rem;
  cursor: pointer;
  line-height: 1.5;
}

[dir="ltr"] select.form-control,
html[dir="ltr"] select.form-control {
  background-position: right 0.9rem center;
  padding-inline-start: 1rem;
  padding-inline-end: 2.5rem;
}

select.form-control:disabled {
  background-color: #f1f5f9;
  cursor: not-allowed;
  opacity: 0.7;
}

.form-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.form-error {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--danger);
  margin-top: 0.35rem;
  display: block;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  background-color: #ffffff;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-input-wrapper input {
  padding-inline-start: 2.25rem;
}

.search-icon {
  position: absolute;
  top: 50%;
  inset-inline-start: 0.75rem;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Alerts */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
}

.alert-success { background-color: var(--success-bg); color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background-color: var(--danger-bg); color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background-color: var(--warning-bg); color: #92400e; border: 1px solid #fde68a; }
.alert-info { background-color: var(--info-bg); color: #075985; border: 1px solid #bae6fd; }

.alert-close {
  background: transparent;
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
}

.alert-close:hover { opacity: 1; }

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
}

.empty-icon {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.empty-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.empty-description {
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop.show {
  display: flex;
}

.modal-dialog {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 550px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: modalSlide 0.2s ease-out;
}

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

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  background-color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Auth Layout */
.auth-page {
  min-height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top right, #111c44, #0b1329 80%);
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  position: relative;
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo .icon-box {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-glow);
}

.auth-logo h1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

.auth-logo p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ==========================================================================
   Mobile Sidebar Overlay Backdrop
   ========================================================================== */
#sidebarOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(11, 19, 41, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 45;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#sidebarOverlay.show {
  display: block;
  opacity: 1;
}

/* ==========================================================================
   Demo Mode Read-Only Banner Component
   ========================================================================== */
.demo-read-only-banner {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1.5px solid #fcd34d;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.demo-banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.demo-banner-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.demo-banner-title {
  font-weight: 800;
  color: #92400e;
  font-size: 0.92rem;
}

.demo-banner-desc {
  font-size: 0.82rem;
  color: #b45309;
  margin-top: 0.15rem;
  line-height: 1.4;
}

.demo-banner-badge {
  font-size: 0.75rem;
  white-space: nowrap;
  font-weight: 700;
  flex-shrink: 0;
}

/* ==========================================================================
   Dashboard Hero Banner & Split Grids
   ========================================================================== */
.dashboard-hero-card {
  background: linear-gradient(135deg, #0b1329 0%, #1e293b 100%);
  color: white;
  border: none;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.dashboard-hero-bg-icon {
  position: absolute;
  inset-inline-end: -20px;
  top: -20px;
  font-size: 8rem;
  opacity: 0.05;
  pointer-events: none;
}

.dashboard-hero-body {
  padding: 2rem 1.75rem;
}

.dashboard-hero-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: white;
  line-height: 1.3;
}

.dashboard-split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

/* ==========================================================================
   Comprehensive Responsive Breakpoints (Tablets & Mobile)
   ========================================================================== */

/* Tablets & Small Laptops (max-width: 1024px) */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(100%);
  }
  [dir="ltr"] .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-inline-start: 0;
  }
  .sidebar-toggle-btn {
    display: inline-flex;
  }
  .topbar {
    padding: 0 1rem;
  }
  .content-body {
    padding: 1.25rem;
  }
}

/* Standard Mobile Devices (max-width: 768px) */
@media (max-width: 768px) {
  /* Layout & Topbar */
  .topbar {
    height: 58px;
    padding: 0 0.75rem;
    gap: 0.5rem;
  }

  .topbar-left {
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
  }

  /* Breadcrumb Mobile Optimization */
  .page-breadcrumb .breadcrumb-app-name,
  .page-breadcrumb .breadcrumb-sep {
    display: none;
  }

  .page-breadcrumb .current {
    font-size: 0.85rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Topbar Right Controls */
  .topbar-right {
    gap: 0.35rem;
    flex-shrink: 0;
  }

  /* Language Switcher Compact */
  .lang-switch-btn {
    padding: 0.35rem 0.5rem;
    min-width: auto;
  }
  .lang-switch-btn .lang-text {
    display: none;
  }
  .lang-switch-btn .lang-flag {
    font-size: 1.1rem;
  }

  /* User Profile Menu Compact (Hide text on mobile to prevent overflow) */
  .user-profile-menu {
    padding: 0;
    border: none;
    background: transparent;
  }
  .user-profile-menu .user-info {
    display: none !important;
  }
  .user-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.82rem;
  }

  .logout-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: var(--radius-full);
  }

  .notification-bell-btn {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  /* Content & Spacing */
  .content-body {
    padding: 0.85rem;
  }

  /* Demo Read-Only Banner Mobile */
  .demo-read-only-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    gap: 0.65rem;
    margin-bottom: 1rem;
  }
  .demo-banner-badge {
    align-self: flex-start;
  }

  /* Dashboard Hero Mobile */
  .dashboard-hero-body {
    padding: 1.25rem 1rem;
  }
  .dashboard-hero-title {
    font-size: 1.25rem;
    line-height: 1.35;
  }

  /* Cards & Forms */
  .card {
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
  }
  .card-header {
    padding: 0.85rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .card-title {
    font-size: 1rem;
  }
  .card-body {
    padding: 1rem;
  }
  .card > form:not(.no-padding) {
    padding: 1rem;
  }

  /* Grids */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }
  .stat-card {
    padding: 1rem 1.15rem;
  }
  .stat-info .stat-value {
    font-size: 1.5rem;
  }

  .dashboard-split-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
  }

  /* Tables Mobile Touch Optimization */
  .table-responsive {
    border-radius: var(--radius-sm);
  }
  .data-table th,
  .data-table td {
    padding: 0.65rem 0.75rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  /* Form Elements */
  .form-row {
    flex-direction: column;
    gap: 0.75rem;
  }
  .form-group {
    margin-bottom: 1rem;
  }

  /* Page Header */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }
  .page-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .page-actions .btn {
    flex: 1;
    min-width: 120px;
  }
}

/* Small Smart Phones (max-width: 480px) */
@media (max-width: 480px) {
  .topbar {
    padding: 0 0.5rem;
  }

  .page-breadcrumb {
    display: none;
  }

  .notifications-dropdown {
    width: 300px;
    max-width: 95vw;
  }

  .auth-card {
    padding: 1.5rem 1.25rem;
  }

  .stat-card {
    padding: 0.85rem 1rem;
  }

  .stat-icon {
    width: 42px;
    height: 42px;
    font-size: 1.25rem;
  }
}

/* ==========================================================================
   Notifications Bell & Dropdown Styles (Pure CSS)
   ========================================================================== */
.topbar-notifications {
  position: relative;
}

.notification-bell-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  background-color: var(--bg-main);
  color: var(--text-secondary);
  font-size: 1.15rem;
  cursor: pointer;
  transition: var(--transition);
}

.notification-bell-btn:hover {
  background-color: #e2e8f0;
  color: var(--text-primary);
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: #ef4444;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #ffffff;
  animation: pulse-badge 2s infinite ease-in-out;
}

[dir="rtl"] .notification-badge {
  right: auto;
  left: -4px;
}

@keyframes pulse-badge {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

.notifications-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  max-width: 90vw;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  z-index: 100;
  display: none;
  overflow: hidden;
}

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

.notifications-dropdown.show {
  display: block;
  animation: dropdown-fade-in 0.2s ease-out;
}

@keyframes dropdown-fade-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notifications-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-light);
  background-color: #ffffff;
}

.notifications-dropdown-header h4 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.notifications-dropdown-body {
  max-height: 360px;
  overflow-y: auto;
}

.dropdown-notification-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}

.dropdown-notification-item:hover {
  background-color: #f8fafc;
}

.dropdown-notification-item.unread {
  background-color: rgba(16, 185, 129, 0.04);
}

.dropdown-notification-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.dropdown-notification-item.unread .dropdown-notification-icon {
  background-color: rgba(16, 185, 129, 0.12);
}

.dropdown-notification-content {
  flex: 1;
  min-width: 0;
}

.dropdown-notification-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.dropdown-notification-message {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0 0 0.25rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dropdown-notification-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.notifications-dropdown-footer {
  padding: 0.65rem 1rem;
  text-align: center;
  border-top: 1px solid var(--border-light);
  background-color: var(--bg-main);
}

.notifications-dropdown-footer a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-600);
  text-decoration: none;
}

.notifications-dropdown-footer a:hover {
  text-decoration: underline;
}

