/* =========================================================
   🌿 PANDO ADMIN PANEL — Style.css
   Auteur : ChatGPT (refonte optimisée)
   ========================================================= */

/* === Variables globales === */
:root {
  --accent: #2563eb;
  --accent-hover: #1e40af;
  --success: #10b981;
  --danger: #ef4444;
  --text: #111827;
  --muted: #6b7280;
  --bg: #f9fafb;
  --bg-card: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --radius: 10px;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  --font-main: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* === Container principal === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* === En-tête / titre === */
h1, h2, h3 {
  font-weight: 600;
  color: var(--text);
}
h1 { font-size: 1.8rem; margin-bottom: 20px; }
h2 { font-size: 1.4rem; margin: 20px 0 12px; }

section.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

/* === Barre de filtre === */
.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
  background: #f3f4f6;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.filter-form input,
.filter-form select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: white;
  font-size: 0.95rem;
  color: var(--text);
  flex: 1 1 150px;
}

.filter-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
  outline: none;
}

.filter-form button {
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}
.filter-form button:hover {
  background: var(--accent-hover);
}

.filter-form .reset {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-left: auto;
}
.filter-form .reset:hover { text-decoration: underline; }

/* === Tables === */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

thead {
  background: #f8fafc;
}
thead th {
  text-align: left;
  padding: 12px 10px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

tbody tr:hover td {
  background: rgba(37, 99, 235, 0.04);
}

/* === Boutons d’action dans les tables === */
td form {
  display: inline;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

button.primary {
  background: var(--accent);
  color: white;
}
button.primary:hover { background: var(--accent-hover); }

button.danger {
  background: var(--danger);
  color: white;
}
button.danger:hover { background: #dc2626; }

button.secondary {
  background: #f3f4f6;
  color: var(--text);
}
button.secondary:hover {
  background: #e5e7eb;
}

/* === Inputs & labels généraux === */
label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  color: var(--muted);
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.95rem;
  color: var(--text);
  transition: all 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
  outline: none;
}

/* === Messages / erreurs === */
.errors {
  background: #fef2f2;
  color: var(--danger);
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(239,68,68,0.1);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

/* === Badges === */
.badge {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
}
.badge.admin {
  background: rgba(16,185,129,0.15);
  color: var(--success);
}
.badge.warn {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
}

/* === Responsive === */
@media (max-width: 768px) {
  .container { padding: 16px; }
  .filter-form {
    flex-direction: column;
    align-items: stretch;
  }
  table thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr { margin-bottom: 14px; }
  td {
    padding: 10px 12px;
    border: none;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 6px;
  }
  td:before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
  }
}

/* === Footer === */
footer {
  margin-top: 30px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* === Subtilités visuelles === */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

hr {
  border: none;
  border-top: 1px solid rgba(0,0,0,0.05);
  margin: 20px 0;
}
