/* HARPOTAURI Admin — feuille de style.
   Palette alignée sur l'app (teal / sable). */

:root {
  --bg: #f5f3ed;
  --surface: #ffffff;
  --ink: #2c241b;
  --muted: #6b7575;
  --faint: #9ca5a5;
  --teal: #1f5963;
  --teal-dark: #16424a;
  --teal-light: #e3eef0;
  --line: #e2ddd2;
  --danger: #b3261e;
  --danger-bg: #fbe9e7;
  --success: #1d7a4d;
  --success-bg: #e6f4ec;
  --warn: #9a6700;
  --warn-bg: #fff4d6;
  --info: #1f5963;
  --info-bg: #e3eef0;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  background: var(--teal-dark);
  color: #dfeaec;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.brand {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: .5px;
  padding: 20px 22px;
  color: #fff;
}
.brand span { color: #7fb3bc; font-weight: 400; }
.nav { display: flex; flex-direction: column; padding: 8px; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px;
  color: #cfe0e3; font-weight: 500;
}
.nav-link:hover { background: rgba(255, 255, 255, .07); text-decoration: none; color: #fff; }
.nav-link.active { background: var(--teal); color: #fff; }
.nav-icon { width: 20px; text-align: center; font-size: 15px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.page-title { font-size: 19px; font-weight: 600; margin: 0; color: var(--teal-dark); }
.user-box { display: flex; align-items: center; gap: 10px; }
.user-name { font-weight: 600; }
.user-email { color: var(--faint); font-size: 12px; }

.content { padding: 24px 28px; max-width: 1280px; width: 100%; }

/* ---------- Flash ---------- */
.flash {
  padding: 11px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 500;
  border: 1px solid transparent;
}
.flash-success { background: var(--success-bg); color: var(--success); border-color: #bfe3cd; }
.flash-error { background: var(--danger-bg); color: var(--danger); border-color: #f3c9c4; }
.flash-info { background: var(--info-bg); color: var(--info); border-color: #c5dde1; }
.flash-warn { background: var(--warn-bg); color: var(--warn); border-color: #efd99a; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px;
}
.card-head {
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-head h2 { font-size: 15px; margin: 0; font-weight: 600; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

/* ---------- KPIs ---------- */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px; margin-bottom: 22px;
}
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); display: block; color: inherit;
}
a.kpi:hover { border-color: var(--teal); text-decoration: none; }
.kpi-value { font-size: 26px; font-weight: 700; color: var(--teal-dark); line-height: 1.1; }
.kpi-label { color: var(--muted); margin-top: 4px; font-size: 13px; }
.kpi-sub { color: var(--faint); font-size: 12px; margin-top: 6px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.grid th, table.grid td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
table.grid th {
  font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase;
  letter-spacing: .03em; background: #fbfaf7;
}
table.grid tbody tr:hover { background: #fbfaf7; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid .row-actions { white-space: nowrap; text-align: right; }
.empty { padding: 30px; text-align: center; color: var(--faint); }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 1.5;
}
.badge-neutral { background: #eee9df; color: #6a5d49; }
.badge-muted { background: #edeeee; color: #74807f; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-admin { background: #2c2138; color: #e8defc; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 8px 15px; border-radius: 8px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; cursor: pointer; background: var(--teal); color: #fff;
  text-decoration: none; line-height: 1.3;
}
.btn:hover { background: var(--teal-dark); text-decoration: none; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-ghost { background: transparent; color: var(--teal); border-color: var(--line); }
.btn-ghost:hover { background: var(--teal-light); color: var(--teal-dark); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #8c1d17; }
.btn-secondary { background: #eee9df; color: var(--ink); }
.btn-secondary:hover { background: #e2ddd2; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 4px; }
.field label { font-weight: 600; font-size: 13px; color: var(--ink); }
.field .hint { color: var(--faint); font-size: 12px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=search], select, textarea {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff; color: var(--ink); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal-light); border-color: var(--teal); }
.check { flex-direction: row; align-items: center; gap: 8px; }
.check input { width: auto; }
textarea { resize: vertical; min-height: 80px; }

/* ---------- Filters bar ---------- */
.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  margin-bottom: 18px;
}
.toolbar .field { margin: 0; }
.toolbar form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.spacer { flex: 1; }

/* ---------- Pager ---------- */
.pager { display: flex; gap: 4px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.pager-item {
  display: inline-block; padding: 6px 11px; border: 1px solid var(--line);
  border-radius: 7px; background: #fff; color: var(--teal); font-size: 13px;
}
.pager-item.active { background: var(--teal); color: #fff; border-color: var(--teal); }
.pager-item.disabled { color: var(--faint); background: #f7f5f0; }
a.pager-item:hover { background: var(--teal-light); text-decoration: none; }
.pager-total { color: var(--faint); margin-left: 8px; font-size: 12.5px; }

/* ---------- Detail / definition list ---------- */
.dl { display: grid; grid-template-columns: 200px 1fr; gap: 0; }
.dl dt { padding: 9px 0; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.dl dd { padding: 9px 0; margin: 0; border-bottom: 1px solid var(--line); }

/* ---------- Bars (mini graphs) ---------- */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 10px; }
.bar { flex: 1; background: var(--teal); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bar:hover { background: var(--teal-dark); }
.bar .bar-val {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--muted); white-space: nowrap;
}
.bar-labels { display: flex; gap: 4px; margin-top: 6px; }
.bar-labels span { flex: 1; text-align: center; font-size: 10px; color: var(--faint); }

.sales-spark { display: flex; align-items: flex-end; gap: 2px; height: 44px; }
.sales-spark .sb { flex: 1; background: var(--teal-light); border-radius: 2px 2px 0 0; min-height: 1px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--teal-dark); }
.login-card { background: var(--surface); border-radius: 14px; padding: 34px; width: 360px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.login-card .brand { padding: 0 0 6px; color: var(--teal-dark); }
.login-card .brand span { color: #7fb3bc; }
.login-sub { color: var(--muted); margin: 0 0 22px; font-size: 13px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; text-align: center; padding: 11px; }

.muted-text { color: var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
.section-title { font-size: 15px; font-weight: 600; margin: 26px 0 12px; color: var(--teal-dark); }
.json-box {
  background: #1d2b2e; color: #d7e7e9; padding: 14px; border-radius: 8px;
  overflow-x: auto; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; white-space: pre;
}
