/* ═══════════════════════════════════════════════════════
   SHARED.CSS — Charte Genesys Cloud (Light Theme)
   Importé par toutes les pages
═══════════════════════════════════════════════════════ */

/* ── Polices modernes ───────────────────────────────────────────
   Inter       : UI principale — propre, lisible, moderne
   Plus Jakarta Sans : titres et valeurs KPI — caractère et élégance
   JetBrains Mono    : données techniques, timestamps, IDs
─────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Variables ── */
:root {
  /* Brand */
  --gc-orange:       #FF4F1F;
  --gc-orange-dark:  #E03A0E;
  --gc-orange-light: #FF6B3D;
  --gc-orange-dim:   rgba(255,79,31,0.08);
  --gc-orange-dim2:  rgba(255,79,31,0.14);

  /* Neutrals */
  --bg:        #F4F6F9;
  --surface:   #FFFFFF;
  --surface2:  #F0F2F5;
  --surface3:  #E8EBF0;
  --border:    #DDE1E9;
  --border2:   #C8CDD8;

  /* Accent blue (actions secondaires) */
  --blue:      #0066FF;
  --blue-dim:  rgba(0,102,255,0.08);
  --blue-dark: #0052CC;

  /* Semantic */
  --green:     #00A651;
  --green-dim: rgba(0,166,81,0.09);
  --yellow:    #FFAB00;
  --yellow-dim:rgba(255,171,0,0.1);
  --red:       #DE350B;
  --red-dim:   rgba(222,53,11,0.08);
  --purple:    #6554C0;
  --purple-dim:rgba(101,84,192,0.09);

  /* Text */
  --text:      #1C2132;
  --text2:     #5A6478;
  --text3:     #8C96AA;
  --text-inv:  #FFFFFF;

  /* Typography */
  --font:      'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;  /* titres & KPIs */
  --mono:      'JetBrains Mono', 'Fira Code', monospace;

  /* Sizes */
  --radius:    6px;
  --radius2:   10px;
  --radius3:   14px;
  --header-h:  60px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.04);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;  /* ligatures Inter */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font); }
input, select { font-family: var(--font); }

/* ── HEADER ── */
.gc-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow-sm);
}

.gc-header-left { display: flex; align-items: center; gap: 16px; }

/* Logo Genesys */
.gc-logo {
  display: flex;
  align-items: center;
  padding-right: 16px;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

/* Logo dans le header */
.gc-logo-img {
  height: 30px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

/* Logo dans l'écran SSO */
.gc-logo-sso-img {
  height: 40px;
  width: auto;
  display: block;
  margin: 0 auto 20px;
}

/* Logo dans l'écran setup */
.gc-logo-setup-img {
  height: 48px;
  width: auto;
  display: block;
  margin-bottom: 8px;
}

/* Back button */
.gc-back {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  transition: all .15s;
}
.gc-back svg { width: 14px; height: 14px; stroke: currentColor; flex-shrink: 0; }
.gc-back:hover { background: var(--gc-orange-dim); border-color: var(--gc-orange); color: var(--gc-orange); }

/* Page title in header */
.gc-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.gc-header-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.gc-header-icon svg { width: 18px; height: 18px; }
.gc-header-icon--orange { background: var(--gc-orange-dim2); color: var(--gc-orange); }
.gc-header-icon--blue   { background: var(--blue-dim);       color: var(--blue); }
.gc-header-icon--green  { background: var(--green-dim);      color: var(--green); }
.gc-header-title h1     { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; }
.gc-header-title .gc-subtitle { font-size: 11px; color: var(--text3); display: block; margin-top: -2px; }

/* Right side */
.gc-header-right { display: flex; align-items: center; gap: 12px; }
.gc-user-info { text-align: right; }
.gc-user-name  { font-size: 13px; font-weight: 700; color: var(--text); }
.gc-user-email { font-size: 11px; color: var(--text3); font-family: var(--mono); }
.gc-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gc-orange);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(255,79,31,0.35);
}

.gc-btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
  transition: all .15s;
}
.gc-btn-logout svg { width: 14px; height: 14px; }
.gc-btn-logout:hover { border-color: var(--red); color: var(--red); background: var(--red-dim); }

/* ── LAYOUT ── */
.gc-layout { display: flex; flex: 1; min-height: calc(100vh - var(--header-h)); }

/* ── SIDEBAR ── */
.gc-sidebar {
  width: 288px;
  min-width: 288px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  height: calc(100vh - var(--header-h));
  position: sticky;
  top: var(--header-h);
}

.gc-sidebar-section { display: flex; flex-direction: column; gap: 8px; }
.gc-sidebar-section h3 {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text3);
  margin-bottom: 2px;
  font-family: var(--font-display);
}
.gc-sidebar-hint {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.7;
}

/* ── FORM CONTROLS ── */
.gc-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  display: block;
  margin-bottom: 5px;
}
.gc-input {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.gc-input:focus {
  border-color: var(--gc-orange);
  box-shadow: 0 0 0 3px var(--gc-orange-dim2);
}
.gc-input[type="date"] { color-scheme: light; }

/* ── PRIMARY BUTTON ── */
.gc-btn-primary {
  width: 100%;
  padding: 11px 20px;
  background: var(--gc-orange);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 2px 6px rgba(255,79,31,0.30);
}
.gc-btn-primary:hover:not(:disabled) {
  background: var(--gc-orange-dark);
  box-shadow: 0 4px 12px rgba(255,79,31,0.35);
}
.gc-btn-primary:active:not(:disabled) { transform: scale(0.99); }
.gc-btn-primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.gc-btn-primary .btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: gc-spin .7s linear infinite;
  display: none; flex-shrink: 0;
}
.gc-btn-primary.loading .btn-spinner { display: block; }
.gc-btn-primary.loading .btn-icon    { display: none; }
.btn-icon { width: 16px; height: 16px; flex-shrink: 0; }
@keyframes gc-spin { to { transform: rotate(360deg); } }

/* ── SECONDARY BUTTON ── */
.gc-btn-secondary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
  transition: all .15s;
  flex-shrink: 0;
}
.gc-btn-secondary svg { width: 13px; height: 13px; }
.gc-btn-secondary:hover { border-color: var(--gc-orange); color: var(--gc-orange); background: var(--gc-orange-dim); }

/* ── CONTENT ── */
.gc-content {
  flex: 1;
  padding: 28px 32px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ── CARDS ── */
.gc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  box-shadow: var(--shadow-sm);
}
.gc-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.gc-card-header h2,
.gc-card-header h3 { font-size: 14px; font-weight: 700; color: var(--text); }
.gc-card-subtitle  { font-size: 12px; color: var(--text3); margin-top: 2px; font-family: var(--mono); }

/* ── KPI BAR ── */
.gc-kpi-bar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.gc-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.gc-kpi--hero {
  border-color: var(--gc-orange);
  border-left: 4px solid var(--gc-orange);
  background: linear-gradient(135deg, #fff 0%, rgba(255,79,31,0.04) 100%);
}
.gc-kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text3);
  margin-bottom: 6px;
}
.gc-kpi-value {
  font-size: 28px;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: -1px;
  line-height: 1.1;
  color: var(--text);
}
.gc-kpi-value--xl { font-size: 52px; letter-spacing: -2px; }
.gc-kpi-sub { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* ── TABLE ── */
.gc-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text3);
  background: var(--surface2);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  cursor: pointer;
  user-select: none;
}
thead th:hover { color: var(--text2); }
thead th.sort-asc::after  { content: ' ↓'; color: var(--gc-orange); }
thead th.sort-desc::after { content: ' ↑'; color: var(--gc-orange); }
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:hover { background: var(--surface2); }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 11px 16px; font-size: 13px; color: var(--text); }
.td-mono { font-family: var(--mono); font-size: 12px; }
.td-right { text-align: right; }

/* ── BADGES / STATUS ── */
.gc-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.gc-badge-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.gc-badge--green  { background: var(--green-dim);  color: var(--green); }
.gc-badge--blue   { background: var(--blue-dim);   color: var(--blue); }
.gc-badge--yellow { background: var(--yellow-dim); color: #8a6a00; }
.gc-badge--orange { background: var(--gc-orange-dim2); color: var(--gc-orange-dark); }
.gc-badge--red    { background: var(--red-dim);    color: var(--red); }
.gc-badge--gray   { background: var(--surface2);   color: var(--text3); }
.gc-badge--purple { background: var(--purple-dim); color: var(--purple); }

/* ── BAR CHART (mini) ── */
.gc-mini-bar-wrap { height: 6px; background: var(--surface3); border-radius: 3px; overflow: hidden; }
.gc-mini-bar      { height: 100%; border-radius: 3px; transition: width .4s; }

/* ── CHART CARD ── */
.gc-chart-wrap { position: relative; height: 320px; padding: 4px 0; }
.gc-chart-legend { display: flex; flex-wrap: wrap; gap: 10px; }
.gc-legend-item  { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text2); font-weight: 600; }
.gc-legend-dot   { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ── SEARCH BOX ── */
.gc-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 11px;
  transition: border-color .15s;
}
.gc-search-box:focus-within { border-color: var(--gc-orange); background: var(--surface); }
.gc-search-box svg { width: 14px; height: 14px; color: var(--text3); flex-shrink: 0; }
.gc-search-box input {
  background: transparent; border: none; outline: none;
  color: var(--text); font-size: 13px; width: 100%;
}
.gc-search-box input::placeholder { color: var(--text3); }

/* ── QUEUE / STATUS CHECKBOXES ── */
.gc-check-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.gc-check-item input[type="checkbox"] { display: none; }
.gc-check-item:hover { border-color: var(--gc-orange); background: var(--gc-orange-dim); }
.gc-check-item.checked { border-color: var(--gc-orange); background: var(--gc-orange-dim); }
.gc-check-box {
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 2px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.gc-check-item.checked .gc-check-box {
  background: var(--gc-orange);
  border-color: var(--gc-orange);
}
.gc-check-item.checked .gc-check-box::after {
  content: '';
  width: 4px; height: 7px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(40deg) translate(-1px, -1px);
}
.gc-check-label { font-size: 12px; font-weight: 600; flex: 1; color: var(--text); }
.gc-check-dot   { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── LINK BUTTONS ── */
.gc-link-btn {
  background: none; border: none; padding: 0;
  font-size: 12px; font-weight: 600;
  color: var(--gc-orange);
  transition: opacity .15s;
}
.gc-link-btn:hover { opacity: .75; }

/* ── QUEUE LIST ── */
.gc-queue-list {
  max-height: 210px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gc-queue-name { font-size: 12px; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── EMPTY STATE ── */
.gc-empty {
  margin: auto;
  text-align: center;
  padding: 72px 32px;
}
.gc-empty-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text3);
  margin: 0 auto 20px;
}
.gc-empty-icon svg { width: 32px; height: 32px; }
.gc-empty h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.gc-empty p  { font-size: 13px; color: var(--text3); line-height: 1.7; }

/* ── LOADING ── */
.gc-loading-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}
.gc-progress-wrap {
  width: 100%; max-width: 300px;
  height: 4px;
  background: var(--surface3);
  border-radius: 2px;
  overflow: hidden;
}
.gc-progress-bar {
  height: 100%;
  background: var(--gc-orange);
  border-radius: 2px;
  animation: gc-prog 1.4s ease-in-out infinite;
}
@keyframes gc-prog {
  0%   { width: 10%; margin-left: 0; }
  50%  { width: 55%; margin-left: 20%; }
  100% { width: 10%; margin-left: 90%; }
}
.gc-loading-card p { font-size: 13px; color: var(--text2); font-family: var(--mono); }

/* ── ERROR ── */
.gc-error-box {
  background: var(--red-dim);
  border: 1.5px solid rgba(222,53,11,.25);
  border-radius: var(--radius2);
  padding: 16px 20px;
  color: var(--red);
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

/* ── SSO SCREEN ── */
.gc-sso-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}
.gc-sso-card {
  text-align: center;
  padding: 56px 48px;
  background: var(--surface);
  border-radius: var(--radius3);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  min-width: 320px;
}
.gc-sso-logo { margin-bottom: 28px; }
.gc-sso-card h2 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.gc-sso-card p  { color: var(--text3); font-size: 13px; margin-bottom: 28px; }
.gc-sso-bar     { width: 200px; height: 4px; background: var(--surface3); border-radius: 2px; overflow: hidden; margin: 0 auto; }
.gc-sso-prog    { height: 100%; background: var(--gc-orange); border-radius: 2px; animation: gc-prog 1.2s ease-in-out infinite; }

/* ── RESULTS HEADER ── */
.gc-results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.gc-results-title { font-size: 22px; font-weight: 800; letter-spacing: -0.6px; font-family: var(--font-display); }
.gc-results-sub   { font-size: 12px; color: var(--text3); font-family: var(--mono); margin-top: 3px; letter-spacing: .01em; }

/* ── DIVIDER ── */
.gc-divider { height: 1px; background: var(--border); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .gc-layout { flex-direction: column; }
  .gc-sidebar { width: 100%; min-width: unset; height: auto; position: static; }
  .gc-content { padding: 16px; }
  .gc-header  { padding: 0 16px; }
  .gc-user-info { display: none; }
}

/* ── Typographie display — Plus Jakarta Sans ────────────────── */
h1, h2,
.gc-kpi-value,
.gc-kpi-value--xl,
.gc-results-title,
.at-results-title,
.gc-loading-card .sa-load-title,
.portal-card h3,
.portal-hero h2 {
  font-family: var(--font-display);
}

/* KPI hero (très grande valeur) */
.gc-kpi-value--xl {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -2px;
  font-family: var(--font-display);
}

/* Amélioration générale de la lisibilité */
p, li, label, td, th {
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: .01em;
}

/* Titres de sections sidebar */
.gc-sidebar-section h3 {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
}

/* Timestamps et IDs — JetBrains Mono */
.td-mono, .gc-results-sub, .gc-card-subtitle,
.gc-kpi-sub, .at-results-sub, .tr-results-sub {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .02em;
}
