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

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

:root {
  --primary: #4f46e5;
  --primary-light: #818cf8;
  --primary-dark: #3730a3;
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --success: #059669;
  --success-light: #d1fae5;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --warning-bg: #fffbeb;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --sidebar-bg: #0f172a;
  --sidebar-active: rgba(79, 70, 229, 0.2);
  --sidebar-border: rgba(255,255,255,0.08);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --radius: 10px;
  --radius-lg: 14px;
  --transition: 0.2s ease;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gray-100);
  color: var(--gray-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ─── Sidebar ─── */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  color: #fff;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar.transitions-enabled {
  transition: width 0.25s ease;
}

.sidebar-brand {
  padding: 1.5rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 72px;
}

.sidebar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-brand .brand-text {
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.2s ease, width 0.25s ease;
}

.sidebar-brand h1 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.sidebar-brand .brand-sub {
  font-size: 0.7rem;
  color: var(--gray-400);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 1px;
}

.sidebar nav {
  padding: 0.75rem 0;
  flex: 1;
}

.sidebar-section {
  padding: 0.5rem 1.5rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  margin-top: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.5rem;
  color: var(--gray-400);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  margin: 1px 0;
  white-space: nowrap;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.sidebar nav a svg {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
  transition: opacity var(--transition);
}

.sidebar nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
  border-left-color: var(--gray-600);
}

.sidebar nav a:hover svg {
  opacity: 1;
}

.sidebar nav a.active {
  color: #fff;
  background: var(--sidebar-active);
  border-left-color: var(--primary-light);
}

.sidebar nav a.active svg {
  opacity: 1;
  color: var(--primary-light);
}

/* ─── Sidebar collapse toggle ─── */
.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  gap: 0.5rem;
}

.sidebar.collapsed .sidebar-footer {
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-collapse-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: var(--gray-400);
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
}

.sidebar-collapse-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.sidebar-collapse-btn svg {
  transition: transform 0.25s ease;
}

/* ─── Collapsed state ─── */
.sidebar.collapsed {
  width: 72px;
}

.sidebar.collapsed .sidebar-brand {
  padding: 1.5rem 0 1.25rem;
  justify-content: center;
  gap: 0;
}

.sidebar.collapsed .brand-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
  position: absolute;
  pointer-events: none;
}

.sidebar.collapsed .sidebar-section {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
  pointer-events: none;
}

.sidebar.collapsed nav a {
  justify-content: center;
  padding: 0.7rem 0;
  border-left-color: transparent;
  gap: 0;
}

.sidebar.collapsed nav a span {
  display: none;
}

.sidebar.collapsed nav a.active {
  border-left-color: transparent;
  border-radius: 0;
}

.sidebar.collapsed .sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

.app.sidebar-collapsed .main-content {
  margin-left: 72px;
}

/* ─── Main Content ─── */
.main-content {
  flex: 1;
  padding: 2rem 2.5rem;
  margin-left: 260px;
  max-width: 1280px;
  min-height: 100vh;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--gray-900);
}

.page-header p {
  color: var(--gray-500);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.main-content h2 {
  margin-bottom: 1.5rem;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ─── Cards ─── */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.card:hover {
  box-shadow: var(--shadow);
}

.card h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  opacity: 0;
  transition: opacity var(--transition);
}

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

.stat-card:hover::before {
  opacity: 1;
}

.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.stat-card .stat-icon.blue   { background: var(--primary-50); color: var(--primary); }
.stat-card .stat-icon.green  { background: var(--success-light); color: var(--success); }
.stat-card .stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-card .stat-icon.red    { background: var(--danger-light); color: var(--danger); }

.stat-card .label {
  font-size: 0.78rem;
  color: var(--gray-500);
  margin-bottom: 0.35rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-card .value {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--gray-900);
  line-height: 1.1;
}

.stat-card .stat-sub {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 0.35rem;
}

/* ─── Dashboard Layout ─── */
.dashboard-greeting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.dashboard-greeting h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0;
}
.dashboard-greeting p {
  color: var(--gray-500);
  margin: 0;
  font-size: 0.9rem;
}

.stat-card .stat-value-group {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}
.stat-card .stat-value-group .value {
  margin: 0;
}
.stat-card .stat-value-group .stat-total {
  font-size: 1rem;
  color: var(--gray-400);
  font-weight: 500;
}

.stat-progress {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  margin-top: 0.6rem;
  overflow: hidden;
}
.stat-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--primary);
  transition: width 0.8s ease;
}

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

.chart-container {
  position: relative;
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
}

.activity-feed {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 400px;
  overflow-y: auto;
}
.activity-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--gray-100);
}
.activity-item:last-child {
  border-bottom: none;
}
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.activity-dot.on-time { background: var(--success); }
.activity-dot.late { background: var(--warning); }
.activity-info {
  flex: 1;
  min-width: 0;
}
.activity-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--gray-800);
}
.activity-detail {
  font-size: 0.78rem;
  color: var(--gray-500);
}
.activity-time {
  font-size: 0.8rem;
  color: var(--gray-400);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.activity-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}
.activity-badge.on-time {
  background: var(--success-light);
  color: var(--success);
}
.activity-badge.late {
  background: var(--warning-light);
  color: var(--warning);
}

.weekly-chart-container {
  position: relative;
  width: 100%;
  height: 200px;
}

.sync-controls .section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.sync-status-bar {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 0.5rem;
}
.sync-controls details {
  margin-top: 0.75rem;
}
.sync-controls summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-600);
  padding: 0.35rem 0;
  user-select: none;
}
.sync-controls summary:hover {
  color: var(--primary);
}

.no-activity {
  text-align: center;
  color: var(--gray-400);
  font-size: 0.875rem;
  padding: 2rem 0;
}

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

/* ─── Tables ─── */
.table-container {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

th, td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-100);
}

th {
  background: var(--gray-50);
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

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

tr:hover td {
  background: var(--gray-50);
}

td {
  font-size: 0.875rem;
  color: var(--gray-700);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Table responsive wrapper ─── */
.table-responsive {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  resize: both;
  min-height: 120px;
}
.table-responsive table {
  border: none;
  border-radius: 0;
  box-shadow: none;
  min-width: 600px;
}

/* ─── Sortable headers ─── */
th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 1.5rem;
  transition: color 0.15s;
}
th.sortable:hover {
  color: var(--primary);
}
th.sortable::after {
  content: '⇅';
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  opacity: 0.35;
  transition: opacity 0.15s;
}
th.sortable:hover::after {
  opacity: 0.65;
}
th.sort-asc::after {
  content: '▲';
  opacity: 0.85;
  color: var(--primary);
}
th.sort-desc::after {
  content: '▼';
  opacity: 0.85;
  color: var(--primary);
}

/* ─── Column resize handles ─── */
.col-resize-handle {
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
  user-select: none;
}
.col-resize-handle::after {
  content: '';
  position: absolute;
  top: 25%;
  right: 2px;
  width: 2px;
  height: 50%;
  border-radius: 1px;
  background: var(--gray-300);
  opacity: 0;
  transition: opacity 0.15s;
}
th:hover .col-resize-handle::after,
.col-resize-handle.active::after {
  opacity: 1;
}
.col-resize-handle.active::after {
  background: var(--primary);
}
[dir="rtl"] .col-resize-handle {
  right: auto;
  left: -3px;
}

/* ─── Pagination ─── */
.table-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  font-size: 0.8rem;
  color: var(--gray-500);
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.pager-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.9rem;
  height: 1.9rem;
  padding: 0 0.45rem;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  background: #fff;
  color: var(--gray-600);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}
.pager-btn:hover:not(:disabled) {
  border-color: var(--primary-light);
  color: var(--primary);
  background: var(--primary-50);
}
.pager-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
}
.pager-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pager-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  color: var(--gray-400);
  font-size: 0.85rem;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
  text-decoration: none;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.3);
}
.btn-success:hover {
  background: #047857;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
  transform: translateY(-1px);
}

.btn-danger {
  background: #fff;
  color: var(--danger);
  border: 1px solid var(--gray-200);
}
.btn-danger:hover {
  background: var(--danger-light);
  border-color: var(--danger);
}

.btn-danger-outline {
  background: #fff;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-danger-outline:hover {
  background: var(--danger);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}
.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  padding: 0.4rem 0.6rem;
}
.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  border-radius: 6px;
}

.btn-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Action cell buttons inline */
td .btn-group {
  display: inline-flex;
}

/* Icon-only action buttons */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  background: #fff;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--gray-500);
}

.btn-icon svg {
  width: 15px;
  height: 15px;
}

.btn-icon:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  color: var(--gray-700);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-icon.btn-icon-danger:hover {
  background: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}

/* ─── Forms ─── */
.form-group {
  margin-bottom: 1.15rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.4rem;
  font-size: 0.835rem;
  color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--gray-900);
  background: #fff;
  transition: all var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
}

.form-group input::placeholder {
  color: var(--gray-400);
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 180px;
}

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge-success { background: var(--success-light); color: #065f46; }
.badge-danger  { background: var(--danger-light); color: #991b1b; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-info    { background: var(--primary-50); color: var(--primary-dark); }

/* ─── Status indicators ─── */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.4rem;
}

.status-dot.online  { background: var(--success); box-shadow: 0 0 0 3px var(--success-light); }
.status-dot.offline { background: var(--gray-400); }
.status-dot.warning { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-light); }

/* ─── Auto-filled cell highlight ─── */
.auto-filled {
  background: var(--warning-bg);
  font-style: italic;
}

/* ─── Flag Pills ─── */
.flag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.flag-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.flag-danger  { background: var(--danger-light); color: #991b1b; }
.flag-warning { background: var(--warning-light); color: #92400e; }
.flag-info    { background: var(--primary-50); color: var(--primary-dark); }
.flag-default { background: var(--gray-100); color: var(--gray-600); }

/* ─── Spinner ─── */
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-lg {
  width: 2rem;
  height: 2rem;
  border-width: 3px;
}

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

/* Page spinner */
.page-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--gray-400);
  gap: 1rem;
  font-size: 0.875rem;
}

/* ─── Skeleton / Shimmer Loading ─── */
.skeleton {
  background: var(--gray-200);
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
  display: inline-block;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 0.875rem;
  width: 100%;
  margin-bottom: 0.5rem;
}

.skeleton-text-sm {
  height: 0.7rem;
  width: 60%;
}

.skeleton-text-lg {
  height: 1.5rem;
  width: 40%;
}

.skeleton-badge {
  height: 1.4rem;
  width: 4.5rem;
  border-radius: 999px;
}

.skeleton-circle {
  border-radius: 50%;
}

.skeleton-btn {
  height: 2rem;
  width: 2rem;
  border-radius: 8px;
}

/* Skeleton stat card - replaces stat-card content while loading */
.stat-card .skeleton-value {
  height: 1.75rem;
  width: 3rem;
  margin: 0.35rem 0;
}

.stat-card .skeleton-sub {
  height: 0.7rem;
  width: 5rem;
}

/* Skeleton table rows */
.skeleton-row td {
  padding: 0.85rem 1rem;
}

.skeleton-row .skeleton {
  animation-delay: calc(var(--row) * 0.08s);
}

/* ─── Filter bar ─── */
.filter-bar {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.filter-bar .form-group {
  margin-bottom: 0;
}

.filter-bar .form-group:has(#filter-employee-ms) {
  min-width: 260px;
}

.filter-bar .form-group:has(#filter-flags-ms) {
  min-width: 200px;
}

.filter-bar input,
.filter-bar select,
.filter-bar .ms-trigger {
  height: 2.375rem;
}

/* ─── Modal ─── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.15s ease;
}

.modal-overlay.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 0;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}

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

.modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.modal-body {
  padding: 1.5rem;
}

.modal h3 {
  margin-bottom: 1rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gray-100);
}

/* ─── Custom Confirm / Alert Dialog ─── */
.confirm-dialog {
  max-width: 420px;
}

.confirm-dialog-body {
  padding: 1.75rem 1.5rem 0.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.confirm-dialog-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-dialog-content {
  flex: 1;
  min-width: 0;
}

.confirm-dialog-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: var(--gray-900);
}

.confirm-dialog-message {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--gray-600);
  margin: 0;
  white-space: pre-line;
}

.confirm-dialog .modal-actions {
  padding: 1rem 1.5rem 1.25rem;
  margin-top: 1rem;
}

/* ─── Page Transition ─── */
.main-content {
  animation: pageFadeIn 0.18s ease-out;
}

@keyframes pageFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── Toast notifications ─── */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 280px;
  max-width: 420px;
  animation: toastIn 0.3s ease;
  pointer-events: auto;
}

.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-error   { border-left: 4px solid var(--danger); }
.toast.toast-warning { border-left: 4px solid var(--warning); }
.toast.toast-info    { border-left: 4px solid var(--primary); }

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

.toast.hiding {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(30px); }
}

/* ─── Empty state ─── */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--gray-400);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 0.35rem;
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--gray-400);
}

/* ─── Section toolbar ─── */
.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-toolbar h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  padding: 0.4rem 0.75rem;
}
.search-box svg { color: var(--gray-400); flex-shrink: 0; }
.search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.875rem;
  color: var(--gray-800);
  width: 200px;
}
.search-box input::placeholder { color: var(--gray-400); }

/* ─── Utility ─── */
.text-muted { color: var(--gray-500); }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }

/* ─── Bulk Assign ─── */
.bulk-employee-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.bulk-search-wrap {
  position: relative;
  flex: 1;
}

.bulk-search-wrap svg {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
}

.bulk-search-wrap input {
  width: 100%;
  padding-left: 2rem;
}

.bulk-select-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.btn-sm {
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
}

.bulk-employee-counter {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.bulk-employee-list {
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}

.bulk-employee-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid var(--gray-100);
  user-select: none;
}

.bulk-employee-item:last-child {
  border-bottom: none;
}

.bulk-employee-item:hover {
  background: var(--gray-50);
}

.bulk-employee-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.bulk-employee-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.bulk-employee-name {
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--gray-800);
}

.bulk-employee-detail {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.bulk-empty {
  padding: 2rem;
  text-align: center;
  color: var(--gray-400);
  font-size: 0.85rem;
}
.gap-3 { gap: 0.75rem; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .sidebar {
    width: 72px;
  }
  .sidebar .sidebar-brand {
    padding: 1.5rem 0;
    justify-content: center;
  }
  .sidebar .brand-text {
    display: none;
  }
  .sidebar .sidebar-section {
    display: none;
  }
  .sidebar nav a {
    justify-content: center;
    padding: 0.7rem 0;
    border-left-color: transparent;
    gap: 0;
  }
  .sidebar nav a span {
    display: none;
  }
  .sidebar .sidebar-footer {
    display: none;
  }
  .main-content {
    margin-left: 72px;
    padding: 1.25rem;
  }
  .stats-row {
    grid-template-columns: 1fr 1fr;
  }
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .sidebar {
    display: none;
  }
  .main-content {
    margin-left: 0;
    padding: 1rem;
  }
  .stats-row {
    grid-template-columns: 1fr;
  }
}

/* ─── Toggle Switch ─── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--gray-300);
  border-radius: 24px;
  transition: background 0.25s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}

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

/* ─── Auto-sync status indicator ─── */
.auto-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.auto-sync-badge.active {
  background: var(--success-light);
  color: #065f46;
}

.auto-sync-badge.inactive {
  background: var(--gray-100);
  color: var(--gray-500);
}

.auto-sync-badge .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.auto-sync-badge.active .pulse-dot {
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ---------- Print Styles ---------- */
@media print {
  body { background: #fff; }
  .sidebar, .page-header, .toast-container,
  .btn-group, .form-row, .card > h3:first-child { display: none !important; }
  .stats-row { display: flex !important; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
  .stat-card { box-shadow: none; border: 1px solid #ccc; padding: 0.4rem 0.6rem; flex: 1 1 0; min-width: 120px; }
  .stat-card .stat-icon { display: none; }
  .stat-card .label { font-size: 9pt; }
  .stat-card .value { font-size: 14pt; }
  .stat-card .stat-sub { font-size: 8pt; }
  .app { display: block; }
  .main-content { margin-left: 0; padding: 0; }
  .card { box-shadow: none; border: none; padding: 0; margin: 0; }
  #report-output { display: block !important; }
  #report-output .card { margin-bottom: 0; }
  #report-title { display: block !important; font-size: 18pt; margin-bottom: 0.5rem; }
  table { width: 100%; border-collapse: collapse; font-size: 10pt; }
  th, td { border: 1px solid #ccc; padding: 4px 8px; text-align: left; }
  th { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  [dir="rtl"] th, [dir="rtl"] td { text-align: right; }
  [dir="rtl"] .main-content { margin-left: 0; margin-right: 0; }
}

/* ─── RTL Support ─── */
[dir="rtl"] body {
  font-family: 'Noto Sans Arabic', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
}

[dir="rtl"] .sidebar nav a {
  border-left: none;
  border-right: 3px solid transparent;
}

[dir="rtl"] .sidebar nav a:hover {
  border-left-color: transparent;
  border-right-color: var(--gray-600);
}

[dir="rtl"] .sidebar nav a.active {
  border-left-color: transparent;
  border-right-color: var(--primary-light);
}

[dir="rtl"] .sidebar.collapsed nav a.active {
  border-right-color: transparent;
}

[dir="rtl"] .sidebar-footer {
  flex-direction: row-reverse;
}

[dir="rtl"] .sidebar.collapsed .sidebar-footer {
  flex-direction: column;
}

[dir="rtl"] .sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

[dir="rtl"] .sidebar.collapsed .sidebar-collapse-btn svg {
  transform: rotate(0deg);
}

[dir="rtl"] .main-content {
  margin-left: 0;
  margin-right: 260px;
}

[dir="rtl"] .app.sidebar-collapsed .main-content {
  margin-left: 0;
  margin-right: 72px;
}

[dir="rtl"] table th,
[dir="rtl"] table td {
  text-align: right;
}

[dir="rtl"] .filter-bar {
  direction: rtl;
}

[dir="rtl"] .form-row {
  direction: rtl;
}

[dir="rtl"] .btn-group {
  direction: rtl;
}

[dir="rtl"] .modal-actions {
  direction: rtl;
}

[dir="rtl"] .page-header {
  text-align: right;
}

[dir="rtl"] .stat-card {
  text-align: right;
}

[dir="rtl"] .section-toolbar {
  direction: rtl;
}

[dir="rtl"] .toast {
  direction: rtl;
}

@media (max-width: 900px) {
  [dir="rtl"] .main-content {
    margin-right: 72px;
    margin-left: 0;
  }
}

@media (max-width: 600px) {
  [dir="rtl"] .main-content {
    margin-right: 0;
  }
}

/* ── Searchable Select ────────────────────────────────── */
.ss-container {
  position: relative;
  width: 100%;
}

.ss-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--gray-900);
  background: #fff;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 2.25rem;
  box-sizing: border-box;
  gap: 0.5rem;
}

.ss-trigger:hover {
  border-color: var(--gray-400);
}

.ss-trigger:focus,
.ss-container.ss-open .ss-trigger {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
}

.ss-display {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ss-display.ss-placeholder {
  color: var(--gray-500);
}

.ss-arrow {
  flex-shrink: 0;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.ss-container.ss-open .ss-arrow {
  transform: rotate(180deg);
}

.ss-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.ss-container.ss-open .ss-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ss-container.ss-above .ss-dropdown {
  top: auto;
  bottom: calc(100% + 4px);
  transform: translateY(4px);
}

.ss-container.ss-above.ss-open .ss-dropdown {
  transform: translateY(0);
}

.ss-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--gray-100);
}

.ss-search-icon {
  color: var(--gray-400);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.ss-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--gray-900);
  background: transparent;
}

.ss-input::placeholder {
  color: var(--gray-400);
}

.ss-list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  max-height: 200px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ss-option {
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--gray-700);
  transition: background 0.1s;
  border-radius: 0;
}

.ss-option:hover,
.ss-option.ss-active {
  background: var(--primary-50);
  color: var(--primary);
}

.ss-option.ss-selected {
  font-weight: 600;
  color: var(--primary);
}

.ss-no-results {
  padding: 0.75rem 0.85rem;
  font-size: 0.83rem;
  color: var(--gray-400);
  text-align: center;
}

/* RTL support */
[dir="rtl"] .ss-search-wrap {
  flex-direction: row-reverse;
}
[dir="rtl"] .ss-trigger {
  flex-direction: row-reverse;
}

/* Scrollbar styling for the dropdown list */
.ss-list::-webkit-scrollbar {
  width: 6px;
}
.ss-list::-webkit-scrollbar-track {
  background: transparent;
}
.ss-list::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}
.ss-list::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ── Multi-Select Dropdown ───────────────────────────── */
.ms-container {
  position: relative;
  width: 100%;
}

.ms-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--gray-900);
  background: #fff;
  cursor: pointer;
  transition: all var(--transition);
  box-sizing: border-box;
  gap: 0.5rem;
}

.ms-trigger:hover {
  border-color: var(--gray-400);
}

.ms-trigger:focus,
.ms-container.ms-open .ms-trigger {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
}

.ms-display {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ms-container.ms-open .ss-arrow {
  transform: rotate(180deg);
}

.ms-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.ms-container.ms-open .ms-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ms-list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  max-height: 220px;
  overflow-y: auto;
}

.ms-option {
  padding: 0;
}

.ms-option label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--gray-700);
  transition: background 0.1s;
  user-select: none;
}

.ms-option label:hover {
  background: var(--primary-50);
}

.ms-option input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

[dir="rtl"] .ms-trigger {
  flex-direction: row-reverse;
}

[dir="rtl"] .ms-option label {
  flex-direction: row-reverse;
}

/* ─── Login Page ─── */
.login-page {
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, #1e293b 50%, var(--primary-dark) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(79, 70, 229, 0.1);
  padding: 2.5rem 2rem 2rem;
}

.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.brand-icon-lg {
  width: 56px;
  height: 56px;
  background: var(--primary);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  color: #fff;
}

.login-brand h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.15rem;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--gray-500);
}

.login-card .form-group {
  margin-bottom: 1.25rem;
}

.login-card .form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.35rem;
}

.login-card .form-group input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--gray-900);
  background: var(--gray-50);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.login-card .form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
  background: #fff;
}

.btn-full {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem;
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.login-error {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--danger-light);
  color: var(--danger);
  font-size: 0.85rem;
  text-align: center;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.login-warning {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--warning-light);
  color: var(--warning);
  font-size: 0.85rem;
  text-align: center;
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.login-footer {
  margin-top: 1.5rem;
  text-align: center;
}

.lang-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  color: var(--gray-600);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
}

.lang-toggle-btn:hover {
  background: var(--gray-100);
  border-color: var(--gray-300);
}

/* ─── Subscription Banner ─── */
.subscription-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  flex-wrap: wrap;
  z-index: 100;
}

.subscription-banner-danger {
  background: var(--danger-light);
  color: var(--danger);
  border-bottom: 1px solid rgba(220, 38, 38, 0.2);
}

.subscription-banner-warning {
  background: var(--warning-light);
  color: var(--warning);
  border-bottom: 1px solid rgba(217, 119, 6, 0.2);
}

.banner-contact {
  font-weight: 400;
  opacity: 0.85;
}

/* ─── Sidebar Logout Button ─── */
.sidebar-logout-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  height: 36px;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 6px;
  color: #f87171;
  cursor: pointer;
  font-size: 0.8125rem;
  white-space: nowrap;
  transition: all var(--transition);
  flex: 1;
}

.sidebar-logout-btn:hover {
  background: rgba(220, 38, 38, 0.2);
  color: #fca5a5;
}

.sidebar-logout-btn span {
  overflow: hidden;
}

.sidebar.collapsed .sidebar-logout-btn span {
  display: none;
}

.sidebar.collapsed .sidebar-logout-btn {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  justify-content: center;
  padding: 0;
}
