/* ─── layout.css : page-level skeletons ─── */

#app { height: 100vh; display: flex; flex-direction: column; }

/* ─── Top header ─── */
top-header { display: block; }

header.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-panel);
  z-index: 10;
}

.brand {
  display: inline-flex; align-items: center; gap: var(--space-3);
  text-decoration: none; color: inherit;
}
.brand:hover .brand-name__strong { color: var(--brand-blue); }

.brand-mark { width: 34px; height: 34px; display: block; }

.brand-name {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-size: var(--text-h3);
  letter-spacing: 0.2px;
}
.brand-name__strong { font-weight: 800; color: var(--text-strong); }
.brand-name__weak   { font-weight: 400; color: var(--text-muted); }

.top-actions { display: flex; gap: var(--space-2); align-items: center; }

/* ─── Dashboard (home) ─── */
#dashboard {
  flex: 1; overflow-y: auto; padding: var(--space-12) var(--space-8);
  display: flex; flex-direction: column; align-items: center;
}
.dashboard-inner { max-width: 1080px; width: 100%; }
.dashboard-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-1);
}
.dashboard-header h2 { margin: 0; }
.dashboard-inner h2 {
  font-size: var(--text-display); font-weight: 800;
  line-height: var(--leading-tight);
  color: var(--text-strong);
}
.dashboard-inner .subtitle {
  color: var(--text-muted); font-size: var(--text-small);
  margin-bottom: var(--space-8);
}
.dashboard-count {
  color: var(--text-muted);
  font-size: var(--text-small);
  margin-bottom: var(--space-5);
}
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}
/* ─── Sessions section (Modifications en cours) ─── */
.sessions-section {
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4) var(--space-5);
  margin-top: var(--space-6);
}
.sessions-section h3 {
  font-size: var(--text-small);
  color: var(--text-strong);
  font-weight: 700;
  margin-bottom: var(--space-3);
  display: flex; align-items: center; gap: var(--space-2);
}
.sessions-section h3 .sessions-count {
  font-size: var(--text-tiny);
  color: var(--text-muted);
  background: var(--surface-elev);
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-default);
  font-weight: 700;
}

#sessions-list {
  display: flex; flex-direction: column; gap: var(--space-2);
}

.session-row {
  background: var(--surface-elev);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 10px var(--space-3);
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: var(--space-3);
  align-items: center;
}
.session-row .session-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: white;
  font-size: var(--text-small);
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.session-row .info-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.session-row .info-text .site-name {
  font-size: var(--text-small);
  font-weight: 700;
  color: var(--text-strong);
}
.session-row .info-text .site-slug {
  font-family: var(--font-mono);
  font-size: var(--text-tiny);
  color: var(--text-muted);
}
.session-row .meta-col {
  display: flex; flex-direction: column; gap: 2px;
  font-size: var(--text-tiny);
  color: var(--text-muted);
  text-align: right;
}
.session-row .row-actions { display: flex; gap: 6px; }

/* Status pill avec dot animé pour les rows */
.session-row .status-pill {
  align-self: flex-end;
}
.session-row .status-pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  animation: pulse 1.4s infinite;
  display: inline-block;
}

/* ─── Session view (split chat / preview) ─── */
#session-view { flex: 1; display: flex; min-height: 0; }
#chat-col {
  width: 44%; min-width: 380px;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border-subtle);
  background: var(--surface-panel);
}
#preview-col {
  flex: 1; display: flex; flex-direction: column;
  background: var(--surface-app);
}
chat-panel, preview-panel {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
}
.session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-panel);
  border-bottom: 1px solid var(--border-default);
}
.session-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ─── Generic page (account, admin, history) ─── */
.page-main {
  flex: 1; overflow-y: auto; padding: var(--space-8);
  display: flex; justify-content: center;
}
.page-inner { max-width: 900px; width: 100%; }
.page-inner h2 {
  font-size: var(--text-display); font-weight: 800;
  line-height: var(--leading-tight);
  color: var(--text-strong);
  margin: var(--space-2) 0 var(--space-6);
}
.page-inner h3 {
  font-size: var(--text-h3); font-weight: 700;
  color: var(--text-strong);
  margin: 0 0 var(--space-3);
}
.back-link {
  color: var(--text-muted); text-decoration: none;
  font-size: var(--text-tiny);
  display: inline-block; margin-bottom: var(--space-2);
}
.back-link:hover { color: var(--text-strong); }

/* ─── Login page (was css/login.css) ─── */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-6);
  background: var(--surface-app);
}
.login-card {
  background: var(--surface-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  width: 100%; max-width: 380px;
  box-shadow: var(--shadow-md);
}
.login-brand {
  text-align: center;
  margin-bottom: var(--space-6);
}
.login-wordmark {
  width: 200px; max-width: 100%;
  height: auto; display: block;
  margin: 0 auto var(--space-2);
}
.login-sub {
  margin: 0 0 var(--space-3);
  font-size: var(--text-body); font-weight: 400;
  color: var(--text-muted); letter-spacing: 0.4px;
}
.login-tagline {
  margin: 0;
  font-size: var(--text-small); color: var(--text-default);
}
.login-card form { display: flex; flex-direction: column; gap: var(--space-3); }
.login-card label {
  display: flex; flex-direction: column; gap: var(--space-1);
  font-size: var(--text-small); color: var(--text-muted);
}
.login-card input[type="email"],
.login-card input[type="password"] {
  padding: 10px var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--surface-panel);
  color: var(--text-strong);
  font-size: var(--text-body);
  font-family: inherit;
}
.login-card input:focus { outline: none; border-color: var(--brand-orange); box-shadow: var(--shadow-focus); }
.login-card button[type="submit"] {
  margin-top: var(--space-1);
  padding: 11px var(--space-4);
  border-radius: var(--radius-sm);
  border: none;
  background: var(--brand-orange);
  color: var(--brand-orange-on);
  font-weight: 700; font-size: var(--text-body);
  cursor: pointer; font-family: inherit;
  transition: background-color 0.15s, box-shadow 0.15s;
}
.login-card button[type="submit"]:hover { background: var(--brand-orange-hover); }
.login-card button[type="submit"]:disabled { opacity: 0.5; cursor: not-allowed; }
.login-card .error {
  min-height: 1.2em;
  color: var(--status-danger);
  font-size: var(--text-small);
  margin-top: var(--space-1);
}
