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

:root {
  --primary: #0033A0;
  --primary-light: #009FDA;
  --white: #FFFFFF;
  --bg: #F4F6F9;
  --gray: #6B7280;
  --violet: #7C3AED;
  --orange: #F59E0B;
  --green: #10B981;
  --red: #EF4444;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: #1F2937;
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== HEADER ===== */
.header {
  background: linear-gradient(135deg, var(--primary) 0%, #001a5e 100%);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,51,160,0.3);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: var(--white);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.logo-text h1 { font-size: 20px; font-weight: 700; letter-spacing: 0.5px; }
.logo-text p { font-size: 12px; opacity: 0.8; font-weight: 300; letter-spacing: 0.3px; }

.header-nav { display: flex; gap: 6px; flex-wrap: wrap; }

.nav-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--white);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn:hover, .nav-btn.active {
  background: rgba(255,255,255,0.25);
  transform: translateY(-1px);
}

.nav-btn.active { background: var(--primary-light); border-color: var(--primary-light); }

/* ===== MAIN ===== */
.main { max-width: 1280px; margin: 0 auto; padding: 24px; }

.page { display: none; animation: fadeIn 0.4s ease; }
.page.active { display: block; }

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

/* ===== CARDS ===== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 20px;
  transition: var(--transition);
}

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

.card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== FORM ===== */
.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.form-group label .required { color: var(--red); }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  transition: var(--transition);
  background: var(--white);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(0,159,218,0.15);
}

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

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: #002580; }
.btn-cyan { background: var(--primary-light); color: var(--white); }
.btn-cyan:hover { background: #007ab8; }
.btn-green { background: var(--green); color: var(--white); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #dc2626; }

/* ===== URGENCY ===== */
.urgency-selector { display: flex; gap: 10px; }

.urgency-option {
  flex: 1;
  padding: 12px;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
  font-weight: 500;
}

.urgency-option:hover { border-color: var(--primary-light); }
.urgency-option.selected { border-width: 2px; }
.urgency-option[data-val="Normal"].selected { border-color: var(--green); background: #ECFDF5; color: #065F46; }
.urgency-option[data-val="Urgent"].selected { border-color: var(--orange); background: #FFFBEB; color: #92400E; }
.urgency-option[data-val="Très urgent"].selected { border-color: var(--red); background: #FEF2F2; color: #991B1B; }

/* ===== SUCCESS MODAL ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

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

.modal {
  background: var(--white);
  border-radius: 20px;
  padding: 40px;
  max-width: 460px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes scaleIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.checkmark-circle {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--green);
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: popIn 0.6s cubic-bezier(0.34,1.56,0.64,1) 0.2s both;
}

@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }

.checkmark-circle svg {
  width: 40px; height: 40px;
  stroke: white; stroke-width: 3; fill: none;
  stroke-dasharray: 60; stroke-dashoffset: 60;
  animation: drawCheck 0.5s ease 0.6s forwards;
}

@keyframes drawCheck { to { stroke-dashoffset: 0; } }

.modal h2 { font-size: 22px; color: var(--primary); margin-bottom: 10px; }

.modal .tracking-number {
  background: var(--bg);
  border: 2px dashed var(--primary-light);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 1px;
  user-select: all;
}

.copy-btn {
  background: var(--primary-light);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  margin-top: 4px;
}

.copy-btn:hover { background: #007ab8; }
.copy-btn.copied { background: var(--green); }

/* ===== TRACKING ===== */
.tracking-input-group { display: flex; gap: 12px; max-width: 500px; margin: 0 auto; }
.tracking-input-group .form-input { flex: 1; font-size: 16px; text-transform: uppercase; }

/* ===== TIMELINE ===== */
.timeline { position: relative; padding-left: 40px; margin-top: 24px; }

.timeline::before {
  content: '';
  position: absolute;
  left: 15px; top: 0; bottom: 0;
  width: 3px;
  background: #E5E7EB;
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
  animation: slideInLeft 0.4s ease;
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.timeline-dot {
  position: absolute;
  left: -32px; top: 4px;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 3px solid var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.timeline-content {
  background: var(--white);
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  border-left: 3px solid;
}

.timeline-content h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.timeline-content p { font-size: 13px; color: var(--gray); }
.timeline-content .meta { font-size: 11px; color: #9CA3AF; margin-top: 6px; }

/* ===== DASHBOARD ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border-left: 4px solid;
  cursor: default;
}

.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stat-card .stat-value { font-size: 32px; font-weight: 800; margin-bottom: 4px; }
.stat-card .stat-label { font-size: 13px; color: var(--gray); font-weight: 500; }

/* ===== FILTERS ===== */
.filters-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; align-items: center; }

.filters-bar .form-input,
.filters-bar .form-select { width: auto; min-width: 160px; padding: 8px 12px; font-size: 13px; }
.filters-bar .search-input { flex: 1; min-width: 200px; }

/* ===== REQUEST CARDS ===== */
.request-list { display: flex; flex-direction: column; gap: 12px; }

.request-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition);
  border-left: 4px solid transparent;
}

.request-card:hover { box-shadow: var(--shadow-lg); transform: translateX(4px); }

.request-card .req-id { font-size: 13px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.request-card .req-info { flex: 1; min-width: 0; }
.request-card .req-name { font-weight: 600; font-size: 14px; }
.request-card .req-type { font-size: 12px; color: var(--gray); }
.request-card .req-date { font-size: 11px; color: #9CA3AF; }

.assigned-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--violet);
  font-weight: 500;
}

.avatar-initials {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--violet);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

/* ===== STATUS BADGE ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-badge[data-status="Reçue"] { background: #F3F4F6; color: #6B7280; }
.status-badge[data-status="En cours d'examen"] { background: #E0F4FD; color: #009FDA; }
.status-badge[data-status="Assignée"] { background: #EDE9FE; color: #7C3AED; }
.status-badge[data-status="En attente de documents"] { background: #FEF3C7; color: #D97706; }
.status-badge[data-status="En traitement"] { background: #DBEAFE; color: #0033A0; }
.status-badge[data-status="Clôturée"] { background: #D1FAE5; color: #059669; }

/* ===== URGENCY BADGE ===== */
.urgency-badge { font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 12px; }
.urgency-badge[data-urgency="Normal"] { background: #D1FAE5; color: #065F46; }
.urgency-badge[data-urgency="Urgent"] { background: #FEF3C7; color: #92400E; }
.urgency-badge[data-urgency="Très urgent"] { background: #FEE2E2; color: #991B1B; animation: blink 1s ease-in-out infinite; }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ===== DETAIL PANEL ===== */
.detail-panel { display: none; animation: fadeIn 0.3s ease; }
.detail-panel.active { display: block; }

.detail-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }

.detail-section { margin-bottom: 24px; }
.detail-section h3 {
  font-size: 15px; font-weight: 700; color: var(--primary);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.info-item label { font-size: 11px; font-weight: 600; color: var(--gray); text-transform: uppercase; letter-spacing: 0.5px; }
.info-item p { font-size: 14px; font-weight: 500; margin-top: 2px; }

.action-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.action-bar .form-group { margin-bottom: 0; flex: 1; min-width: 180px; }

/* ===== LOGIN ===== */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 60vh; }

.login-card { max-width: 400px; width: 100%; text-align: center; }
.login-card .logo-icon { width: 64px; height: 64px; font-size: 24px; margin: 0 auto 20px; }

.login-error { color: var(--red); font-size: 13px; margin-top: 8px; display: none; }

/* ===== SETTINGS ===== */
.settings-section { margin-bottom: 30px; }
.settings-section h3 { font-size: 16px; font-weight: 700; color: var(--primary); margin-bottom: 12px; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid #E5E7EB;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.tag .remove-tag {
  cursor: pointer; color: var(--red); font-weight: 700; font-size: 14px;
  line-height: 1; border: none; background: none; padding: 0 2px;
}

.tag .remove-tag:hover { transform: scale(1.2); }

.add-item-row { display: flex; gap: 8px; }
.add-item-row .form-input { flex: 1; }

/* ===== NOTIFICATION ===== */
.notification {
  position: fixed;
  top: 80px; right: 24px;
  background: var(--white);
  border-radius: 12px;
  padding: 14px 20px;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--green);
  z-index: 3000;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  font-size: 14px;
  font-weight: 500;
  max-width: 360px;
}

.notification.show { transform: translateX(0); }

/* ===== NOTIFICATION BELL ===== */
.bell-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--white);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s ease;
}

.bell-btn:hover { background: rgba(255,255,255,0.25); }

.bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  animation: bellPulse 2s ease-in-out infinite;
}

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

.bell-badge.hidden { display: none; }

/* ===== NOTIFICATION PANEL ===== */
.notif-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1500;
}

.notif-overlay.hidden { display: none; }

.notif-panel {
  position: fixed;
  top: 72px;
  right: 24px;
  width: 380px;
  max-height: 480px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1600;
  display: flex;
  flex-direction: column;
  animation: scaleIn 0.25s ease;
  overflow: hidden;
}

.notif-panel.hidden { display: none; }

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #E5E7EB;
}

.notif-panel-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

.notif-panel-body {
  overflow-y: auto;
  flex: 1;
  max-height: 400px;
}

.notif-item {
  padding: 12px 18px;
  border-bottom: 1px solid #F3F4F6;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 13px;
  line-height: 1.5;
}

.notif-item:hover { background: var(--bg); }

.notif-item.unread {
  background: #EFF6FF;
  border-left: 3px solid var(--primary-light);
}

.notif-item .notif-time {
  font-size: 11px;
  color: #9CA3AF;
  margin-top: 4px;
}

.notif-item .notif-tracking {
  font-weight: 700;
  color: var(--primary);
  font-size: 11px;
}

.notif-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--gray);
  font-size: 14px;
}

@media (max-width: 768px) {
  .notif-panel { right: 8px; left: 8px; width: auto; }
}

/* ===== ASSIGNED INFO ===== */
.assigned-info {
  background: #EDE9FE;
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 14px;
  color: var(--violet);
  font-weight: 500;
}

/* ===== PAGE HEADER ===== */
.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 24px; font-weight: 800; color: var(--primary); }
.page-header p { color: var(--gray); font-size: 14px; margin-top: 4px; }

/* ===== BACK BUTTON ===== */
.back-btn {
  background: none; border: none;
  color: var(--primary);
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 0; margin-bottom: 16px;
  transition: var(--transition);
}

.back-btn:hover { color: var(--primary-light); }

/* ===== STATS PANEL (new layout) ===== */
.stats-panel {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
}

.stats-panel-left,
.stats-panel-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stats-card-inner {
  background: var(--bg);
  border-radius: 12px;
  padding: 20px 22px;
}

.stats-card-inner h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== FANCY BAR CHARTS ===== */
.fancy-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  animation: fadeIn 0.4s ease both;
}

.fancy-bar-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(0,51,160,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  font-weight: 700;
}

.fancy-bar-info {
  flex: 1;
  min-width: 0;
}

.fancy-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.fancy-bar-name {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fancy-bar-count {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  margin-left: 8px;
}

.fancy-bar-track {
  width: 100%;
  height: 8px;
  background: #E5E7EB;
  border-radius: 4px;
  overflow: hidden;
}

.fancy-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
  min-width: 4px;
}

/* ===== USERS TABLE ===== */
.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.users-table th, .users-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #E5E7EB;
}

.users-table th {
  font-weight: 600;
  color: var(--gray);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.users-table tr:hover td { background: var(--bg); }

.role-badge {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.role-badge.traitant { background: #DBEAFE; color: var(--primary); }
.role-badge.demandeur { background: #F3F4F6; color: var(--gray); }

/* ===== EMPTY / NO RESULTS ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }
.no-results { text-align: center; padding: 40px; color: var(--gray); font-size: 14px; }

/* ===== LOADING / SKELETONS ===== */
.request-list.refreshing,
#myRequestsList.refreshing {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.skeleton-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  border-left: 4px solid #E5E7EB;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #E9EDF2 25%, #F6F8FA 50%, #E9EDF2 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

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

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ===== CALENDRIER ===== */
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-month-label {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  min-width: 150px;
  text-align: center;
  text-transform: capitalize;
}

.calendar-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.calendar-filters .form-select { min-width: 200px; }

.calendar-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray);
  cursor: pointer;
  white-space: nowrap;
}

.calendar-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 8px;
}

.cal-legend-item { font-size: 12px; color: var(--gray); }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-head {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 0;
}

.cal-cell {
  min-height: 92px;
  background: var(--bg);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-empty { background: transparent; }

.cal-today {
  background: #E7F0FF;
  box-shadow: inset 0 0 0 2px var(--primary-light);
}

.cal-daynum {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray);
}

.cal-today .cal-daynum { color: var(--primary); }

.cal-events {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  max-height: 150px;
}

.cal-event {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--white);
  border-left: 3px solid var(--gray);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 11px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: var(--transition);
}

.cal-event:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.cal-event-icon { flex-shrink: 0; }

.cal-event-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #374151;
  font-weight: 500;
}

.cal-event-who {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 700;
  color: var(--primary);
  background: #DBEAFE;
  border-radius: 8px;
  padding: 1px 5px;
}

.cal-upcoming-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid #E5E7EB;
  cursor: pointer;
  transition: var(--transition);
  flex-wrap: wrap;
}

.cal-upcoming-row:last-child { border-bottom: none; }
.cal-upcoming-row:hover { background: var(--bg); }

.cal-upcoming-date {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  min-width: 140px;
  text-transform: capitalize;
}

.cal-upcoming-info { flex: 1; min-width: 200px; }

.cal-unassigned {
  font-size: 11px;
  color: var(--orange);
  font-weight: 600;
  background: #FEF3C7;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; gap: 12px; }
  .header-nav { width: 100%; justify-content: center; }
  .form-row { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stats-panel { grid-template-columns: 1fr; }
  .filters-bar { flex-direction: column; }
  .filters-bar .form-input,
  .filters-bar .form-select { width: 100%; min-width: auto; }
  .request-card { flex-direction: column; align-items: flex-start; }
  .action-bar { flex-direction: column; }
  .urgency-selector { flex-direction: column; }
  .tracking-input-group { flex-direction: column; }
  .main { padding: 16px; }
  .calendar-toolbar { flex-direction: column; align-items: stretch; }
  .calendar-nav { justify-content: center; }
  .calendar-filters .form-select { width: 100%; min-width: auto; }
  .cal-cell { min-height: 60px; padding: 4px; }
  .cal-event-text { display: none; }
  .cal-upcoming-date { min-width: 100%; }
}
