/* ==========================================================================
   AURA-MEET — GENEVA GRADUATE INSTITUTE (IHEID) DESIGN SYSTEM
   Institut de hautes études internationales et du développement (Genève)
   Charte graphique officielle : Rouge IHEID #E20020, Typographie Montserrat
   Authentification Google Workspace (@graduateinstitute.ch) & Souveraineté
   ========================================================================== */

:root {
  /* Official IHEID Signature Palette */
  --iheid-red: #e20020;
  --iheid-red-hover: #c00018;
  --iheid-red-subtle: rgba(226, 0, 32, 0.08);
  --iheid-red-border: rgba(226, 0, 32, 0.35);

  --primary: #e20020;
  --primary-hover: #c00018;
  --primary-subtle: rgba(226, 0, 32, 0.1);

  /* Dark Theme (Scholarly Executive Slate) */
  --bg-app: #0f141c;
  --bg-sidebar: #141b26;
  --bg-card: #182232;
  --bg-card-subtle: #1e2b3e;
  --bg-card-hover: #25354d;
  --bg-input: #1a2536;
  --bg-input-focus: #223147;

  --border-subtle: #27374f;
  --border-strong: #364b6b;
  --border-focus: #e20020;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Accent Colors */
  --accent-emerald: #10b981;
  --accent-emerald-bg: rgba(16, 185, 129, 0.12);
  --accent-amber: #f59e0b;
  --accent-amber-bg: rgba(245, 158, 11, 0.12);
  --accent-purple: #8b5cf6;
  --accent-purple-bg: rgba(139, 92, 246, 0.12);
  --accent-teal: #0d9488;
  --accent-teal-bg: rgba(13, 148, 136, 0.12);
  --accent-blue: #2563eb;
  --accent-blue-bg: rgba(37, 99, 235, 0.12);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.25);
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);

  --sidebar-width: 275px;
  --topbar-height: 58px;
}

[data-theme="light"] {
  --bg-app: #f4f4f6;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-subtle: #f9f9fb;
  --bg-card-hover: #f1f2f6;
  --bg-input: #ffffff;
  --bg-input-focus: #ffffff;

  --border-subtle: #e0e0e0;
  --border-strong: #cccccc;
  --border-focus: #e20020;

  --text-main: #1a1a1a;
  --text-muted: #505050;
  --text-dim: #888888;

  --primary: #e20020;
  --primary-hover: #c00018;
  --primary-subtle: #fdf2f2;

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
  --shadow-card: 0 2px 5px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
}

/* Base Reset & Typography (Montserrat / Swiss Geometric) */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.5;
}

/* Red institutional top ribbon (Signature IHEID) */
.iheid-top-ribbon {
  height: 4px;
  background: var(--iheid-red);
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}

/* App Layout Grid (Sidebar + Main Viewport) */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  padding-top: 4px; /* Space for top ribbon */
}

/* ==========================================================================
   SIDEBAR (Navigation Institutionnelle IHEID)
   ========================================================================== */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: calc(100vh - 4px);
  position: sticky;
  top: 4px;
  z-index: 50;
  overflow-y: auto;
}

/* Sidebar Header & IHEID Logo Branding */
.sidebar-header {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-shield {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--iheid-red);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(226, 0, 32, 0.3);
}

.brand-text h1 {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text-main);
  text-transform: uppercase;
}

.brand-text p {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.2;
  margin-top: 0.1rem;
}

/* Persona Switcher Card inside Sidebar */
.sidebar-persona-card {
  padding: 0.85rem 1rem;
  margin: 0.85rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.persona-info-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.persona-avatar {
  font-size: 1.4rem;
  line-height: 1;
}

.persona-details {
  flex: 1;
  min-width: 0;
}

.persona-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.persona-email {
  font-size: 0.68rem;
  color: var(--iheid-red);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: monospace;
}

.persona-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.persona-role-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  align-self: flex-start;
}

.persona-select-wrapper {
  margin-top: 0.25rem;
}

.persona-select {
  width: 100%;
  padding: 0.35rem 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.persona-select:focus {
  border-color: var(--iheid-red);
}

/* Sidebar Navigation Sections */
.sidebar-nav {
  padding: 0.5rem 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 0 0.5rem;
  margin-bottom: 0.35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.825rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
}

.nav-item-content {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-item:hover:not(.locked) {
  background-color: var(--bg-card-hover);
  color: var(--text-main);
}

.nav-item.active {
  background-color: var(--primary-subtle);
  color: var(--iheid-red);
  font-weight: 700;
  border-left: 3px solid var(--iheid-red);
}

/* Locked items (RBAC restrictions) - En production, les modules non autorisés sont strictement masqués */
.nav-item.locked {
  display: none !important;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: opacity 0.2s ease;
}

/* Chips interactifs de suggestions pour l'assistant */
.chat-chips-container {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.btn-chat-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-chat-chip:hover {
  background: var(--primary-subtle);
  color: var(--iheid-red);
  border-color: var(--iheid-red-border);
  transform: translateY(-1px);
}

.nav-lock-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card-subtle);
  color: var(--text-dim);
  border: 1px solid var(--border-subtle);
}

/* Sidebar Footer (Air Gap & IHEID Domain) */
.sidebar-footer {
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.airgap-status-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.footer-compliance-tags {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 0.2rem 0.45rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.theme-toggle-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

/* ==========================================================================
   MAIN VIEWPORT (Header Topbar + Content)
   ========================================================================== */
.main-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: calc(100vh - 4px);
  overflow-y: auto;
}

/* Topbar */
.topbar {
  height: var(--topbar-height);
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 40;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.campus-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.campus-badge strong {
  color: var(--iheid-red);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.clearance-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.725rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

/* User Session Status in Topbar */
.user-session-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.725rem;
}

.user-session-email {
  font-family: monospace;
  font-weight: 600;
  color: var(--iheid-red);
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  border-radius: 3px;
  padding: 0.15rem 0.4rem;
  font-size: 0.68rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-logout:hover {
  background: var(--iheid-red-subtle);
  color: var(--iheid-red);
  border-color: var(--iheid-red-border);
}

/* Main Viewport Content */
.content-area {
  padding: 1.5rem;
  flex: 1;
}

/* ==========================================================================
   CARDS, PANELS & GRIDS
   ========================================================================== */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-iheid {
  background: var(--iheid-red-subtle);
  color: var(--iheid-red);
  border: 1px solid var(--iheid-red-border);
}

.badge-low {
  background: var(--accent-emerald-bg);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-medium {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-high {
  background: var(--iheid-red-subtle);
  color: var(--iheid-red);
  border: 1px solid var(--iheid-red-border);
}

.badge-purple {
  background: var(--accent-purple-bg);
  color: var(--accent-purple);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-teal {
  background: var(--accent-teal-bg);
  color: var(--accent-teal);
  border: 1px solid rgba(13, 148, 136, 0.3);
}

/* Buttons */
.btn-primary {
  background-color: var(--iheid-red);
  color: #ffffff;
  border: 1px solid transparent;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: background-color 0.15s ease;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--iheid-red-hover);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background-color: var(--bg-card-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.btn-danger {
  background-color: var(--iheid-red-subtle);
  color: var(--iheid-red);
  border: 1px solid var(--iheid-red-border);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-danger:hover:not(:disabled) {
  background-color: rgba(226, 0, 32, 0.2);
}

/* Inputs & Forms */
.input-text {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.825rem;
  outline: none;
}

.input-text:focus {
  border-color: var(--iheid-red);
}

/* Tables */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8rem;
}

th {
  background-color: var(--bg-card-subtle);
  color: var(--text-muted);
  font-weight: 700;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background-color: var(--bg-card-subtle);
}

/* Dual Transcript Stream */
.transcript-dual-view {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.4rem;
}

.segment-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.segment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.segment-speaker {
  font-weight: 700;
  color: var(--iheid-red);
}

.segment-original {
  font-size: 0.825rem;
  color: var(--text-main);
}

.segment-translated {
  font-size: 0.825rem;
  color: var(--accent-emerald);
  border-top: 1px dashed var(--border-subtle);
  padding-top: 0.35rem;
}

/* Tab Management */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Studio Layout */
.studio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1080px) {
  .studio-grid {
    grid-template-columns: 1fr;
  }
}

/* Dropzone */
.audio-recorder-box {
  background-color: var(--bg-input);
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.audio-recorder-box:hover {
  border-color: var(--iheid-red);
}

/* Audio Waveform Canvas */
#waveform-canvas {
  width: 100%;
  height: 60px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: block;
  margin-bottom: 0.75rem;
}

/* IT Console Dashboard Metric Cards */
.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.metric-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.metric-data h4 {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.metric-data .metric-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 0.15rem;
}

.metric-data .metric-sub {
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* Restricted banner for locked features */
.restricted-banner {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  margin: 1rem 0;
}

.restricted-banner-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.restricted-banner h3 {
  font-size: 1rem;
  color: var(--text-main);
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.restricted-banner p {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
}

/* ==========================================================================
   AUTHENTIFICATION GOOGLE WORKSPACE IHEID (LOGIN MODAL & OVERLAY)
   ========================================================================== */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 14, 22, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.login-overlay.active {
  display: flex;
}

.login-modal {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.login-modal-header {
  padding: 1.75rem 1.5rem 1.25rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card-subtle);
}

.login-iheid-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--iheid-red);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.login-modal-header h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.login-modal-header p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.login-modal-body {
  padding: 1.5rem;
}

.google-auth-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.15);
}

.google-auth-btn:hover {
  background: #f8f9fa;
  border-color: #c6c9ce;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.25);
}

.google-icon {
  width: 18px;
  height: 18px;
}

.domain-enforcement-pill {
  margin-top: 1rem;
  padding: 0.6rem 0.85rem;
  background: var(--iheid-red-subtle);
  border: 1px solid var(--iheid-red-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--iheid-red);
  font-weight: 600;
}

.login-divider {
  display: flex;
  align-items: center;
  margin: 1.25rem 0;
  color: var(--text-dim);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.login-divider::before, .login-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.login-divider span {
  padding: 0 0.75rem;
}

/* Quick test personas grid */
.quick-test-accounts {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.btn-test-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.btn-test-account:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.btn-test-account-invalid {
  border-color: rgba(226, 0, 32, 0.4);
  background: rgba(226, 0, 32, 0.05);
  color: var(--iheid-red);
}

.btn-test-account-invalid:hover {
  background: rgba(226, 0, 32, 0.1);
}

.login-error-alert {
  padding: 0.75rem;
  background: rgba(226, 0, 32, 0.15);
  border: 1px solid var(--iheid-red);
  border-radius: var(--radius-sm);
  color: var(--iheid-red);
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 1rem;
  display: none;
  animation: modalFadeIn 0.2s ease;
}

/* ==========================================================================
   MODAL VISIONNEUSE PDF OFFICIELLE (A4 HAUTE FIDÉLITÉ)
   ========================================================================== */
.pdf-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 14, 22, 0.88);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2500;
  padding: 1.5rem;
}

.pdf-modal-overlay.active {
  display: flex;
}

.pdf-modal-container {
  width: 100%;
  max-width: 1100px;
  height: 92vh;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}

.pdf-modal-header {
  padding: 1rem 1.5rem;
  background: var(--bg-card-subtle);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.pdf-header-left h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 0.2rem;
  line-height: 1.3;
}

.pdf-badge-iheid {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--iheid-red);
  background: var(--iheid-red-subtle);
  border: 1px solid var(--iheid-red-border);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pdf-conf-tag {
  font-size: 0.68rem;
  font-weight: 700;
  color: #0d9488;
  background: rgba(13, 148, 136, 0.1);
  border: 1px solid rgba(13, 148, 136, 0.3);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.pdf-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-pdf-action {
  padding: 0.45rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.btn-pdf-action:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  color: var(--primary);
}

.btn-pdf-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-pdf-close:hover {
  background: rgba(226, 0, 32, 0.1);
  border-color: var(--iheid-red);
  color: var(--iheid-red);
}

.pdf-modal-body {
  flex: 1;
  position: relative;
  background: #2d3748;
  display: flex;
  flex-direction: column;
}

.pdf-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}

.pdf-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  z-index: 5;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(226, 0, 32, 0.2);
  border-top-color: var(--iheid-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   SYSTÈME DE NOTIFICATIONS TOAST INTERACTIVES (MASTER PROMPT)
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 3000;
  pointer-events: none;
}

.toast {
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.82rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  pointer-events: auto;
  animation: toastSlideIn 0.25s ease-out forwards;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 380px;
}

.toast-success {
  border-left: 4px solid var(--accent-emerald);
}

.toast-error {
  border-left: 4px solid var(--iheid-red);
}

.toast-info {
  border-left: 4px solid var(--primary);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   MICRO-INTERACTIONS & EFFETS VIVANTS (MASTER PROMPT)
   ========================================================================== */
.card {
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  border-color: var(--border-strong);
}

.btn-primary:active, .btn-secondary:active, .btn-danger:active {
  transform: scale(0.98);
}

.pulse-beacon {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--iheid-red);
  box-shadow: 0 0 0 rgba(226, 0, 32, 0.6);
  animation: pulseBeacon 1.5s infinite;
}

@keyframes pulseBeacon {
  0% { box-shadow: 0 0 0 0 rgba(226, 0, 32, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(226, 0, 32, 0); }
  100% { box-shadow: 0 0 0 0 rgba(226, 0, 32, 0); }
}

/* ==========================================================================
   OPTIMISATION MOBILE & TABLETTE (SMARTPHONES iOS & ANDROID)
   ========================================================================== */
@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
    padding-top: 0;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.75rem 1rem;
  }

  .sidebar-header {
    padding: 0.5rem 0;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 0.4rem;
    padding: 0.5rem 0;
    scrollbar-width: none;
  }
  .sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex-shrink: 0;
    padding: 0.45rem 0.75rem;
    font-size: 0.75rem;
    white-space: nowrap;
    border-radius: var(--radius-sm);
  }

  .main-content {
    padding: 1rem 0.75rem 2rem 0.75rem;
  }

  .main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .studio-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .login-modal {
    max-width: 95% !important;
    padding: 1.25rem 1rem;
  }

  .pdf-modal-container {
    width: 98%;
    height: 94vh;
  }

  .pdf-header-actions {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .btn-primary, .btn-secondary, .btn-danger {
    min-height: 38px;
    touch-action: manipulation;
  }
}


