/* ============================================================
   TransfertUni – Feuille de style principale
   ============================================================ */

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

:root {
  --primary:       #1a3a5c;
  --primary-light: #264d7a;
  --primary-dark:  #0f2238;
  --accent:        #e8a020;
  --accent-light:  #f5c052;
  --success:       #2ecc71;
  --danger:        #e74c3c;
  --warning:       #f39c12;
  --info:          #3498db;
  --bg:            #f0f4f9;
  --surface:       #ffffff;
  --border:        #d8e3ef;
  --text:          #1e2d3d;
  --text-muted:    #6b7f93;
  --sidebar-w:     260px;
  --radius:        10px;
  --shadow:        0 4px 20px rgba(26,58,92,0.10);
  --shadow-lg:     0 8px 40px rgba(26,58,92,0.15);
  --font-display:  'Playfair Display', Georgia, serif;
  --font-body:     'DM Sans', 'Segoe UI', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--primary-dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .3s;
}

.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo .logo-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 6px;
}

.sidebar-logo h1 {
  font-family: var(--font-display);
  color: #fff;
  font-size: 20px;
  line-height: 1.2;
}

.sidebar-logo p {
  color: rgba(255,255,255,.5);
  font-size: 11px;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }

.nav-section {
  padding: 8px 20px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,.3);
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .2s;
}

.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
  border-left-color: rgba(232,160,32,.5);
}

.nav-item.active {
  background: rgba(232,160,32,.12);
  color: var(--accent-light);
  border-left-color: var(--accent);
}

.nav-item .nav-icon { font-size: 18px; width: 22px; text-align: center; }

.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 14px;
  flex-shrink: 0;
}

.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-role { color: rgba(255,255,255,.4); font-size: 11px; }

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 90;
  box-shadow: 0 1px 8px rgba(26,58,92,.06);
}

.topbar-title { font-size: 18px; font-weight: 600; color: var(--primary); }
.topbar-right { display: flex; align-items: center; gap: 16px; }

.page-content { padding: 32px; flex: 1; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

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

.card-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

.card-body { padding: 24px; }

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

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}

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

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}

.stat-icon.total    { background: rgba(26,58,92,.1); }
.stat-icon.pending  { background: rgba(243,156,18,.1); }
.stat-icon.accepted { background: rgba(46,204,113,.1); }
.stat-icon.rejected { background: rgba(231,76,60,.1); }
.stat-icon.process  { background: rgba(52,152,219,.1); }

.stat-value { font-size: 30px; font-weight: 700; color: var(--primary); line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-responsive { overflow-x: auto; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.data-table thead th {
  background: #f5f8fc;
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
}

table.data-table thead th:hover { color: var(--primary); }

table.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}

table.data-table tbody tr:hover { background: #f8fbff; }
table.data-table tbody td { padding: 13px 16px; vertical-align: middle; }

/* ============================================================
   BADGES / STATUTS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: currentColor; }

.badge-draft       { background: #f0f0f0; color: #666; }
.badge-submitted   { background: #e8f4fd; color: #2980b9; }
.badge-processing  { background: #fff3cd; color: #856404; }
.badge-pending     { background: #fff8e1; color: #e65100; }
.badge-accepted    { background: #d4edda; color: #155724; }
.badge-rejected    { background: #f8d7da; color: #721c24; }
.badge-complement  { background: #e2d9f3; color: #432874; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .2s;
  white-space: nowrap;
  font-family: var(--font-body);
}

.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-accent    { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-light); }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { opacity: .85; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .85; }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-warning:hover { opacity: .85; }
.btn-outline   { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm        { padding: 6px 12px; font-size: 13px; }
.btn-lg        { padding: 13px 28px; font-size: 16px; }
.btn-block     { width: 100%; justify-content: center; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 7px; }
.form-label .required { color: var(--danger); }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,58,92,.1);
}

.form-control.is-invalid { border-color: var(--danger); }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

.alert-success { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.alert-error   { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border-color: #ffeeba; }
.alert-info    { background: #cce5ff; color: #004085; border-color: #b8daff; }

/* ============================================================
   FILTERS BAR
   ============================================================ */
.filters-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: #fafcff;
}

.filters-bar .form-control { width: auto; min-width: 160px; }

/* ============================================================
   TIMELINE (historique)
   ============================================================ */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 9px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item { position: relative; margin-bottom: 24px; }
.timeline-dot {
  position: absolute;
  left: -23px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--primary);
}

.timeline-date { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.timeline-content { background: #f5f8fc; border-radius: 8px; padding: 12px 16px; font-size: 14px; }

/* ============================================================
   FILE UPLOAD ZONE
   ============================================================ */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  transition: all .2s;
  cursor: pointer;
  background: #fafcff;
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: rgba(26,58,92,.03);
}

.upload-zone .upload-icon { font-size: 36px; margin-bottom: 10px; }
.upload-zone p { color: var(--text-muted); font-size: 14px; }
.upload-zone strong { color: var(--primary); }

.file-list { margin-top: 16px; }
.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f0f4f9;
  border-radius: 7px;
  margin-bottom: 8px;
  font-size: 13px;
}
.file-item .file-name { flex: 1; font-weight: 500; }
.file-item .file-size { color: var(--text-muted); }
.file-item .file-remove { cursor: pointer; color: var(--danger); font-size: 16px; }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  position: relative;
  background-image: url('../images/login_bg.jpg');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
}

.auth-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(5, 15, 35, 0.70);
  z-index: 0;
}

.auth-sidebar {
  width: 420px;
  background: rgba(10, 25, 55, 0.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-right: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 48px;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.auth-sidebar::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232,160,32,.18) 0%, transparent 70%);
  pointer-events: none;
}

.auth-sidebar::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(52,152,219,.12) 0%, transparent 70%);
  pointer-events: none;
}

/* Logo image styling */
.auth-sidebar .brand-logo {
  margin-bottom: 24px;
  display: flex;
  justify-content: flex-start;
}

.auth-sidebar .brand-logo-img {
  width: 210px;
  height: 210px;
  object-fit: contain;
  filter: drop-shadow(0 0 22px rgba(232, 160, 32, 0.55)) drop-shadow(0 0 8px rgba(52, 152, 219, 0.4));
  animation: logoGlow 3.5s ease-in-out infinite alternate;
  border-radius: 50%;
}

@keyframes logoGlow {
  from { filter: drop-shadow(0 0 14px rgba(232,160,32,0.4)) drop-shadow(0 0 6px rgba(52,152,219,0.3)); }
  to   { filter: drop-shadow(0 0 30px rgba(232,160,32,0.75)) drop-shadow(0 0 16px rgba(52,152,219,0.55)); }
}

.auth-sidebar h2 { font-family: var(--font-display); color: #fff; font-size: 30px; line-height: 1.3; margin-bottom: 16px; text-shadow: 0 2px 12px rgba(0,0,0,0.4); }
.auth-sidebar p { color: rgba(255,255,255,.65); font-size: 14px; line-height: 1.8; }

.auth-features { margin-top: 40px; }
.auth-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  color: rgba(255,255,255,.80);
  font-size: 14px;
}
.auth-feature-icon {
  width: 36px; height: 36px;
  background: rgba(232,160,32,.18);
  border: 1px solid rgba(232,160,32,.25);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  background: transparent;
  z-index: 1;
  position: relative;
}

.auth-form-box {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 44px 48px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.15);
}

.auth-form-box .auth-title {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--primary);
  margin-bottom: 8px;
}

.auth-form-box .auth-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  padding: 20px;
}

.page-link {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px;
  border: 1.5px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
}

.page-link:hover { border-color: var(--primary); color: var(--primary); }
.page-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-link.disabled { opacity: .4; pointer-events: none; }

/* ============================================================
   NOTIFICATION BELL
   ============================================================ */
.notif-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  color: var(--text-muted);
  padding: 6px;
  border-radius: 8px;
  transition: all .2s;
}
.notif-btn:hover { background: var(--bg); color: var(--primary); }
.notif-badge {
  position: absolute;
  top: 2px; right: 2px;
  width: 16px; height: 16px;
  background: var(--danger);
  border-radius: 50%;
  font-size: 10px;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 12px;
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn .25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h4 { font-size: 17px; font-weight: 600; color: var(--primary); }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ============================================================
   MISC
   ============================================================ */
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.fw-600 { font-weight: 600; }
.mb-0 { margin-bottom: 0; }
.mt-16 { margin-top: 16px; }
.mb-20 { margin-bottom: 20px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.justify-between { justify-content: space-between; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .auth-sidebar { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: 20px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .filters-bar { flex-direction: column; align-items: stretch; }
}
