/* Gnoson — Michroma web font */
@font-face {
  font-family: "Michroma";
  src: url("../fonts/Michroma.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Gnoson Design System — Color Tokens
 *
 * Valeurs RGB sans rgb() pour compatibilité avec les modificateurs d'opacité Tailwind
 * (ex: bg-primary/50 fonctionne parce que la valeur est "53 68 193" et non "rgb(53 68 193)").
 *
 * Palette Gnoson — Indigo · Cyan · Neutres
 * Pour changer le thème : modifier les valeurs ici uniquement.
 * Pour un thème par tenant : injecter une balise <style> Django qui surcharge :root.
 */

:root {
  /* ── Primary (Indigo) ────────────────────────────────────────────── */
  --c-primary:       53  68 193;   /* Indigo 600  #3544C1  ✦ CTA principal */
  --c-primary-hover: 30  46 138;   /* Indigo 800  #1E2E8A */
  --c-primary-50:   238 240 251;   /* Indigo 50   #EEF0FB */
  --c-primary-100:  197 201 242;   /* Indigo 100  #C5C9F2 */
  --c-primary-200:  155 163 232;   /* Indigo 200  #9BA3E8 */
  --c-primary-400:   92 104 216;   /* Indigo 400  #5C68D8 */
  --c-primary-700:   30  46 138;   /* Indigo 800  #1E2E8A  (texte sur fond primaire clair) */
  --c-primary-800:   30  46 138;   /* Indigo 800  #1E2E8A */
  --c-primary-900:   15  26  92;   /* Indigo 900  #0F1A5C */

  /* ── Accent (Cyan) ───────────────────────────────────────────────── */
  --c-accent:        34 181 200;   /* Cyan 500  #22B5C8  ✦ CTA secondaire */
  --c-accent-200:   125 216 228;   /* Cyan 200  #7DD8E4 */
  --c-accent-700:    14 122 137;   /* Cyan 700  #0E7A89 */

  /* ── Neutral (Gris) ──────────────────────────────────────────────── */
  --c-neutral-50:   245 245 243;   /* Gris 50   #F5F5F3 */
  --c-neutral-100:  232 232 230;
  --c-neutral-200:  205 205 201;
  --c-neutral-300:  184 184 178;   /* Gris 300  #B8B8B2 */
  --c-neutral-400:  155 155 148;
  --c-neutral-500:  121 121 117;
  --c-neutral-600:   89  89  85;
  --c-neutral-700:   71  71  68;
  --c-neutral-800:   58  58  56;   /* Gris 800  #3A3A38  (corps de texte) */
  --c-neutral-900:   32  32  30;

  /* ── Semantic ─────────────────────────────────────────────────────── */
  --c-danger:        220  38  38;   /* red-600 */
  --c-danger-light:  254 242 242;   /* red-50  */
  --c-danger-border: 248 113 113;   /* red-400 */
  --c-danger-dark:   185  28  28;   /* red-700 */

  --c-success:       22 163  74;   /* green-600 */
  --c-success-dark:  21 128  61;   /* green-700 */
  --c-warning:      217 119   6;   /* amber-600 */
  --c-info:          34 181 200;   /* = accent (Cyan 500) */
}

/* ── Gnoson Design System — Component: btn-primary ──────────────────────────
 *
 * Bouton d'action primaire. Usage type : "Configure", "New referential", etc.
 * S'applique à <button> ou <a>. Utiliser `inline-flex` nativement.
 *
 * Équivalent Tailwind (pour référence) :
 *   inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5
 *   text-sm font-medium text-white shadow-sm hover:bg-primary/90 transition-colors
 */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 0.375rem;
  background-color: rgb(var(--c-primary));
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5rem;
  color: #ffffff;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: background-color 0.15s ease;
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}
.btn-primary:hover {
  background-color: rgb(var(--c-primary-hover));
  color: #ffffff;
  text-decoration: none;
}
.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgb(var(--c-primary) / 0.35);
}

/* ── Layout ──────────────────────────────────────────────────────────────── */

body {
  background-color: rgb(var(--c-neutral-50));
  color: rgb(var(--c-neutral-800));
  font-family: ui-sans-serif, system-ui, sans-serif;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Navigation bar ──────────────────────────────────────────────────────── */

.console-nav {
  background-color: rgb(var(--c-primary-900));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 3.5rem;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.console-nav__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #fff;
}

.console-nav__logo {
  height: 1.5rem;
  width: auto;
}

.console-nav__site-name {
  font-family: "Michroma", sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  color: #fff;
  white-space: nowrap;
}

.console-nav__tenant {
  font-size: 0.8rem;
  color: rgb(var(--c-accent-200));
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  background: rgb(var(--c-primary) / 0.4);
  border-radius: 0.25rem;
  margin-left: 0.5rem;
}

.console-nav__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.console-nav__user {
  font-size: 0.8rem;
  color: rgb(var(--c-primary-100));
}

.console-nav__link {
  font-size: 0.8rem;
  color: rgb(var(--c-primary-100));
  text-decoration: none;
  padding: 0.25rem 0.75rem;
  border: 1px solid rgb(var(--c-primary-400));
  border-radius: 0.25rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.console-nav__link:hover {
  background-color: rgb(var(--c-primary) / 0.4);
  color: #fff;
  text-decoration: none;
}

/* ── Main content ────────────────────────────────────────────────────────── */

.console-main {
  flex: 1;
  padding: 2rem 1.5rem;
  max-width: 72rem;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.console-page-title {
  font-family: "Michroma", sans-serif;
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgb(var(--c-primary-900));
  margin: 0 0 0.25rem 0;
}

.console-page-subtitle {
  font-size: 0.85rem;
  color: rgb(var(--c-neutral-500));
  margin: 0 0 1.75rem 0;
}

/* ── Alert / messages ────────────────────────────────────────────────────── */

.console-alert {
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.console-alert--warning {
  background-color: rgb(254 243 199);
  color: rgb(146 64 14);
  border: 1px solid rgb(252 211 77);
}
.console-alert--error {
  background-color: rgb(var(--c-danger-light));
  color: rgb(var(--c-danger-dark));
  border: 1px solid rgb(var(--c-danger-border));
}

/* ── Instance cards grid ─────────────────────────────────────────────────── */

.console-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
  gap: 1.25rem;
}

.console-card {
  background: #fff;
  border: 1px solid rgb(var(--c-neutral-200));
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.console-card__header {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid rgb(var(--c-neutral-100));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.console-card__title {
  font-family: "Michroma", sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  color: rgb(var(--c-neutral-900));
  margin: 0;
  letter-spacing: 0.03em;
}

.console-card__body {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.console-card__row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.console-card__label {
  color: rgb(var(--c-neutral-500));
  flex-shrink: 0;
  min-width: 6rem;
}

.console-card__value {
  color: rgb(var(--c-neutral-800));
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
}

.console-card__footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgb(var(--c-neutral-100));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: rgb(var(--c-neutral-50));
}

/* ── Badges ──────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.badge--running {
  background: rgb(220 252 231);
  color: rgb(21 128 61);
}

.badge--stopped {
  background: rgb(var(--c-neutral-100));
  color: rgb(var(--c-neutral-600));
}

.badge--unknown {
  background: rgb(254 243 199);
  color: rgb(146 64 14);
}

.badge--multi {
  background: rgb(var(--c-primary-50));
  color: rgb(var(--c-primary-700));
}

.badge--single {
  background: rgb(var(--c-neutral-100));
  color: rgb(var(--c-neutral-600));
}

/* ── Tenant count chip ───────────────────────────────────────────────────── */

.tenant-count {
  font-size: 0.78rem;
  color: rgb(var(--c-neutral-500));
}

.tenant-count strong {
  color: rgb(var(--c-neutral-800));
}

/* ── Empty state ─────────────────────────────────────────────────────────── */

.console-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: rgb(var(--c-neutral-500));
}

.console-empty__title {
  font-family: "Michroma", sans-serif;
  font-size: 1rem;
  color: rgb(var(--c-neutral-400));
  margin: 0 0 0.5rem 0;
}

.console-empty__body {
  font-size: 0.85rem;
}
