:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --hover: #27354a;
}

/* Barre de navigation / Bouton retour */
.nav-bar {
  max-width: 960px;
  margin: 0 auto 16px auto;
  display: flex;
  gap: 12px;
}

.btn-back, .btn-home {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
}

.btn-back:hover, .btn-home:hover {
  background: var(--hover);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* Style de la ligne Apache Parent Directory lorsqu'elle s'affiche */
tr:has(a[href^="/"]) td a,
a[href="../"] {
  font-weight: bold;
}

a[href="../"]::before {
  content: "📁 ⬆ ";
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 40px 16px;
}

/* Centrage propre sans flex sur le body */
h1, table {
  width: 100%;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Nettoyage Apache */
hr, address { display: none; }

/* Tableau */
table {
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  display: table; /* Force le rendu tabulaire */
}

th {
  text-align: left;
  padding: 12px 16px;
  background: #182234;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: var(--hover);
}

/* Liens */
a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  text-decoration: underline;
  color: #7dd3fc;
}

/* Bouton / Ligne retour (Parent Directory) */
a[href^="../"], a[href^="/"] {
  font-weight: 600;
}

a[href^="../"]::before, a[href^="/"]::before {
  content: "← ";
  font-size: 1.1rem;
}

/* Dates et Tailles */
td:nth-child(2), td:nth-child(3) {
  color: var(--muted);
  font-family: monospace;
  font-size: 0.85rem;
}
