/* ==========================================================================
   Alpha-Dis Storage — feuille de style
   Direction : "bordereau d'expédition" — chaque fichier est un ticket de
   retrait avec un tampon de type, une ligne perforée, et un bouton d'action.
   ========================================================================== */

:root {
  --bg: #10141a;
  --surface: #181e27;
  --surface-raised: #1f2731;
  --border: #2a323d;
  --text: #edeff3;
  --text-muted: #8b95a3;
  --accent-apk: #e8a33d;
  --accent-apk-dim: #4a3a20;
  --accent-guide: #4fb0ae;
  --accent-guide-dim: #1f3a39;
  --danger: #e8615c;
  --radius: 14px;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
}

body {
  background-image:
    radial-gradient(circle at 15% 0%, rgba(232, 163, 61, 0.06), transparent 40%),
    radial-gradient(circle at 85% 100%, rgba(79, 176, 174, 0.06), transparent 40%);
}

a { color: inherit; }

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

/* --- Header ------------------------------------------------------------ */

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-apk);
  box-shadow: 0 0 0 3px var(--accent-apk-dim);
}

h1 {
  font-family: var(--sans);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 40px;
  max-width: 46ch;
}

.top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.logout-form button {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.logout-form button:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

/* --- Ticket cards -------------------------------------------------------- */

.tickets {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ticket {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

.ticket-main {
  flex: 1;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.ticket-badge {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
}

.ticket--apk .ticket-badge { background: var(--accent-apk-dim); color: var(--accent-apk); }
.ticket--guide .ticket-badge { background: var(--accent-guide-dim); color: var(--accent-guide); }

.ticket-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ticket-label {
  font-weight: 600;
  font-size: 16px;
}

.ticket-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.ticket-meta span { white-space: nowrap; }

.ticket-empty {
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}

/* Ligne perforée qui sépare l'info du bouton */
.ticket-perf {
  width: 0;
  border-left: 2px dashed var(--border);
  position: relative;
  flex-shrink: 0;
}

.ticket-perf::before,
.ticket-perf::after {
  content: "";
  position: absolute;
  left: -8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
}
.ticket-perf::before { top: -8px; }
.ticket-perf::after { bottom: -8px; }

.ticket-action {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 22px;
}

.btn-download {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: #14181f;
  background: var(--text-muted);
  padding: 11px 18px;
  border-radius: 8px;
  white-space: nowrap;
  transition: transform 0.1s, filter 0.15s;
  display: inline-block;
}

.ticket--apk .btn-download { background: var(--accent-apk); }
.ticket--guide .btn-download { background: var(--accent-guide); }

.btn-download:hover { filter: brightness(1.08); }
.btn-download:active { transform: scale(0.98); }

.btn-download.disabled {
  background: var(--surface-raised);
  color: var(--text-muted);
  pointer-events: none;
}

/* --- Footer note --------------------------------------------------------- */

.footnote {
  margin-top: 40px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--mono);
}

.footnote a { color: var(--accent-guide); text-decoration: none; }
.footnote a:hover { text-decoration: underline; }

/* --- Auth / Login page ---------------------------------------------------- */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
}

.auth-card h1 {
  font-size: 20px;
  margin-bottom: 4px;
}

.auth-card .subtitle { margin-bottom: 28px; font-size: 13px; }

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field input, .field select {
  width: 100%;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--sans);
}

.field input:focus, .field select:focus {
  outline: 2px solid var(--accent-guide);
  outline-offset: 1px;
}

.btn-primary {
  width: 100%;
  background: var(--accent-apk);
  color: #14181f;
  border: none;
  font-weight: 600;
  font-size: 14px;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: filter 0.15s;
}

.btn-primary:hover { filter: brightness(1.08); }

.error-box {
  background: rgba(232, 97, 92, 0.1);
  border: 1px solid rgba(232, 97, 92, 0.3);
  color: var(--danger);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.status-box {
  background: rgba(79, 176, 174, 0.1);
  border: 1px solid rgba(79, 176, 174, 0.3);
  color: var(--accent-guide);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 20px;
}

/* --- Admin panel ----------------------------------------------------------- */

.admin-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}

.admin-card h2 {
  font-size: 15px;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-card .current {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.admin-card form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.admin-card .field { margin-bottom: 0; flex: 1; min-width: 160px; }
.admin-card .field.file-field { flex: 2; min-width: 220px; }

.admin-card button {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
}

.admin-card.apk button { background: var(--accent-apk); color: #14181f; border: none; }
.admin-card.guide button { background: var(--accent-guide); color: #14181f; border: none; }

@media (max-width: 560px) {
  .ticket { flex-direction: column; }
  .ticket-perf { display: none; }
  .ticket-action { padding: 0 24px 20px; }
  h1 { font-size: 26px; }
}
