/* ==========================================================================
   OméSky Store — back-office. Reprend les couleurs et la typographie du site,
   avec la densité d'un outil de travail.
   ========================================================================== */

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

/* ------------------------------------------------------------ Barre latérale */
.sidebar {
  position: sticky; top: 0; align-self: start; height: 100vh;
  display: flex; flex-direction: column; gap: 1.5rem;
  padding: 1.3rem 1.2rem; background: #101116;
  border-right: 1px solid var(--line-soft);
}
.sidebar > .wordmark { font-size: 1.1rem; white-space: normal; line-height: 1.2; }

.sidebar-nav { display: grid; align-content: start; gap: .2rem; flex: 1; }
.sidebar-nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .7rem; border-radius: var(--r-sm);
  font-size: .93rem; font-weight: 500; text-decoration: none; color: var(--text-2);
}
.sidebar-nav a:hover { background: var(--surface); color: var(--text); }
.sidebar-nav a.is-active { background: var(--surface-2); color: var(--text); font-weight: 600; }
.sidebar-nav .ico { display: none; }

.badge {
  margin-left: auto; min-width: 1.35rem; padding: 0 .35rem; text-align: center;
  border-radius: 999px; font-size: .76rem; font-weight: 700;
  background: var(--accent); color: var(--on-accent);
}

.sidebar-foot { display: grid; gap: .9rem; }
.sidebar-user {
  display: flex; align-items: flex-end; justify-content: space-between; gap: .6rem;
  padding-top: .9rem; border-top: 1px solid var(--line-soft); font-size: .85rem;
}
.sidebar-user span { display: block; font-size: .77rem; color: var(--text-3); }

/* ----------------------------------------------------------- Zone de travail */
.admin-main { padding: 1.6rem 2.2rem 4rem; min-width: 0; }
.admin-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 1.6rem;
}
.admin-head h1 { margin: 0; font-size: 1.6rem; }

.panel {
  padding: 1.3rem 1.4rem; margin-bottom: 1.3rem; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line-soft);
}
.panel > h2, .panel > h3 { font-size: 1rem; margin: 0 0 1rem; }
.panel-flush { padding: 1.3rem 0 .4rem; }
.panel-flush > h2 { padding: 0 1.4rem; }
.hint { display: block; font-size: .82rem; color: var(--text-3); margin-top: .3rem; }
.hint a { color: var(--text-2); }

/* --------------------------------------------------------------- Compteurs */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.3rem; }
.stat-card {
  padding: 1rem 1.15rem 1.1rem; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line-soft);
}
.stat-card .k { font-size: .84rem; color: var(--text-3); }
.stat-card .v { font-size: 2rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.03em; }

.chart { display: flex; align-items: flex-end; gap: 3px; height: 110px; }
.chart .col { flex: 1; min-height: 3px; border-radius: 3px 3px 0 0; background: var(--surface-2); }
.chart .col:hover { background: var(--accent); }
.chart-legend { display: flex; justify-content: space-between; font-size: .8rem; color: var(--text-3); margin-top: .6rem; }

/* --------------------------------------------------------------- Tableaux */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .7rem .9rem; text-align: left; vertical-align: middle; }
.table th { font-size: .82rem; font-weight: 600; color: var(--text-3); border-bottom: 1px solid var(--line); }
.table td { border-bottom: 1px solid var(--line-soft); }
.table tbody tr:hover { background: var(--surface-2); }
.table td.actions { text-align: right; white-space: nowrap; }
.table td.actions > * { margin-left: .35rem; }
.table .row-title { display: flex; align-items: center; gap: .75rem; font-weight: 600; text-decoration: none; }
.table .row-title:hover { color: var(--accent); }

.thumb {
  width: 2.4rem; height: 2.4rem; flex: none; display: grid; place-items: center;
  overflow: hidden; border-radius: var(--r-sm); font-weight: 700; color: #fff;
  background: var(--tint-own, var(--surface-2));
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.status { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--text-2); }
.status::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; flex: none; }
.status-published::before, .status-approved::before { background: var(--ok); }
.status-draft::before, .status-pending::before { background: #ffb020; }
.status-rejected::before { background: var(--accent); }
button.status { background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }
button.status:hover { color: var(--text); }

.inline-form { display: inline; }

/* ------------------------------------------------------------- Formulaires */
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.3rem; align-items: start; }
.form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .25rem; }
.check { display: flex; gap: .55rem; align-items: center; font-size: .92rem; cursor: pointer; padding: .12rem 0; }
.check input { accent-color: var(--accent); }
.field input[type="checkbox"], .field input[type="radio"] { width: auto; }
.field input[type="file"] { background: transparent; border: 1px dashed var(--line); padding: .5rem; }
.field input[type="color"] { width: 3.6rem; padding: .15rem; height: 2.4rem; }

.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.3rem; }
.toolbar input[type="search"], .toolbar select {
  padding: .45rem .7rem; border-radius: var(--r-sm); font: inherit; font-size: .92rem;
  color: var(--text); background: var(--surface); border: 1px solid var(--line);
}

.tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.tabs a {
  padding: .35rem .85rem; border-radius: 999px; font-size: .88rem; font-weight: 600;
  text-decoration: none; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--line-soft);
}
.tabs a:hover { color: var(--text); }
.tabs a.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.media-preview {
  display: flex; align-items: center; gap: .9rem; margin-bottom: .6rem;
  padding: .55rem; border-radius: var(--r-sm); background: var(--surface-2);
}
.media-preview img { width: 3.4rem; height: 3.4rem; object-fit: cover; border-radius: var(--r-sm); }

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .9rem; }
.shot { border-radius: var(--r); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line-soft); }
.shot img { width: 100%; height: 6.2rem; object-fit: cover; }
.shot-foot { padding: .55rem; display: grid; gap: .45rem; }
.shot-foot input {
  width: 100%; padding: .3rem .45rem; border-radius: var(--r-sm);
  font: inherit; font-size: .82rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--line);
}

.side-apps { display: grid; gap: .1rem; }
.side-app {
  display: flex; align-items: center; gap: .75rem; padding: .55rem 0;
  text-decoration: none; font-size: .92rem;
}
.side-app + .side-app { border-top: 1px solid var(--line-soft); }
.side-app:hover strong { color: var(--accent); }
.side-app strong { display: block; font-weight: 600; }
.side-app .quiet { font-size: .82rem; color: var(--text-3); }

.releases .release { background: var(--surface-2); }

/* ---------------------------------------------------------------- Connexion */
.blank-body { display: grid; place-items: center; min-height: 100vh; padding: 2rem; }
.login-card {
  width: min(24rem, 100%); padding: 2rem 1.9rem;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--line-soft);
}
.login-card .wordmark { display: block; margin-bottom: 1.5rem; }
.login-card h1 { font-size: 1.45rem; }
.login-card > p { color: var(--text-2); font-size: .92rem; margin-bottom: 1.5rem; }
.login-card .action-block { margin-top: 1.3rem; }
.login-card .hint { text-align: center; margin-top: 1.2rem; }

@media (max-width: 1080px) {
  .form-grid, .form-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .admin-body { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center;
    border-right: 0; border-bottom: 1px solid var(--line-soft);
  }
  .sidebar-nav { flex: 1 1 100%; grid-auto-flow: column; grid-auto-columns: max-content; gap: .4rem; overflow-x: auto; }
  .sidebar-foot { flex: 1 1 100%; grid-auto-flow: column; align-items: center; }
  .sidebar-user { border-top: 0; padding-top: 0; }
  .admin-main { padding: 1.2rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
