/* ============================================================
   OCTET · console de gestion (back-office)
   Identité ambre — distincte du site public (teal)
   ============================================================ */

.admin-body { background: var(--ink-950); overflow-x: hidden; }

.admin-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }

/* ---------- sidebar ---------- */
.admin-side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  border-right: 1px solid var(--ink-700); background: rgba(8, 24, 35, 0.75);
  backdrop-filter: blur(10px); padding: 22px 16px;
}
.admin-brand { margin-bottom: 30px; }
.admin-brand-tag {
  font-family: var(--font-mono); font-size: 9px; text-transform: uppercase;
  letter-spacing: 0.18em; color: #171004; background: var(--amber); padding: 2px 6px;
}
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-link {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; text-decoration: none;
  font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--mist); border: 1px solid transparent;
  transition: color 0.25s, border-color 0.25s, background 0.25s, transform 0.25s;
}
.admin-link:hover { color: var(--amber); transform: translateX(3px); }
.admin-link-active { color: var(--amber); border-color: rgba(246, 168, 33, 0.4); background: rgba(246, 168, 33, 0.07); }
.admin-ico { width: 16px; text-align: center; color: var(--amber); }
.admin-link-danger:hover { color: var(--coral); }
.admin-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--ink-700); padding-top: 16px; }
.admin-user { margin-top: 10px; }

/* ---------- zone principale ---------- */
.admin-main { display: flex; flex-direction: column; min-width: 0; }
.admin-topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding: 26px 32px 18px; border-bottom: 1px solid var(--ink-700);
}
.admin-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 3vw, 34px); margin-top: 4px; }
.admin-topbar-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-messages { padding: 16px 32px 0; }
.admin-content { padding: 26px 32px 40px; display: grid; gap: 24px; }
.admin-foot { padding: 18px 32px; border-top: 1px solid var(--ink-700); }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi-card {
  border: 1px solid var(--ink-700); background: rgba(8, 24, 35, 0.5); padding: 18px 18px 14px;
  transition: transform 0.3s, border-color 0.3s;
}
.kpi-card:hover { transform: translateY(-3px); border-color: rgba(246, 168, 33, 0.5); }
.kpi-card strong { display: block; font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-card span { display: block; margin-top: 8px; font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--mist); }

/* ---------- panneaux & graphiques ---------- */
.admin-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.panel { border: 1px solid var(--ink-700); background: rgba(8, 24, 35, 0.5); padding: 22px; min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.panel-head a { color: var(--teal); text-decoration: none; }
.panel-head a:hover { color: var(--paper); }

.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr) 52px; align-items: center; gap: 10px; }
.bar-label { font-family: var(--font-mono); font-size: 10.5px; color: var(--mist); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 12px; background: var(--ink-800); border: 1px solid var(--ink-700); overflow: hidden; }
.bar-fill { height: 100%; width: 0; transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1); }
.bar-teal { background: linear-gradient(90deg, var(--teal-deep), var(--teal)); }
.bar-amber { background: linear-gradient(90deg, var(--amber-deep), var(--amber)); }
.bar-value { font-family: var(--font-mono); font-size: 11px; color: var(--paper); text-align: right; font-variant-numeric: tabular-nums; }

.month-chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; }
.month-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.month-fill { width: 100%; max-width: 34px; background: linear-gradient(180deg, var(--teal), var(--teal-deep)); min-height: 3px; transition: height 0.9s cubic-bezier(0.22, 1, 0.36, 1); }
.month-col:hover .month-fill { background: linear-gradient(180deg, var(--amber), var(--amber-deep)); }

/* ---------- flux d'activité ---------- */
.activity-feed { list-style: none; display: grid; gap: 13px; }
.activity-feed-full { gap: 0; }
.activity-feed-full .activity-item { padding: 13px 0; border-bottom: 1px solid rgba(22, 52, 74, 0.6); }
.activity-feed-full .activity-item:last-child { border-bottom: none; }
.activity-item { display: flex; align-items: flex-start; gap: 12px; }
.activity-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--mist); }
.activity-download { background: var(--teal); }
.activity-create, .activity-publish { background: var(--amber); }
.activity-update { background: #7fb3d5; }
.activity-archive, .activity-delete { background: var(--coral); }
.activity-feature { background: var(--amber); box-shadow: 0 0 8px rgba(246, 168, 33, 0.7); }
.activity-body { min-width: 0; flex: 1; }
.activity-body p { font-size: 13.5px; line-height: 1.45; color: var(--paper); }
.activity-body strong { font-weight: 600; }
.activity-time { flex: none; color: var(--mist); }

/* ---------- filtres ---------- */
.admin-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-search { flex: 1 1 220px; min-width: 180px; }
.filter-search input, .admin-filters select {
  width: 100%; background: var(--ink-900); border: 1px solid var(--ink-600); color: var(--paper);
  font-family: var(--font-mono); font-size: 12.5px; padding: 10px 12px; transition: border-color 0.25s;
}
.admin-filters select { width: auto; cursor: pointer; }
.filter-search input:focus, .admin-filters select:focus { outline: none; border-color: var(--amber); }
.admin-result { margin-top: 12px; }

/* ---------- table admin ---------- */
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 760px; }
.admin-table th {
  text-align: left; font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--mist); padding: 10px 12px; border-bottom: 1px solid var(--ink-600);
  background: var(--ink-850); white-space: nowrap;
}
.admin-table td { padding: 12px; border-bottom: 1px solid rgba(22, 52, 74, 0.5); vertical-align: middle; }
.admin-table tr { transition: background 0.2s; }
.admin-table tbody tr:hover { background: rgba(246, 168, 33, 0.04); }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.row-title { display: block; color: var(--paper); text-decoration: none; font-weight: 600; transition: color 0.2s; }
.row-title:hover { color: var(--amber); }
.row-title + .mono { display: block; margin-top: 3px; }

.status-pill {
  display: inline-block; font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase;
  letter-spacing: 0.1em; padding: 3px 9px; border: 1px solid;
}
.status-published { color: var(--teal); border-color: rgba(47, 214, 195, 0.5); background: rgba(47, 214, 195, 0.08); }
.status-draft { color: var(--amber); border-color: rgba(246, 168, 33, 0.5); background: rgba(246, 168, 33, 0.08); }
.status-archived { color: var(--coral); border-color: rgba(255, 107, 91, 0.5); background: rgba(255, 107, 91, 0.08); }

.row-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.icon-btn {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--ink-600); background: var(--ink-900); color: var(--mist); cursor: pointer;
  font-size: 13px; text-decoration: none; transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}
.icon-btn:hover { color: var(--amber); border-color: var(--amber); transform: translateY(-2px); }
.icon-ok:hover { color: var(--teal); border-color: var(--teal); }
.icon-warn:hover { color: var(--amber); border-color: var(--amber); }
.icon-star:hover { color: var(--amber); border-color: var(--amber); }
.icon-danger:hover { color: var(--coral); border-color: var(--coral); }
.actions-col { white-space: nowrap; }

/* ---------- pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; }
.page-link {
  font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--amber); text-decoration: none; border: 1px solid rgba(246, 168, 33, 0.4); padding: 9px 16px;
  transition: background 0.25s, color 0.25s;
}
.page-link:hover { background: var(--amber); color: #171004; }

/* ---------- formulaire admin ---------- */
.admin-form { display: grid; gap: 24px; max-width: 900px; }
.admin-form fieldset { border: 1px solid var(--ink-700); background: rgba(8, 24, 35, 0.5); padding: 22px; }
.admin-form legend { font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber); padding: 0 10px; }
.field-check-row { grid-column: span 2; }
.field-check-row .field-check { width: auto; accent-color: var(--amber); transform: scale(1.3); }
.btn-danger { background: var(--coral); color: #2a0c08; border: none; }
.btn-danger:hover { background: var(--paper); color: var(--coral); }
.danger-panel { max-width: 640px; border-color: rgba(255, 107, 91, 0.5); }
.danger-panel h2 { font-family: var(--font-display); font-size: 20px; margin-bottom: 12px; }
.confirm-text { color: var(--mist); line-height: 1.65; font-size: 14.5px; margin-bottom: 22px; }
.confirm-text strong { color: var(--coral); }

/* ---------- login ---------- */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--ink-950); }
.login-card {
  width: 100%; max-width: 400px; border: 1px solid var(--ink-600); background: rgba(8, 24, 35, 0.9);
  padding: 34px 30px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.85);
}
.login-title { font-family: var(--font-display); font-weight: 700; font-size: 24px; margin: 20px 0 6px; }
.login-sub { margin-bottom: 22px; }
.login-form { display: grid; gap: 16px; margin-bottom: 20px; }
.login-hint { line-height: 1.7; }
.login-hint code { background: var(--ink-950); border: 1px solid var(--ink-700); padding: 2px 6px; color: var(--teal); }

/* ---------- responsive : tablette ---------- */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .admin-panels { grid-template-columns: 1fr; }
  .admin-topbar, .admin-content, .admin-messages, .admin-foot { padding-left: 22px; padding-right: 22px; }
}

/* ---------- responsive : mobile ---------- */
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side {
    position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: 8px; padding: 14px 16px; border-right: none; border-bottom: 1px solid var(--ink-700);
  }
  .admin-brand { margin: 0 auto 0 0; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; width: 100%; }
  .admin-link { padding: 9px 10px; font-size: 11px; }
  .admin-side-foot { margin-top: 0; width: 100%; flex-direction: row; flex-wrap: wrap; border-top: none; padding-top: 0; gap: 8px; }
  .admin-user { display: none; }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-topbar, .admin-content, .admin-messages, .admin-foot { padding-left: 16px; padding-right: 16px; }
  .bar-row { grid-template-columns: minmax(0, 1fr) 44px; }
  .bar-label { grid-column: 1 / -1; }
  .field-check-row { grid-column: span 1; }
  .activity-time { display: none; }
}
