:root {
  --primary: #111;
  --secondary: #b98e47;
  --light: #f6f2e8;
  --background: linear-gradient(180deg, #f5eee3 0%, #f2ebe1 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: var(--light);
  color: var(--primary);
  min-height: 100vh;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 20px 28px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(17, 17, 17, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.admin-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.admin-nav {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
}

.admin-nav a,
.admin-nav button {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--primary);
  transition: all 0.3s;
}

.admin-nav a:hover,
.admin-nav button:hover {
  background: rgba(185, 142, 71, 0.1);
  color: var(--secondary);
}

main {
  padding: 28px;
  max-width: 1400px;
  margin: 0 auto;
}

h1,
h2,
h3 {
  margin: 0 0 15px 0;
  color: var(--primary);
}

h1 {
  font-size: 32px;
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 18px;
}

.panel {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid #ddd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-bar input,
.filter-bar select {
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  flex: 1;
  min-width: 150px;
}

.table-container {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px;
  border-bottom: 1px solid #eee;
  text-align: left;
  font-size: 14px;
}

.table th {
  background: #f9f9f9;
  font-weight: 600;
  color: #555;
}

.table tr:hover {
  background: #fafafa;
}

.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge.active {
  background: #d4edda;
  color: #155724;
}

.badge.pending {
  background: #fff3cd;
  color: #856404;
}

.badge.unpaid {
  background: #f8d7da;
  color: #721c24;
}

.badge.suspended {
  background: #e2e3e5;
  color: #383d41;
}

.badge.free {
  background: #e7e7e7;
  color: #383d41;
}

.badge.classique,
.badge.abo-classique {
  background: #e7f1ff;
  color: #084298;
}

.badge.premium {
  background: #ffecd1;
  color: #b98e47;
}

.badge.gold,
.badge.abo-gold {
  background: #111;
  color: #fff;
}

.badge.abo-gratuit {
  background: #e7e7e7;
  color: #383d41;
}

.badge.abo-premium {
  background: #ffecd1;
  color: #b98e47;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--primary);
  font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(185, 142, 71, 0.1);
}

button {
  padding: 10px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

button:hover {
  background: #333;
  transform: translateY(-1px);
}

button.secondary {
  background: white;
  color: var(--primary);
  border: 1px solid var(--primary);
}

button.secondary:hover {
  background: #f9f9f9;
}

.actions {
  display: flex;
  gap: 8px;
}

.actions button {
  width: auto;
  padding: 8px 12px;
  font-size: 12px;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  overflow-y: auto;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  padding: 0;
  width: auto;
}

.close-btn:hover {
  color: var(--primary);
  transform: none;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #ddd;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-card h3 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #666;
  text-transform: uppercase;
}

.stat-card .value {
  font-size: 32px;
  font-weight: 700;
  color: var(--secondary);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.admin-welcome {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-welcome h2 {
  margin: 0;
}

.admin-welcome p {
  margin: 0;
  color: #666;
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-nav {
    width: 100%;
  }

  .admin-nav a {
    flex: 1;
    text-align: center;
  }

  main {
    padding: 16px;
  }

  .filter-bar {
    flex-direction: column;
  }

  .filter-bar input,
  .filter-bar select {
    min-width: unset;
  }

  .table {
    font-size: 12px;
  }

  .table th,
  .table td {
    padding: 8px;
  }
}
