/* =====================================================
   Scrapbook'Nine — Styles personnalisés
   ===================================================== */

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

:root {
  --sb-primary:       #FF6D72;
  --sb-primary-dark:  #C74E5A;
  --sb-primary-light: #fff0f0;
  --sb-text:          #444;
  --sb-bg:            #F2F2F2;
  --sb-sidebar-bg:    #fff;
  --sb-sidebar-w:     230px;
  --sb-topbar-h:      56px;
  --sb-sidebar-border: #f0e8e8;
}

/* ---- Base ---- */
body {
  font-family: 'Roboto', sans-serif;
  font-size: 17px;
  font-weight: 400;
  color: var(--sb-text);
  background: var(--sb-bg);
}

/* ---- Layout ---- */
#app-wrapper {
  min-height: 100vh;
}

#sidebar {
  width: var(--sb-sidebar-w);
  min-height: 100vh;
  background: var(--sb-sidebar-bg);
  border-right: 1px solid var(--sb-sidebar-border);
  flex-shrink: 0;
  transition: width .25s ease;
  box-shadow: 2px 0 8px rgba(0,0,0,.04);
}

#sidebar.collapsed {
  width: 62px;
}

#sidebar.collapsed .sidebar-brand span,
#sidebar.collapsed .nav-link span,
#sidebar.collapsed .sidebar-footer a span {
  display: none;
}

#sidebar.collapsed .nav-link {
  justify-content: center;
  padding: .5rem;
}

#sidebar.collapsed .nav-link i {
  margin-right: 0 !important;
  font-size: 1.25rem;
}

#sidebar.collapsed .sidebar-brand {
  padding: .75rem .5rem;
  justify-content: center;
}

#sidebar.collapsed .sidebar-brand img {
  height: 30px;
  width: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--sb-sidebar-border);
  text-decoration: none;
}

.sidebar-brand img {
  width: 90%;
  height: auto;
  display: block;
}

.sidebar-brand-text {
  font-size: .95rem;
  font-weight: 700;
  color: var(--sb-primary-dark);
  white-space: nowrap;
  line-height: 1.2;
}

.sidebar-divider {
  border-color: var(--sb-sidebar-border);
  margin: .5rem .75rem;
}

#sidebar .nav-link {
  color: #666;
  border-radius: 8px;
  padding: .48rem .85rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: .9rem;
  font-weight: 400;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
}

#sidebar .nav-link:hover {
  background: var(--sb-primary-light);
  color: var(--sb-primary-dark);
}

#sidebar .nav-link.active {
  background: var(--sb-primary-light);
  color: var(--sb-primary);
  font-weight: 600;
}

#sidebar .nav-link i {
  font-size: 1rem;
  flex-shrink: 0;
  color: inherit;
}

#sidebar .collapse .nav-link {
  font-size: .85rem;
  padding: .35rem .75rem;
  color: #888;
}

#sidebar .collapse .nav-link:hover,
#sidebar .collapse .nav-link.active {
  color: var(--sb-primary);
  background: var(--sb-primary-light);
}

.sidebar-footer {
  border-top: 1px solid var(--sb-sidebar-border);
}

.sidebar-footer .nav-link {
  color: #999 !important;
  font-size: .85rem;
}

.sidebar-footer .nav-link:hover {
  color: var(--sb-primary-dark) !important;
  background: var(--sb-primary-light);
}

#page-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--sb-bg);
}

.topbar {
  height: var(--sb-topbar-h);
  background: #fff;
  border-bottom: 1px solid #ece4e4;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.main-content {
  flex: 1;
}

/* ---- Page header ---- */
.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--sb-text);
  margin: 0;
}

/* ---- Cartes ---- */
.card {
  border-radius: 12px;
  border: 1px solid #ecdede;
}

.card-header {
  background: transparent;
  border-bottom: 1px solid #f5eded;
  font-weight: 600;
  font-size: .9rem;
  padding: .9rem 1.25rem .75rem;
}

.card-header > i,
.card-header > span > i {
  color: var(--sb-primary);
}

.card-header .btn i {
  color: inherit;
}

.dashboard-card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 1px 5px rgba(0,0,0,.07);
  background: #fff;
}

/* ---- Boutons ---- */
.btn-purple,
.btn-primary-brand {
  background: var(--sb-primary);
  color: #fff;
  border: none;
  font-weight: 500;
}

.btn-purple:hover,
.btn-primary-brand:hover {
  background: var(--sb-primary-dark);
  color: #fff;
}

.btn-purple:focus,
.btn-primary-brand:focus {
  box-shadow: 0 0 0 .25rem rgba(255,109,114,.35);
  color: #fff;
}

/* ---- Badges ---- */
.badge-brand {
  background: var(--sb-primary-light);
  color: var(--sb-primary-dark);
  font-weight: 500;
}

.fidelite-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: #fff3cd;
  color: #7d4e00;
  border-radius: 20px;
  padding: .2rem .75rem;
  font-size: .8rem;
  font-weight: 600;
}

/* ---- Tables ---- */
.table {
  font-size: .9rem;
  color: var(--sb-text);
}

.table thead th {
  background: #faf7f7;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #999;
  border-bottom: 2px solid #f0e8e8;
  font-weight: 600;
}

.table-hover tbody tr:hover {
  background: #fff7f7;
}

/* ---- Forms ---- */
.form-label {
  font-size: .875rem;
  font-weight: 500;
  color: #555;
  margin-bottom: .3rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--sb-primary);
  box-shadow: 0 0 0 .2rem rgba(255,109,114,.2);
}

/* ---- Highlights stats clientes ---- */
.cliente-top {
  background: #fff7f0 !important;
}

/* ---- Tables dans les cards (p-0) ---- */
.card-body .dataTables_wrapper {
  padding: .75rem 1rem;
}

.card-body .dataTables_wrapper table.dataTable {
  margin-top: .25rem !important;
  margin-bottom: .25rem !important;
}

/* ---- DataTables ---- */
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--sb-primary) !important;
  border-color: var(--sb-primary) !important;
  color: #fff !important;
  border-radius: 6px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--sb-primary-light) !important;
  border-color: var(--sb-primary-light) !important;
  color: var(--sb-primary-dark) !important;
}

/* ---- Login ---- */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #C74E5A 0%, #FF6D72 60%, #ffb3b5 100%);
}

.login-card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
}

/* ---- Nav tabs ---- */
.nav-tabs .nav-link.active {
  color: var(--sb-primary);
  border-color: #ecdede #ecdede #fff;
  font-weight: 600;
}

.nav-tabs .nav-link:hover {
  color: var(--sb-primary-dark);
}

/* ---- Accordion ---- */
.accordion-button:not(.collapsed) {
  color: var(--sb-primary-dark);
  background: var(--sb-primary-light);
  box-shadow: none;
}

.accordion-button:focus {
  box-shadow: 0 0 0 .2rem rgba(255,109,114,.2);
}

/* ---- Impression ---- */
@media print {
  #sidebar, .topbar { display: none !important; }
  #app-wrapper { display: block !important; }
  #page-content { width: 100% !important; }
  .main-content { padding: 1rem !important; }
  .card { border: none !important; box-shadow: none !important; }
  #printParticipants table { border-collapse: collapse !important; border: none !important; }
  #printParticipants th,
  #printParticipants td { border: none !important; border-top: 1.5px solid #333 !important; }
  #printParticipants thead th { border-top: none !important; }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  #sidebar {
    width: 62px;
  }
  #sidebar .sidebar-brand span,
  #sidebar .nav-link span {
    display: none;
  }
  #sidebar .nav-link {
    justify-content: center;
  }
  #sidebar .sidebar-brand img {
    height: 28px;
  }
}
