/* ═══════════════════════════════════════════════════
   NeoReno GenTab — Design System
   ═══════════════════════════════════════════════════ */

:root {
  --bg: #e2e4e8;
  --bg-card: #ffffff;
  --bg-input: #ecedf0;
  --bg-hover: #d8dade;
  --bg-workspace: #e2e4e8;
  --border: #b8bcc4;
  --border-light: #cfd1d7;
  --divider: rgba(0,0,0,0.15);

  --text-primary: #111114;
  --text-secondary: #4a4d56;
  --text-tertiary: #8a8d96;
  --text-inverse: #ffffff;

  --accent: #1d2024;
  --accent-hover: #2c3038;
  --accent-bg: rgba(29,32,36,0.07);
  --success: #2ecc71;
  --warning: #f39c12;
  --error: #e74c3c;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.07);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.18), 0 4px 12px rgba(0,0,0,0.10);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --topbar-h: 34px;
  --dock-h: 54px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* html, body overflow handled in mobile media query only */
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════
   Auth
   ═══════════════════════════════════════════════════ */
.auth-screen {
  height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
}
.auth-card {
  width: 340px; padding: 36px;
  background: var(--bg-card); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); text-align: center;
}
.auth-logo {
  width: 52px; height: 52px; margin: 0 auto 14px;
  background: var(--accent); color: var(--text-inverse);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
}
.auth-title { font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.auth-subtitle { font-size: 13px; color: var(--text-secondary); margin-bottom: 24px; }
#auth-form { display: flex; flex-direction: column; gap: 10px; }
#auth-form input {
  padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: var(--font);
  background: var(--bg-input); color: var(--text-primary);
  outline: none; transition: border-color 0.2s;
}
#auth-form input:focus { border-color: var(--accent); background: var(--bg-card); }
.btn-primary {
  padding: 11px; background: var(--accent); color: var(--text-inverse);
  border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; font-family: var(--font);
  cursor: pointer; transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-error { margin-top: 10px; font-size: 13px; color: var(--error); min-height: 18px; }

/* ═══════════════════════════════════════════════════
   App Shell
   ═══════════════════════════════════════════════════ */
.app { height: 100vh; display: flex; flex-direction: column; }

/* Top Bar */
.topbar {
  height: var(--topbar-h); padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  background: transparent; flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 6px; }
.topbar-logo {
  width: 22px; height: 22px;
  background: var(--accent); color: var(--text-inverse); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-email { font-size: 11px; color: var(--text-tertiary); }
.btn-icon {
  width: 26px; height: 26px; border: none; background: transparent;
  color: var(--text-tertiary); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ═══════════════════════════════════════════════════
   Workspace — full width, scrollable
   ═══════════════════════════════════════════════════ */
.workspace {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 100px;
  background: var(--bg);
  transition: background 300ms var(--ease);
}
.workspace::-webkit-scrollbar { width: 5px; }
.workspace::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }

/* In active state, workspace gets lighter background */
body.gentab-active .workspace {
  background: var(--bg-workspace);
}

/* ═══════════════════════════════════════════════════
   Welcome — centered in workspace
   ═══════════════════════════════════════════════════ */
.welcome {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 55vh; text-align: center;
}
.welcome-icon {
  width: 72px; height: 72px;
  background: var(--accent-bg); border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px; color: var(--accent);
}
.welcome h2 { font-size: 19px; font-weight: 600; margin-bottom: 6px; }
.welcome p { font-size: 14px; color: var(--text-secondary); max-width: 380px; line-height: 1.5; margin-bottom: 24px; }
.welcome-suggestions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.suggestion {
  padding: 7px 15px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; font-size: 13px; font-family: var(--font);
  color: var(--text-primary); cursor: pointer; transition: all 0.15s;
}
.suggestion:hover { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }

/* ═══════════════════════════════════════════════════
   Skeleton
   ═══════════════════════════════════════════════════ */
.skeleton { display: flex; flex-direction: column; gap: 14px; }
.sk-bar {
  height: 13px; border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--border-light) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite;
}
.sk-title { height: 20px; width: 40%; }
.sk-line { width: 75%; }
.sk-line.short { width: 50%; }
.sk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.sk-card {
  height: 90px; border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--border-light) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ═══════════════════════════════════════════════════
   GenTab content — slides in from right
   ═══════════════════════════════════════════════════ */
.gentab {
  animation: slideInRight 300ms var(--ease) both;
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ═══════════════════════════════════════════════════
   Dock — fixed bottom bar, full width
   IDLE: centered floating pill with nav
   ACTIVE: full-width bottom bar, no nav, with reset button
   ═══════════════════════════════════════════════════ */
.dock {
  position: fixed;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.45);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;

  /* IDLE state — centered pill */
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(700px, calc(100% - 32px));
  border-radius: 22px;

  transition: all 300ms var(--ease);
}

.dock-input {
  display: flex; align-items: center; gap: 4px;
  padding: 0 8px 0 8px;
  height: 48px;
  transition: all 300ms var(--ease);
}
.dock-input:focus-within { background: rgba(0,122,255,0.03); }

#prompt-input {
  flex: 1; border: none; outline: none;
  font-size: 14px; font-family: var(--font);
  color: var(--text-primary); background: transparent;
  height: 100%;
  transition: font-size 300ms var(--ease);
}
#prompt-input::placeholder { color: var(--text-tertiary); }

.bar-btn {
  width: 32px; height: 32px; border: none; background: transparent;
  color: var(--text-tertiary); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: color 0.15s;
}
.bar-btn:hover { color: var(--text-secondary); }
.bar-btn-send { color: var(--accent); }
.bar-btn-send:hover { color: var(--accent-hover); }
.bar-btn.recording { color: var(--error); animation: pulse 1.5s infinite; }
.bar-btn-mic { width: 36px; height: 36px; color: var(--text-secondary); }
.bar-btn-mic:hover { color: var(--accent); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Reset/back button — hidden in idle, visible in active */
.btn-reset-dock {
  display: none;
  width: 32px; height: 32px; border: none;
  background: var(--accent); color: #fff;
  border-radius: 8px;
  align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: all 0.15s;
}
.btn-reset-dock:hover { background: var(--accent-hover); }

.dock-nav {
  display: flex; align-items: center; justify-content: space-around;
  border-top: 1px solid var(--border-light);
  padding: 4px 8px;
  max-height: 56px; opacity: 1;
  transition: max-height 300ms var(--ease), opacity 200ms var(--ease), padding 300ms var(--ease);
  overflow: hidden;
}

.nav-tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 8px; border: none; background: transparent;
  color: var(--text-tertiary); font-size: 10px;
  font-family: var(--font); font-weight: 500;
  cursor: pointer; transition: all 0.15s;
  border-radius: 8px;
}
.nav-tab:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-tab.active { color: var(--accent); background: var(--accent-bg); }

/* ═══════════════════════════════════════════════════
   ACTIVE STATE — body.gentab-active
   Same centered pill, nav hidden, reset button visible
   ═══════════════════════════════════════════════════ */
body.gentab-active .btn-reset-dock {
  display: flex;
}

/* Keep nav tabs visible in active state */
body.gentab-active .dock-nav {
  max-height: 60px;
  opacity: 1;
  padding: 6px 0;
}
/* Allow dock menu to expand when Plus is clicked */
body.gentab-active .dock-nav.show-all {
  max-height: none !important;
  overflow: visible !important;
}
body.gentab-active .dock.dock-open {
  overflow: visible !important;
}


/* ═══════════════════════════════════════════════════
   GenTab Generated HTML — Base design tokens
   ═══════════════════════════════════════════════════ */
.gentab h1 { font-size: 22px; font-weight: 700; margin-bottom: 14px; }
.gentab h2 { font-size: 17px; font-weight: 600; margin: 18px 0 10px; }
.gentab h3 { font-size: 15px; font-weight: 600; margin: 14px 0 8px; }
.gentab p { font-size: 14px; line-height: 1.6; margin-bottom: 10px; color: var(--text-secondary); }

.gentab table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13px; }
.gentab th {
  text-align: left; padding: 9px 12px;
  background: var(--bg); font-weight: 600; color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px;
}
.gentab td { padding: 9px 12px; border-bottom: 1px solid var(--border-light); }
.gentab tr:hover td { background: var(--bg); }

.gentab .card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 18px;
  margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.gentab .grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px; margin: 14px 0;
}

.gentab .badge { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.gentab .badge-success { background: #dcfce7; color: #15803d; }
.gentab .badge-warning { background: #fef3c7; color: #b45309; }
.gentab .badge-error { background: #fee2e2; color: #b91c1c; }
.gentab .badge-info { background: #dbeafe; color: #1d4ed8; }

.gentab .btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
  font-family: var(--font); cursor: pointer;
  background: var(--bg-card); color: var(--text-primary); transition: all 0.15s;
}
.gentab .btn:hover { background: var(--bg); }
.gentab .btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.gentab .btn-primary:hover { background: var(--accent-hover); }

.gentab input, .gentab select, .gentab textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: var(--font);
  color: var(--text-primary); background: var(--bg-card);
  outline: none; transition: border-color 0.2s;
}
.gentab input:focus, .gentab select:focus, .gentab textarea:focus { border-color: var(--accent); }
.gentab label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 3px; color: var(--text-secondary); }
.gentab .form-group { margin-bottom: 14px; }
.gentab .stat-value { font-size: 26px; font-weight: 700; }
.gentab .stat-label { font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; }

/* ═══════════════════════════════════════════════════
   Form item row — CSS Grid (override GT_STYLE flex)
   ═══════════════════════════════════════════════════ */
.gt-item-row {
  display: grid !important;
  grid-template-columns: 1fr 70px 70px 90px 80px 30px;
  gap: 8px;
  align-items: end;
}
.gt-item-row .gt-form-field { min-width: 0; }
.gt-item-row .gt-form-field input,
.gt-item-row .gt-form-field select {
  width: 100%; min-width: 0; box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════
   MOBILE — hamburger "Plus" button hidden on desktop
   ═══════════════════════════════════════════════════ */
/* Backdrop overlay for mobile dock menu */
#dock-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 199;
}
#dock-backdrop.show {
  display: block;
  animation: dockFadeIn 0.2s ease;
}
@keyframes dockFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Handle bar inside the dock sheet */
.dock-handle-bar {
  display: none;
  width: 40px; height: 4px;
  background: var(--border, #ddd);
  border-radius: 2px;
  margin: 0 auto;
  flex-basis: 100%;
}

.mobile-more { display: none; }

/* ═══════════════════════════════════════════════════
   TABLET (< 900px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .workspace { padding: 20px 20px 110px; }
  .sk-grid { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════════════════
   MOBILE (< 640px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* ── Layout ── */
  .workspace { padding: 12px 12px 140px; }
  .sk-grid { grid-template-columns: 1fr; }

  /* ── Top bar compact ── */
  .topbar { height: 30px; padding: 0 10px; }
  .topbar-email { display: none; }
  .topbar-logo { width: 20px; height: 20px; font-size: 10px; }

  /* ── Welcome ── */
  .welcome { min-height: 40vh; }
  .welcome h2 { font-size: 17px; }
  .welcome p { font-size: 13px; }
  .welcome-icon { width: 56px; height: 56px; }
  .welcome-icon svg { width: 32px; height: 32px; }
  .welcome-suggestions { gap: 6px; }
  .suggestion { padding: 6px 12px; font-size: 12px; }

  /* ── Auth ── */
  .auth-card { width: calc(100% - 32px); max-width: 340px; padding: 28px 24px; }

  /* ── Dock: full-width bar at bottom ── */
  .dock {
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100% !important;
    border-radius: 0 !important;
    border: none !important;
    border-top: 1px solid var(--border-light) !important;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.08) !important;
  }
  .dock.dock-open {
    overflow: visible !important;
  }

  .dock-input { height: 44px; padding: 0 6px; }
  #prompt-input { font-size: 16px; } /* prevent iOS zoom */

  /* ── Nav: show only 5 tabs + "Plus" button ── */
  .dock-nav {
    padding: 2px 0 env(safe-area-inset-bottom, 4px);
    justify-content: space-around;
    position: relative;
  }

  .nav-tab { padding: 6px 4px; font-size: 10px; min-width: 0; flex-direction: column; align-items: center; gap: 2px; }
  .nav-tab svg { width: 22px; height: 22px; }

  /* Mobile: hide all tabs, show only 5 (no Plus menu) */
  .dock-nav .nav-tab { display: none; }
  .mobile-more { display: none !important; }
  [data-prompt=tableau_bord]    { display: flex !important; order: 1; }
  [data-prompt=notes]           { display: flex !important; order: 2; }
  [data-prompt=liste_depenses]  { display: flex !important; order: 3; }
  [data-prompt=liste_taches]    { display: flex !important; order: 4; }
  [data-action=settings]        { display: flex !important; order: 5; }
  /* Hide Taches on desktop (mobile-only tab) */


  /* ── Form items grid → stacked ── */
  .gt-item-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px;
  }

  /* ── GenTab generated content ── */
  .gentab h1 { font-size: 18px; }
  .gentab h2 { font-size: 15px; }
  .gentab table { font-size: 12px; }
  .gentab th, .gentab td { padding: 7px 8px; }
  /* App-like: no page scroll, fixed viewport */
  html, body { height: 100%; overflow: hidden; position: fixed; width: 100%; }
  #app { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
  .workspace { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .dock { flex-shrink: 0; }
  /* iOS: prevent bounce scroll and rubber-banding */
  html { overscroll-behavior: none; touch-action: manipulation; }
  body { overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
  .workspace { overscroll-behavior-y: contain; }
  .gentab { overscroll-behavior-y: contain; }
  .dock { touch-action: manipulation; }
  .gentab { max-height: calc(100vh - 130px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
}

/* ═══════════════════════════════════════════════════
   SMALL MOBILE (< 400px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 400px) {
  .workspace { padding: 8px 8px 140px; overflow: hidden; }
  .dock-input { height: 40px; }
  /* .nav-tab span always visible for better UX */
  .nav-tab { padding: 6px 8px; }
  .nav-tab svg { width: 24px; height: 24px; }
  .dock-nav.show-all .nav-tab span { display: block; }
}
/* Hide QR card on mobile — pointless on phone */
@media (max-width: 640px) { #qr-mobile { display: none; } }

/* ═══════════════════════════════════════════════════
   Expense form: Drop zone + Preview + Chips
   ═══════════════════════════════════════════════════ */
.gt-dep-layout { display:flex; gap:20px; margin-top:16px; }
.gt-dep-left { flex:1; min-width:0; display:flex; flex-direction:column; gap:12px; }
.gt-dep-right { flex:1; min-width:0; display:flex; flex-direction:column; }
@media (max-width:768px) {
  .gt-dep-layout { flex-direction:column; }
}

.gt-drop-zone {
  border:2px dashed var(--border); border-radius:12px;
  padding:60px 24px; text-align:center; cursor:pointer; flex:1;
  transition: border-color .2s, background .2s;
  background: var(--bg-input);
}
.gt-drop-zone:hover, .gt-drop-hover {
  border-color: var(--accent) !important;
  background: var(--accent-bg) !important;
}
.gt-drop-done {
  border-style:solid; border-color:var(--success);
  padding:16px; background:rgba(34,197,94,.04);
}
.gt-drop-icon { font-size:52px; margin-bottom:14px; }
.gt-drop-text { font-size:17px; font-weight:600; color:var(--text-primary); }
.gt-drop-sub { font-size:13px; color:var(--text-tertiary); margin-top:4px; }
.gt-drop-link { color:var(--accent); cursor:pointer; text-decoration:underline; }
.gt-drop-formats { font-size:11px; color:var(--text-tertiary); margin-top:8px; }

.gt-dep-preview {
  border:1px solid var(--border); border-radius:12px;
  min-height:400px; flex:1; display:flex; align-items:center; justify-content:center;
  background:var(--bg-input); overflow:hidden;
}
.gt-preview-empty { color:var(--text-tertiary); font-size:14px; }
.gt-preview-img { max-width:100%; max-height:600px; object-fit:contain; border-radius:8px; }
.gt-preview-pdf { text-align:center; padding:40px; color:var(--text-secondary); }

.gt-dep-chips { display:flex; flex-wrap:wrap; gap:8px; }
.gt-chip {
  display:inline-flex; align-items:center; gap:4px;
  padding:6px 14px; border-radius:20px; font-size:13px; font-weight:600;
  background:var(--accent-bg); color:var(--accent); border:1px solid var(--accent);
  cursor:text; outline:none; min-width:40px; transition: box-shadow .15s;
}
.gt-chip:focus { box-shadow:0 0 0 2px rgba(29,32,36,.15); }
.gt-chip[contenteditable="true"]::after { content:" \270E"; font-size:11px; opacity:.5; }
.gt-chip-count { background:var(--accent) !important; color:white !important; font-weight:600; }

.gt-ocr-status { padding:8px 14px; border-radius:8px; font-size:13px; font-weight:500; }
.gt-ocr-loading { background:var(--accent-bg); color:var(--accent); }
.gt-ocr-ok { background:rgba(34,197,94,.08); color:#16a34a; }
.gt-ocr-warn { background:rgba(245,158,11,.08); color:#d97706; }
.gt-ocr-err { background:rgba(239,68,68,.08); color:#dc2626; }

.gt-spinner {
  display:inline-block; width:14px; height:14px;
  border:2px solid var(--accent); border-top-color:transparent;
  border-radius:50%; animation:gt-spin .6s linear infinite;
  vertical-align:middle; margin-right:6px;
}
@keyframes gt-spin { to { transform:rotate(360deg); } }

.gt-dep-fields { margin-top:4px; }

.gt-btn-cancel { color:#dc2626 !important; border-color:#dc2626 !important; background:transparent !important; }
.gt-btn-cancel:hover { background:rgba(220,38,38,.06) !important; }

.gt-btn-primary:disabled { opacity:0.4; cursor:not-allowed; background:#94a3b8 !important; border-color:#94a3b8 !important; }

.gt-progress-bar { width:100%; height:8px; background:#e2e8f0; border-radius:4px; overflow:hidden; margin-bottom:4px; }
.gt-progress-fill { height:100%; width:0%; background:linear-gradient(90deg, var(--accent), #555); border-radius:4px; transition:width 0.15s ease; }
.gt-progress-label { font-size:12px; color:var(--text-tertiary); }

.gt-preview-pdf-embed { width:100%; min-height:400px; height:100%; border:none; border-radius:8px; }

.gt-preview-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(120px, 1fr)); gap:8px; padding:8px; width:100%; }
.gt-preview-thumb { border:1px solid var(--border); border-radius:8px; overflow:hidden; background:var(--bg-card); text-align:center; padding:4px; }
.gt-preview-thumb img { width:100%; height:100px; object-fit:cover; border-radius:4px; }
.gt-thumb-pdf { font-size:40px; padding:20px 0 4px; }
.gt-thumb-name { font-size:11px; color:var(--text-tertiary); padding:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ═══════════════════════════════════════════════════
   Voice recording UX
   ═══════════════════════════════════════════════════ */
.voice-timer {
  display: none;
  font-size: 13px;
  font-weight: 600;
  color: #dc2626;
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
  animation: voice-pulse 1.5s infinite;
}
@keyframes voice-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.voice-wave {
  display: none;
  align-items: center;
  gap: 3px;
  margin-left: 8px;
  height: 24px;
}
.voice-wave-bar {
  display: inline-block;
  width: 3px;
  height: 4px;
  background: #dc2626;
  border-radius: 2px;
  transition: height 0.08s ease;
}

.voice-loading {
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 10px,
    rgba(29,32,36,0.04) 10px,
    rgba(29,32,36,0.04) 20px
  );
  background-size: 200% 100%;
  animation: voice-shimmer 1.5s linear infinite;
}
@keyframes voice-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════
   Inline mic button for forms (notes, etc.)
   ═══════════════════════════════════════════════════ */
.gt-mic-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  padding: 0;
  line-height: 1;
}
.gt-mic-inline:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.gt-mic-inline.gt-mic-active {
  border-color: #dc2626;
  background: rgba(220,38,38,0.08);
  animation: voice-pulse 1.5s infinite;
}

.gt-mic-status {
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.gt-mic-recording { color: #dc2626; animation: voice-pulse 1.5s infinite; }
.gt-mic-transcribing { color: var(--accent); }
.gt-mic-ok { color: #16a34a; }
.gt-mic-warn { color: #d97706; }
.gt-mic-err { color: #dc2626; }


/* ── Note form: content + mic ─────────────────────────────────── */
.gt-note-content-wrap { position: relative; }
.gt-note-content-wrap textarea { padding-bottom: 48px; }
.gt-note-mic-bar {
  position: absolute; bottom: 8px; left: 8px; right: 8px;
  display: flex; align-items: center; gap: 10px;
}
.gt-note-mic-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px;
  background: var(--accent); color: #fff;
  border: none; cursor: pointer; font-size: 13px; font-weight: 500;
  transition: all 0.2s;
}
.gt-note-mic-btn:hover { background: var(--accent-hover); transform: scale(1.03); }
.gt-note-mic-btn.gt-mic-active {
  background: #dc2626; animation: voice-pulse 1.5s infinite;
}
.gt-note-mic-btn.gt-mic-active span::after { content: " ..."; }

/* ── Note form: file picker button ────────────────────────────── */
.gt-note-file-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px;
  background: #fff; color: var(--text-primary);
  border: 1.5px dashed var(--border); cursor: pointer;
  font-size: 13px; font-weight: 500; transition: all 0.2s;
  width: 100%;
  justify-content: center;
}
.gt-note-file-btn:hover {
  border-color: var(--accent); color: var(--accent);
  background: rgba(29,32,36,0.03);
}
.gt-note-file-btn svg { opacity: 0.6; }
.gt-note-file-btn:hover svg { opacity: 1; }

/* ── Note form: image previews with delete ────────────────────── */
.gt-note-previews {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px;
}
.gt-note-preview-item {
  position: relative; width: 88px; height: 88px;
  border-radius: 10px; overflow: hidden;
  border: 1.5px solid var(--border-light);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: transform 0.15s;
}
.gt-note-preview-item:hover { transform: scale(1.05); }
.gt-note-preview-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.gt-note-preview-del {
  position: absolute; top: 3px; right: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,0.65); color: #fff;
  border: none; cursor: pointer; font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s;
}
.gt-note-preview-item:hover .gt-note-preview-del { opacity: 1; }

/* Mobile: always show delete button */
@media (max-width: 768px) {
  .gt-note-preview-del { opacity: 1; }
  .gt-note-mic-btn { padding: 8px 16px; font-size: 14px; }
}


/* ── Modal overlay ─────────────────────────────────────────────── */
.gt-modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000; animation: fadeIn 0.15s ease;
}
.gt-modal {
  background: #fff; border-radius: 14px; padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  max-height: 90vh; overflow-y: auto; width: 90%;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── PDF buttons outline style ────────────────────────────────── */
.gt-btn-outline {
  background: transparent; color: var(--accent);
  border: 1.5px solid var(--border); border-radius: 8px;
  padding: 8px 14px; cursor: pointer; font-size: 13px; font-weight: 500;
  transition: all 0.2s;
}
.gt-btn-outline:hover {
  border-color: var(--accent); background: rgba(29,32,36,0.04);
}


/* ═══ Walkthrough (Tour guidé) ═══ */
.wt-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
}
.wt-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 10000;
  pointer-events: auto;
  transition: opacity 0.3s;
}
.wt-spotlight {
  position: fixed;
  z-index: 10001;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.55);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.wt-tooltip {
  position: fixed;
  z-index: 10002;
  background: #fff;
  border-radius: 14px;
  padding: 24px 28px;
  max-width: 380px;
  width: calc(100vw - 40px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(0,0,0,0.06);
  pointer-events: auto;
  animation: wt-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes wt-pop {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.wt-tooltip-title {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  margin-bottom: 8px;
}
.wt-tooltip-text {
  font-size: 13px;
  color: #555;
  line-height: 1.6;
  margin-bottom: 18px;
}
.wt-tooltip-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wt-dots {
  display: flex;
  gap: 6px;
}
.wt-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d0d0d0;
  transition: background 0.2s;
}
.wt-dot.active {
  background: #1d2024;
}
.wt-actions {
  display: flex;
  gap: 8px;
}
.wt-btn-skip {
  background: none;
  border: none;
  color: #888;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 12px;
}
.wt-btn-skip:hover { color: #555; }
.wt-btn-next {
  background: #1d2024;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 20px;
  cursor: pointer;
  transition: background 0.2s;
}
.wt-btn-next:hover { background: #2c3038; }
.wt-welcome-icon {
  font-size: 40px;
  margin-bottom: 8px;
}
@media (max-width: 640px) {
  .wt-tooltip {
    max-width: calc(100vw - 24px);
    padding: 20px;
    border-radius: 12px;
  }
}

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.8s linear infinite; }

.gt-preview-group-wrap { page-break-inside: avoid; margin-bottom: 4px; }

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

/* ── Reset password form ─────────────────────────────── */
#reset-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#reset-form input {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
}
#reset-form input:focus {
  border-color: var(--accent);
  background: var(--bg-card);
}
#reset-form .btn-primary {
  margin-top: 4px;
  width: 100%;
}
#reset-msg { margin-top: 6px; font-size: 13px; min-height: 18px; text-align: center; }

/* Taches: hidden on desktop, visible only on mobile */
@media (min-width: 641px) { [data-mobile-only] { display: none !important; } }
