/* Console développeur Hopcast — tout le visuel sort des tokens du design
   system (design/colors_and_type.css). Cartes : border OU shadow, jamais les
   deux ; un seul accent orange par surface ; motion 120–240 ms sans bounce. */

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg-subtle); }
[hidden] { display: none !important; }

/* ---------- Login ---------- */
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hop-blue-600);
  padding: var(--space-6);
}
.login-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-9) var(--space-8);
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  text-align: center;
  align-items: center;
}
.login-logo { width: 160px; height: auto; }
.login-lead { color: var(--fg-muted); font-size: var(--text-sm); }

.banner {
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  width: 100%;
}
.banner-danger { background: var(--hop-danger-bg); color: var(--hop-danger); }

/* ---------- Boutons ---------- */
.btn {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px var(--space-5);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  transition: background var(--dur-fast) var(--ease-standard),
              transform var(--dur-fast) var(--ease-standard);
}
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--hop-blue-600); color: var(--fg-inverse); }
.btn-primary:hover { background: var(--hop-blue-700); }

.btn-ghost { background: transparent; color: var(--fg-brand); }
.btn-ghost:hover { background: var(--hop-blue-50); }

.btn-google {
  background: var(--bg-surface);
  color: var(--fg-primary);
  border: 1px solid var(--border-default);
  width: 100%;
  padding: 12px var(--space-5);
}
.btn-google:hover { background: var(--hop-gray-50); }

.btn-danger { background: transparent; color: var(--hop-danger); padding: 6px 10px; }
.btn-danger:hover { background: var(--hop-danger-bg); }

.btn-icon {
  background: transparent;
  color: var(--fg-muted);
  padding: 6px;
  border-radius: var(--radius-sm);
  flex: none;
}
.btn-icon:hover { background: var(--hop-blue-50); color: var(--fg-brand); }
/* Icône copier (style Lucide, trait 1.75) injectée en CSS pour rester statique. */
.btn-icon::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>') center / contain no-repeat;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>') center / contain no-repeat;
}

/* ---------- Topbar ---------- */
.topbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-6);
}
.topbar-logo { height: 24px; width: auto; }
.topbar-title {
  font-size: var(--text-sm);
  color: var(--fg-muted);
  border-left: 1px solid var(--border-subtle);
  padding-left: var(--space-4);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--space-4); }
.topbar-email { font-size: var(--text-sm); color: var(--fg-muted); }

/* ---------- Layout ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: var(--space-7) var(--space-6); }
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}
.card-wide { grid-column: 1 / -1; }
@media (max-width: 800px) { .grid { grid-template-columns: 1fr; } }

/* ---------- Cartes ---------- */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }

.badge {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  background: var(--hop-blue-100);
  color: var(--hop-blue-700);
}
.badge-success { background: var(--hop-success-bg); color: var(--hop-success); }
.badge-muted { background: var(--hop-gray-150); color: var(--hop-gray-600); }

.tenant-name { font-weight: 600; color: var(--fg-primary); font-size: var(--text-md); }
.field-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--fg-subtle);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.id-row { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.id-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--hop-blue-50);
  color: var(--hop-blue-800);
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  overflow-x: auto;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.id-value-block { padding: 10px 12px; }

/* ---------- Usage ---------- */
.segments { display: flex; gap: var(--space-1); background: var(--hop-gray-100); border-radius: var(--radius-md); padding: 3px; }
.segment {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--fg-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.segment:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.segment.is-active { background: var(--bg-surface); color: var(--fg-primary); box-shadow: var(--shadow-xs); }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.metric-block { display: flex; flex-direction: column; gap: var(--space-1); }
.metric { font-size: var(--text-2xl); }
/* Un seul accent orange sur la carte usage : le volume échangé. */
.metric-accent { color: var(--hop-orange-600); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th {
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--fg-subtle);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}
td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--fg-body);
  white-space: nowrap;
}
td.mono { font-family: var(--font-mono); font-size: var(--text-xs); }
tr:last-child td { border-bottom: none; }
.empty { color: var(--fg-subtle); font-size: var(--text-sm); }

/* ---------- Formulaires ---------- */
.inline-form { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.inline-form input, .inline-form select {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--fg-body);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 9px var(--space-3);
  min-width: 180px;
  transition: border-color var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast) var(--ease-standard);
}
.inline-form input:focus, .inline-form select:focus {
  outline: none;
  border-color: var(--border-brand);
  box-shadow: var(--shadow-focus);
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(38, 50, 69, 0.4); /* scrim --hop-blue-900 à 40 % */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  z-index: 50;
}
.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-7);
  max-width: 560px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
/* Un seul accent orange sur la modal : l'avertissement une-seule-fois. */
.modal-warning {
  background: var(--hop-warning-bg);
  color: var(--hop-orange-900);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
}
.modal-actions { display: flex; justify-content: flex-end; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  background: var(--hop-blue-800);
  color: var(--fg-inverse);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: var(--space-3) var(--space-5);
  z-index: 60;
}
