/* ============================================================
   GOD BLESS ATELIER - CSS Principal
   Palette: Or #C9A84C | Noir #1a1a1a | Blanc #FAFAFA
   Polices: Poppins (titres) + Open Sans (corps)
   ============================================================ */

/* ======================== VARIABLES ======================== */
:root {
  --gold: #C9A84C;
  --gold-light: #E4C97E;
  --gold-dark: #A0822E;
  --gold-bg: #FFF8E7;
  --black: #1a1a1a;
  --black-soft: #2C2C2C;
  --white: #FAFAFA;
  --white-pure: #FFFFFF;
  --gray-light: #F5F5F5;
  --gray: #E0E0E0;
  --gray-medium: #9E9E9E;
  --gray-dark: #616161;
  --sidebar-width: 270px;
  --topbar-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-md: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-gold: 0 4px 20px rgba(201,168,76,0.25);
  --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  /* Couleurs statut */
  --color-en-attente: #FF9800;
  --color-en-cours: #2196F3;
  --color-termine: #4CAF50;
  --color-livre: #9C27B0;
  --color-paye: #C9A84C;
  --color-danger: #F44336;
  --color-success: #4CAF50;
  --color-info: #2196F3;
  --color-warning: #FF9800;
}

/* ======================== RESET & BASE ======================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Open Sans', sans-serif;
  background-color: var(--gray-light);
  color: var(--black);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

h1, h2, h3, h4, h5 { font-family: 'Poppins', sans-serif; font-weight: 600; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
input, select, textarea, button { font-family: inherit; }
img { max-width: 100%; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-light); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

/* ======================== SIDEBAR ======================== */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, var(--black) 0%, var(--black-soft) 100%);
  color: var(--white);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: var(--transition);
  box-shadow: 4px 0 20px rgba(0,0,0,0.2);
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(201,168,76,0.2);
}

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

.logo-icon {
  font-size: 32px;
  filter: drop-shadow(0 2px 8px rgba(201,168,76,0.5));
}

.logo-text h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.logo-text p {
  font-size: 0.7rem;
  color: var(--gray-medium);
  letter-spacing: 0.5px;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--gray-medium);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
}
.sidebar-close:hover { color: var(--gold); }

.sidebar-info {
  padding: 12px 20px;
  border-bottom: 1px solid rgba(201,168,76,0.15);
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--gray-medium);
  margin-bottom: 6px;
}
.info-item i { color: var(--gold); margin-top: 2px; flex-shrink: 0; font-size: 0.75rem; }
.info-item:last-child { margin-bottom: 0; }

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

.sidebar-nav ul { padding: 0 12px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 4px;
  position: relative;
}

.nav-link i { width: 18px; text-align: center; font-size: 0.9rem; }
.nav-link span { flex: 1; }

.nav-link:hover {
  background: rgba(201,168,76,0.15);
  color: var(--gold-light);
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(201,168,76,0.3), rgba(201,168,76,0.15));
  color: var(--gold-light);
  box-shadow: 0 2px 12px rgba(201,168,76,0.2);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--gold);
  border-radius: 0 3px 3px 0;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(201,168,76,0.15);
}

.taux-change {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--gray-medium);
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.taux-change i { color: var(--gold); }

.taux-change input {
  width: 70px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 6px;
  padding: 3px 6px;
  color: var(--gold-light);
  font-size: 0.78rem;
  text-align: center;
}

.footer-copy {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.3);
  text-align: center;
}

/* Overlay mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  backdrop-filter: blur(2px);
}

/* ======================== MAIN WRAPPER ======================== */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

/* ======================== TOPBAR ======================== */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: var(--white-pure);
  border-bottom: 1px solid var(--gray);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

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

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--black);
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.hamburger:hover { background: var(--gray-light); color: var(--gold); }

.topbar-title h1 { font-size: 1.15rem; font-weight: 700; color: var(--black); }
.topbar-title span { font-size: 0.75rem; color: var(--gray-medium); }

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

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-light);
  border: 1px solid var(--gray);
  border-radius: 25px;
  padding: 7px 16px;
  transition: var(--transition);
}
.search-box:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,76,0.1); }
.search-box i { color: var(--gray-medium); font-size: 0.85rem; }
.search-box input {
  border: none;
  background: none;
  outline: none;
  font-size: 0.85rem;
  width: 200px;
  color: var(--black);
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  animation: pulse 2s infinite;
}
.status-dot.closed { background: var(--color-danger); animation: none; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ======================== MAIN CONTENT ======================== */
.main-content { flex: 1; padding: 24px; }

/* Pages */
.page { display: none; animation: fadeInUp 0.3s ease; }
.page.active { display: block; }

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

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h2 { font-size: 1.4rem; color: var(--black); }
.page-subtitle { font-size: 0.85rem; color: var(--gray-medium); margin-top: 4px; }

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ======================== BUTTONS ======================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--white-pure);
  box-shadow: var(--shadow-gold);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--gold-light), var(--gold)); transform: translateY(-1px); box-shadow: 0 6px 25px rgba(201,168,76,0.4); }

.btn-secondary {
  background: var(--black);
  color: var(--white);
}
.btn-secondary:hover { background: var(--black-soft); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--gray-dark);
  border: 1px solid var(--gray);
}
.btn-ghost:hover { background: var(--gray-light); border-color: var(--gray-dark); color: var(--black); }

.btn-danger {
  background: var(--color-danger);
  color: white;
}
.btn-danger:hover { background: #D32F2F; transform: translateY(-1px); }

.btn-success {
  background: var(--color-success);
  color: white;
}
.btn-success:hover { background: #388E3C; }

.btn-sm { padding: 5px 12px; font-size: 0.78rem; }
.btn-icon { padding: 7px; border-radius: var(--radius-sm); }

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

.stat-card {
  background: var(--white-pure);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border-left: 4px solid transparent;
}

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

.stat-card.gold { border-left-color: var(--gold); }
.stat-card.blue { border-left-color: var(--color-info); }
.stat-card.green { border-left-color: var(--color-success); }
.stat-card.purple { border-left-color: #9C27B0; }
.stat-card.orange { border-left-color: var(--color-warning); }
.stat-card.teal { border-left-color: #009688; }
.stat-card.red { border-left-color: var(--color-danger); }

.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.stat-card.gold .stat-icon { background: var(--gold-bg); color: var(--gold-dark); }
.stat-card.blue .stat-icon { background: #E3F2FD; color: var(--color-info); }
.stat-card.green .stat-icon { background: #E8F5E9; color: var(--color-success); }
.stat-card.purple .stat-icon { background: #F3E5F5; color: #9C27B0; }
.stat-card.orange .stat-icon { background: #FFF3E0; color: var(--color-warning); }
.stat-card.teal .stat-icon { background: #E0F2F1; color: #009688; }
.stat-card.red .stat-icon { background: #FFEBEE; color: var(--color-danger); }

.stat-info h3 { font-size: 1.5rem; font-weight: 700; color: var(--black); line-height: 1; }
.stat-info p { font-size: 0.78rem; color: var(--gray-medium); margin-top: 4px; }

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

.dashboard-card {
  background: var(--white-pure);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dashboard-card.wide { grid-column: 1 / -1; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray);
  background: linear-gradient(135deg, var(--gold-bg), var(--white-pure));
}

.card-header h3 {
  font-size: 0.95rem;
  color: var(--black);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-header h3 i { color: var(--gold); }
.card-link { font-size: 0.78rem; color: var(--gold); font-weight: 600; transition: var(--transition); }
.card-link:hover { color: var(--gold-dark); }

/* Tailleurs status */
.tailleurs-status, .machines-status { padding: 16px 20px; }

.tailleur-status-item, .machine-status-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray);
}
.tailleur-status-item:last-child, .machine-status-item:last-child { border-bottom: none; }

.status-person {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
}

.machine-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* ======================== BADGES STATUT ======================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-en-attente { background: #FFF3E0; color: #E65100; }
.badge-en-cours { background: #E3F2FD; color: #1565C0; }
.badge-termine { background: #E8F5E9; color: #2E7D32; }
.badge-livre { background: #F3E5F5; color: #6A1B9A; }
.badge-paye { background: var(--gold-bg); color: var(--gold-dark); }
.badge-actif { background: #E8F5E9; color: #2E7D32; }
.badge-inactif { background: #FFEBEE; color: #C62828; }
.badge-absent { background: #FFF3E0; color: #E65100; }
.badge-bon { background: #E8F5E9; color: #2E7D32; }
.badge-usage { background: #FFF3E0; color: #E65100; }
.badge-panne { background: #FFEBEE; color: #C62828; }
.badge-remplacer { background: #FCE4EC; color: #AD1457; }
.badge-confection { background: #E8EAF6; color: #283593; }
.badge-modification { background: #E0F7FA; color: #006064; }
.badge-reduction { background: #F3E5F5; color: #4A148C; }
.badge-reparation { background: #FBE9E7; color: #BF360C; }
.badge-autre { background: var(--gray-light); color: var(--gray-dark); }

/* ======================== FILTRES BAR ======================== */
.filters-bar {
  background: var(--white-pure);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 0.75rem;
  color: var(--gray-medium);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ======================== FORMULAIRES ======================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 140px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--black-soft);
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.form-group:not(.form-row > .form-group) { margin-bottom: 16px; }

input[type="text"],
input[type="number"],
input[type="tel"],
input[type="email"],
input[type="date"],
input[type="password"],
select,
textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--gray);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--black);
  background: var(--white-pure);
  transition: var(--transition);
  outline: none;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
}

textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%239E9E9E' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 20px; padding-right: 32px; }

.input-readonly { background: var(--gray-light); cursor: not-allowed; }

.input-with-btn { display: flex; gap: 6px; }
.input-with-btn select { flex: 1; }

.required { color: var(--color-danger); }

.search-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-light);
  border: 1.5px solid var(--gray);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  transition: var(--transition);
}
.search-inline:focus-within { border-color: var(--gold); }
.search-inline i { color: var(--gray-medium); }
.search-inline input { border: none; background: none; outline: none; font-size: 0.85rem; width: 180px; }

/* ======================== TABLES ======================== */
.table-responsive {
  background: var(--white-pure);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: auto;
  margin-bottom: 16px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.table thead th {
  background: linear-gradient(135deg, var(--black), var(--black-soft));
  color: var(--white);
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.table thead th:last-child { border-radius: 0 var(--radius-sm) 0 0; }

.table.sortable th.sortable { cursor: pointer; }
.table .sortable { cursor: pointer; user-select: none; }
.table .sortable i { font-size: 0.7rem; opacity: 0.5; margin-left: 4px; transition: var(--transition); }
.table .sortable.asc i, .table .sortable.desc i { opacity: 1; color: var(--gold); }

.table tbody tr {
  border-bottom: 1px solid var(--gray);
  transition: var(--transition);
}

.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover { background: var(--gold-bg); }

.table tbody td {
  padding: 10px 14px;
  vertical-align: middle;
  color: var(--black-soft);
}

.table tbody td.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-medium);
  font-size: 0.9rem;
  line-height: 1.8;
}
.table tbody td.empty-state i { font-size: 2rem; display: block; margin-bottom: 8px; opacity: 0.4; }

/* Actions dans tableau */
.table-actions { display: flex; gap: 4px; align-items: center; }

.btn-table {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  transition: var(--transition);
}
.btn-edit { background: #E3F2FD; color: #1565C0; }
.btn-edit:hover { background: #1565C0; color: white; }
.btn-delete { background: #FFEBEE; color: #C62828; }
.btn-delete:hover { background: #C62828; color: white; }
.btn-view { background: #E8F5E9; color: #2E7D32; }
.btn-view:hover { background: #2E7D32; color: white; }
.btn-print { background: var(--gold-bg); color: var(--gold-dark); }
.btn-print:hover { background: var(--gold); color: white; }
.btn-pay { background: #E8F5E9; color: #2E7D32; }
.btn-pay:hover { background: #2E7D32; color: white; }
.btn-deliver { background: #F3E5F5; color: #6A1B9A; }
.btn-deliver:hover { background: #6A1B9A; color: white; }

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

.page-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray);
  background: var(--white-pure);
  color: var(--black);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}
.page-btn:hover { border-color: var(--gold); color: var(--gold); }
.page-btn.active { background: var(--gold); border-color: var(--gold); color: white; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-info { font-size: 0.78rem; color: var(--gray-medium); padding: 0 8px; }

/* ======================== TARIFS GRID ======================== */
.tarifs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.tarif-card {
  background: var(--white-pure);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--gold);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.tarif-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.tarif-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.tarif-card-title { font-weight: 700; font-size: 0.92rem; color: var(--black); flex: 1; }
.tarif-card-price {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gold-dark);
  font-family: 'Poppins', sans-serif;
  text-align: right;
  white-space: nowrap;
}
.tarif-card-price-range { font-size: 0.8rem; color: var(--gray-medium); }
.tarif-card-notes { font-size: 0.78rem; color: var(--gray-medium); }
.tarif-card-actions { display: flex; gap: 6px; }

/* ======================== TAILLEURS CARDS ======================== */
.tailleurs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.tailleur-card {
  background: var(--white-pure);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-align: center;
  position: relative;
}
.tailleur-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.tailleur-card-avatar {
  width: 70px; height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 auto 16px;
  box-shadow: var(--shadow-gold);
}

.tailleur-card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.tailleur-card-info { font-size: 0.8rem; color: var(--gray-medium); margin-bottom: 4px; }
.tailleur-card-stats { margin-top: 12px; display: flex; justify-content: center; gap: 20px; }
.tailleur-card-stat { text-align: center; }
.tailleur-card-stat span { display: block; font-size: 1.1rem; font-weight: 700; color: var(--gold-dark); }
.tailleur-card-stat small { font-size: 0.72rem; color: var(--gray-medium); }
.tailleur-card-badge { position: absolute; top: 16px; right: 16px; }

/* ======================== INVENTAIRE ALERTS ======================== */
.alerts-zone {
  margin-bottom: 16px;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 0.83rem;
  border-left: 4px solid transparent;
}

.alert-warning { background: #FFF8E1; border-left-color: var(--color-warning); color: #795548; }
.alert-danger { background: #FFEBEE; border-left-color: var(--color-danger); color: #B71C1C; }
.alert-info { background: #E3F2FD; border-left-color: var(--color-info); color: #0D47A1; }
.alert-success { background: #E8F5E9; border-left-color: var(--color-success); color: #1B5E20; }
.alert i { margin-top: 1px; flex-shrink: 0; }

/* ======================== RAPPORTS ======================== */
.rapports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.rapport-content {
  padding: 16px 20px;
}

.rapport-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray);
  font-size: 0.85rem;
}
.rapport-item:last-child { border-bottom: none; }
.rapport-item .label { color: var(--gray-dark); }
.rapport-item .value { font-weight: 700; color: var(--black); }

.rapport-section-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--gold-dark);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--gold-bg);
}

.top-list { padding: 16px 20px; }
.top-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray);
}
.top-list-item:last-child { border-bottom: none; }
.top-rank {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gold-bg);
  color: var(--gold-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.top-rank:nth-child(1) { background: var(--gold); color: white; }
.top-info { flex: 1; }
.top-name { font-weight: 600; font-size: 0.85rem; }
.top-sub { font-size: 0.75rem; color: var(--gray-medium); }
.top-value { font-weight: 700; color: var(--gold-dark); font-size: 0.88rem; }

/* ======================== MODALS ======================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 2000;
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--white-pure);
  border-radius: var(--radius);
  width: 100%;
  max-width: 540px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: slideUp 0.3s ease;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal.modal-lg { max-width: 720px; }
.modal.modal-sm { max-width: 420px; }

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray);
  background: linear-gradient(135deg, var(--black), var(--black-soft));
  border-radius: var(--radius) var(--radius) 0 0;
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 1rem;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-header h3 i { color: var(--gold); }

.modal-header.danger { background: linear-gradient(135deg, #B71C1C, #C62828); }
.modal-header.danger h3 { color: white; }

.modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: var(--transition);
}
.modal-close:hover { color: white; background: rgba(255,255,255,0.1); }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--gray);
  background: var(--gray-light);
  border-radius: 0 0 var(--radius) var(--radius);
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ======================== TOASTS ======================== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--white-pure);
  box-shadow: 0 6px 24px rgba(0,0,0,0.15);
  animation: slideInRight 0.3s ease;
  border-left: 4px solid transparent;
  font-size: 0.83rem;
  position: relative;
}

.toast.success { border-left-color: var(--color-success); }
.toast.error { border-left-color: var(--color-danger); }
.toast.warning { border-left-color: var(--color-warning); }
.toast.info { border-left-color: var(--color-info); }

.toast i { font-size: 1rem; margin-top: 1px; }
.toast.success i { color: var(--color-success); }
.toast.error i { color: var(--color-danger); }
.toast.warning i { color: var(--color-warning); }
.toast.info i { color: var(--color-info); }

.toast-text { flex: 1; }
.toast-title { font-weight: 700; margin-bottom: 2px; color: var(--black); }
.toast-msg { color: var(--gray-dark); }

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-medium);
  font-size: 0.85rem;
  padding: 2px;
}

.toast.hiding { animation: slideOutRight 0.3s ease forwards; }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(50px); }
}

/* ======================== REÇU ======================== */
.recu {
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--black);
}

.recu-header {
  text-align: center;
  border-bottom: 2px dashed var(--gold);
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.recu-header h2 { font-size: 1.2rem; font-family: 'Poppins', sans-serif; color: var(--gold-dark); }
.recu-header p { font-size: 0.75rem; color: var(--gray-dark); }
.recu-ref { font-size: 1rem; font-weight: 700; color: var(--black); }

.recu-section { margin-bottom: 12px; }
.recu-line { display: flex; justify-content: space-between; padding: 2px 0; }
.recu-line.total {
  border-top: 2px dashed var(--gold);
  padding-top: 8px;
  margin-top: 8px;
  font-weight: 700;
  font-size: 1rem;
}
.recu-footer {
  text-align: center;
  border-top: 2px dashed var(--gold);
  padding-top: 12px;
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--gray-medium);
}

/* ======================== DÉTAIL CLIENT ======================== */
.detail-client-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray);
}
.detail-info h3 { font-size: 1.2rem; }
.detail-info p { font-size: 0.82rem; color: var(--gray-medium); }
.detail-section-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: var(--gold-dark);
  margin-bottom: 12px;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.detail-item label { font-size: 0.72rem; text-transform: uppercase; color: var(--gray-medium); letter-spacing: 0.5px; font-weight: 600; display: block; margin-bottom: 2px; }
.detail-item span { font-size: 0.88rem; color: var(--black); font-weight: 500; }

/* ======================== PRINT ======================== */
@media print {
  .sidebar, .topbar, .page-actions, .filters-bar,
  .table-actions, .pagination, .toast-container,
  .modal-overlay:not(#modalRecu), .btn,
  #hamburger, .sidebar-overlay { display: none !important; }

  .main-wrapper { margin-left: 0 !important; }
  .main-content { padding: 0 !important; }
  .page.active { display: block !important; }
  body { background: white; }

  .recu {
    max-width: 300px;
    margin: 0 auto;
    font-size: 11px;
  }
}

/* ======================== RESPONSIVE ======================== */
@media (max-width: 1024px) {
  :root { --sidebar-width: 260px; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-close { display: flex; }
  .sidebar-overlay.show { display: block; }

  .main-wrapper { margin-left: 0; }
  .hamburger { display: flex; }

  .search-box { display: none; }
  .main-content { padding: 16px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-card.wide { grid-column: auto; }
  .rapports-grid { grid-template-columns: 1fr; }

  .filters-bar { flex-direction: column; align-items: stretch; }
  .filter-group { width: 100%; }
  .filter-group select, .filter-group input { width: 100%; }

  .page-header { flex-direction: column; align-items: flex-start; }

  .form-row { flex-direction: column; }
  .form-group { min-width: unset; }

  .modal { max-width: 100%; margin: 0; }
  .modal.modal-lg { max-width: 100%; }

  .toast-container { max-width: calc(100vw - 40px); }

  .tarifs-grid { grid-template-columns: 1fr; }
  .tailleurs-cards { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  html { font-size: 13px; }
}

/* ======================== UTILITAIRES ======================== */
.text-gold { color: var(--gold); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-muted { color: var(--gray-medium); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.fw-bold { font-weight: 700; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.d-flex { display: flex; }
.gap-8 { gap: 8px; }
.align-center { align-items: center; }

.loading-spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 3px solid var(--gray);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.divider {
  height: 1px;
  background: var(--gray);
  margin: 16px 0;
}

/* Sélection texte */
::selection { background: rgba(201,168,76,0.25); color: var(--black); }
