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

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

:root {
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  --accent: #2563eb;
  --accent-light: #3b82f6;
  --accent-dark: #1d4ed8;
  --bg: #f4f7fc;
  --bg-card: #ffffff;
  --bg-dark: #101a35;
  --text: #101828;
  --text-muted: #5b6472;
  --text-light: #98a2b3;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --info: #2563eb;
  --info-light: #eaf1ff;
  --border: rgba(37, 99, 235, 0.13);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.07), 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.1), 0 2px 6px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 10px 40px rgba(16, 24, 40, 0.14), 0 4px 12px rgba(16, 24, 40, 0.07);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-display: "Poppins", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

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

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

img {
  max-width: 100%;
  display: block;
}

input,
select,
textarea,
button {
  font-family: var(--font-body);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
}

.btn-accent {
  background: #d7d7d7;
  color: var(--primary-dark);
  border-color: var(--accent);
}
.btn-accent:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

.btn-outline-white {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}
.btn-outline-white:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover {
  background: #b91c1c;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}
.btn-lg {
  padding: 14px 32px;
  font-size: 16px;
}

/* FORMS */
.form-group {
  margin-bottom: 18px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-card);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(45, 90, 142, 0.12);
}
.form-control::placeholder {
  color: var(--text-light);
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* CARDS */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-body {
  padding: 1.5rem;
}
.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
}

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.badge-success {
  background: var(--success-light);
  color: var(--success);
}
.badge-danger {
  background: var(--danger-light);
  color: var(--danger);
}
.badge-warning {
  background: var(--warning-light);
  color: var(--warning);
}
.badge-info {
  background: var(--info-light);
  color: var(--info);
}
.badge-primary {
  background: rgba(26, 58, 92, 0.1);
  color: var(--primary);
}

/* TABLE */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead th {
  padding: 11px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #e0f2fe;
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: none;
}
tbody tr:hover td {
  background: rgba(26, 58, 92, 0.025);
}

/* MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 45, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}
.modal-overlay.open {
  display: flex;
}
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.modal-header {
  padding: 1.5rem 1.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--primary);
}
.modal-body {
  padding: 1.5rem 1.75rem;
}
.modal-footer {
  padding: 1rem 1.75rem 1.5rem;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.btn-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f3f4f6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-muted);
  transition: all var(--transition);
}
.btn-close:hover {
  background: #e5e7eb;
  color: var(--text);
}

/* SIDEBAR */
.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--primary-dark);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.sidebar-logo {
  padding: 1.75rem 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-logo .logo-icon {
  width: 42px;
  height: 42px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.sidebar-logo h2 {
  color: #fff;
  font-family: var(--font-display);
  font-size: 17px;
}
.sidebar-logo span {
  color: rgba(255, 255, 255, 0.45);
  font-size: 11px;
}
.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}
.sidebar-section-title {
  padding: 6px 1.5rem 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 1.5rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  cursor: pointer;
}
.sidebar-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.sidebar-link.active {
  color: #fff;
  background: var(--primary);
  border-left-color: #fff;
  border-radius: 0 8px 8px 0;
  margin-right: 10px;
}
.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.sidebar-user {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}
.avatar-sm {
  width: 30px;
  height: 30px;
  font-size: 11px;
}
.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 16px;
}
.avatar-admin {
  background: var(--accent);
  color: var(--primary-dark);
}
.avatar-biblio {
  background: #4f9cf9;
  color: #fff;
}
.avatar-membre {
  background: #6ee7b7;
  color: #065f46;
}

/* LAYOUT */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}
.dashboard-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  background: var(--bg);
}
.page-section {
  display: none;
}
.page-section.active {
  display: block;
}

/* STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}
.stat-card.blue::before {
  background: linear-gradient(90deg, #0c4a6e, #0284c7);
}
.stat-card.gold::before {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}
.stat-card.green::before {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}
.stat-card.red::before {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}
.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 6px;
}
.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}
.stat-card .stat-icon {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.08;
  font-size: 42px;
}

/* ALERTS */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.alert-success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid #bbf7d0;
}
.alert-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fecaca;
}
.alert-warning {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid #fde68a;
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  opacity: 0.3;
}
.empty-state p {
  font-size: 14px;
}

/* TOAST */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--primary-dark);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease;
  max-width: 320px;
  border-left: 3px solid var(--accent);
}
.toast.success {
  border-left-color: var(--success);
}
.toast.error {
  border-left-color: var(--danger);
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* SEARCH BAR */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}
.search-bar input {
  padding-left: 38px;
  background: #f9f8f5;
  border-color: transparent;
}
.search-bar input:focus {
  background: #fff;
}
.search-bar svg {
  position: absolute;
  left: 11px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

/* TOOLBAR */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.toolbar .search-bar {
  flex: 1;
  min-width: 200px;
}

/* ROLE PILL */
.role-pill {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.role-admin {
  background: rgba(217, 119, 6, 0.15);
  color: #92400e;
}
.role-biblio {
  background: rgba(2, 132, 199, 0.15);
  color: #0369a1;
}
.role-membre {
  background: rgba(22, 163, 74, 0.15);
  color: #15803d;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .sidebar {
    width: 200px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .sidebar {
    display: none;
  }
  .content-area {
    padding: 1rem;
  }
}

/* SCROLL */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(2, 132, 199, 0.2);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(2, 132, 199, 0.4);
}

/* PRINT / OFFLINE hint */
.offline-note {
  display: none;
}



/* .auth-showcase{
  position:relative;
  overflow:hidden;
  padding:54px 48px;
  color:#fff;
  background:
    radial-gradient(circle at 85% 12%, rgba(255,255,255,.18), transparent 18rem),
    linear-gradient(145deg,#0b2a6f 0%,#1557d6 58%,#3b82f6 100%);
  min-height:620px;
  width:360px;
}
.sp-auth-showcase::before,.auth-showcase::before{
  content:"";
  position:absolute;
  width:260px;height:260px;border:1px solid rgba(255,255,255,.16);
  border-radius:50%;right:-90px;bottom:-70px;
  box-shadow:0 0 0 35px rgba(255,255,255,.035),0 0 0 70px rgba(255,255,255,.025);
}
.showcase-badge{
  display:inline-flex;align-items:center;gap:8px;
  padding:8px 12px;border:1px solid rgba(255,255,255,.2);
  background:rgba(255,255,255,.10);border-radius:999px;
  font-size:12px;font-weight:700;letter-spacing:.02em;
  backdrop-filter:blur(8px);
}
.showcase-logo{
  width:72px;height:72px;border-radius:22px;
  display:grid;place-items:center;margin:28px 0 28px;
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.20);
  box-shadow:0 18px 35px rgba(3,18,58,.22);
}
.showcase-title{
  font-family:var(--font-display);
  font-size:clamp(2rem,3.2vw,3rem);
  line-height:1.08;
  letter-spacing:-.04em;
  margin-bottom:18px;
}
.showcase-title span{color:#dce9ff}
.showcase-copy{
  color:rgba(255,255,255,.82);
  line-height:1.8;font-size:14px;max-width:470px;
}
.showcase-list{
  list-style:none;display:grid;gap:15px;margin-top:30px;
}
.showcase-list li{
  display:flex;align-items:center;gap:12px;color:rgba(255,255,255,.9);font-size:13.5px;
}
.showcase-check{
  width:30px;height:30px;border-radius:10px;display:grid;place-items:center;
  background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.14);
  flex-shrink:0;
}
.showcase-metrics{
  display:flex;gap:12px;flex-wrap:wrap;margin-top:34px;
}
.showcase-metric{
  padding:12px 14px;border-radius:14px;
  background:rgba(255,255,255,.09);border:1px solid rgba(255,255,255,.13);
}
.showcase-metric strong{display:block;font-size:17px}
.showcase-metric span{font-size:10px;color:rgba(255,255,255,.65)}


.complet {
   width: 100%;
    max-width: 1500px;
    min-height: 92vh;
    margin: 28px auto;

    display: grid;
    grid-template-columns: 1fr 1.55fr;

    background: white;
    border-radius: 24px;
    overflow: hidden;

    box-shadow: 0 10px 40px rgba(30, 70, 120, .12);
} */
