/* ─── BSD Registre de Suivi ─── */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

/* ─── Variables ─────────────────────────────────────────────── */
:root {
  --sidebar-w: 248px;
  --topbar-h: 56px;

  --bg: #f0f4f8;
  --sidebar-bg: #111827;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: rgba(59, 130, 246, 0.18);
  --accent: #3b82f6;
  --accent-dark: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.22);
  --green: #10b981;
  --green-bg: rgba(16, 185, 129, 0.1);
  --yellow: #f59e0b;
  --yellow-bg: rgba(245, 158, 11, 0.1);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.1);

  --surface: #ffffff;
  --border: #e2e8f0;
  --border-dark: #cbd5e1;
  --text: #0f172a;
  --text-sub: #475569;
  --text-muted: #94a3b8;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.07), 0 12px 40px rgba(0, 0, 0, 0.1);
}

/* ─── Reset / Base ──────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

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

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-decoration: none;
}

.sidebar-brand .brand-icon {
  width: 34px;
  height: 34px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-brand .brand-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
  display: block;
}

.sidebar-brand .brand-sub {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  display: block;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 12px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
  padding: 10px 10px 5px;
  margin-top: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: 7px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13.5px;
  font-weight: 500;
  transition:
    background 0.15s,
    color 0.15s;
}

.sidebar-link i {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.sidebar-link.active {
  background: var(--sidebar-active);
  color: #93c5fd;
}
.sidebar-link.active i {
  color: var(--accent);
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.sidebar-footer .sidebar-link {
  color: rgba(255, 255, 255, 0.4);
}
.sidebar-footer .sidebar-link:hover {
  color: var(--red);
  background: var(--red-bg);
}

/* ─── Page Wrapper ──────────────────────────────────────────── */
.page-wrapper {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ─── Topbar ────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}

.topbar-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-sub);
  font-size: 13px;
}

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

/* ─── Main Content ──────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 28px 28px 48px;
}

/* ─── Page Header ───────────────────────────────────────────── */
.page-header {
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}
.page-header p {
  font-size: 13.5px;
  color: var(--text-sub);
  margin: 0;
}

/* ─── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  background: transparent;
}

.card-header i {
  font-size: 15px;
  color: var(--accent);
  margin-right: 0;
}

.card-header.bg-primary {
  background: var(--accent) !important;
  border-color: var(--accent-dark);
  color: #fff;
}
.card-header.bg-primary i {
  color: rgba(255, 255, 255, 0.85);
}
.card-header.bg-success {
  background: var(--green) !important;
  border-color: #059669;
  color: #fff;
}
.card-header.bg-success i {
  color: rgba(255, 255, 255, 0.85);
}

.card-body {
  padding: 20px;
}

/* ─── Stat Cards ─────────────────────────────────────────────── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}
.stat-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.blue {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent);
}
.stat-icon.green {
  background: var(--green-bg);
  color: var(--green);
}
.stat-icon.yellow {
  background: var(--yellow-bg);
  color: var(--yellow);
}

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

/* ─── Tables ─────────────────────────────────────────────────── */
.table {
  font-size: 13.5px;
  color: var(--text);
  margin: 0;
}

.table thead th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  white-space: nowrap;
}

.table tbody td {
  padding: 11px 14px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  color: var(--text-sub);
}

.table tbody tr:last-child td {
  border-bottom: none;
}
.table tbody tr:hover td {
  background: #f8fafc;
}
.table-striped > tbody > tr:nth-of-type(odd) > td {
  background: transparent;
}

.table-sm thead th {
  padding: 7px 9px;
  font-size: 10.5px;
}
.table-sm tbody td {
  padding: 5px 8px;
}
.table-sm input.form-control,
.table-sm select.form-select {
  font-size: 12.5px;
  padding: 3px 7px;
  height: auto;
  border-radius: var(--radius-sm);
}

/* ─── Forms ──────────────────────────────────────────────────── */
.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 5px;
  letter-spacing: 0.2px;
}

.form-control,
.form-select {
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  padding: 8px 12px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  font-family: inherit;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
}

.input-group-text {
  background: #f1f5f9;
  border: 1px solid var(--border-dark);
  color: var(--text-muted);
  font-size: 14px;
}

.form-text {
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  letter-spacing: 0.1px;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
}

.btn-success {
  background: var(--green);
  border-color: #059669;
  color: #fff;
}
.btn-success:hover {
  background: #059669;
  border-color: #047857;
  color: #fff;
}

.btn-outline-warning {
  border-color: var(--yellow);
  color: var(--yellow);
}
.btn-outline-warning:hover {
  background: var(--yellow-bg);
  color: var(--yellow);
  border-color: var(--yellow);
}

.btn-outline-danger {
  border-color: var(--red);
  color: var(--red);
}
.btn-outline-danger:hover {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red);
}

.btn-lg {
  padding: 10px 22px;
  font-size: 14px;
}
.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}
.btn:disabled {
  opacity: 0.45;
}

/* ─── Alerts ─────────────────────────────────────────────────── */
.alert {
  font-size: 13.5px;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  border-width: 0;
  border-left: 3px solid;
}
.alert-success {
  background: var(--green-bg);
  color: #065f46;
  border-color: var(--green);
}
.alert-danger {
  background: var(--red-bg);
  color: #991b1b;
  border-color: var(--red);
}
.alert-warning {
  background: var(--yellow-bg);
  color: #92400e;
  border-color: var(--yellow);
}
.alert-info {
  background: rgba(59, 130, 246, 0.08);
  color: #1e40af;
  border-color: var(--accent);
}

#flash-messages .alert {
  animation: fadeSlideOut 6s forwards;
  animation-delay: 3.5s;
}
@keyframes fadeSlideOut {
  90% {
    opacity: 0.4;
  }
  to {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
  }
}

/* ─── Badges ─────────────────────────────────────────────────── */
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}
.badge.bg-primary {
  background: rgba(59, 130, 246, 0.12) !important;
  color: var(--accent);
}
.badge.bg-success {
  background: var(--green-bg) !important;
  color: var(--green);
}
.badge.bg-warning {
  background: var(--yellow-bg) !important;
  color: #d97706;
}
.badge.bg-secondary {
  background: #f1f5f9 !important;
  color: var(--text-sub);
}

/* ─── Pagination ─────────────────────────────────────────────── */
.pagination .page-link {
  font-size: 13px;
  color: var(--accent);
  border-color: var(--border);
  border-radius: var(--radius-sm) !important;
  margin: 0 2px;
}
.pagination .page-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.pagination .page-item.disabled .page-link {
  color: var(--text-muted);
}

/* ─── Upload Zone ─────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-dark);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
  position: relative;
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.03);
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-icon {
  font-size: 38px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 10px;
}

/* ─── List Group ─────────────────────────────────────────────── */
.list-group-item {
  border-color: var(--border);
  font-size: 13.5px;
  padding: 12px 16px;
  color: var(--text);
}
.list-group-item:hover {
  background: #f8fafc;
}

/* ─── Auth Page ──────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(59, 130, 246, 0.15) 0%,
    transparent 70%
  );
  top: -200px;
  right: -150px;
  pointer-events: none;
}
.auth-page::after {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(16, 185, 129, 0.08) 0%,
    transparent 70%
  );
  bottom: -100px;
  left: -100px;
  pointer-events: none;
}

.auth-card {
  background: #1a2035;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 1;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}

.auth-logo-icon {
  width: 44px;
  height: 44px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
}

.auth-logo-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: block;
}
.auth-logo-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: block;
}

.auth-card h2 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}
.auth-card .auth-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 28px;
}
.auth-card .form-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 600;
}

.auth-card .form-control {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 10px 12px;
}
.auth-card .form-control::placeholder {
  color: rgba(255, 255, 255, 0.25);
}
.auth-card .form-control:focus {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  color: #fff;
}
.auth-card .input-group-text {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.4);
}
.auth-card .btn-primary {
  padding: 11px;
  font-size: 14px;
  letter-spacing: 0.3px;
}

/* ─── Mono ────────────────────────────────────────────────────── */
.mono {
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
}

/* ─── Utilities ───────────────────────────────────────────────── */
.text-muted {
  color: var(--text-muted) !important;
}
.text-success {
  color: var(--green) !important;
}
.text-danger {
  color: var(--red) !important;
}
.text-warning {
  color: var(--yellow) !important;
}
.text-primary {
  color: var(--accent) !important;
}
.fw-semibold {
  font-weight: 600;
}

/* ─── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .page-wrapper {
    margin-left: 0;
  }
  .main-content {
    padding: 16px;
  }
  .stat-card {
    padding: 16px;
  }
}
