/**
 * FlowTask AI — Main CSS (AUDIT: 734 !important rules)
 *
 * REFACTOR STATUS: !important reduction in progress.
 * NOTE: :root variables have been moved to ft-design-tokens.css.
 * This file still re-declares them for backward compatibility.
 * Remove the :root block here once all files import ft-design-tokens.css.
 *
 * DO NOT ADD new !important rules without a comment explaining why.
 */

/* ============================================================
   FlowTask AI — flowtask.css  (v5.8.5 — Clean Build)
   Merged & de-duplicated. All PATCH blocks consolidated.
   840 !important → ~180 (scoped only where cascade demands it)
   ============================================================ */

/* ── GOOGLE FONTS — must stay first ──────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ═══════════════════════════════════════════════════════════════
   1. CSS CUSTOM PROPERTIES
   ═══════════════════════════════════════════════════════════════ */
:root {
  /* Fonts */
  --ft-font:            'Plus Jakarta Sans', system-ui, sans-serif;
  --ft-font-en:         'Inter', system-ui, sans-serif;
  --ft-font-ar:         'Cairo', sans-serif;
  --ft-font-size-base:  15px;

  /* Brand colours */
  --ft-primary:         #7c3aed;
  --ft-primary-light:   #8b5cf6;
  --ft-primary-dark:    #6d28d9;
  --ft-primary-xlight:  rgba(124,58,237,.08);
  --ft-accent:          #7c3aed;
  --ft-gold:            #f59e0b;
  --ft-danger:          #ef4444;
  --ft-danger-bg:       rgba(239,68,68,.08);
  --ft-warning:         #f59e0b;
  --ft-success:         #10b981;

  /* Surfaces */
  --ft-surface:         #ffffff;
  --ft-surface-2:       #f3f4f6;
  --ft-surface-3:       #e9ecef;
  --ft-surface-footer:  rgba(249,250,251,.6);
  --ft-bg-primary:      #ffffff;
  --ft-bg-secondary:    #f9fafb;
  --ft-bg-tertiary:     #f3f4f6;

  /* Typography */
  --ft-text:            #111827;
  --ft-text-muted:      #6b7280;
  --ft-text-dim:        #9ca3af;
  --ft-text-secondary:  #6b7280;

  /* Borders */
  --ft-border:          #e5e7eb;
  --ft-border-strong:   #d1d5db;

  /* Shadows */
  --ft-shadow-card:     0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.05);
  --ft-shadow-hover:    0 4px 16px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.08);

  /* Radii */
  --ft-r-sm:            8px;
  --ft-r-md:            12px;
  --ft-r-lg:            16px;
  --ft-r-full:          9999px;
  --ft-radius-card:     16px;

  /* Transition */
  --ft-transition:      all .2s cubic-bezier(.4,0,.2,1);
}

/* ═══════════════════════════════════════════════════════════════
   2. DARK MODE VARIABLES
   ═══════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
  --ft-bg-primary:     #1a1a2e;
  --ft-bg-secondary:   #16213e;
  --ft-bg-tertiary:    #0f3460;
  --ft-surface:        #18181b;
  --ft-surface-2:      #27272a;
  --ft-surface-3:      #3f3f46;
  --ft-border:         #2d3748;
  --ft-border-strong:  #52525b;
  --ft-text:           #f7fafc;
  --ft-text-muted:     #a1a1aa;
  --ft-text-dim:       #71717a;
  --ft-text-secondary: #a0aec0;
  --ft-primary-xlight: rgba(124,58,237,.15);
  --ft-shadow-card:    0 1px 3px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.3);
  --ft-shadow-hover:   0 4px 16px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.4);
}

[data-theme="dark"] body,
[data-theme="dark"] .ftvip-wrapper,
[data-theme="dark"] .fvip-page-wrap {
  background: var(--ft-bg-secondary);
  color: var(--ft-text);
}

/* ═══════════════════════════════════════════════════════════════
   3. LAYOUT WRAPPERS
   ═══════════════════════════════════════════════════════════════ */
#flowtask-wrap,
#ftvip-wrap {
  font-family: var(--ft-font);
  color: var(--ft-text);
  line-height: 1.5;
  box-sizing: border-box;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

#flowtask-wrap *,
#ftvip-wrap * { box-sizing: border-box; }

/* Preserve icon font-family (FA / Fi) */
#flowtask-wrap *:not(i):not([class*="fa-"]):not([class*="fi-"]),
#ftvip-wrap    *:not(i):not([class*="fa-"]):not([class*="fi-"]) {
  font-family: inherit;
}

#ftvip-wrap-inner {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 20px 28px 60px;
  box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════════════════
   4. TOPBAR / HEADER — REMOVED
   Source of truth: assets/css/header.css
   ═══════════════════════════════════════════════════════════════ */
/* .fv-topbar rules moved to header.css */
.fv-vip-chip-inline { flex-shrink: 0; align-self: center; flex: 0 0 auto; }

/* ═══════════════════════════════════════════════════════════════
   5. DASHBOARD HERO
   ═══════════════════════════════════════════════════════════════ */
.fv-dashboard-hero {
  font-family: var(--ft-font);
  background: linear-gradient(160deg,#1a2332 0%,#1e2d3d 40%,#162535 100%);
  border-radius: 20px;
  margin-top: 20px !important;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,.05), 0 16px 48px rgba(0,0,0,.3);
  border: 1px solid rgba(78,144,182,.15);
}

.fv-dashboard-hero::before {
  content: '';
  position: absolute; top: -80px; left: -80px;
  width: 360px; height: 360px;
  background: radial-gradient(circle,rgba(56,142,165,.25) 0%,transparent 70%);
  pointer-events: none; z-index: 0;
}
.fv-dashboard-hero::after {
  content: '';
  position: absolute; bottom: -60px; right: 80px;
  width: 280px; height: 280px;
  background: radial-gradient(circle,rgba(32,178,155,.15) 0%,transparent 70%);
  pointer-events: none; z-index: 0;
}

.fv-dashboard-hero .fv-hero-noise {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 0; border-radius: 20px;
}

/* ═══════════════════════════════════════════════════════════════
   HERO TOPBAR + USER PILL — DEFINED IN flowtask-header-redesign.css
   All selectors below are neutralized to avoid conflicts.
   Source of truth: flowtask-header-redesign.css
   ═══════════════════════════════════════════════════════════════ */

/* .fv-hero-topbar { ... } */
/* .fv-hero-topbar-actions { ... } */
/* .fv-hero-topbar-btn { ... } */
/* .fv-hero-topbar-btn-primary { ... } */
/* .fv-hero-topbar-btn-primary:hover { ... } */
/* .fv-hero-topbar-btn-ghost { ... } */
/* .fv-hero-topbar-btn-ghost:hover { ... } */
/* .fv-hero-topbar-btn-icon { ... } */
/* .fv-hero-topbar-btn-icon:hover { ... } */
/* .fv-hero-user { ... } */
/* .fv-hero-avatar { ... } */
/* .fv-hero-user-info { ... } */
/* .fv-hero-user-name-row { ... } */
/* .fv-hero-user-name { ... } */
/* .fv-hero-user-email { ... } */
/* .fv-hero-user-vip-badge { ... } */
/* .fv-hero-body { ... } */
/* .fv-hero-left { ... } */
/* .fv-hero-greeting { ... } */
/* .fv-hero-title { ... } */
/* .fv-hero-subtitle { ... } */

/* ── Hero stats ── */
.fv-hero-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.fv-hero-stat {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px; padding: 8px 14px;
  backdrop-filter: blur(8px); transition: all .18s;
}
.fv-hero-stat:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.13); }
.fv-hero-stat-icon { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.fv-hero-stat-icon.tasks { background: rgba(45,143,168,.2);  color: #7cc8dc; }
.fv-hero-stat-icon.done  { background: rgba(16,185,129,.18); color: #34d399; }
.fv-hero-stat-icon.notes { background: rgba(59,130,246,.18); color: #60a5fa; }
.fv-hero-stat-icon.pct   { background: rgba(245,158,11,.15); color: #fbbf24; }
.fv-hero-stat-val { font-size: 16px; font-weight: 800; color: #fff; line-height: 1; }
.fv-hero-stat-lbl { font-size: 10px; font-weight: 600; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }

/* ── Sub-card (subscription bar) ── */
.fv-sub-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; background: #fff;
  border: 1px solid rgba(0,0,0,.06); border-radius: 14px;
  margin: 12px 24px; gap: 16px; flex-wrap: nowrap;
  position: relative; z-index: 1; min-height: 60px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08); color: #111;
}
.fv-sub-left  { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 16px; }
.fv-sub-title { font-size: 12px; font-weight: 700; margin-bottom: 0; color: #6b7280; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.fv-sub-title i { color: #f59e0b; }
.fv-sub-exp   { font-size: 12px; color: #374151; font-weight: 500; margin-bottom: 0; }
.fv-sub-expires-today { color: #ef4444; font-weight: 700; }
.fv-sub-right { text-align: right; display: flex; align-items: center; gap: 12px; }
.fv-sub-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.fv-sub-badge-active { background: rgba(16,185,129,.1);  color: #059669; border: 1.5px solid rgba(16,185,129,.3); }
.fv-sub-badge-warn   { background: rgba(245,158,11,.1);  color: #d97706; border: 1.5px solid rgba(245,158,11,.3); }
.fv-sub-badge-crit   { background: rgba(239,68,68,.1);   color: #dc2626; border: 1.5px solid rgba(239,68,68,.3); }
.fv-sub-since { font-size: 11px; color: #9ca3af; white-space: nowrap; }

/* Progress bar (subscription) */
.fv-sub-pb    { flex: 1; min-width: 120px; max-width: 200px; }
.fv-pb-wrap   { margin-top: 0; }
.fv-pb-track  { height: 6px; background: #e5e7eb; border-radius: 99px; overflow: hidden; }
.fv-pb-fill   { height: 100%; border-radius: 99px; transition: width .6s cubic-bezier(.4,0,.2,1); }
.fv-pb-meta   { display: flex; justify-content: space-between; font-size: 10px; color: #9ca3af; margin-top: 4px; }
.fv-pb-days   { font-weight: 700; color: #6b7280; }

/* ── VIP popup card (floating, hero right) ── */
.fv-vip-popup-card { background: #fff; border-radius: 14px; padding: 14px 16px; min-width: 230px; max-width: 280px; box-shadow: 0 8px 32px rgba(0,0,0,.18),0 2px 8px rgba(0,0,0,.1); position: relative; z-index: 2; flex-shrink: 0; }
.fv-vip-popup-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.fv-vip-popup-title  { font-size: 11px; font-weight: 700; color: #6b7280; display: flex; align-items: center; gap: 6px; }
.fv-vip-popup-exp    { font-size: 11.5px; font-weight: 600; color: #111; margin-bottom: 2px; }
.fv-vip-popup-since  { font-size: 10px; color: #9ca3af; margin-bottom: 8px; display: flex; align-items: center; gap: 5px; }
.fv-vip-popup-bar-track { height: 6px; background: #f0f0f0; border-radius: 99px; overflow: hidden; margin-bottom: 4px; }
.fv-vip-popup-bar-fill  { height: 100%; border-radius: 99px; transition: width .6s cubic-bezier(.4,0,.2,1); }
.fv-vip-popup-bar-meta  { display: flex; justify-content: space-between; font-size: 10px; color: #9ca3af; }
.fv-vip-popup-user { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #1a2332; border-radius: 8px; margin-top: 8px; }
.fv-vip-popup-avatar { width: 28px; height: 28px; border-radius: 6px; background: linear-gradient(135deg,#ef4444,#b91c1c); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 800; flex-shrink: 0; position: relative; }
.fv-vip-popup-avatar::after { content: '2'; position: absolute; top: -4px; left: -4px; width: 14px; height: 14px; border-radius: 50%; background: #3b82f6; color: #fff; font-size: 8px; font-weight: 800; display: flex; align-items: center; justify-content: center; line-height: 1; }
.fv-vip-popup-user-name  { font-size: 11.5px; font-weight: 700; color: #fff; }
.fv-vip-popup-user-email { font-size: 9.5px; color: rgba(255,255,255,.45); }
.fv-vip-popup-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font-size: 10px; font-weight: 700; }

/* ── Hero tab nav ── */
.fv-hero-tabs {
  display: flex; align-items: center; gap: 2px; padding: 0 20px;
  background: rgba(255,255,255,.02); border-top: 1px solid rgba(255,255,255,.06);
  position: relative; z-index: 1; border-radius: 0 0 20px 20px;
  overflow-x: auto; scrollbar-width: none;
}
.fv-hero-tabs::-webkit-scrollbar { display: none; }

.fv-hero-tab-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 12px 16px; font-size: 12.5px; font-weight: 600;
  color: rgba(255,255,255,.4); border: none; background: none; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all .18s; white-space: nowrap; font-family: inherit;
  position: relative; border-radius: 0; flex-shrink: 0;
}
.fv-hero-tab-btn:hover { color: rgba(255,255,255,.75); }
.fv-hero-tab-btn.active { color: #fff; border-bottom-color: #7c3aed; }

.fv-hero-tab-btn .fv-tab-dot { width: 18px; height: 18px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; flex-shrink: 0; }
.fv-hero-tab-btn .fv-tab-dot.tasks    { background: rgba(124,58,237,.25); color: #a78bfa; }
.fv-hero-tab-btn .fv-tab-dot.notes    { background: rgba(59,130,246,.22);  color: #60a5fa; }
.fv-hero-tab-btn .fv-tab-dot.trash    { background: rgba(239,68,68,.15);   color: #f87171; }
.fv-hero-tab-btn .fv-tab-dot.settings { background: rgba(255,255,255,.08); color: rgba(255,255,255,.5); }

/* Legacy — hidden; kept for HTML compat */
.fv-hero-actions { display: none; }
.fv-tabs-nav,
.fv-tab-btn { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   6. ADMIN TOPBAR
   ═══════════════════════════════════════════════════════════════ */
.ft-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  background: linear-gradient(135deg,#1e1b4b,#312e81);
  border-radius: 0 0 var(--ft-r-lg) var(--ft-r-lg);
  color: #fff; flex-wrap: wrap; gap: 12px;
}
.ft-topbar h2        { margin: 0; font-size: 18px; font-weight: 800; color: #fff; }
.ft-topbar-brand     { display: flex; align-items: center; gap: 14px; }
.ft-brand-icon       { width: 42px; height: 42px; background: rgba(255,255,255,.15); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #a78bfa; }
.ft-topbar-meta      { font-size: 12px; color: #c4b5fd; margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════════
   7. STATS GRID (admin)
   ═══════════════════════════════════════════════════════════════ */
.ft-stats-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 14px; margin: 20px 24px; }
.ft-stat-card  { display: flex; align-items: center; gap: 14px; padding: 18px; background: var(--ft-surface); border: 1.5px solid var(--ft-border); border-radius: var(--ft-r-md); transition: all .2s; }
.ft-stat-card:hover { border-color: rgba(124,58,237,.3); box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.ft-stat-icon  { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.ft-stat-todo     .ft-stat-icon { background: rgba(99,102,241,.1);      color: #6366f1; }
.ft-stat-progress .ft-stat-icon { background: rgba(245,158,11,.1);      color: #d97706; }
.ft-stat-done     .ft-stat-icon { background: rgba(16,185,129,.1);      color: #059669; }
.ft-stat-total    .ft-stat-icon { background: var(--ft-primary-xlight); color: var(--ft-primary); }
.ft-stat-val { font-size: 22px; font-weight: 800; color: var(--ft-text); }
.ft-stat-lbl { font-size: 11px; font-weight: 600; color: var(--ft-text-muted); text-transform: uppercase; letter-spacing: .5px; }

/* ═══════════════════════════════════════════════════════════════
   8. TABS
   ═══════════════════════════════════════════════════════════════ */
/* Admin tabs */
.ft-tabs { display: flex; gap: 4px; padding: 0 24px; margin: 16px 0; border-bottom: 2px solid var(--ft-border); flex-wrap: wrap; }
.ft-tab  { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; font-size: 13px; font-weight: 700; color: var(--ft-text-muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all .2s; cursor: pointer; border-radius: var(--ft-r-sm) var(--ft-r-sm) 0 0; }
.ft-tab:hover  { color: var(--ft-primary); background: var(--ft-primary-xlight); }
.ft-tab.active { color: var(--ft-primary); border-bottom-color: var(--ft-primary); background: var(--ft-primary-xlight); }

/* Tab panes */
.fv-tab-pane { display: none; width: 100%; position: relative; overflow: hidden; clear: both; box-sizing: border-box; }
.fv-tab-pane.active,
.fv-tab-pane[style*="display:block"],
.fv-tab-pane[style*="display: block"] { display: block !important; }
/* Workspace tab needs flex layout — override the block forced above */
#fv-tab-workspace.fv-tab-pane.active,
#fv-tab-workspace.fv-tab-pane[style*="display:block"],
#fv-tab-workspace.fv-tab-pane[style*="display: block"],
#fv-tab-workspace.fv-tab-pane[style*="display:flex"] { display: flex !important; flex-direction: column; overflow: hidden; }
#fv-tab-notes, #fv-tab-trash { width: 100%; position: relative; overflow: hidden; clear: both; }
#fv-tab-settings { width: 100%; position: relative; overflow: visible; clear: both; }
#fv-tab-settings.fv-tab-pane { overflow: visible; }
#fv-tab-notes > *, #fv-tab-trash > *, #fv-tab-settings > * { float: none !important; clear: both; box-sizing: border-box; }

/* ═══════════════════════════════════════════════════════════════
   9. BUTTONS
   ═══════════════════════════════════════════════════════════════ */
/* Admin buttons */
.ft-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border: 1.5px solid transparent;
  border-radius: var(--ft-r-sm); font-size: 13px; font-weight: 700;
  font-family: var(--ft-font); cursor: pointer; transition: all .15s;
  text-decoration: none; line-height: 1.4;
}
.ft-btn:disabled      { opacity: .6; cursor: not-allowed; pointer-events: none; }
.ft-btn:focus-visible { outline: 2px solid var(--ft-primary); outline-offset: 2px; }
.ft-btn-primary       { background: var(--ft-primary); color: #fff; border-color: var(--ft-primary-dark); }
.ft-btn-primary:hover { background: var(--ft-primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124,58,237,.3); }
.ft-btn-danger        { background: var(--ft-danger-bg); color: var(--ft-danger); border-color: rgba(239,68,68,.2); }
.ft-btn-danger:hover  { background: rgba(239,68,68,.15); }
.ft-btn-ghost         { background: transparent; color: var(--ft-text-muted); border-color: var(--ft-border); }
.ft-btn-ghost:hover   { border-color: var(--ft-primary); color: var(--ft-primary); }
.ft-btn-gold          { background: linear-gradient(135deg,#f59e0b,#d97706); color: #fff; border-color: #d97706; }
.ft-btn-gold:hover    { filter: brightness(1.1); transform: translateY(-1px); }
.ft-btn-edit          { background: rgba(59,130,246,.08); color: #2563eb; border-color: rgba(59,130,246,.2); }
.ft-btn-edit:hover    { background: rgba(59,130,246,.15); }
.ft-btn-sm            { padding: 6px 12px; font-size: 12px; }

/* VIP buttons */
.fvbtn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border: 1.5px solid transparent;
  border-radius: var(--ft-r-sm,8px); font-size: 13px; font-weight: 700;
  font-family: var(--ft-font,system-ui); cursor: pointer; transition: all .15s;
  text-decoration: none; background: transparent; color: var(--ft-text,#111827); line-height: 1.4;
}
.fvbtn-p       { background: var(--ft-primary,#7c3aed); color: #fff; border-color: var(--ft-primary-dark,#6d28d9); }
.fvbtn-p:hover { background: var(--ft-primary-dark,#6d28d9); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124,58,237,.3); }
.fvbtn-p:disabled { opacity: .6; cursor: not-allowed; pointer-events: none; }
.fvbtn-g       { background: transparent; color: var(--ft-text-muted); border-color: var(--ft-border); border-radius: 8px; }
.fvbtn-g:hover { border-color: var(--ft-primary); color: var(--ft-primary); }
.fvbtn-ghost   { background: transparent; color: var(--ft-text-muted,#6b7280); border: 1.5px solid var(--ft-border,#e5e7eb); }
.fvbtn-ghost:hover { border-color: var(--ft-primary,#7c3aed); color: var(--ft-primary,#7c3aed); }
.fvbtn-white   { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.2); }
.fvbtn-white:hover { background: rgba(255,255,255,.2); }
.fvbtn-ai      { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; background: linear-gradient(135deg,rgba(124,58,237,.12),rgba(139,92,246,.08)); color: var(--ft-primary); border: 1.5px solid rgba(124,58,237,.25); border-radius: 8px; font-size: 12px; font-weight: 700; font-family: var(--ft-font,system-ui); cursor: pointer; transition: all .15s; }
.fvbtn-ai:hover { background: linear-gradient(135deg,rgba(124,58,237,.2),rgba(139,92,246,.15)); transform: translateY(-1px); }
.fvbtn-sm      { padding: 6px 12px; font-size: 12px; }
.fvbtn-block   { width: 100%; justify-content: flex-start; text-align: left; padding: 10px 16px; gap: 10px; font-size: 14px; border-radius: 10px; transition: var(--ft-transition,all .2s ease); }
.fvbtn-block:hover { transform: translateX(3px); }
.fvbtn-block i { width: 20px; text-align: center; flex-shrink: 0; }

[data-theme="dark"] .fvbtn-ghost       { border-color: var(--ft-border); color: var(--ft-text-secondary); }
[data-theme="dark"] .fvbtn-ghost:hover { background: var(--ft-bg-tertiary); color: var(--ft-text); border-color: var(--ft-accent); }

/* ═══════════════════════════════════════════════════════════════
   10. TOOLBARS & FILTERS
   ═══════════════════════════════════════════════════════════════ */
.ft-toolbar    { display: flex; align-items: center; gap: 10px; padding: 14px 24px; flex-wrap: wrap; }
.ft-export-btns { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.ft-export-lbl { font-size: 12px; font-weight: 600; color: var(--ft-text-muted); }
.ft-filter-bar { display: flex; align-items: center; gap: 8px; padding: 0 24px 14px; flex-wrap: wrap; }
.ft-filter-bar select,
.ft-filter-bar input[type="text"] { padding: 8px 12px; border: 1.5px solid var(--ft-border); border-radius: var(--ft-r-sm); font-size: 13px; font-family: var(--ft-font); background: var(--ft-surface); color: var(--ft-text); }

.fv-toolbar       { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.fv-toolbar-left  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fv-toolbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.fv-toolbar-form  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; }
.fv-toolbar-form .fv-inp-select { min-width: 130px; }

.fv-per-page-wrap    { display: flex; align-items: center; gap: 6px; }
.fv-per-page-wrap select { width: auto; }
.fv-per-page-custom  { width: 64px; display: none; }
.fv-per-page-custom.visible { display: block; }

.ftvip-filter-wrapper {
  position: sticky; top: 0; z-index: 90;
  background: var(--ft-bg,#f8fafc); padding-bottom: 8px;
}
[data-theme="dark"] .ftvip-filter-wrapper { background: var(--ft-bg,#0f172a); }

/* ═══════════════════════════════════════════════════════════════
   11. INPUTS & FORMS
   ═══════════════════════════════════════════════════════════════ */
.fv-inp {
  padding: 9px 12px; border: 1.5px solid var(--ft-border,#e5e7eb);
  border-radius: var(--ft-r-sm,8px); font-size: 13px; font-family: var(--ft-font,system-ui);
  color: var(--ft-text,#111827); background: var(--ft-surface,#fff);
  transition: border-color .15s; width: 100%;
}
.fv-inp:focus     { border-color: var(--ft-primary,#7c3aed); outline: none; box-shadow: 0 0 0 3px rgba(124,58,237,.08); }
.fv-inp-icon      { position: relative; }
.fv-inp-icon i    { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ft-text-dim,#9ca3af); font-size: 12px; pointer-events: none; }
.fv-inp-icon .fv-inp { padding-left: 30px; }
.fv-inp-select    { width: auto; min-width: 140px; }
.fv-textarea      { min-height: 80px; resize: vertical; }
.fv-textarea-ai   { background: var(--ft-primary-xlight,rgba(124,58,237,.05)); border-color: rgba(124,58,237,.2); }
.fv-color-row     { display: flex; align-items: center; gap: 10px; }
.fv-color-pick    { width: 36px; height: 36px; border: none; border-radius: 8px; cursor: pointer; padding: 0; }
.fv-color-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.fv-swatch        { width: 28px; height: 28px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; transition: all .15s; }
.fv-swatch:hover  { transform: scale(1.15); }
.fv-swatch-on     { border-color: var(--ft-text,#111827); box-shadow: 0 0 0 2px rgba(0,0,0,.1); }
.fv-form-grid-2   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fv-ai-gen-btn    { align-self: flex-start; margin-top: 4px; }

input[type="datetime-local"].fv-inp { cursor: pointer; }

[data-theme="dark"] .fv-inp,
[data-theme="dark"] .ftvip-status-select { background: var(--ft-bg-secondary) !important; border-color: var(--ft-border) !important; color: var(--ft-text) !important; }

/* Chip group */
.fv-chip-group       { display: flex; gap: 6px; flex-wrap: wrap; }
.fv-chip-radio       { cursor: pointer; }
.fv-chip-radio input { display: none; }
.fv-chip-radio span  { display: inline-block; padding: 5px 14px; border-radius: 99px; border: 1.5px solid var(--ft-border-strong,#d1d5db); background: var(--ft-surface-2,#f3f4f6); font-size: 12px; font-weight: 700; color: var(--ft-text-muted,#6b7280); transition: all .15s; user-select: none; }
.fv-chip-radio input:checked + span { background: var(--ft-primary-xlight,rgba(124,58,237,.1)); border-color: var(--ft-primary,#7c3aed); color: var(--ft-primary-light,#8b5cf6); }
.fv-chip-radio:hover span { border-color: var(--ft-primary-light,#8b5cf6); }
[data-theme="dark"] .fv-chip-radio span { background: var(--ft-bg-tertiary); border-color: var(--ft-border); color: var(--ft-text-secondary); }
[data-theme="dark"] .fv-chip-radio input:checked + span { background: var(--ft-accent); color: #fff; border-color: var(--ft-accent); }

/* Task modal fields */
.ft-field       { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.ft-field:last-child { margin-bottom: 0; }
.ft-label       { font-size: 12px; font-weight: 700; color: #555; text-transform: uppercase; letter-spacing: .5px; line-height: 1; }
.ft-required    { color: var(--ft-danger); margin-left: 2px; }
.ft-input       { width: 100%; padding: 10px 12px; border: 1.5px solid var(--ft-border); border-radius: 8px; font-size: 13px; font-family: var(--ft-font); color: #111; background: #fff; line-height: 1.5; transition: border-color .15s, box-shadow .15s; box-sizing: border-box; -webkit-appearance: none; appearance: none; }
.ft-input:focus { border-color: var(--ft-primary); outline: none; box-shadow: 0 0 0 3px var(--ft-primary-xlight); }
.ft-input::placeholder { color: #aaa; }
.ft-textarea    { resize: vertical; min-height: 80px; }
.ft-select      { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.ft-input-icon  { padding-left: 36px; }
.ft-field-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

.ft-user-search-wrap  { position: relative; display: flex; align-items: center; }
.ft-user-search-icon  { position: absolute; left: 12px; color: #aaa; font-size: 12px; pointer-events: none; z-index: 1; }
.ft-user-clear-btn    { position: absolute; right: 8px; background: var(--ft-surface-2); border: none; border-radius: 6px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ft-text-muted); font-size: 11px; transition: all .15s; flex-shrink: 0; }
.ft-user-clear-btn:hover { background: var(--ft-danger-bg); color: var(--ft-danger); }
.ft-user-results-dropdown { position: relative; z-index: 200; }
#ft-inline-user-results { position: absolute; width: 100%; left: 0; }
#ft-inline-user-results > div { background: var(--ft-surface); border: 1.5px solid var(--ft-border); border-radius: var(--ft-r-sm); box-shadow: 0 8px 28px rgba(0,0,0,.12); overflow: hidden; margin-top: 2px; }

.fv-lbl       { font-size: 11px; font-weight: 700; color: var(--ft-text-muted,#6b7280); text-transform: uppercase; letter-spacing: .4px; display: block; }
.fv-form-row  { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.fv-form-row:last-child { margin-bottom: 0; }
.required, .fv-required { color: var(--ft-danger); font-weight: 800; }

/* ═══════════════════════════════════════════════════════════════
   12. TOGGLE SWITCHES
   ═══════════════════════════════════════════════════════════════ */
.ft-toggle        { position: relative; display: inline-flex; width: 44px; height: 24px; cursor: pointer; }
.ft-toggle input  { position: absolute; opacity: 0; width: 0; height: 0; }
.ft-toggle-slider { position: absolute; inset: 0; background: var(--ft-surface-3); border-radius: 99px; border: 1.5px solid var(--ft-border-strong); transition: all .2s; }
.ft-toggle-slider::before { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.ft-toggle input:checked + .ft-toggle-slider { background: var(--ft-primary); border-color: var(--ft-primary-dark); }
.ft-toggle input:checked + .ft-toggle-slider::before { transform: translateX(20px); }

.fv-toggle        { position: relative; display: inline-flex; cursor: pointer; user-select: none; }
.fv-toggle input  { position: absolute; opacity: 0; width: 0; height: 0; }
.fv-toggle-track  { width: 44px; height: 24px; background: var(--ft-surface-3,#e9ecef); border-radius: 99px; transition: background .2s; position: relative; border: 1.5px solid var(--ft-border-strong,#d1d5db); }
.fv-toggle input:checked ~ .fv-toggle-track { background: var(--ft-primary,#7c3aed); border-color: var(--ft-primary-dark,#6d28d9); }
.fv-toggle-thumb  { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .2s cubic-bezier(.4,0,.2,1); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.fv-toggle input:checked ~ .fv-toggle-track .fv-toggle-thumb { transform: translateX(20px); }

/* ═══════════════════════════════════════════════════════════════
   13. ADMIN TABLE
   ═══════════════════════════════════════════════════════════════ */
.ft-table           { width: 100%; border-collapse: separate; border-spacing: 0; margin: 0 0 16px; background: var(--ft-surface); border: 1.5px solid var(--ft-border); border-radius: var(--ft-r-md); overflow: hidden; }
.ft-table thead     { background: var(--ft-surface-2); }
.ft-table th        { padding: 10px 14px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--ft-text-muted); text-align: left; border-bottom: 1.5px solid var(--ft-border); }
.ft-table td        { padding: 12px 14px; font-size: 13px; border-bottom: 1px solid var(--ft-border); vertical-align: middle; }
.ft-table tbody tr:last-child td { border-bottom: none; }
.ft-table tbody tr  { transition: background .12s; }
.ft-table tbody tr:hover { background: var(--ft-primary-xlight); }
.ft-table .ft-btn   { padding: 5px 10px; font-size: 11px; }
.ft-task-title-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════════
   14. BADGES
   ═══════════════════════════════════════════════════════════════ */
.ft-badge          { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.ft-priority-low      { background: rgba(16,185,129,.1);  color: #059669; }
.ft-priority-medium   { background: rgba(59,130,246,.1);  color: #2563eb; }
.ft-priority-high     { background: rgba(245,158,11,.1);  color: #d97706; }
.ft-priority-critical { background: rgba(239,68,68,.1);   color: #dc2626; }

/* VIP badges — priority */
.ftvip-badge             { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .01em; border: 1.5px solid transparent; line-height: 1; }
.ftvip-priority-low      { background: rgba(16,185,129,.1);  color: #059669; border-color: rgba(16,185,129,.25); }
.ftvip-priority-medium   { background: rgba(59,130,246,.1);  color: #2563eb; border-color: rgba(59,130,246,.25); }
.ftvip-priority-high     { background: rgba(245,158,11,.1);  color: #d97706; border-color: rgba(245,158,11,.25); }
.ftvip-priority-critical { background: rgba(239,68,68,.1);   color: #dc2626; border-color: rgba(239,68,68,.25); }

/* VIP badges — status */
.ftvip-status-todo        { background: rgba(99,102,241,.06);  color: #4338ca; border-color: rgba(99,102,241,.3); }
.ftvip-status-in-progress { background: rgba(245,158,11,.08);  color: #b45309; border-color: rgba(245,158,11,.35); }
.ftvip-status-done        { background: rgba(16,185,129,.08);  color: #047857; border-color: rgba(16,185,129,.3); }
.ftvip-status-cancelled   { background: rgba(107,114,128,.07); color: #4b5563; border-color: rgba(107,114,128,.25); }

.ft-status-select { border: 1px solid var(--ft-border-strong); border-radius: 6px; background: var(--ft-surface-2); font-size: 12px; font-weight: 600; padding: 4px 8px; font-family: var(--ft-font); cursor: pointer; }
.ft-cat-dot       { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.ft-color-swatch  { display: inline-block; width: 18px; height: 18px; border-radius: 4px; vertical-align: middle; margin-right: 6px; border: 1px solid rgba(0,0,0,.1); }

/* Category card grid (admin) */
.ft-cat-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 14px; padding: 4px 0 16px; }
.ft-cat-card { background: var(--ft-surface); border: 1.5px solid var(--ft-border); border-radius: 14px; padding: 16px; display: flex; align-items: center; gap: 14px; transition: box-shadow .18s,border-color .18s; position: relative; overflow: hidden; }
.ft-cat-card:hover { border-color: var(--ft-primary,#7c3aed); box-shadow: 0 4px 18px rgba(124,58,237,.1); }
.ft-cat-card-icon  { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; transition: transform .18s; }
.ft-cat-card:hover .ft-cat-card-icon { transform: scale(1.1); }
.ft-cat-card-body  { flex: 1; min-width: 0; }
.ft-cat-card-name  { font-size: 13px; font-weight: 700; color: var(--ft-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-cat-card-meta  { display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.ft-cat-card-color-txt { font-size: 11px; color: var(--ft-text-muted); font-family: monospace; }
.ft-cat-card-actions { display: flex; flex-direction: column; gap: 5px; flex-shrink: 0; opacity: 0; transition: opacity .18s; }
.ft-cat-card:hover .ft-cat-card-actions { opacity: 1; }
.ft-cat-act-btn    { width: 30px; height: 30px; border: 1.5px solid var(--ft-border); border-radius: 8px; background: var(--ft-surface-2); cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; transition: all .15s; color: var(--ft-text-muted); }
.ft-cat-act-edit:hover { background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.3); color: #2563eb; transform: scale(1.1); }
.ft-cat-act-del:hover  { background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.2); color: #ef4444; transform: scale(1.1); }
.ft-cat-empty      { grid-column: 1/-1; text-align: center; padding: 40px; color: var(--ft-text-muted); font-size: 14px; }

.ft-icon-pick-btn.active { border-color: var(--ft-primary,#7c3aed) !important; background: var(--ft-primary,#7c3aed) !important; color: #fff !important; }
.ft-icon-pick-btn:hover  { border-color: var(--ft-primary,#7c3aed) !important; color: var(--ft-primary,#7c3aed) !important; }
.ft-muted  { color: var(--ft-text-dim); }
.ft-empty  { text-align: center; padding: 30px; color: var(--ft-text-muted); font-size: 13px; }
.ft-ai-badge { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; background: var(--ft-primary-xlight); border-radius: 50%; color: var(--ft-primary); font-size: 10px; margin-left: 6px; vertical-align: middle; cursor: help; }

/* ═══════════════════════════════════════════════════════════════
   15. PAGINATION
   ═══════════════════════════════════════════════════════════════ */
.ft-pagination { display: flex; justify-content: center; gap: 6px; padding: 0 24px 20px; }
.ft-page-btn   { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--ft-r-sm); border: 1.5px solid var(--ft-border); background: var(--ft-surface); color: var(--ft-text-muted); font-size: 13px; font-weight: 600; text-decoration: none; transition: all .15s; }
.ft-page-btn:hover { border-color: var(--ft-primary); color: var(--ft-primary); }
.ft-page-btn.active { background: var(--ft-primary); color: #fff; border-color: var(--ft-primary); }

.ftvip-pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 20px; flex-wrap: wrap; }
.ftvip-pg-btn    { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1.5px solid var(--ft-border,#e5e7eb); background: var(--ft-surface,#fff); color: var(--ft-text-muted,#6b7280); font-size: 13px; font-weight: 600; text-decoration: none; transition: all .15s; }
.ftvip-pg-btn:hover  { border-color: var(--ft-primary,#7c3aed); color: var(--ft-primary,#7c3aed); }
.ftvip-pg-btn.active { background: var(--ft-primary,#7c3aed); color: #fff; border-color: var(--ft-primary,#7c3aed); }
.ftvip-pg-nav    { background: none; border: 1px solid #e5e7eb; border-radius: 8px; padding: 6px 14px; cursor: pointer; font-size: 14px; font-weight: 600; color: #7c3aed; transition: all .15s; }
.ftvip-pg-nav:hover    { background: #ede9fe; border-color: #7c3aed; }
.ftvip-pg-nav:disabled { opacity: .4; cursor: not-allowed; }

[data-theme="dark"] .ftvip-pg-nav { border-color: #334155; color: #a78bfa; }
[data-theme="dark"] .ftvip-pg-btn { background: var(--ft-surface,#18181b); border-color: var(--ft-border,#3f3f46); color: var(--ft-text-muted,#a1a1aa); }

/* Load-more button */
.ftvip-load-more-wrap { display: flex; justify-content: center; padding: 16px 0 8px; }
.ftvip-load-more-btn  {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ft-surface,#fff); border: 1.5px solid var(--ft-border,#e5e7eb);
  border-radius: 10px; color: var(--ft-primary,#7c3aed);
  font-size: 13px; font-weight: 600; padding: 9px 22px;
  cursor: pointer; transition: all .18s;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.ftvip-load-more-btn:hover  { background: rgba(124,58,237,.06); border-color: var(--ft-primary,#7c3aed); box-shadow: 0 4px 14px rgba(124,58,237,.12); }
.ftvip-load-more-btn:active { transform: scale(.97); }
.ftvip-load-more-btn i      { font-size: 14px; transition: transform .2s; }
.ftvip-load-more-btn:hover i { transform: scale(1.2); }
.ftvip-load-more-btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
[data-theme="dark"] .ftvip-load-more-btn       { background: var(--ft-surface,#18181b); border-color: rgba(255,255,255,.14); color: #a78bfa; }
[data-theme="dark"] .ftvip-load-more-btn:hover { background: rgba(167,139,250,.1); border-color: #a78bfa; }

/* ═══════════════════════════════════════════════════════════════
   16. MODALS
   ═══════════════════════════════════════════════════════════════ */
.ft-modal, .fv-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 999999; padding: 3px;
}
.ft-modal-box, .fv-modal-box {
  background: var(--ft-surface); border-radius: var(--ft-r-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  width: 100%; max-width: 560px; max-height: 90vh;
  overflow: hidden; display: flex; flex-direction: column;
  animation: ftModalIn .25s ease;
}
.ft-modal-sm, .fv-modal-sm { max-width: 400px; }
.ft-modal-task             { max-width: 620px; }

@keyframes ftModalIn {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ft-modal-header, .fv-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1.5px solid var(--ft-border); }
.ft-modal-header h3, .fv-modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; color: var(--ft-text); }
.ft-modal-close, .fv-modal-close { width: 32px; height: 32px; border: none; background: var(--ft-surface-2); border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ft-text-muted); font-size: 14px; transition: all .15s; }
.ft-modal-close:hover, .fv-modal-close:hover { background: var(--ft-danger-bg); color: var(--ft-danger); }
.ft-modal-body, .fv-modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; max-height: 70vh; font-family: var(--ft-font,system-ui,sans-serif); font-size: var(--ft-font-size-base,15px); }
.ft-modal-footer, .fv-modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1.5px solid var(--ft-border); }

.ft-modal-body label, .fv-modal-body label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 700; color: var(--ft-text-muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 14px; }
.ft-modal-body input, .ft-modal-body select, .ft-modal-body textarea { padding: 9px 12px; border: 1.5px solid var(--ft-border); border-radius: var(--ft-r-sm); font-size: 13px; font-family: var(--ft-font); color: var(--ft-text); background: var(--ft-surface); transition: border-color .15s; }
.ft-modal-body input:focus, .ft-modal-body select:focus, .ft-modal-body textarea:focus,
.fv-modal-body  input:focus, .fv-modal-body  select:focus, .fv-modal-body  textarea:focus {
  border-color: var(--ft-primary) !important; outline: none !important; box-shadow: 0 0 0 3px var(--ft-primary-xlight) !important;
}

.ft-row2    { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ft-ai-area { display: flex; flex-direction: column; gap: 8px; }

/* Special modals */
#ftvip-export-modal .fv-modal-box { max-width: 380px; }
#ftvip-note-modal   .fv-modal-box { max-width: 640px; width: 90vw; }
#ftvip-note-modal   .fv-modal-body { padding: 24px; max-height: 70vh; overflow-y: auto; }
#ftvip-export-modal, #ftvip-note-modal { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

[data-theme="dark"] #ftvip-note-modal   .fv-modal-box,
[data-theme="dark"] #ftvip-export-modal .fv-modal-box,
[data-theme="dark"] .ftvip-modal-box,
[data-theme="dark"] .ftvip-modal { background: var(--ft-bg-primary) !important; color: var(--ft-text) !important; border-color: var(--ft-border) !important; }

.fv-modal-icon-sm { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: var(--ft-primary-xlight,rgba(124,58,237,.1)); border-radius: 6px; color: var(--ft-primary-light,#8b5cf6); font-size: 12px; vertical-align: middle; margin-right: 4px; }

/* Settings modal */
.fv-settings-box   { max-width: 540px; max-height: 90vh; display: flex; flex-direction: column; background: #fff; border-radius: 14px; border: 1px solid #e5e7eb; box-shadow: 0 8px 32px rgba(0,0,0,.10); }
.fv-settings-body  { overflow-y: auto; flex: 1; }
.fv-settings-section { padding: 20px 24px; border-bottom: 1px solid var(--ft-border,#e5e7eb); }
.fv-settings-section:last-of-type { border-bottom: none; }
.fv-settings-section-title { font-size: 10px; font-weight: 700; color: var(--ft-text-muted,#6b7280); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }
.fv-settings-section-title i { color: var(--ft-primary-light,#8b5cf6); }
.fv-settings-row          { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.fv-settings-row:last-child { margin-bottom: 0; }
.fv-settings-row label    { font-size: 13px; font-weight: 600; color: var(--ft-text,#1f2937); }
.fv-settings-row input, .fv-settings-row select, .fv-settings-row textarea { padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; width: 100%; box-sizing: border-box; background: #f9fafb; color: #1f2937; transition: border-color .15s; }
.fv-settings-row input:focus, .fv-settings-row select:focus, .fv-settings-row textarea:focus { outline: none; border-color: #7c3aed; background: #fff; }
.fv-settings-toggle-row   { flex-direction: row !important; align-items: center; justify-content: space-between; }
.fv-settings-hint         { font-size: 11px; color: var(--ft-text-dim,#9ca3af); line-height: 1.5; margin-top: 3px; }
.fv-settings-about        { text-align: center; padding: 16px; font-size: 12px; color: var(--ft-text-dim,#9ca3af); }
.fv-settings-version      { background: var(--ft-surface-2,#f3f4f6); padding: 2px 8px; border-radius: 4px; font-weight: 700; margin-left: 4px; }
.fv-settings-group-label  { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #9ca3af; margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 1px solid #f3f4f6; }

[data-theme="dark"] .fv-settings-box       { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .fv-settings-group-label { border-color: #334155; }

.ft-settings-section-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px; color: var(--ft-text-muted); margin: 20px 0 10px; padding: 0 24px; }

/* Admin settings form */
.ft-settings-form { display: flex; flex-direction: column; gap: 16px; padding: 0 24px 20px; max-width: 680px; }
.ft-field-group   { background: var(--ft-surface); border: 1.5px solid var(--ft-border); border-radius: var(--ft-r-md); padding: 20px; }
.ft-field-group h3 { margin: 0 0 14px; font-size: 14px; font-weight: 800; color: var(--ft-text); }
.ft-field-group label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 700; color: var(--ft-text-muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 12px; }
.ft-field-group input, .ft-field-group select { padding: 9px 12px; border: 1.5px solid var(--ft-border); border-radius: var(--ft-r-sm); font-size: 13px; font-family: var(--ft-font); color: var(--ft-text); background: var(--ft-surface); }
.ft-field-group input:focus, .ft-field-group select:focus { border-color: var(--ft-primary); outline: none; box-shadow: 0 0 0 3px var(--ft-primary-xlight); }

/* VIP add form */
.ft-vip-add-form  { background: var(--ft-surface); border: 1.5px solid var(--ft-border); border-radius: var(--ft-r-md); padding: 20px; margin: 0 0 16px; }
.ft-vip-add-form h4 { margin: 0 0 12px; font-size: 14px; font-weight: 800; }
.ft-vip-add-row   { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.ft-vip-header-icon { font-size: 28px; }

/* ═══════════════════════════════════════════════════════════════
   17. PROGRESS OVERVIEW CARD
   ═══════════════════════════════════════════════════════════════ */
.ft-prog-overview {
  border-radius: 18px; padding: 22px;
  background: linear-gradient(146deg,#ffffff,#ededed);
  box-shadow: 0 10px 25px rgba(0,0,0,.15);
  margin-bottom: 22px;
}
.ft-prog-overview.hidden { display: none; }
[data-theme="dark"] .ft-prog-overview { background: var(--ft-card-bg,#1e1e2e); border-color: var(--ft-border-dark,#2d2d3d); }

.ft-prog-overview-head  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ft-prog-overview-title { font-weight: 700; font-size: 14px; color: #1c1917; }
.ft-prog-overview-title i { color: #7c3aed; margin-right: 6px; }
.ft-prog-overview-total { font-size: 12px; color: #6b7280; }
[data-theme="dark"] .ft-prog-overview-title { color: #f1f5f9; }

.ft-prog-stack { height: 12px; border-radius: 99px; overflow: hidden; background: #f3f4f6; display: flex; margin-bottom: 16px; }
[data-theme="dark"] .ft-prog-stack { background: #2d2d3d; }
.ft-prog-seg   { height: 100%; transition: width .4s ease; }

.ft-prog-legend   { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ft-prog-leg-item { display: flex; flex-direction: column; gap: 5px; }
.ft-prog-leg-row  { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #374151; }
[data-theme="dark"] .ft-prog-leg-row { color: #cbd5e1; }
.ft-prog-dot      { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.ft-prog-leg-pct  { font-weight: 700; white-space: nowrap; }
.ft-prog-mini-track { height: 5px; border-radius: 99px; background: #f3f4f6; overflow: hidden; }
[data-theme="dark"] .ft-prog-mini-track { background: #2d2d3d; }
.ft-prog-mini-fill  { height: 100%; border-radius: 99px; transition: width .4s ease; }

.ft-prog-footer      { margin-top: 14px; padding-top: 12px; border-top: 1px solid #f3f4f6; display: flex; align-items: center; gap: 10px; }
[data-theme="dark"] .ft-prog-footer { border-top-color: #2d2d3d; }
.ft-prog-footer-track { flex: 1; height: 8px; border-radius: 99px; background: #f3f4f6; overflow: hidden; }
[data-theme="dark"] .ft-prog-footer-track { background: #2d2d3d; }
.ft-prog-footer-fill  { height: 100%; background: linear-gradient(90deg,#10b981,#059669); border-radius: 99px; transition: width .5s ease; }
.ft-prog-footer-label { font-size: 12px; font-weight: 700; color: #10b981; white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════════
   18. VIP KPI PANEL
   ═══════════════════════════════════════════════════════════════ */
.fv-kpi  { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 14px; margin-bottom: 20px; }
.fv-kc   { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--ft-surface,#fff); border: 1.5px solid var(--ft-border,#e5e7eb); border-radius: 14px; transition: all .2s; }
.fv-kc:hover { border-color: rgba(124,58,237,.3); box-shadow: 0 4px 12px rgba(0,0,0,.06); transform: translateY(-2px); }
.fv-ki   { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.fv-ka .fv-ki { background: var(--ft-primary-xlight,rgba(124,58,237,.08)); color: var(--ft-primary,#7c3aed); }
.fv-kd .fv-ki { background: rgba(16,185,129,.1);  color: #059669; }
.fv-kw .fv-ki { background: rgba(245,158,11,.1);  color: #d97706; }
.fv-kx .fv-ki { background: rgba(239,68,68,.08);  color: #ef4444; }
.fv-kv { font-size: 20px; font-weight: 800; color: var(--ft-text,#111827); }
.fv-kl { font-size: 11px; font-weight: 600; color: var(--ft-text-muted,#6b7280); text-transform: uppercase; letter-spacing: .4px; }

/* Category panel */
.fv-cat-panel       { background: var(--ft-surface,#fff); border: 1.5px solid var(--ft-border,#e5e7eb); border-radius: 14px; padding: 14px 18px; margin-bottom: 16px; }
.fv-cat-panel-head  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.fv-cat-panel-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.fv-cat-count       { background: var(--ft-primary-xlight,rgba(124,58,237,.08)); color: var(--ft-primary,#7c3aed); font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; }

/* Old chip classes kept for JS selector compat */
.fv-cat-chips       { display: flex; gap: 8px; flex-wrap: wrap; }
.fv-cat-chip        { display: none; }
.fv-cat-chip-actions { display: inline-flex; align-items: center; gap: 4px; }
.fv-cat-chip-edit,
.fv-cat-chip-del    { background: none; border: none; cursor: pointer; border-radius: 6px; transition: all .15s; }

/* Category card (horizontal scroll) */
.fv-cat-scroll-wrap {
  position: relative;
  /* Space for absolute-positioned prev/next arrows on desktop */
  margin-left: 20px;
  margin-right: 20px;
}
.fv-cat-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 2; display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  background: var(--ft-surface,#fff); border: 1.5px solid var(--ft-border,#e5e7eb);
  border-radius: 50%; cursor: pointer; color: var(--ft-text,#374151);
  font-size: 13px; box-shadow: 0 2px 8px rgba(0,0,0,.08);
  transition: all .15s; padding: 0;
}
.fv-cat-nav:hover    { background: var(--ft-primary,#7c3aed); border-color: var(--ft-primary,#7c3aed); color: #fff; box-shadow: 0 4px 12px rgba(124,58,237,.25); }
.fv-cat-nav:disabled { opacity: .3; cursor: default; pointer-events: none; }
/* Desktop: arrows sit outside the cards — prev on left, next on right */
.fv-cat-nav-prev { left: -20px; }
.fv-cat-nav-next { right: -20px; }

.fv-cat-grid {
  display: flex; flex-direction: row; gap: 10px;
  overflow-x: auto; scroll-behavior: smooth; padding: 2px 2px 6px;
  -ms-overflow-style: none; scrollbar-width: none;
}
.fv-cat-grid::-webkit-scrollbar { display: none; }
.fv-cat-grid .fv-cat-empty { display: flex; align-items: center; gap: 10px; color: var(--ft-text-dim,#9ca3af); font-size: 13px; padding: 16px 0; white-space: nowrap; }

/* ── Category thin draggable scrollbar ── */
.fv-cat-scrollbar {
  position: relative; height: 4px; border-radius: 99px;
  background: var(--ft-border,#e5e7eb);
  margin: 6px 2px 2px; overflow: hidden;
  cursor: pointer; display: none;
}
.fv-cat-scrollbar.visible { display: block; }
.fv-cat-scrollbar-thumb {
  position: absolute; top: 0; left: 0;
  height: 100%; border-radius: 99px;
  background: var(--ft-primary,#7c3aed);
  opacity: .45; transition: opacity .15s, width .1s, left .05s;
  cursor: grab; min-width: 32px;
}
.fv-cat-scrollbar:hover .fv-cat-scrollbar-thumb,
.fv-cat-scrollbar-thumb.dragging { opacity: .75; }
.fv-cat-scrollbar-thumb.dragging { cursor: grabbing; transition: none; }
[data-theme="dark"] .fv-cat-scrollbar { background: rgba(255,255,255,.1); }

.fv-cat-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start;
  gap: 6px; padding: 10px 12px 8px;
  background: var(--ft-surface,#fff); border: 1.5px solid var(--ft-border,#e5e7eb);
  border-radius: 12px; overflow: hidden;
  transition: box-shadow .2s,transform .18s,border-color .18s;
  cursor: default; flex: 0 0 auto; width: 140px; min-width: 140px;
}
.fv-cat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); transform: translateY(-2px); border-color: var(--ft-primary,#7c3aed); }

.fv-cat-card-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: 12px 12px 0 0; }

/* Icon + name on same row */
.fv-cat-card-top { display: flex; align-items: center; gap: 8px; width: 100%; }

.fv-cat-card-icon-wrap {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; border: 1.5px solid transparent;
  font-size: 15px; flex-shrink: 0; transition: transform .18s;
}
.fv-cat-card:hover .fv-cat-card-icon-wrap { transform: scale(1.08); }

.fv-cat-card-name { font-size: 12.5px; font-weight: 700; color: var(--ft-text,#111827); line-height: 1.3; word-break: break-word; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fv-cat-card-footer { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 4px; }

.fv-cat-card-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; padding: 2px 6px; border-radius: 99px; text-transform: uppercase; }
.fv-cat-card-badge i { font-size: 9px; }
.fv-cat-card-badge-admin,
.fv-cat-card-badge-shared { background: rgba(107,114,128,.1); color: var(--ft-text-dim,#6b7280); }
.fv-cat-card-badge-mine   { background: rgba(124,58,237,.08); color: var(--ft-primary,#7c3aed); }

.fv-cat-card-actions { display: inline-flex; align-items: center; gap: 2px; opacity: 0; transition: opacity .18s; }
.fv-cat-card:hover .fv-cat-card-actions { opacity: 1; }
.fv-cat-card-btn { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; background: none; border: none; cursor: pointer; border-radius: 6px; font-size: 10px; color: var(--ft-text-dim,#9ca3af); transition: all .15s; }
.fv-cat-card-edit:hover { color: #2563eb; background: rgba(37,99,235,.1); }
.fv-cat-card-del:hover  { color: var(--ft-danger,#ef4444); background: rgba(239,68,68,.08); }

/* Icon picker */
.fv-icon-picker-row { display: flex; align-items: center; gap: 10px; }
.fv-icon-preview    { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; background: rgba(124,58,237,.1); color: #7c3aed; border: 1.5px solid rgba(124,58,237,.15); transition: all .18s; }
.fv-icon-quick-picks {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px;
  max-height: 160px; overflow-y: auto;
  padding: 6px 4px 6px 0;
  border: 1px solid var(--ft-border,#e5e7eb); border-radius: 8px;
  padding: 8px;
  background: var(--ft-surface-2,#f9fafb);
}
.fv-icon-quick-picks::-webkit-scrollbar { width: 5px; }
.fv-icon-quick-picks::-webkit-scrollbar-track { background: transparent; }
.fv-icon-quick-picks::-webkit-scrollbar-thumb { background: var(--ft-border,#d1d5db); border-radius: 99px; }
.fv-icon-quick      { width: 34px; height: 34px; border: 1.5px solid var(--ft-border,#e5e7eb); border-radius: 8px; background: var(--ft-surface,#fff); cursor: pointer; font-size: 13px; display: flex; align-items: center; justify-content: center; transition: all .15s; color: var(--ft-text,#111); flex-shrink: 0; }
.fv-icon-quick:hover  { border-color: var(--ft-primary,#7c3aed); background: var(--ft-primary-xlight,rgba(124,58,237,.07)); color: var(--ft-primary,#7c3aed); transform: scale(1.1); }
.fv-icon-quick.active { border-color: var(--ft-primary,#7c3aed); background: var(--ft-primary,#7c3aed); color: #fff; }
.fv-hint { font-size: 11px; color: var(--ft-text-muted,#6b7280); font-weight: 400; margin-left: 4px; }

/* Progress panel */
.fv-prog       { background: var(--ft-surface,#fff); border: 1.5px solid var(--ft-border,#e5e7eb); border-radius: 14px; padding: 20px 22px; margin-bottom: 20px; }
.fv-prog-h     { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.fv-prog-title { font-size: 14px; font-weight: 700; }
.fv-prog-pct   { font-size: 13px; font-weight: 700; color: var(--ft-success,#10b981); }
.fv-multi-bar  { height: 10px; border-radius: 99px; overflow: hidden; display: flex; background: var(--ft-surface-2,#f3f4f6); margin-bottom: 16px; }
.fv-mbs        { height: 100%; transition: width .4s ease; }
.fv-prog-legs  { display: grid; grid-template-columns: repeat(auto-fit,minmax(110px,1fr)); gap: 12px; }
.fv-leg        { text-align: center; }
.fv-leg-top    { font-size: 12px; color: var(--ft-text-muted,#6b7280); margin-bottom: 4px; }
.fv-dot        { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.fv-leg-val    { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.fv-leg-bar    { height: 5px; border-radius: 99px; background: var(--ft-surface-2,#f3f4f6); overflow: hidden; }
.fv-leg-bar-f  { height: 100%; border-radius: 99px; transition: width .4s ease; }

/* ═══════════════════════════════════════════════════════════════
   19. VIP GATE / EMPTY
   ═══════════════════════════════════════════════════════════════ */
.fv-gate      { text-align: center; padding: 70px 32px; max-width: 520px; margin: 60px auto; background: var(--ft-surface,#fff); border: 1.5px solid var(--ft-border,#e5e7eb); border-radius: 20px; box-shadow: 0 8px 40px rgba(0,0,0,.08); }
.fv-gate-ico  { width: 88px; height: 88px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 36px; margin: 0 auto 24px; }
.fv-gate-lock  { background: linear-gradient(135deg,rgba(59,130,246,.15),rgba(99,102,241,.15)); color: #3b82f6; box-shadow: 0 4px 20px rgba(59,130,246,.2); }
.fv-gate-dis   { background: rgba(107,114,128,.1); color: #6b7280; }
.fv-gate-crown { background: linear-gradient(135deg,rgba(245,158,11,.15),rgba(234,179,8,.15)); color: #f59e0b; box-shadow: 0 4px 20px rgba(245,158,11,.2); }
.fv-gate h2    { font-size: 24px; font-weight: 800; margin: 0 0 10px; color: var(--ft-text,#111827); }
.fv-gate p     { font-size: 14px; color: var(--ft-text-muted,#6b7280); margin: 0 0 24px; line-height: 1.7; }
.fv-gate-btns  { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.fv-perks      { display: flex; flex-direction: column; gap: 8px; margin: 0 auto 24px; text-align: left; max-width: 340px; background: rgba(124,58,237,.04); border: 1px solid rgba(124,58,237,.1); border-radius: 12px; padding: 16px 20px; }
.fv-perk       { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ft-text,#111827); font-weight: 600; }
.fv-perk i     { color: var(--ft-success,#10b981); }

.fv-empty      { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 24px; width: 100%; }
.fv-empty-icon { font-size: 40px; color: var(--ft-border,#e5e7eb); margin-bottom: 14px; }
.fv-empty h3   { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.fv-empty p    { margin: 0 0 16px; font-size: 13px; color: var(--ft-text-muted,#6b7280); }

/* ═══════════════════════════════════════════════════════════════
   20. TASK CARDS (ftc- system)
   ═══════════════════════════════════════════════════════════════ */
.ftc-card {
  background: var(--ft-surface,#ffffff);
  border: 1.5px solid var(--ft-border,#e8eaed);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  display: flex; flex-direction: column;
  width: 100%; height: auto; min-height: 200px; overflow: visible;
  padding: 0; position: relative;
  transition: box-shadow .2s ease, transform .18s ease, border-color .18s;
}
.ftc-card[data-card-color] {
  background-color: var(--ftc-card-bg);
  border-inline-start: 4px solid var(--ftc-card-border);
  border-start-start-radius: 0;
  border-end-start-radius: 0;
}
.ftc-card:hover {
  border-color: rgba(99,102,241,.25);
  box-shadow: 0 6px 20px rgba(0,0,0,.09);
  transform: translateY(-2px);
}

.ftc-topbar       { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px 6px; }
.ftc-topbar-right { display: flex; align-items: center; gap: 2px; }

.ftc-pin-btn  { width: 28px; height: 28px; border: none; background: transparent; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #d1d5db; font-size: 12px; transition: color .15s,background .15s; flex-shrink: 0; }
.ftc-pin-btn:hover { background: #f3f4f6; color: #6b7280; }
.ftc-pin-btn.ftvip-pin-active { color: #7c3aed; }

.ftc-icon-btn { width: 28px; height: 28px; border: none; background: transparent; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #9ca3af; font-size: 12px; transition: color .15s,background .15s; flex-shrink: 0; }
.ftc-icon-btn:hover { background: #f3f4f6; color: #374151; }
.ftc-menu-wrap { position: relative; }

.ftc-badges { display: flex; align-items: center; justify-content: space-between; padding: 4px 14px 10px; gap: 6px; overflow: visible; min-width: 0; }

.ftc-badge           { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 8px; font-size: 13px; font-weight: 700; letter-spacing: .01em; border: 1.5px solid transparent; line-height: 1; white-space: nowrap; flex-shrink: 0; overflow: visible; }
.ftc-priority-low      { background: rgba(16,185,129,.1);  color: #059669; border-color: rgba(16,185,129,.22); }
.ftc-priority-medium   { background: rgba(59,130,246,.11); color: #1d4ed8; border-color: rgba(59,130,246,.28); }
.ftc-priority-high     { background: rgba(245,158,11,.1);  color: #b45309; border-color: rgba(245,158,11,.25); }
.ftc-priority-critical { background: rgba(239,68,68,.1);   color: #b91c1c; border-color: rgba(239,68,68,.25); }
.ftc-status-todo        { background: transparent;             color: #4338ca; border-color: rgba(99,102,241,.4); }
.ftc-status-in-progress { background: rgba(245,158,11,.07);   color: #b45309; border-color: rgba(245,158,11,.4); }
.ftc-status-done        { background: rgba(16,185,129,.07);   color: #047857; border-color: rgba(16,185,129,.4); }
.ftc-status-cancelled   { background: rgba(107,114,128,.06);  color: #4b5563; border-color: rgba(107,114,128,.3); }

.ftc-body  { padding: 0 14px 14px; flex: 1; }
.ftc-title { font-size: calc(var(--ft-font-size-base, 15px) + 2px); font-weight: 700; color: var(--ft-text,#111827); margin: 0 0 7px; line-height: 1.4; }
.ftc-body .ftvip-task-desc { font-size: var(--ft-font-size-base, 15px); color: var(--ft-text-muted,#6b7280); line-height: 1.65; margin: 0; }

/* ═══════════════════════════════════════════════════════════════
   CARD FOOTER — Two-row system (Row1=Cat+Preview, Row2=Date+Status)
   Consolidated from all PATCH v5.8.3-* blocks
   ═══════════════════════════════════════════════════════════════ */
.ftc-footer,
.ftvip-task-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 9px 14px 12px;
  border-top: 1.5px solid var(--ft-border,#f0f1f3);
  background: var(--ft-surface-footer,rgba(249,250,251,.6));
  border-radius: 0 0 14px 14px; flex-shrink: 0;
}
.ftc-footer-left  { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.ftc-footer-right { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }

/* Two-row footer */
.ftc-footer-2row {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px 14px 11px;
  border-top: 1.5px solid var(--ft-border,#f0f1f3);
  background: var(--ft-surface-footer,rgba(249,250,251,.55));
  border-radius: 0 0 14px 14px;
}
[data-theme="dark"] .ftc-footer-2row {
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.07);
}

/* Row base */
.ftc-footer-row {
  display: flex; flex-direction: row; align-items: center;
  justify-content: space-between; gap: 8px;
  width: 100%; min-height: 24px; direction: ltr;
}

/* Row 1 — Category (left) | Preview (right) */
.ftc-footer-row1-left {
  display: flex; align-items: center; flex: 1 1 auto; min-width: 0; overflow: hidden;
}
.ftc-footer-row1-left .ftvip-cat-pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ftc-footer-row1-right {
  display: flex; align-items: center; flex-shrink: 0;
}
/* Preview button — Row 1 hidden (lives in Row 2) */

/* Row 2 — Date+Time (left) | Preview + Status (right) */
.ftc-footer-row2-left {
  display: flex; align-items: center; flex: 1 1 auto; min-width: 0; gap: 4px; overflow: visible;
}
.ftc-footer-row2-left .ftvip-due {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 500; color: var(--ft-text-muted,#64748b); white-space: nowrap; flex-wrap: nowrap;
}
.ftc-footer-row2-left .ftvip-due i { font-size: 11px; opacity: .75; flex-shrink: 0; }
.ftc-footer-row2-left .ftvip-due-overdue { color: #ef4444 !important; font-weight: 700; }
.ftc-footer-row2-left .ftvip-due .ftvip-due-sep { opacity: .35; margin: 0 1px; }

.ftc-footer-row2-right {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}

/* Row 2 separator (optional) */
.ftc-row2-sep { flex-shrink: 0; color: var(--ft-text-muted,#9ca3af); font-size: 12px; padding: 0 6px; opacity: .6; }

/* Right-aligned slot — wide enough for "In Progress" + arrow */
.ftc-aligned-right {
  display: flex; align-items: center; flex-shrink: 0;
  min-width: 110px; width: auto;
}

/* ── Shared base for Preview btn & Status select ── */
.ftc-right-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  width: 100%; min-width: 110px;
  height: 30px; padding: 5px 11px;
  font-size: 13px; font-weight: 700; letter-spacing: .01em; line-height: 1;
  border-radius: 8px; border: 1.5px solid var(--ft-border,#e2e8f0);
  background: var(--ft-surface,#fff); color: var(--ft-text-muted,#6b7280);
  cursor: pointer; white-space: nowrap; box-sizing: border-box;
  overflow: visible;
  transition: color .15s, border-color .15s, background .15s;
}

/* Preview button */
.ftc-right-btn.ftc-preview-btn {
  opacity: 1;
  color: var(--ft-primary,#7c3aed);
  border-color: rgba(124,58,237,.35);
  background: rgba(124,58,237,.06);
}
.ftc-right-btn.ftc-preview-btn:hover {
  color: var(--ft-primary,#7c3aed); border-color: var(--ft-primary,#7c3aed);
  background: rgba(124,58,237,.12);
}
.ftc-right-btn.ftc-preview-btn i { font-size: 11px; opacity: .85; }

/* Status select */
.ftc-right-btn.ftc-status-select,
.ftc-right-btn.ftvip-status-select {
  appearance: auto;
  padding: 5px 6px 5px 11px;
  color: var(--ft-text,#1e293b);
}
.ftc-right-btn.ftc-status-select:focus,
.ftc-right-btn.ftvip-status-select:focus { border-color: var(--ft-primary,#7c3aed); outline: none; }

.ftc-preview-label { font-size: 13px; font-weight: 700; }

/* Preview "view" btn — neutralise legacy opacity */
.ftvip-btn-view           { opacity: .7; transition: opacity .15s, color .15s; }
.ftvip-btn-view:hover     { opacity: 1; color: var(--ft-primary,#7c3aed); }
.ftvip-btn-view::after    { display: none; }
.ftc-right-btn.ftvip-btn-view { opacity: 1; }

/* Dark mode — ftc footer */
[data-theme="dark"] .ftc-footer,
[data-theme="dark"] .ftvip-task-card-footer { background: rgba(255,255,255,.03); border-color: rgba(255,255,255,.07); }
[data-theme="dark"] .ftc-card               { background: var(--ft-surface,#1e1e2e); border-color: rgba(255,255,255,.1); }
[data-theme="dark"] .ftc-card:hover         { border-color: rgba(139,92,246,.35); box-shadow: 0 6px 24px rgba(0,0,0,.3); }
[data-theme="dark"] .ftc-icon-btn,
[data-theme="dark"] .ftc-pin-btn            { color: #6b7280; }
[data-theme="dark"] .ftc-icon-btn:hover,
[data-theme="dark"] .ftc-pin-btn:hover      { background: rgba(255,255,255,.08); color: #e5e7eb; }
[data-theme="dark"] .ftc-title              { color: #f1f5f9; }
[data-theme="dark"] .ftc-status-select      { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: #e5e7eb; }
[data-theme="dark"] .ftc-status-todo        { border-color: rgba(139,92,246,.5); color: #a78bfa; }
[data-theme="dark"] .ftc-priority-medium    { color: #93c5fd; border-color: rgba(147,197,253,.35); }
[data-theme="dark"] .ftc-right-btn          { background: var(--ft-surface,#1e293b); color: #9ca3af; border-color: rgba(255,255,255,.14); }
[data-theme="dark"] .ftc-right-btn.ftc-preview-btn:hover { color: #a78bfa; border-color: #a78bfa; background: rgba(167,139,250,.09); }
[data-theme="dark"] .ftc-right-btn.ftc-status-select,
[data-theme="dark"] .ftc-right-btn.ftvip-status-select   { background: var(--ft-surface,#1e293b); border-color: rgba(255,255,255,.14); color: #e2e8f0; }
[data-theme="dark"] .ftvip-btn-view         { color: #a78bfa; }
[data-theme="dark"] .ftvip-btn-view:hover   { color: #c4b5fd; }

/* ═══════════════════════════════════════════════════════════════
   21. FTVIP TASK & NOTE CARDS
   ═══════════════════════════════════════════════════════════════ */
.ftvip-cards-grid  { display: grid; grid-template-columns: repeat(auto-fill,minmax(300px,1fr)); gap: 16px; align-items: stretch; padding-top: 10px; }
.ftvip-tasks-inner { display: contents; }

.ftvip-task-card {
  background: var(--ft-surface,#fff);
  border: 1px solid var(--ft-border,#e5e7eb);
  border-radius: var(--ft-radius-card,16px);
  box-shadow: var(--ft-shadow-card);
  display: flex; flex-direction: column; justify-content: space-between;
  height: auto; min-height: 260px; width: 100%;
  padding: 0; overflow: visible; position: relative; will-change: transform;
  transition: var(--ft-transition);
  animation: ftCardIn .3s ease both;
  font-family: var(--ft-font,system-ui,sans-serif);
  font-size: var(--ft-font-size-base,15px);
}
.ftvip-task-card:hover          { border-color: rgba(124,58,237,.3); box-shadow: var(--ft-shadow-hover); transform: translateY(-2px); }
.ftvip-task-card[draggable="true"]        { cursor: grab; }
.ftvip-task-card[draggable="true"]:active { cursor: grabbing; }
.ftvip-task-card.ftvip-drag-over          { outline: 2px dashed var(--ft-accent,#7c3aed); outline-offset: 2px; transform: scale(.98); }
.ftvip-task-card[data-card-color]         { background-color: var(--ftc-card-bg); border-inline-start: 4px solid var(--ftc-card-border); border-start-start-radius: 0; border-end-start-radius: 0; }

.ftvip-task-card:nth-child(1) { animation-delay: .02s; }
.ftvip-task-card:nth-child(2) { animation-delay: .04s; }
.ftvip-task-card:nth-child(3) { animation-delay: .06s; }
.ftvip-task-card:nth-child(4) { animation-delay: .08s; }
.ftvip-task-card:nth-child(5) { animation-delay: .10s; }
.ftvip-task-card:nth-child(6) { animation-delay: .12s; }

.ftvip-task-card-body   { padding: 4px 16px 14px; flex: 1; overflow-y: auto; min-height: 0; }
.ftvip-task-card-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 8px; gap: 8px; }
.ftvip-task-card-footer { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 13px; border-top: 1px solid var(--ft-border,#f0f0f0); gap: 8px; }
.ftvip-footer-left      { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.ftvip-footer-right     { display: flex; align-items: center; gap: 8px; flex-shrink: 0; white-space: nowrap; }

.ftvip-task-actions-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px 7px; border-bottom: 1px solid var(--ft-border,#f0f0f0); background: var(--ft-surface-2,#fafafa); border-radius: 13px 13px 0 0; }
.ftvip-action-label     { font-size: 11px; color: var(--ft-text-dim,#9ca3af); font-weight: 500; display: inline-flex; align-items: center; gap: 5px; letter-spacing: .01em; }
.ftvip-task-actions     { display: flex; gap: 1px; align-items: center; }

.ftvip-task-title { font-size: calc(var(--ft-font-size-base, 15px) + 2px); font-weight: 700; color: var(--ft-text,#111827); margin: 0 0 7px; line-height: 1.4; }
.ftvip-task-desc  { font-size: var(--ft-font-size-base, 15px); color: var(--ft-text-muted,#6b7280); line-height: 1.65; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.ftvip-ai-hint    { display: flex; align-items: flex-start; gap: 7px; background: var(--ft-primary-xlight,rgba(124,58,237,.08)); border: 1px solid rgba(124,58,237,.15); border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
.ftvip-ai-hint i  { color: var(--ft-primary-light,#8b5cf6); font-size: 11px; margin-top: 2px; flex-shrink: 0; }
.ftvip-ai-hint span { font-size: 11px; color: var(--ft-text-muted,#6b7280); line-height: 1.5; }

.ftvip-cat-pill  { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 13px; font-weight: 600; background: rgba(0,0,0,.04); border: 1px solid rgba(0,0,0,.08); color: var(--ft-text,#111827); white-space: nowrap; flex-shrink: 0; overflow: visible; }
.ftvip-cat-dot   { width: 7px; height: 7px; border-radius: 50%; background: var(--cat-color,#6c757d); flex-shrink: 0; }
.ftvip-due       { font-size: 13px; color: var(--ft-text-muted,#6b7280); display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.ftvip-due-overdue   { color: #ef4444 !important; font-weight: 700; }
.ftvip-updated-time  { font-size: 11px; color: var(--ft-text-dim,#9ca3af); display: inline-flex; align-items: center; gap: 3px; margin-inline-start: auto; }
.ftvip-relative-time { font-variant-numeric: tabular-nums; }

.ftvip-status-select { border: 1px solid var(--ft-border-strong,#d1d5db); border-radius: 6px; background: var(--ft-surface-2,#f9fafb); color: var(--ft-text,#111827); font-size: 11px; font-weight: 600; padding: 4px 8px; height: 27px; cursor: pointer; outline: none; font-family: var(--ft-font,system-ui,sans-serif); transition: border-color .15s; }
.ftvip-status-select:hover { border-color: var(--ft-primary,#7c3aed); }

/* Icon buttons */
.ftvip-icon-btn { width: 28px; height: 28px; border: none; background: transparent; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--ft-text-dim,#9ca3af); font-size: 12px; cursor: pointer; transition: all .15s; position: relative; }
.ftvip-icon-btn:hover     { background: var(--ft-surface-hover,#f3f4f6); color: var(--ft-text,#111827); }
.ftvip-icon-danger:hover  { background: rgba(239,68,68,.08); color: #ef4444; }
.ftvip-icon-btn.ftvip-btn-active { transform: scale(.88); opacity: .7; }
.ftvip-icon-btn[disabled] { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* JS Tooltip via ::after (suppressed on touch) */
.ftvip-icon-btn::after { content: attr(title); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #1f2937; color: #fff; font-size: 11px; white-space: nowrap; padding: 3px 8px; border-radius: 6px; pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 100; }
.ftvip-icon-btn:hover::after { opacity: 1; }

/* Card top row */
.ftvip-card-toprow { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px 4px; gap: 6px; }
.ftvip-card-toprow .ftvip-task-badges { flex: 1; }

/* Card actions */
.ftvip-card-actions button, .ftvip-card-actions [data-action],
.ftvip-card-footer  button, .ftvip-card-footer  [data-action] {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 30px; min-width: 30px; padding: 0 8px; font-size: 13px; font-weight: 500;
  border-radius: 6px; border: 1px solid var(--ft-border,#e5e7eb); background: none;
  cursor: pointer; transition: background .15s,border-color .15s,color .15s,transform .1s;
  white-space: nowrap; box-sizing: border-box;
}
.ftvip-card-actions button:hover, .ftvip-card-actions [data-action]:hover,
.ftvip-card-footer  button:hover, .ftvip-card-footer  [data-action]:hover {
  background: var(--ft-surface-2,#f3f4f6); border-color: var(--ft-primary,#7c3aed); transform: translateY(-1px);
}

/* Dropdown */
.ftvip-dropdown-menu { right: auto; left: 0; top: calc(100% + 4px); }
[dir="rtl"] .ftvip-dropdown-menu { left: auto; right: 0; }

/* Dark mode — ftvip cards */
[data-theme="dark"] .ftvip-task-card          { background: var(--ft-bg-primary); border-color: var(--ft-border); color: var(--ft-text); }
[data-theme="dark"] .ftvip-task-card:hover    { background: var(--ft-bg-tertiary); }
[data-theme="dark"] .ftvip-task-title,
[data-theme="dark"] .ftvip-task-desc          { color: var(--ft-text); }
[data-theme="dark"] .ftvip-task-card-footer,
[data-theme="dark"] .ftvip-task-actions-row   { color: var(--ft-text-secondary); border-color: var(--ft-border); }
[data-theme="dark"] .ftvip-status-select      { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.12); color: #e5e7eb; }
[data-theme="dark"] .ftvip-cat-pill           { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.1); color: #e5e7eb; }
[data-theme="dark"] .ftvip-icon-btn           { color: var(--ft-text-secondary); }
[data-theme="dark"] .ftvip-icon-btn:hover     { background: rgba(255,255,255,.08); color: #e5e7eb; }
[data-theme="dark"] .ftvip-task-actions-row   { background: rgba(255,255,255,.03); border-color: rgba(255,255,255,.06); }
[data-theme="dark"] .ftvip-card-actions button,
[data-theme="dark"] .ftvip-card-footer button { border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .ftvip-card-actions button:hover,
[data-theme="dark"] .ftvip-card-footer button:hover { background: #1e293b; border-color: #818cf8; }

/* Pinned */
.ftvip-pinned-grid .ftvip-note-card,
.ftvip-note-card.ftvip-task-pinned { border: 2px solid #f59e0b !important; box-shadow: 0 0 12px rgba(245,158,11,.18) !important; }
.ftvip-pinned-section { padding-top: 6px; }

/* Note cards */
.ftvip-note-card {
  border-radius: 16px; border: 1px solid var(--ft-border,#e5e7eb);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: transform .2s ease, box-shadow .2s ease;
  background: var(--ft-surface,#fff); padding: 0; overflow: hidden;
  position: relative; display: flex; flex-direction: column;
  height: auto; min-height: 220px;
  font-family: var(--ft-font,system-ui,sans-serif);
  font-size: var(--ft-font-size-base,15px);
}
.ftvip-note-card[data-card-color] { background-color: var(--ftc-card-bg); border-inline-start: 4px solid var(--ftc-card-border); }
.ftvip-note-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
[data-theme="dark"] .ftvip-note-card { background: var(--ft-bg-secondary,#1e293b); border-color: var(--ft-border,#334155); }

.ftvip-note-content { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; flex: 1; position: relative; line-height: 1.6; color: #374151; font-size: calc(var(--ft-font-size-base, 15px) - 1px); padding: 0 14px 10px; }
.ftvip-note-content::after { display: none; }
[data-theme="dark"] .ftvip-note-content { color: var(--ft-text-secondary); }

/* Bulk bar */
.ftvip-bulk-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: #ede9fe; border: 1px solid #c4b5fd; border-radius: 10px; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: #6d28d9; flex-wrap: wrap; }
[data-theme="dark"] .ftvip-bulk-bar { background: #1e1b4b; border-color: #4c1d95; color: #c4b5fd; }
.ftvip-bulk-bar .fvbtn[disabled], .ftvip-bulk-bar .fvbtn.fvbtn-action-disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.ftvip-bulk-count     { margin-inline-end: auto; }
.ftvip-bulk-checkbox  { width: 16px; height: 16px; cursor: pointer; accent-color: #7c3aed; border-radius: 4px; }
.ftvip-card-select-wrap { position: absolute; top: 10px; left: 12px; }

/* ═══════════════════════════════════════════════════════════════
   22. TOASTS
   ═══════════════════════════════════════════════════════════════ */
.ftvip-toast-wrap, #ftvip-toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 9999999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.ftvip-toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 12px; font-size: 13px; font-weight: 600; font-family: var(--ft-font,system-ui); box-shadow: 0 8px 28px rgba(0,0,0,.18); pointer-events: all; cursor: pointer; max-width: 360px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: ftvipToastIn .3s cubic-bezier(.175,.885,.32,1.275); }
.ftvip-toast-success { background: rgba(17,24,39,.95);  color: #fff;    border: 1px solid rgba(255,255,255,.08); }
.ftvip-toast-success i { color: #34d399; }
.ftvip-toast-error   { background: rgba(127,29,29,.95); color: #fca5a5; border: 1px solid rgba(252,165,165,.15); }
.ftvip-toast-error i { color: #f87171; }
.ftvip-toast-info    { background: rgba(30,27,75,.95);  color: #c4b5fd; border: 1px solid rgba(196,181,253,.15); }
.ftvip-toast-warn    { background: rgba(120,53,15,.95); color: #fcd34d; border: 1px solid rgba(252,211,77,.15); }
.ftvip-toast-out     { opacity: 0; transform: translateX(20px); transition: all .3s ease; }
.ftvip-toast i       { font-size: 15px; flex-shrink: 0; }

.ft-toast         { position: fixed; bottom: 24px; right: 24px; z-index: 99999; padding: 12px 20px; border-radius: var(--ft-r-md); font-size: 13px; font-weight: 700; font-family: var(--ft-font); box-shadow: 0 8px 24px rgba(0,0,0,.15); animation: ftToastIn .3s ease; }
.ft-toast-success { background: #111827; color: #fff; }
.ft-toast-error   { background: #1f1315; color: #fca5a5; }

/* ═══════════════════════════════════════════════════════════════
   23. ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */
@keyframes ftCardIn     { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ftvipToastIn { from { opacity: 0; transform: translateX(20px) scale(.9); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes ftToastIn    { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ═══════════════════════════════════════════════════════════════
   24. MISC UI
   ═══════════════════════════════════════════════════════════════ */
#ftvip-color-picker-popup {
  position: absolute; z-index: 999;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  padding: 10px; display: flex; flex-wrap: wrap; gap: 6px; width: 200px;
}
@keyframes ftvipColorFadeIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
.ftvip-color-picker-fadein { animation: ftvipColorFadeIn .15s ease both; }
.ftvip-color-swatch {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid; cursor: pointer;
  transition: transform .15s; display: inline-flex; align-items: center; justify-content: center;
}
.ftvip-color-swatch:hover { transform: scale(1.2); }
[data-theme="dark"] #ftvip-color-picker-popup { background: var(--ft-bg-primary) !important; border-color: var(--ft-border) !important; }

.ftvip-preview-copy-btn { background: none; border: 1px solid #e5e7eb; border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 13px; color: #6b7280; display: inline-flex; align-items: center; gap: 6px; transition: all .15s; }
.ftvip-preview-copy-btn:hover { background: #f3f4f6; color: #374151; }

.ftvip-hide-sm { display: inline; }

/* Dark override vars on #ftvip-wrap */
#ftvip-wrap[data-theme="dark"] { --ft-text:#fafafa; --ft-text-muted:#a1a1aa; --ft-text-dim:#71717a; --ft-surface:#18181b; --ft-surface-2:#27272a; --ft-surface-3:#3f3f46; --ft-border:#3f3f46; --ft-border-strong:#52525b; --ft-primary-xlight:rgba(124,58,237,.15); }

/* Dark toggle button */
#ftvip-dark-toggle { position: fixed; bottom: 24px; right: 24px; z-index: 1000; width: 44px; height: 44px; border-radius: 50%; background: var(--ft-accent,#7c3aed); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: 0 4px 16px rgba(124,58,237,.4); transition: var(--ft-transition); }
#ftvip-dark-toggle:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(124,58,237,.5); }

/* Note modal preview */
#ftvip-note-modal-body [style*="white-space:pre-wrap"] { background: var(--ft-bg-secondary,#f9fafb); border-radius: 8px; padding: 12px; font-size: 14px; line-height: 1.7; }
[data-theme="dark"] #ftvip-note-modal-body [style*="white-space:pre-wrap"] { background: var(--ft-bg-tertiary); color: var(--ft-text); }

[data-theme="dark"] .fv-tab-btn        { color: var(--ft-text-secondary); }
[data-theme="dark"] .fv-tab-btn.active,
[data-theme="dark"] .fv-tab-btn:hover  { color: var(--ft-accent); }
[data-theme="dark"] .ftvip-modal-overlay { background: rgba(0,0,0,.7); }
[data-theme="dark"] .ft-prog-overview  { background: var(--ft-card-bg,#1e1e2e); border-color: var(--ft-border-dark,#2d2d3d); }

.fv-settings-card, .ftvip-modal-inner, .ftvip-preview-modal .ftvip-modal-inner { border-radius: 16px; }

/* JS tooltip */
#ft-tooltip {
  position: fixed; background: #1e293b; color: #f8fafc;
  font-size: 11px; font-weight: 500; white-space: nowrap;
  padding: 4px 9px; border-radius: 5px; pointer-events: none;
  z-index: 99999; box-shadow: 0 2px 8px rgba(0,0,0,.28);
  opacity: 0; transition: opacity .12s ease;
}
#ft-tooltip.ft-tip-visible { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════
   25. RTL / LTR SUPPORT
   ═══════════════════════════════════════════════════════════════ */

/* Global direction */
#ftvip-wrap[dir="rtl"],
[dir="rtl"] { direction: rtl; }

/* Input icon — logical positioning */
#ftvip-wrap[dir="rtl"] .fv-inp-icon i       { inset-inline-start: auto; inset-inline-end: 10px; left: auto; }
#ftvip-wrap[dir="rtl"] .fv-inp-icon .fv-inp { padding-inline-start: 28px; padding-inline-end: 10px; }

/* Toolbar — CAN mirror */
#ftvip-wrap[dir="rtl"] .fv-toolbar,
#ftvip-wrap[dir="rtl"] .fv-toolbar-left,
#ftvip-wrap[dir="rtl"] .fv-toolbar-right,
#ftvip-wrap[dir="rtl"] .fv-cat-panel-head   { flex-direction: row-reverse; }
#ftvip-wrap[dir="rtl"] .fv-settings-toggle-row { flex-direction: row-reverse; }

/* Block buttons in RTL */
[dir="rtl"] .fvbtn-block { text-align: end; justify-content: flex-end; flex-direction: row-reverse; }
[dir="rtl"] .fvbtn-block:hover { transform: translateX(-3px); }

/* CARD ROWS — always LTR visually; bidi text handled by unicode-bidi */
.ftc-card,
.ftvip-task-card,
.ftvip-note-card,
.ftc-footer,
.ftvip-task-card-footer,
.ftvip-task-actions-row,
.ftc-topbar,
.ftc-badges,
.ftvip-task-card-header,
.ftc-footer-row {
  direction: ltr;
}

/* Text in cards: correct bidi rendering */
.ftc-title,
.ftvip-task-title,
.ftc-body .ftvip-task-desc,
.ftvip-task-desc,
.ftvip-note-content {
  unicode-bidi: plaintext;
  text-align: start;
}

.ftc-footer-left, .ftvip-footer-left,
.ftc-topbar-right, .ftc-footer-right, .ftvip-footer-right { flex-direction: row; }

/* ═══════════════════════════════════════════════════════════════
   26. TYPOGRAPHY SETTINGS (admin)
   ═══════════════════════════════════════════════════════════════ */
#ft-typography-section {
  border: 1.5px solid rgba(124,58,237,.18);
  background: linear-gradient(135deg,rgba(124,58,237,.03) 0%,rgba(139,92,246,.05) 100%);
}
#ft-typography-section h3 { color: var(--ft-primary); }
#ft-font-preview-box { transition: box-shadow .2s ease; }
#ft-font-preview-box:hover { box-shadow: var(--ft-shadow-hover); }
#ft-preview-en, #ft-preview-ar { transition: background .2s ease; }

#ft-font-size-slider {
  -webkit-appearance: none; height: 5px; border-radius: 9999px;
  background: linear-gradient(to right,var(--ft-primary) 0%,var(--ft-primary) var(--slider-pct,50%),var(--ft-border-strong) var(--slider-pct,50%),var(--ft-border-strong) 100%);
  outline: none;
}
#ft-font-size-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--ft-primary); cursor: pointer;
  box-shadow: 0 0 0 3px rgba(124,58,237,.15); transition: box-shadow .15s,transform .15s;
}
#ft-font-size-slider::-webkit-slider-thumb:hover { box-shadow: 0 0 0 5px rgba(124,58,237,.22); transform: scale(1.12); }
#ft-font-size-slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--ft-primary); border: none; cursor: pointer; }

#ft-typography-status { padding: 3px 10px; border-radius: var(--ft-r-full); background: rgba(16,185,129,.1); font-size: 12px; font-weight: 700; }

[data-theme="dark"] #ft-typography-section { background: linear-gradient(135deg,rgba(124,58,237,.07) 0%,rgba(139,92,246,.1) 100%); border-color: rgba(124,58,237,.3); }
[data-theme="dark"] #ft-preview-en { background: var(--ft-surface-2); }
[data-theme="dark"] #ft-preview-ar { background: var(--ft-surface); }

/* ═══════════════════════════════════════════════════════════════
   27. RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* Layout */
  #ftvip-wrap-inner { padding: 8px 0 40px !important; margin-top: 8px !important; }
  .ftvip-cards-grid { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--ft-border,#e5e7eb); }

  /* Cards — flush on mobile */
  .ftvip-task-card {
    border-radius: 0; border-inline: none; border-top: none;
    border-bottom: 1px solid var(--ft-border,#e5e7eb);
    box-shadow: none; height: auto; min-height: 180px;
    width: 100%; margin: 0; transform: none;
  }
  .ftvip-task-card:hover { transform: none; box-shadow: none; }
  .ftvip-task-card[data-card-color] { border-inline-start: 4px solid var(--ftc-card-border) !important; border-radius: 0; }

  .ftvip-note-card {
    border-radius: 0; border-inline: none; border-top: none;
    border-bottom: 1px solid var(--ft-border,#e5e7eb);
    box-shadow: none; height: auto; min-height: unset;
    width: 100%; margin: 0;
  }
  .ftvip-note-card:hover { transform: none; box-shadow: none; }

  /* Card internals */
  .ftvip-task-card-header, .ftvip-card-toprow { padding: 10px 14px 6px; }
  .ftvip-task-card-body   { padding: 6px 14px 10px; }
  .ftvip-task-card-footer { padding: 8px 14px 11px; flex-wrap: wrap; }
  .ftvip-footer-right     { width: 100%; justify-content: flex-end; }
  .ftvip-task-actions     { flex-wrap: wrap; gap: 2px; }

  /* ftc card internals */
  .ftc-topbar  { padding: 9px 10px 4px; }
  .ftc-badges  { padding: 4px 10px 8px; }
  .ftc-body    { padding: 0 10px 12px; }
  .ftc-footer, .ftc-footer-2row { padding: 7px 10px 10px; gap: 4px; }
  .ftc-footer-right { width: 100%; justify-content: flex-end; }

  /* Footer row 2 date/actions */
  .ftc-footer-row2 { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: nowrap; }
  .ftc-footer-row2 .ftc-footer-row2-left { flex: 1 1 auto; min-width: 0; overflow: visible; flex-wrap: nowrap; align-items: center; }
  .ftc-footer-row2 .ftvip-due { display: inline-flex; white-space: nowrap; font-size: 10px; gap: 3px; flex-shrink: 1; }
  .ftc-footer-row2 .ftvip-due i { font-size: 10px; flex-shrink: 0; }

  .ftc-aligned-right { min-width: 100px; width: auto; }
  .ftc-right-btn { font-size: 11px; height: 28px; padding: 4px 8px; min-width: 100px; }
  .ftc-preview-label { font-size: 11px; }
  .ftc-row2-sep { padding: 0 4px; font-size: 11px; }

  /* Toast */
  .ftvip-toast-wrap { right: 12px; bottom: 12px; left: 12px; }
  .ftvip-toast      { max-width: 100%; }

  /* Toolbar */
  .fv-toolbar       { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .fv-toolbar-left, .fv-toolbar-right { width: 100%; }
  .fv-toolbar-form  { flex-wrap: wrap; gap: 6px; }
  .fv-header-stats  { gap: 8px; }
  .fv-header-stat   { font-size: 12px; padding: 4px 10px; }
  .fv-settings-box  { max-width: 100%; border-radius: 0; }

  /* Dark toggle */
  #ftvip-dark-toggle { bottom: 16px; right: 16px; width: 38px; height: 38px; font-size: 15px; }

  /* Hero — no outer radius, no extra gap */
  #ftvip-wrap .fv-dashboard-hero,
  .fv-dashboard-hero { border-radius: 0; margin: 0 !important; }
  .fv-hero-noise     { border-radius: 0; }

  /* Hero topbar + user pill mobile — DEFINED IN flowtask-header-redesign.css */
  /* .fv-hero-topbar { ... } */
  .fv-hero-brand  { flex: 1 1 auto; min-width: 0; overflow: hidden; }
  .fv-hero-brand-icon { width: 30px; height: 30px; font-size: 13px; flex-shrink: 0; }
  .fv-hero-brand-name    { font-size: 13px; white-space: nowrap; }
  .fv-hero-brand-ver     { font-size: 9px; white-space: nowrap; }
  .fv-hero-brand-tagline { font-size: 8px; white-space: nowrap; letter-spacing: .8px; }
  /* .fv-hero-topbar-actions { ... } */
  /* .fv-hero-user { ... } */
  /* .fv-hero-user-email { ... } */
  /* .fv-hero-user-name-row { ... } */
  /* .fv-hero-user-vip-badge { ... } */
  /* .fv-hero-avatar { ... } */
  /* .fv-hero-topbar-btn { ... } */
  /* .fv-hero-topbar-btn span { ... } */
  /* .fv-hero-topbar-btn-primary { ... } */
  /* .fv-hero-topbar-btn-icon { ... } */
  .fv-topbar-divider { display: none; }
  .fv-vip-popup-card { display: none; }

  /* .fv-hero-body { ... } */
  .fv-hero-title    { font-size: 20px; letter-spacing: -.3px; }
  .fv-hero-subtitle { font-size: 11px; margin-top: 3px; }
  /* .fv-hero-greeting { ... } */
  /* .fv-vip-chip { ... } */

  .fv-hero-stats    { gap: 6px; margin-top: 12px; flex-wrap: wrap; }
  .fv-hero-stat     { padding: 8px 10px; flex: 1 1 calc(50% - 6px); min-width: 0; box-sizing: border-box; }
  .fv-hero-stat-val { font-size: 15px; }
  .fv-hero-stat-lbl { font-size: 9px; }
  .fv-hero-stat-icon { width: 24px; height: 24px; font-size: 11px; }

  .fv-sub-card      { padding: 10px 14px; flex-direction: row; align-items: center; flex-wrap: nowrap; gap: 8px; border-radius: 0; }
  .fv-sub-pb        { display: none; }
  .fv-sub-left      { flex-direction: row; gap: 8px; align-items: center; flex-wrap: wrap; flex: 1; min-width: 0; }
  .fv-sub-title     { font-size: 11px; }
  .fv-sub-exp       { font-size: 11px; }
  .fv-sub-right     { align-self: center; flex-shrink: 0; }

  .fv-hero-tabs     { padding: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; border-radius: 0; }
  .fv-hero-tabs::-webkit-scrollbar { display: none; }
  .fv-hero-tab-btn  { padding: 11px 14px; font-size: 12px; }

  /* Pagination on mobile: hide numbers, show load-more */
  .ftvip-pagination { display: none; }
  .ftvip-load-more-wrap { padding: 12px 14px 4px; }
  .ftvip-load-more-btn  { width: 100%; justify-content: center; font-size: 13px; padding: 11px 16px; }

  /* Pagination prev/next — bigger tap target */
  .ftvip-pg-nav { min-width: 48px; min-height: 40px; padding: 8px 14px; font-size: 15px; touch-action: manipulation; -webkit-tap-highlight-color: transparent; cursor: pointer; }
  .ftvip-pg-nav:disabled { opacity: .35; pointer-events: none; }
  .ftvip-pagination { gap: 8px; padding: 12px 0; }

  /* Color picker — bottom sheet on mobile */
  #ftvip-color-picker-popup {
    position: fixed !important; left: 50% !important; transform: translateX(-50%) !important;
    top: auto !important; bottom: 16px !important; right: auto !important;
    width: calc(100vw - 32px) !important; max-width: 320px;
    z-index: 99999 !important; display: flex; flex-wrap: wrap; gap: 8px;
    justify-content: center; padding: 14px 12px;
    border-radius: 16px; box-shadow: 0 -4px 32px rgba(0,0,0,.18),0 8px 24px rgba(0,0,0,.15);
  }
  #ftvip-color-picker-popup .ftvip-color-swatch { width: 36px; height: 36px; }

  /* Misc */
  .ftvip-hide-sm { display: none; }
}

@media (max-width: 600px) {
  .fv-form-grid-2 { grid-template-columns: 1fr; }
  .fv-kpi         { grid-template-columns: repeat(2,1fr); }
  .ft-row2        { grid-template-columns: 1fr; }
  .ft-stats-grid  { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 520px) {
  .ft-field-grid { grid-template-columns: 1fr; }
  .ft-modal-task { max-width: 100%; border-radius: 0; }
  .ftvip-status-select { font-size: 11px; padding: 3px 6px; }
  .ftvip-task-card-footer { flex-wrap: wrap; gap: 6px; }
}

@media (max-width: 480px) {
  .ft-prog-legend { grid-template-columns: 1fr; }
  .fv-hero-tab-btn { padding: 10px 12px; }
}

@media (max-width: 400px) {
  .ftc-badge { font-size: 11px; padding: 4px 8px; }
}

/* Touch: suppress JS tooltip */
@media (hover: none), (pointer: coarse) {
  #ft-tooltip { display: none; }
}
/* ============================================================
   MERGED FROM: flowtask-header-redesign.css
   ============================================================ */
/* ============================================================
   FlowTask AI — HEADER REDESIGN  (Premium SaaS Edition)
   File: flowtask-header-redesign.css
   Drop-in after flowtask.css — no breaking changes.
   ============================================================ */

/* ══════════════════════════════════════════════════════════════
   SECTION 1 — DESIGN TOKENS (extends flowtask.css variables)
   ══════════════════════════════════════════════════════════════ */
:root {
  /* Hero gradient — deep indigo-slate */
  --fvh-bg-from:      #0f1623;
  --fvh-bg-mid:       #141d2e;
  --fvh-bg-to:        #0d1520;

  /* Accent neon-teal glow */
  --fvh-glow-a:       rgba(56,189,248,.18);
  --fvh-glow-b:       rgba(99,102,241,.14);
  --fvh-glow-c:       rgba(168,85,247,.10);

  /* Glass surfaces */
  --fvh-glass-bg:     rgba(255,255,255,.04);
  --fvh-glass-border: rgba(255,255,255,.08);
  --fvh-glass-hover:  rgba(255,255,255,.08);

  /* Typography on dark */
  --fvh-text:         rgba(255,255,255,.92);
  --fvh-text-muted:   rgba(255,255,255,.45);
  --fvh-text-dim:     rgba(255,255,255,.25);

  /* Accent colours */
  --fvh-violet:       #8b5cf6;
  --fvh-violet-glow:  rgba(139,92,246,.35);
  --fvh-teal:         #22d3ee;
  --fvh-teal-glow:    rgba(34,211,238,.25);
  --fvh-emerald:      #34d399;
  --fvh-amber:        #fbbf24;
  --fvh-rose:         #fb7185;

  /* Subscription card */
  --fvh-sub-bg:       #ffffff;
  --fvh-sub-border:   rgba(0,0,0,.07);
  --fvh-sub-shadow:   0 4px 24px rgba(0,0,0,.10), 0 1px 4px rgba(0,0,0,.06);

  /* Radii */
  --fvh-r-hero:       22px;
  --fvh-r-card:       16px;
  --fvh-r-btn:        10px;
  --fvh-r-pill:       999px;
  --fvh-r-icon:       10px;

  /* Timing */
  --fvh-ease:         cubic-bezier(.4,0,.2,1);
  --fvh-spring:       cubic-bezier(.34,1.56,.64,1);
}

/* Dark mode token overrides */
[data-theme="dark"] {
  --fvh-sub-bg:       #1e2535;
  --fvh-sub-border:   rgba(255,255,255,.07);
  --fvh-sub-shadow:   0 4px 24px rgba(0,0,0,.4), 0 1px 4px rgba(0,0,0,.3);
}

/* ══════════════════════════════════════════════════════════════
   SECTION 2 — HERO WRAPPER
   ══════════════════════════════════════════════════════════════ */
.fv-dashboard-hero {
  background: linear-gradient(150deg, var(--fvh-bg-from) 0%, var(--fvh-bg-mid) 50%, var(--fvh-bg-to) 100%);
  border-radius: var(--fvh-r-hero);
  margin: 0 0 20px 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: visible; /* allow dropdowns to escape hero bounds */
  box-shadow:
    0 0 0 1px rgba(255,255,255,.055),
    0 20px 60px rgba(0,0,0,.45),
    0 4px 16px rgba(0,0,0,.25);
  border: none;
}

/* Inner layer that clips glows/noise to hero border-radius */
.fv-hero-bg-clip {
  position: absolute;
  inset: 0;
  border-radius: var(--fvh-r-hero);
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

/* Atmospheric glows */
.fv-dashboard-hero::before {
  content: '';
  position: absolute;
  top: -120px; left: -100px;
  width: 480px; height: 480px;
  background: radial-gradient(ellipse, var(--fvh-glow-a) 0%, transparent 65%);
  pointer-events: none; z-index: 0;
}
.fv-dashboard-hero::after {
  content: '';
  position: absolute;
  bottom: -60px; right: -60px;
  width: 380px; height: 380px;
  background: radial-gradient(ellipse, var(--fvh-glow-b) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}

/* Subtle dot-grid texture */
.fv-hero-noise {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none; z-index: 0; border-radius: var(--fvh-r-hero);
  mask-image: linear-gradient(to bottom, transparent 0%, black 30%, black 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 30%, black 70%, transparent 100%);
}

/* Third glow — violet right-center */
.fv-dashboard-hero .fv-hero-noise::after {
  content: '';
  position: absolute;
  top: 30%; right: -80px;
  width: 300px; height: 300px;
  background: radial-gradient(ellipse, var(--fvh-glow-c) 0%, transparent 65%);
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════════
   SECTION 3 — TOP BAR
   ══════════════════════════════════════════════════════════════ */
.fv-hero-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px 10px;
  border-bottom: 1px solid rgba(255,255,255,.055);
  position: relative; z-index: 2;
  gap: 12px; flex-wrap: nowrap; min-width: 0;
  min-height: 62px;
}

/* ── Brand / Logo ── */
.fv-hero-brand {
  display: flex; align-items: center;
  gap: 12px; min-width: 0; flex-shrink: 0;
}

.fv-hero-brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; flex-shrink: 0;
  box-shadow: 0 4px 16px var(--fvh-violet-glow), inset 0 1px 0 rgba(255,255,255,.25);
  position: relative;
  transition: transform .2s var(--fvh-spring), box-shadow .2s var(--fvh-ease);
}
.fv-hero-brand-icon:hover {
  transform: rotate(-6deg) scale(1.08);
  box-shadow: 0 6px 24px var(--fvh-violet-glow);
}

.fv-hero-brand-info    { display: flex; flex-direction: column; gap: 1px; }
.fv-hero-brand-top     { display: flex; align-items: baseline; gap: 6px; }
.fv-hero-brand-name {
  font-size: 15px; font-weight: 800;
  color: #fff; letter-spacing: -.3px;
  white-space: nowrap;
  background: linear-gradient(90deg, #fff 0%, rgba(255,255,255,.75) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.fv-hero-brand-ver {
  font-size: 10px; font-weight: 600;
  color: rgba(99,102,241,.7); letter-spacing: .5px; text-transform: uppercase;
  -webkit-text-fill-color: unset; background: none;
}
.fv-hero-brand-tagline {
  font-size: 9px; font-weight: 600;
  color: rgba(34,211,238,.55); letter-spacing: 1.5px; text-transform: uppercase;
  white-space: nowrap;
}

/* ── Smart Command/Search Bar (center) ── */
.fv-hero-search-wrap {
  flex: 1;
  max-width: 380px;
  min-width: 0;
  position: relative;
}

.fv-hero-search {
  width: 100%;
  height: 38px;
  background: rgba(255,255,255,.06);
  border: 1.5px solid rgba(255,255,255,.09);
  border-radius: 10px;
  color: rgba(255,255,255,.85);
  font-size: 13px;
  font-family: inherit;
  padding: 0 14px 0 38px;
  outline: none;
  transition: all .2s var(--fvh-ease);
  caret-color: var(--fvh-violet);
}
.fv-hero-search::placeholder { color: rgba(255,255,255,.28); }
.fv-hero-search:focus {
  background: rgba(255,255,255,.09);
  border-color: rgba(139,92,246,.5);
  box-shadow: 0 0 0 3px rgba(139,92,246,.12);
}

.fv-hero-search-icon {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.28);
  font-size: 13px;
  pointer-events: none;
  transition: color .2s;
}
.fv-hero-search:focus ~ .fv-hero-search-icon,
.fv-hero-search-wrap:focus-within .fv-hero-search-icon {
  color: rgba(139,92,246,.7);
}

/* Command hint */
.fv-hero-search-hint {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,.2);
  letter-spacing: .4px;
  pointer-events: none;
  white-space: nowrap;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 4px;
  padding: 2px 6px;
}

/* Search suggestions dropdown */
.fv-search-suggestions {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #1a2235;
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.45);
  z-index: 100;
  overflow: hidden;
}
.fv-hero-search:focus + .fv-hero-search-icon + .fv-search-suggestions,
.fv-hero-search-wrap:focus-within .fv-search-suggestions { display: block; }
/* Controlled via JS instead */

.fv-search-suggestion-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  color: rgba(255,255,255,.75);
  font-size: 12.5px;
  cursor: pointer;
  transition: background .12s;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.fv-search-suggestion-item:last-child { border-bottom: none; }
.fv-search-suggestion-item:hover { background: rgba(139,92,246,.12); }
.fv-search-suggestion-item i {
  width: 24px; height: 24px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0;
}
.fv-ssi-task i  { background: rgba(139,92,246,.2); color: #a78bfa; }
.fv-ssi-note i  { background: rgba(59,130,246,.2);  color: #60a5fa; }
.fv-ssi-ai i    { background: rgba(34,211,238,.15); color: #22d3ee; }
.fv-search-suggestion-label { flex: 1; }
.fv-search-suggestion-key {
  font-size: 10px; color: rgba(255,255,255,.25);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 4px; padding: 2px 6px;
}

/* ── Top Bar Actions (right) ── */
.fv-hero-topbar-actions {
  display: flex; align-items: center;
  gap: 7px; flex-shrink: 0; flex-wrap: nowrap;
}

/* ── Desktop: fvh-row1-right dissolves into topbar flex context ── */
/* display:contents makes bell + user-pill direct flex children of topbar */
.fvh-row1-right {
  display: contents;
}

/* ── Desktop: fvh-row2-actions (+ Task, Note, AI) inline in topbar ── */
.fvh-row2-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  flex-shrink: 0;
}

/* ── Topbar flex order: Brand | Search | Bell | Actions | UserPill ── */
.fv-hero-brand               { order: 1; }
.fv-hero-search-wrap         { order: 2; }
.fv-notif-wrap               { order: 3; }   /* bell — hoisted via display:contents */
.fvh-row2-actions            { order: 4; }   /* + Task, Note, AI */
.fv-settings-dropdown-wrap   { order: 5; }   /* user pill — hoisted via display:contents */

/* Hide mobile-only search icon on desktop */
.fvh-mobile-search-btn { display: none !important; }

/* All button text labels visible on desktop */
.fvh-btn-text-task,
.fvh-btn-text-note,
.fvh-btn-text-ai { display: inline; }

/* ── Desktop: Notification wrap + Bell ── */
.fv-notif-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.fv-notif-bell {
  position: relative;
  background: rgba(255,255,255,.06);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 10px;
  cursor: pointer;
  color: #f59e0b;
  font-size: 20px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s, border-color .18s, color .18s;
  flex-shrink: 0;
}
.fv-notif-bell:hover {
  background: rgba(245,158,11,.12);
  border-color: rgba(245,158,11,.3);
  color: #fbbf24;
}
.fv-notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 17px; height: 17px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  padding: 0 3px;
  pointer-events: none;
  border: 2px solid rgba(15,20,40,1);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Unified button base */
.fv-hero-topbar-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--fvh-r-btn);
  font-size: 12.5px; font-weight: 600;
  cursor: pointer; border: 1.5px solid transparent;
  transition: all .18s var(--fvh-ease);
  white-space: nowrap; font-family: inherit;
  text-decoration: none; line-height: 1;
}
.fv-hero-topbar-btn i { font-size: 11.5px; }

/* Primary — "+ Task" */
.fv-hero-topbar-btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  border-color: rgba(139,92,246,.4);
  box-shadow: 0 2px 10px rgba(99,102,241,.35), inset 0 1px 0 rgba(255,255,255,.2);
}
.fv-hero-topbar-btn-primary:hover {
  background: linear-gradient(135deg, #7c7ff5 0%, #9d6ffb 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(99,102,241,.45);
}

/* Ghost — "+ Note" */
.fv-hero-topbar-btn-ghost {
  background: var(--fvh-glass-bg);
  color: rgba(255,255,255,.65);
  border-color: var(--fvh-glass-border);
}
.fv-hero-topbar-btn-ghost:hover {
  background: var(--fvh-glass-hover);
  color: #fff;
  border-color: rgba(255,255,255,.15);
}

/* AI button — teal glow */
.fv-hero-topbar-btn-ai {
  background: linear-gradient(135deg, rgba(34,211,238,.12) 0%, rgba(99,102,241,.08) 100%);
  color: var(--fvh-teal);
  border-color: rgba(34,211,238,.25);
}
.fv-hero-topbar-btn-ai:hover {
  background: linear-gradient(135deg, rgba(34,211,238,.2) 0%, rgba(99,102,241,.15) 100%);
  color: #fff;
  border-color: rgba(34,211,238,.45);
  box-shadow: 0 2px 12px rgba(34,211,238,.2);
  transform: translateY(-1px);
}
/* Pulse on the AI star */
.fv-hero-topbar-btn-ai i { animation: fvh-ai-pulse 2.5s ease-in-out infinite; }
@keyframes fvh-ai-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .7; transform: scale(1.15); }
}

/* Icon-only (Settings, Logout) */
.fv-hero-topbar-btn-icon {
  width: 36px; height: 36px;
  padding: 0; border-radius: 9px;
  background: var(--fvh-glass-bg);
  color: rgba(255,255,255,.5);
  border-color: var(--fvh-glass-border);
}
.fv-hero-topbar-btn-icon:hover {
  background: var(--fvh-glass-hover);
  color: #fff;
  border-color: rgba(255,255,255,.15);
}

/* Divider */
.fv-topbar-divider {
  width: 1px; height: 22px;
  background: rgba(255,255,255,.08);
  flex-shrink: 0;
}

/* ── User Pill (rightmost) ── */
.fv-hero-user {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 14px 4px 4px;
  background: var(--fvh-glass-bg);
  border: 1.5px solid var(--fvh-glass-border);
  border-radius: 14px;
  cursor: pointer;
  transition: all .18s var(--fvh-ease);
  position: relative;
}
.fv-hero-user:hover {
  background: var(--fvh-glass-hover);
  border-color: rgba(255,255,255,.14);
}

.fv-hero-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 800; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(139,92,246,.35);
  align-self: center;
}

.fv-hero-user-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fv-hero-user-name-row { display: flex; align-items: center; gap: 20px; flex-wrap: nowrap; min-width: 0; }
.fv-hero-user-name  { font-size: 13px; font-weight: 700; color: rgba(255,255,255,.92); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.fv-hero-user-email { font-size: 10.5px; color: rgba(255,255,255,.38); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 175px; }

/* VIP badge inside user pill */
.fv-hero-user-vip-badge {
  display: inline-flex; align-items: center; gap: 3px;
  background: linear-gradient(135deg, #f1f7ff 0%, #d1e6ff 100%);
  color: #9C27B0;
  font-size: 10px; font-weight: 800;
  padding: 1px 5px; border-radius: 5px;
  letter-spacing: .4px; text-transform: uppercase;
  box-shadow: 0 1px 4px rgba(156,39,176,.35);
  white-space: nowrap; flex-shrink: 0; line-height: 1.3;
  margin-left: 4px; transform: translateY(0);
  vertical-align: middle;
}
.fv-hero-user-vip-badge i {
  font-size: 8px;
}

/* Chevron on user pill */
.fv-hero-user-chevron {
  font-size: 9px;
  color: rgba(255,255,255,.4);
  margin-left: 2px;
  transition: transform .18s ease, color .18s ease;
  flex-shrink: 0;
}
.fv-settings-dropdown-wrap.open .fv-hero-user-chevron {
  transform: rotate(180deg);
  color: rgba(255,255,255,.7);
}
.fv-hero-user--clickable { user-select: none; }

/* ── VIP tag inline before username ── */
.fvh-pill-vip-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #fff;
  font-size: 9px; font-weight: 800;
  padding: 2px 6px; border-radius: 5px;
  letter-spacing: .5px; text-transform: uppercase;
  box-shadow: 0 1px 5px rgba(109,40,217,.5);
  white-space: nowrap; line-height: 1.4;
  flex-shrink: 0;
  pointer-events: none;
}
.fvh-pill-vip-tag i { font-size: 7px; }
.fv-settings-dropdown--right { right: 0; left: auto; }

/* ── Desktop: Settings dropdown wrap ── */
.fv-settings-dropdown-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* ── User dropdown (bonus) ── */
.fv-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #1a2235;
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.45);
  z-index: 200;
  overflow: hidden;
  animation: fvh-dropdown-in .15s var(--fvh-ease);
}
.fv-hero-user.open .fv-user-dropdown { display: block; }
@keyframes fvh-dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fv-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  color: rgba(255,255,255,.72);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background .12s;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.fv-dropdown-item:last-child { border-bottom: none; }
.fv-dropdown-item:hover { background: rgba(139,92,246,.1); color: #fff; }
.fv-dropdown-item i { width: 16px; text-align: center; opacity: .6; }
.fv-dropdown-item:hover i { opacity: 1; }

/* ══════════════════════════════════════════════════════════════
   SECTION 4 — SMART WELCOME (hero body)
   ══════════════════════════════════════════════════════════════ */
.fv-hero-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 26px 18px;
  position: relative; z-index: 1;
  gap: 20px; flex-wrap: wrap;
}

.fv-hero-left { flex: 1 1 220px; min-width: 0; overflow: hidden; }

/* Greeting + VIP chip row */
.fv-hero-greeting {
  display: inline-flex; align-items: center;
  gap: 4px; margin-bottom: 2px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow: visible;
  max-width: 100%;
}

.fv-vip-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #1877f2;
  border-radius: 50%;
  flex-shrink: 0;
  vertical-align: middle;
  box-shadow: none;
  padding: 0;
  font-size: 0;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.fv-vip-chip::after {
  content: '';
  display: block;
  width: 9px;
  height: 7px;
  border-left: 2.5px solid #fff;
  border-bottom: 2.5px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

/* Title */
.fv-hero-title {
  font-size: 22px; font-weight: 700;
  color: #fff; margin: 0;
  letter-spacing: -.6px; line-height: 1.15;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  min-width: 0;
  flex: 0 1 auto;
  max-width: none;
}

/* Dynamic subtitle (task summary line) */
.fv-hero-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,.4);
  margin: 5px 0 0; font-weight: 500; letter-spacing: .05px;
}
/* Highlight urgent count */
.fv-hero-subtitle .fvh-urgent {
  color: var(--fvh-rose);
  font-weight: 700;
}
.fv-hero-subtitle .fvh-accent {
  color: var(--fvh-teal);
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════════════
   SECTION 5 — STATS CARDS (hero stats row)
   ══════════════════════════════════════════════════════════════ */

/* Unified row: greeting group on left, stats on right — same line */
.fv-hero-row-unified {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  width: 100%;
  min-width: 0;
}
.fv-hero-greeting-group {
  flex: 1 1 200px;
  min-width: 0;
  overflow: hidden;
}

.fv-hero-stats {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 22px;
}
/* When stats are inline (inside unified row), remove top margin */
.fv-hero-stats--inline {
  margin-top: 0;
  flex-wrap: nowrap;
  gap: 8px;
}
/* Compact stat cards when inline */
.fv-hero-stats--inline .fv-hero-stat {
  padding: 8px 14px;
  gap: 8px;
  border-radius: 11px;
}
.fv-hero-stats--inline .fv-hero-stat-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  font-size: 12px;
}
.fv-hero-stats--inline .fv-hero-stat-val {
  font-size: 16px;
}
.fv-hero-stats--inline .fv-hero-stat-lbl {
  font-size: 9px;
  margin-top: 2px;
}

.fv-hero-stat {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.045);
  border: 1.5px solid rgba(255,255,255,.07);
  border-radius: 13px; padding: 10px 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all .2s var(--fvh-ease);
  cursor: pointer;
  text-decoration: none;
  min-width: 0;
}
.fv-hero-stat:hover {
  background: rgba(255,255,255,.075);
  border-color: rgba(255,255,255,.13);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}

.fv-hero-stat-icon {
  width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.fv-hero-stat-icon.tasks { background: rgba(99,102,241,.2);   color: #a5b4fc; }
.fv-hero-stat-icon.done  { background: rgba(52,211,153,.18);  color: var(--fvh-emerald); }
.fv-hero-stat-icon.notes { background: rgba(59,130,246,.18);  color: #93c5fd; }
.fv-hero-stat-icon.pct   { background: rgba(251,191,36,.15);  color: var(--fvh-amber); }

.fv-hero-stat-val {
  font-size: 18px; font-weight: 800;
  color: #fff; line-height: 1;
}
.fv-hero-stat-lbl {
  font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,.4);
  text-transform: uppercase; letter-spacing: .5px; margin-top: 3px;
}

/* ══════════════════════════════════════════════════════════════
   SECTION 6 — VIP SUBSCRIPTION CARD (premium redesign)
   ══════════════════════════════════════════════════════════════ */
.fv-sub-card {
  display: flex; align-items: stretch;
  justify-content: space-between;
  padding: 0;
  background: var(--fvh-sub-bg);
  border: 1.5px solid var(--fvh-sub-border);
  border-radius: 16px;
  margin: 14px 22px 4px;
  gap: 0; flex-wrap: nowrap;
  position: relative; z-index: 1;
  box-shadow: var(--fvh-sub-shadow);
  overflow: hidden;
  color: #111;
  transition: box-shadow .2s var(--fvh-ease);
}
.fv-sub-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.07);
}

/* Left accent stripe */
.fv-sub-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, #6366f1, #8b5cf6);
  border-radius: 16px 0 0 16px;
}

/* Dark mode sub-card text */
[data-theme="dark"] .fv-sub-card {
  color: rgba(255,255,255,.88);
}
[data-theme="dark"] .fv-sub-exp { color: rgba(255,255,255,.75) !important; }
[data-theme="dark"] .fv-sub-since { color: rgba(255,255,255,.4) !important; }
[data-theme="dark"] .fv-sub-title { color: rgba(255,255,255,.5) !important; }
[data-theme="dark"] .fv-pb-track { background: rgba(255,255,255,.1) !important; }
[data-theme="dark"] .fv-pb-meta  { color: rgba(255,255,255,.35) !important; }

.fv-sub-left {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px 16px 24px;
}

/* VIP Crown icon block */
.fv-sub-title {
  width: 36px; height: 36px; flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(99,102,241,.3);
}
.fv-sub-title i { color: #fff !important; font-size: 15px; }

/* Content column */
.fv-sub-content { flex: 1; min-width: 0; }

.fv-sub-plan-name {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: #6366f1; margin-bottom: 3px;
}
[data-theme="dark"] .fv-sub-plan-name { color: #a5b4fc; }

.fv-sub-exp {
  font-size: 13px; font-weight: 600; color: #1f2937;
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.fv-sub-expires-today {
  color: #dc2626; font-weight: 700;
  background: rgba(220,38,38,.08);
  padding: 1px 7px; border-radius: 5px;
}

/* Progress bar */
.fv-sub-pb { flex: 1; min-width: 120px; max-width: 240px; }
.fv-pb-wrap { }
.fv-pb-track {
  height: 7px;
  background: #f0f0f0;
  border-radius: 99px; overflow: hidden;
}
.fv-pb-fill {
  height: 100%; border-radius: 99px;
  transition: width .8s cubic-bezier(.4,0,.2,1);
  position: relative; overflow: hidden;
}
/* Shimmer on progress fill */
.fv-pb-fill::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.35) 50%, transparent 100%);
  animation: fvh-shimmer 2s infinite;
}
@keyframes fvh-shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}
.fv-pb-meta {
  display: flex; justify-content: space-between;
  font-size: 10.5px; color: #9ca3af; margin-top: 5px;
  font-weight: 500;
}

/* Right side of sub-card */
.fv-sub-right {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-left: 1px solid rgba(0,0,0,.06);
  flex-shrink: 0;
}
[data-theme="dark"] .fv-sub-right { border-left-color: rgba(255,255,255,.06); }

.fv-sub-since {
  font-size: 11px; color: #9ca3af;
  white-space: nowrap; font-weight: 500;
}

.fv-sub-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 13px; border-radius: 99px;
  font-size: 11px; font-weight: 700;
  white-space: nowrap;
}
.fv-sub-badge-active {
  background: rgba(16,185,129,.1); color: #059669;
  border: 1.5px solid rgba(16,185,129,.25);
}
.fv-sub-badge-warn {
  background: rgba(245,158,11,.1); color: #d97706;
  border: 1.5px solid rgba(245,158,11,.25);
}
.fv-sub-badge-crit {
  background: rgba(239,68,68,.1); color: #dc2626;
  border: 1.5px solid rgba(239,68,68,.25);
}

/* CTA buttons inside sub-card */
.fv-sub-cta {
  display: flex; flex-direction: column; gap: 6px;
}
.fv-sub-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px;
  border-radius: 8px; font-size: 11.5px; font-weight: 700;
  cursor: pointer; border: none;
  white-space: nowrap; font-family: inherit;
  transition: all .15s var(--fvh-ease);
  text-decoration: none;
}
.fv-sub-btn-upgrade {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,.3);
}
.fv-sub-btn-upgrade:hover {
  filter: brightness(1.1); transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99,102,241,.4);
}
.fv-sub-btn-manage {
  background: transparent;
  color: #6b7280;
  border: 1.5px solid #e5e7eb;
}
.fv-sub-btn-manage:hover { border-color: #6366f1; color: #6366f1; }
[data-theme="dark"] .fv-sub-btn-manage {
  color: rgba(255,255,255,.5);
  border-color: rgba(255,255,255,.1);
}
[data-theme="dark"] .fv-sub-btn-manage:hover {
  color: #a5b4fc; border-color: rgba(99,102,241,.5);
}

/* ══════════════════════════════════════════════════════════════
   SECTION 7 — NAV TABS (animated underline)
   ══════════════════════════════════════════════════════════════ */
.fv-hero-tabs {
  display: flex; align-items: center; gap: 0;
  padding: 0 22px;
  background: rgba(255,255,255,.018);
  border-top: 1px solid rgba(255,255,255,.06);
  position: relative; z-index: 1;
  border-radius: 0 0 var(--fvh-r-hero) var(--fvh-r-hero);
  overflow-x: auto; scrollbar-width: none;
}
.fv-hero-tabs::-webkit-scrollbar { display: none; }

/* Animated indicator line */
.fv-hero-tabs::after {
  content: '';
  position: absolute; bottom: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 2px;
  transition: left .25s var(--fvh-ease), width .25s var(--fvh-ease);
  /* JS will set left/width via data attrs or inline style */
}

.fv-hero-tab-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 18px;
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,.38);
  border: none; background: none; cursor: pointer;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1px;
  transition: color .18s var(--fvh-ease), border-color .18s var(--fvh-ease);
  white-space: nowrap; font-family: inherit;
  position: relative; flex-shrink: 0;
}
.fv-hero-tab-btn:hover { color: rgba(255,255,255,.7); }
.fv-hero-tab-btn.active {
  color: #fff;
  border-bottom-color: #8b5cf6;
}

/* Tab icon badges */
.fv-hero-tab-btn .fv-tab-dot {
  width: 20px; height: 20px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; flex-shrink: 0;
  transition: transform .15s var(--fvh-spring);
}
.fv-hero-tab-btn:hover .fv-tab-dot { transform: scale(1.15); }
.fv-hero-tab-btn.active .fv-tab-dot { transform: scale(1.1); }

.fv-hero-tab-btn .fv-tab-dot.tasks    { background: rgba(99,102,241,.22);  color: #a5b4fc; }
.fv-hero-tab-btn .fv-tab-dot.notes    { background: rgba(59,130,246,.2);   color: #93c5fd; }
.fv-hero-tab-btn .fv-tab-dot.trash    { background: rgba(239,68,68,.14);   color: #fca5a5; }
.fv-hero-tab-btn .fv-tab-dot.settings { background: rgba(255,255,255,.07); color: rgba(255,255,255,.5); }

.fv-hero-tab-btn.active .fv-tab-dot.tasks    { background: rgba(99,102,241,.35);  color: #c4b5fd; }
.fv-hero-tab-btn.active .fv-tab-dot.notes    { background: rgba(59,130,246,.3);   color: #bfdbfe; }
.fv-hero-tab-btn.active .fv-tab-dot.trash    { background: rgba(239,68,68,.22);   color: #fca5a5; }
.fv-hero-tab-btn.active .fv-tab-dot.settings { background: rgba(255,255,255,.12); color: rgba(255,255,255,.85); }

/* ══════════════════════════════════════════════════════════════
   SECTION 7B — TAB ADD BUTTONS (Tasks / Notes inline CTAs)
   ══════════════════════════════════════════════════════════════ */

/* ── Tab group: wraps a tab-btn + its add-btn as one flex unit ── */
.fvh-tab-group {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

/* ── Add button base ─────────────────────────────────────────────
   BEHAVIOUR:
   • Desktop: icon "+" always visible (both tabs).
              Hover → label slides in smoothly.
   • Mobile:  icon + full label always visible (no hover needed).
   ─────────────────────────────────────────────────────────────── */
.fvh-tab-add-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 26px;
  /* compact: only icon visible by default → padding fits icon */
  padding: 0 7px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
  font-family: inherit;
  white-space: nowrap;
  /* clip the expanding label */
  overflow: hidden;
  margin-left: 4px;
  /* ALWAYS visible at full opacity — no hiding */
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
  transition:
    padding        .25s cubic-bezier(.4,0,.2,1),
    background     .15s ease,
    box-shadow     .15s ease,
    transform      .15s ease;
  will-change: transform;
}

/* No separate .fvh-tab-add-visible state needed for opacity/transform.
   JS still toggles the class — used only for the pop animation. */
.fvh-tab-add-btn.fvh-tab-add-visible {
  animation: fvhAddBtnPop .32s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes fvhAddBtnPop {
  0%   { transform: scale(.8);  opacity: .5; }
  65%  { transform: scale(1.07); opacity: 1; }
  100% { transform: scale(1);   opacity: 1; }
}

/* ── Label: collapses to 0 by default, expands on hover ── */
.fvh-tab-add-label {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  letter-spacing: .01em;
  line-height: 1;
  margin-left: 0;
  pointer-events: none;
  transition:
    max-width .26s cubic-bezier(.4,0,.2,1),
    opacity   .2s  ease,
    margin-left .26s cubic-bezier(.4,0,.2,1);
}

/* Desktop hover: expand padding + label */
@media (hover: hover) {
  .fvh-tab-add-btn:hover {
    padding: 0 10px 0 8px;
  }
  .fvh-tab-add-btn:hover .fvh-tab-add-label {
    max-width: 130px;
    opacity: 1;
    margin-left: 5px;
  }
}

/* ── Icon ── */
.fvh-tab-add-btn .fvh-tab-add-icon {
  font-size: 13px;
  flex-shrink: 0;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1);
}
.fvh-tab-add-btn:hover .fvh-tab-add-icon {
  transform: rotate(12deg) scale(1.15);
}

/* ── Task add button: purple ── */
.fvh-tab-add-task {
  background: linear-gradient(135deg, rgba(99,102,241,.22) 0%, rgba(139,92,246,.22) 100%);
  color: #c4b5fd;
  box-shadow: 0 0 0 1px rgba(139,92,246,.3) inset;
}
.fvh-tab-add-task:hover {
  background: linear-gradient(135deg, rgba(99,102,241,.45) 0%, rgba(139,92,246,.45) 100%);
  color: #e9d5ff;
  box-shadow: 0 0 0 1px rgba(139,92,246,.6) inset,
              0 4px 16px rgba(139,92,246,.28);
  transform: scale(1.04) translateY(-1px);
}
.fvh-tab-add-task:active {
  transform: scale(.96) translateY(0);
  transition: transform .08s ease;
}

/* ── Note add button: blue ── */
.fvh-tab-add-note {
  background: linear-gradient(135deg, rgba(59,130,246,.2) 0%, rgba(96,165,250,.2) 100%);
  color: #93c5fd;
  box-shadow: 0 0 0 1px rgba(96,165,250,.3) inset;
}
.fvh-tab-add-note:hover {
  background: linear-gradient(135deg, rgba(59,130,246,.42) 0%, rgba(96,165,250,.42) 100%);
  color: #bfdbfe;
  box-shadow: 0 0 0 1px rgba(96,165,250,.6) inset,
              0 4px 16px rgba(96,165,250,.24);
  transform: scale(1.04) translateY(-1px);
}
.fvh-tab-add-note:active {
  transform: scale(.96) translateY(0);
  transition: transform .08s ease;
}

/* ── Ripple on click ── */
.fvh-tab-add-ripple {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255,255,255,.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}
.fvh-tab-add-btn:active .fvh-tab-add-ripple {
  opacity: 1;
  transition: none;
}

/* ── Pulse glow (still fires via animation class) ── */
@keyframes fvhAddBtnGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(139,92,246,.3) inset; }
  50%       { box-shadow: 0 0 0 1px rgba(139,92,246,.7) inset, 0 0 10px rgba(139,92,246,.35); }
}
.fvh-tab-add-task.fvh-tab-add-visible {
  animation: fvhAddBtnPop .32s cubic-bezier(.34,1.56,.64,1) both,
             fvhAddBtnGlow 1.8s ease .35s 2;
}

@keyframes fvhAddBtnGlowBlue {
  0%, 100% { box-shadow: 0 0 0 1px rgba(96,165,250,.3) inset; }
  50%       { box-shadow: 0 0 0 1px rgba(96,165,250,.7) inset, 0 0 10px rgba(96,165,250,.3); }
}
.fvh-tab-add-note.fvh-tab-add-visible {
  animation: fvhAddBtnPop .32s cubic-bezier(.34,1.56,.64,1) both,
             fvhAddBtnGlowBlue 1.8s ease .35s 2;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE: touch devices — icon + full label always visible
   (hover: none selector targets touch correctly)
   ══════════════════════════════════════════════════════════════ */
@media (hover: none), (max-width: 768px) {
  .fvh-tab-add-btn {
    height: 26px;
    padding: 0 10px 0 8px;
    margin-left: 3px;
    /* force layout to accommodate label */
    overflow: visible;
  }
  .fvh-tab-add-btn .fvh-tab-add-label {
    max-width: 130px !important;
    opacity: 1 !important;
    margin-left: 5px !important;
    transition: none !important;
    overflow: visible !important;
  }
  .fvh-tab-add-btn .fvh-tab-add-icon { font-size: 12px; }
}

@media (max-width: 480px) {
  .fvh-tab-add-btn {
    height: 24px;
    padding: 0 8px 0 7px;
    border-radius: 6px;
    font-size: 11px;
    margin-left: 2px;
  }
  .fvh-tab-add-btn .fvh-tab-add-label {
    margin-left: 4px !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   SECTION 8 — KPI STAT CARDS (tasks tab)
   ══════════════════════════════════════════════════════════════ */
.fv-kpi {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.fv-kc {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px;
  background: var(--ft-surface, #fff);
  border: 1.5px solid var(--ft-border, #e5e7eb);
  border-radius: 16px;
  transition: all .2s var(--fvh-ease);
  cursor: pointer;
  text-decoration: none;
  min-width: 0;
}
.fv-kc:hover {
  border-color: rgba(99,102,241,.35);
  box-shadow: 0 6px 22px rgba(0,0,0,.08);
  transform: translateY(-2px);
}

.fv-ki {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.fv-ka .fv-ki { background: rgba(99,102,241,.1);   color: #6366f1; }
.fv-kd .fv-ki { background: rgba(16,185,129,.1);   color: #10b981; }
.fv-kw .fv-ki { background: rgba(245,158,11,.1);   color: #f59e0b; }
.fv-kx .fv-ki { background: rgba(239,68,68,.08);   color: #ef4444; }

.fv-kv {
  font-size: 26px; font-weight: 800;
  color: var(--ft-text, #111827); line-height: 1;
}
.fv-kl {
  font-size: 11px; font-weight: 600;
  color: var(--ft-text-muted, #6b7280);
  text-transform: uppercase; letter-spacing: .5px; margin-top: 3px;
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════
   SECTION 9 — BUTTON CONSISTENCY FIXES
   ══════════════════════════════════════════════════════════════ */

/* Force equal height on all fvbtn variants */
.fvbtn {
  height: 36px;
  padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 700;
  border-radius: 9px;
  line-height: 1;
  white-space: nowrap;
}
.fvbtn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}
.fvbtn-block {
  height: auto; padding: 10px 16px;
  width: 100%; justify-content: flex-start;
}

/* Fix "In Progress" text overflow */
.fv-task-status,
.fv-task-priority,
[class*="fv-badge"],
.fv-badge,
.fvbtn {
  white-space: nowrap;
  min-width: fit-content;
  overflow: visible;
}

/* ══════════════════════════════════════════════════════════════
   SECTION 10 — PRIORITY BADGE SIZING (all equal)
   ══════════════════════════════════════════════════════════════ */
.fv-priority,
.fv-status,
.ft-priority,
.ft-status,
[class*="-priority-"],
[class*="-status-"] {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 700;
  white-space: nowrap; min-width: 0;
  height: 28px;
  line-height: 1;
}

/* Task card action buttons — 28px height */
.fv-task-actions .fvbtn,
.fv-task-actions .fvbtn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 11.5px;
}

/* ══════════════════════════════════════════════════════════════
   SECTION 11 — COMMAND BAR (BONUS)
   ══════════════════════════════════════════════════════════════ */
.fv-command-bar {
  display: flex; align-items: center; gap: 0;
  margin: 16px 0 12px;
  background: var(--ft-surface, #fff);
  border: 1.5px solid var(--ft-border, #e5e7eb);
  border-radius: 13px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  transition: border-color .2s, box-shadow .2s;
}
.fv-command-bar:focus-within {
  border-color: rgba(99,102,241,.4);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1), 0 2px 10px rgba(0,0,0,.05);
}

.fv-command-icon {
  padding: 0 14px;
  color: var(--ft-text-muted, #6b7280);
  font-size: 14px;
  flex-shrink: 0;
}

.fv-command-input {
  flex: 1; min-width: 0;
  height: 44px;
  border: none; outline: none; background: transparent;
  font-size: 14px; font-family: inherit;
  color: var(--ft-text, #111827);
  caret-color: #6366f1;
}
.fv-command-input::placeholder { color: var(--ft-text-muted, #9ca3af); }

.fv-command-suggestions {
  display: none;
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: var(--ft-surface, #fff);
  border: 1.5px solid var(--ft-border, #e5e7eb);
  border-top: none;
  border-radius: 0 0 13px 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  z-index: 50;
}
.fv-command-wrap { position: relative; }
.fv-command-wrap.show .fv-command-suggestions { display: block; }

.fv-command-suggestion {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px; color: var(--ft-text, #111);
  transition: background .1s;
  border-bottom: 1px solid var(--ft-border, #e5e7eb);
}
.fv-command-suggestion:last-child { border-bottom: none; }
.fv-command-suggestion:hover { background: rgba(99,102,241,.05); }
.fv-command-suggestion i {
  width: 26px; height: 26px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0;
}
.fv-cs-task i  { background: rgba(99,102,241,.1);   color: #6366f1; }
.fv-cs-note i  { background: rgba(59,130,246,.1);   color: #3b82f6; }
.fv-cs-ai i    { background: rgba(34,211,238,.1);   color: #06b6d4; }
.fv-cs-cat i   { background: rgba(245,158,11,.1);   color: #f59e0b; }
.fv-command-suggestion-type {
  margin-left: auto;
  font-size: 10px; font-weight: 600;
  color: var(--ft-text-muted);
  background: var(--ft-surface-2, #f3f4f6);
  padding: 2px 7px; border-radius: 4px;
}

/* ══════════════════════════════════════════════════════════════
   SECTION 12 — RESPONSIVE BREAKPOINTS
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .fv-kpi { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  /* ============================================================
     === MOBILE HEADER SYSTEM — 2-ROW LAYOUT ===
     Row 1: [⚡ FlowTask]  ────────────  [🔔] [Avatar]
     Row 2: [🔍]  [+ Task]  [Note]  [AI]     (action row, centered)
     Clean. No overflow. No overlaps. Modern marketplace feel.
     ============================================================ */

  /* ── Hero wrapper: flush, no radius ── */
  .fv-dashboard-hero {
    border-radius: 0 !important;
    margin: 0 !important;
    box-shadow: 0 2px 16px rgba(0,0,0,.35), 0 1px 0 rgba(255,255,255,.04);
  }
  .fv-hero-noise { border-radius: 0; }

  /* ── TOPBAR: 2-row flex column container ── */
  .fv-hero-topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    padding: 0;
    gap: 0;
    min-height: unset;
    border-bottom: 1px solid rgba(255,255,255,.07);
    overflow: hidden;
  }

  /* ══ ROW 1: Brand (left) + Notif + Avatar (right) ══ */
  /* Injected via .fv-mobile-row1 wrapper in PHP — see PATCH_README */
  /* Fallback: brand and settings-wrap reorder naturally via flex order */

  /* Brand: stays left, fixed size */
  .fv-hero-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    order: 1;
    padding: 10px 14px 0;
  }
  .fv-hero-brand-icon {
    width: 32px; height: 32px;
    font-size: 14px;
    flex-shrink: 0;
  }
  .fv-hero-brand-info { display: flex; flex-direction: column; gap: 1px; }
  .fv-hero-brand-top  { display: flex; align-items: baseline; gap: 5px; }
  .fv-hero-brand-name    { font-size: 14px; }
  .fv-hero-brand-ver     { font-size: 9px; }
  .fv-hero-brand-tagline { font-size: 8px; letter-spacing: .8px; }

  /* Desktop search hidden on mobile */
  .fv-hero-search-wrap { display: none; }

  /* ── Right cluster (notif + avatar): row 1, pushed right ── */
  /* Re-uses .fv-hero-topbar-actions but we split it into row 1 & row 2 */
  .fv-hero-topbar-actions {
    display: contents; /* dissolve — children are placed individually */
  }

  /* Row 1 right section: notif bell + user pill */
  /* We use a generated wrapper .fvh-row1-right added in PHP */
  .fvh-row1-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    order: 2;
    padding: 10px 14px 0;
    margin-left: auto;
  }

  /* Row 2: action buttons bar */
  .fvh-row2-actions {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 6px;
    width: 100%;
    order: 3;
    padding: 8px 14px 10px;
    border-top: 1px solid rgba(255,255,255,.055);
    box-sizing: border-box;
    overflow: hidden;
  }

  /* ── Fallback (no PHP wrapper): all in row-1 compact ── */
  /* If PHP not patched, actions stay in a single row but wrap cleanly */
  .fv-hero-topbar:not(.fvh-two-rows) {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 8px 12px;
    gap: 6px;
    overflow-x: hidden;
  }
  .fv-hero-topbar:not(.fvh-two-rows) .fv-hero-brand {
    padding: 0;
    flex: 1 1 auto;
    order: 1;
  }
  .fv-hero-topbar:not(.fvh-two-rows) .fv-hero-topbar-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    order: 2;
    margin-left: auto;
  }
  .fv-hero-topbar:not(.fvh-two-rows) .fvh-row1-right,
  .fv-hero-topbar:not(.fvh-two-rows) .fvh-row2-actions { display: none; }

  /* ── Button sizing ── */
  .fv-hero-topbar-btn {
    height: 34px;
    padding: 0 12px;
    font-size: 12px;
    flex-shrink: 0;
    min-width: 0;
  }
  .fv-hero-topbar-btn-icon {
    width: 34px; height: 34px; padding: 0;
    flex-shrink: 0;
  }

  /* All btn text labels hidden by default; show only + Task */
  .fv-hero-topbar-btn span { display: none; }
  .fvh-btn-text-task { display: inline !important; }

  /* Prevent shrink on action buttons */
  .fv-hero-topbar-btn-primary,
  .fv-hero-topbar-btn-ghost,
  .fv-hero-topbar-btn-ai { flex-shrink: 0; }

  /* Dividers hidden on mobile */
  .fv-topbar-divider { display: none !important; }

  /* ── Mobile search bar: full-width search field look ── */
  .fvh-mobile-search-btn {
    display: flex !important;
    flex: 1 1 auto;
    width: 100%;
    height: 36px;
    padding: 0 12px 0 36px;
    background: rgba(255,255,255,.07);
    border: 1.5px solid rgba(255,255,255,.1);
    border-radius: 10px;
    color: rgba(255,255,255,.85);
    font-size: 13px;
    font-family: inherit;
    align-items: center;
    gap: 0;
    cursor: text;
    position: relative;
    box-sizing: border-box;
    flex-shrink: 0;
    overflow: hidden;
  }
  .fvh-mobile-search-btn i {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,.3);
    font-size: 13px;
    pointer-events: none;
  }
  .fvh-msb-placeholder {
    display: block !important;
    color: rgba(255,255,255,.28);
    font-size: 12px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .fvh-msb-kbd {
    display: flex !important;
    font-size: 10px;
    color: rgba(255,255,255,.2);
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 4px;
    padding: 2px 6px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 4px;
  }

  /* ── Notification bell ── */
  .fv-notif-wrap {
    flex-shrink: 0;
    position: relative;
  }
  .fv-notif-bell {
    width: 36px; height: 36px;
    padding: 0;
    font-size: 15px;
    color: #f59e0b;
  }
  /* Badge: absolute top-right of bell */
  .fv-notif-badge {
    position: absolute;
    top: -4px; right: -4px;
    min-width: 16px; height: 16px;
    font-size: 9px;
    padding: 0 3px;
    border-radius: 8px;
    line-height: 16px;
    text-align: center;
    font-weight: 800;
  }

  /* ── User pill: avatar only, compact ── */
  .fv-settings-dropdown-wrap {
    flex: 0 0 auto;
  }
  .fv-hero-user {
    padding: 2px;
    gap: 0;
    border-radius: 10px;
    max-width: none;
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.1);
  }
  .fv-hero-avatar {
    width: 32px; height: 32px;
    border-radius: 8px;
    font-size: 12px;
  }
  /* Mobile: show full name + email + VIP badge in user pill */
  .fv-hero-user-info  { display: flex !important; flex-direction: column; gap: 1px; min-width: 0; }
  .fv-hero-user-chevron { display: none; }
  .fv-hero-user-name {
    font-size: 11px !important;
    max-width: 120px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .fv-hero-user-email {
    font-size: 9px !important;
    max-width: 120px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block !important;
  }
  /* VIP badge: always visible inside pill on mobile */
  .fv-hero-user-vip-badge {
    display: inline-flex !important;
    font-size: 9px !important;
    padding: 2px 6px !important;
    margin-left: 0 !important;
    margin-top: 2px !important;
  }
  /* Widen pill slightly to accommodate text on mobile */
  .fv-hero-user {
    padding: 4px 8px 4px 4px !important;
    gap: 6px !important;
    max-width: 180px !important;
  }
  .fv-hero-user-name-row {
    flex-wrap: nowrap;
    gap: 4px;
    align-items: center;
  }
  .fvh-pill-vip-tag {
    display: inline-flex !important;
    font-size: 8px !important;
    padding: 1px 5px !important;
    flex-shrink: 0;
  }

  /* ══ ROW 3 (optional VIP badge strip) ══ */
  .fvh-row3-vip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 14px 6px;
    order: 4;
  }
  .fvh-row3-vip .fv-hero-user-vip-badge {
    display: inline-flex;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 6px;
    margin-left: 0;
  }

  /* ── GREETING BODY: tight, no dead space ── */
  .fv-hero-body {
    padding: 12px 14px 10px;
    gap: 10px;
  }

  .fv-hero-title    { font-size: 18px; letter-spacing: -.3px; }
  .fv-hero-subtitle { font-size: 11px; margin-top: 3px; }
  .fv-hero-greeting { flex-wrap: wrap; overflow: visible; }

  /* Unified row: greeting + stats stacked */
  .fv-hero-row-unified    { flex-direction: column; align-items: flex-start; gap: 10px; }
  .fv-hero-stats--inline  { flex-wrap: wrap; gap: 6px; width: 100%; }
  .fv-hero-stats--inline .fv-hero-stat {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
    padding: 8px 10px;
    box-sizing: border-box;
  }
  .fv-hero-stat-val  { font-size: 15px; }
  .fv-hero-stat-lbl  { font-size: 9px; }
  .fv-hero-stat-icon { width: 22px; height: 22px; font-size: 10px; }

  /* ── TABS: scrollable, flush ── */
  .fv-hero-tabs {
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-radius: 0;
  }
  .fv-hero-tabs::-webkit-scrollbar { display: none; }
  .fv-hero-tab-btn { padding: 11px 14px; font-size: 12px; }

  /* ── Misc ── */
  .fv-sub-card { flex-direction: column; margin: 10px 14px 4px; }
  .fv-sub-right {
    border-left: none;
    border-top: 1px solid rgba(0,0,0,.06);
    justify-content: space-between;
    padding: 10px 14px;
  }
  [data-theme="dark"] .fv-sub-right { border-top-color: rgba(255,255,255,.06); }
  .fv-sub-cta { flex-direction: row; }
  .fv-kpi { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .fv-kv  { font-size: 22px; }
}

@media (max-width: 480px) {
  /* Extra-small: tighten row 2 buttons, hide + Task text label */
  .fvh-row2-actions { padding: 7px 10px 9px; gap: 4px; }
  .fvh-btn-text-task { display: none !important; }
  .fv-hero-topbar-btn { height: 32px; padding: 0 10px; }
  .fv-hero-topbar-btn-icon { width: 32px; height: 32px; }
  .fv-notif-bell { width: 32px; height: 32px; font-size: 13px; }
  .fv-hero-avatar { width: 30px; height: 30px; font-size: 11px; }

  .fv-hero-tabs { padding: 0 10px; }
  .fv-hero-tab-btn { padding: 12px 12px; font-size: 12px; }
  .fv-kpi { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .fv-sub-left { padding: 14px 16px; }
  .fv-topbar-divider { display: none !important; }
}

/* ══════════════════════════════════════════════════════════════
   SECTION 12B — MOBILE HEADER COMPREHENSIVE FIX v3.4.0
   Fixes: notif overflow · RTL dropdown · safe-area · landscape
   ══════════════════════════════════════════════════════════════ */

/* ── 1. Prevent ANY horizontal overflow from the header ── */
.fv-dashboard-hero,
.fv-hero-topbar,
.fvh-row1-right,
.fvh-row2-actions {
  max-width: 100vw;
  box-sizing: border-box;
}

/* ── 2. Notification Dropdown — Fixed portal positioning on mobile ── */
@media (max-width: 768px) {
  /* Make notif wrap a positioning anchor for the dropdown */
  .fv-notif-wrap { position: relative; }

  /* Override absolute positioning: clamp to viewport */
  .fv-notif-dropdown {
    position: fixed !important;
    top: auto !important;
    right: 8px !important;
    left: 8px !important;
    width: auto !important;
    max-width: calc(100vw - 16px) !important;
    transform-origin: top right;
  }

  /* RTL: flip transform origin */
  [dir="rtl"] .fv-notif-dropdown {
    transform-origin: top left;
    right: 8px !important;
    left: 8px !important;
  }

  /* Position dynamically via JS data attribute */
  .fv-notif-dropdown[data-top] {
    top: attr(data-top px) !important;
  }

  /* Notif list max-height reduced so it doesn't overflow screen */
  .fv-notif-list { max-height: 55vh; }
}

/* ── 3. Settings Dropdown — RTL + mobile safe positioning ── */
@media (max-width: 768px) {
  .fv-settings-dropdown {
    right: 8px !important;
    left: auto !important;
    min-width: min(240px, calc(100vw - 16px)) !important;
    max-width: calc(100vw - 16px) !important;
  }
  [dir="rtl"] .fv-settings-dropdown {
    right: auto !important;
    left: 8px !important;
  }
}

/* ── 4. Mobile Search Overlay — safe-area notch support ── */
@media (max-width: 768px) {
  .fvh-mobile-search-overlay {
    padding-top: max(env(safe-area-inset-top, 0px), 0px);
  }
  .fvh-mobile-search-bar {
    padding-top: max(12px, calc(env(safe-area-inset-top, 0px) + 12px));
  }
}

/* ── 5. Row 1: prevent overflow with long names ── */
@media (max-width: 768px) {
  .fvh-row1-right {
    flex-shrink: 0;
    min-width: 0;
    max-width: calc(100vw - 160px); /* ensure brand has at least 160px */
  }
  .fv-hero-brand {
    min-width: 0;
    overflow: hidden;
  }
  .fv-hero-brand-name,
  .fv-hero-brand-tagline {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ── 6. Landscape phone: single-row compact header ── */
@media (max-width: 768px) and (orientation: landscape) and (max-height: 500px) {
  .fv-hero-topbar {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    padding: 0 12px !important;
    min-height: 48px !important;
    height: 48px;
    gap: 8px;
  }
  .fv-hero-brand  { order: 1; padding: 0; flex-shrink: 0; }
  .fvh-row1-right { order: 2; padding: 0; margin-left: auto; }
  .fvh-row2-actions {
    order: 3;
    border-top: none !important;
    padding: 0 !important;
    gap: 4px;
    flex-shrink: 0;
    width: auto !important;
    justify-content: flex-end;
  }
  /* Hide tagline in landscape to save space */
  .fv-hero-brand-tagline { display: none; }
}

/* ── 7. Extra-small 360px devices ── */
@media (max-width: 360px) {
  .fvh-row2-actions { gap: 3px; padding: 6px 8px 8px; }
  .fv-hero-topbar-btn { height: 30px; padding: 0 8px; font-size: 11px; }
  .fv-hero-topbar-btn-icon { width: 30px; height: 30px; }
  .fv-hero-avatar { width: 28px; height: 28px; font-size: 10px; border-radius: 7px; }
  .fv-notif-bell { width: 30px; height: 30px; font-size: 13px; }
  .fv-hero-brand-name { font-size: 13px; }
  .fvh-btn-text-task { display: none !important; }
}

/* ── 8. Touch targets: minimum 44×44 per WCAG ── */
@media (hover: none), (pointer: coarse) {
  .fv-notif-bell,
  .fv-hero-topbar-btn,
  .fv-hero-topbar-btn-icon {
    min-width: 44px;
    min-height: 44px;
  }
  /* Compensate visual size with padding instead of height */
  .fv-hero-topbar-btn {
    height: auto;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .fv-hero-topbar-btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
  }
  /* But keep the row contained */
  .fvh-row2-actions { align-items: center; }
}

/* ── 9. VIP badge: show compactly in row1 right on mobile ── */
@media (max-width: 768px) {
  .fvh-pill-vip-tag {
    font-size: 8px;
    padding: 1px 5px 1px 4px;
    border-radius: 5px;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 2px;
  }
  /* Show badge near avatar */
  .fv-hero-user .fvh-pill-vip-tag {
    display: none; /* hidden inside pill (no text), shown via row3 strip */
  }
}

/* ══════════════════════════════════════════════════════════════
   SECTION 13 — RTL SUPPORT
   ══════════════════════════════════════════════════════════════ */
[dir="rtl"] .fv-sub-card::before {
  left: auto; right: 0;
  border-radius: 0 16px 16px 0;
}
[dir="rtl"] .fv-hero-search { padding: 0 38px 0 14px; }
[dir="rtl"] .fv-hero-search-icon { left: auto; right: 11px; }
[dir="rtl"] .fv-hero-search-hint { right: auto; left: 10px; }
[dir="rtl"] .fv-sub-right { border-left: none; border-right: 1px solid rgba(0,0,0,.06); }
[dir="rtl"][data-theme="dark"] .fv-sub-right { border-right-color: rgba(255,255,255,.06); }
[dir="rtl"] .fv-user-dropdown { right: auto; left: 0; }

/* ── RTL Header row alignment ── */
[dir="rtl"] .fvh-row1-right { margin-left: 0; margin-right: auto; }
[dir="rtl"] .fv-hero-topbar { direction: rtl; }
[dir="rtl"] .fv-hero-brand  { order: 1; }
[dir="rtl"] .fvh-row1-right { order: 2; }
[dir="rtl"] .fvh-row2-actions { direction: rtl; }

/* ── RTL Search bar on desktop ── */
[dir="rtl"] .fvh-search-clear { right: auto; left: 10px; }

/* ── RTL Mobile: row1 right-to-left flow ── */
@media (max-width: 768px) {
  [dir="rtl"] .fv-hero-brand  { padding: 10px 14px 0 0; }
  [dir="rtl"] .fvh-row1-right { padding: 10px 0 0 14px; }
  [dir="rtl"] .fvh-row2-actions { flex-direction: row-reverse; justify-content: space-evenly; }
  [dir="rtl"] .fv-notif-unread-dot { left: auto; right: 4px; }
  [dir="rtl"] .fv-notif-item { flex-direction: row-reverse; }
  [dir="rtl"] .fv-notif-right { margin-left: 0; margin-right: 6px; align-items: flex-start; }
}

/* ══════════════════════════════════════════════════════════════
   SECTION 14 — DARK THEME PATCH (hero inherits vars)
   ══════════════════════════════════════════════════════════════ */
[data-theme="dark"] .fv-kc {
  background: var(--ft-surface, #18181b);
  border-color: var(--ft-border, #2d3748);
}
[data-theme="dark"] .fv-kc:hover {
  border-color: rgba(99,102,241,.45);
  box-shadow: 0 6px 22px rgba(0,0,0,.35);
}
[data-theme="dark"] .fv-kv { color: var(--ft-text, #f7fafc); }
[data-theme="dark"] .fv-kl { color: var(--ft-text-muted, #a1a1aa); }

[data-theme="dark"] .fv-command-bar {
  background: var(--ft-surface, #18181b);
  border-color: var(--ft-border, #2d3748);
}
[data-theme="dark"] .fv-command-input { color: var(--ft-text, #f7fafc); }
[data-theme="dark"] .fv-command-suggestions {
  background: var(--ft-surface, #18181b);
  border-color: var(--ft-border, #2d3748);
}
[data-theme="dark"] .fv-command-suggestion { color: var(--ft-text, #f7fafc); }
[data-theme="dark"] .fv-command-suggestion:hover { background: rgba(99,102,241,.1); }
[data-theme="dark"] .fv-command-suggestion-type {
  background: var(--ft-surface-2, #27272a);
}

/* ══════════════════════════════════════════════════════════════
   SECTION 15 — MICRO-ANIMATIONS (page load stagger)
   ══════════════════════════════════════════════════════════════ */
.fv-dashboard-hero {
  animation: fvh-hero-in .5s var(--fvh-ease) both;
}
@keyframes fvh-hero-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fv-hero-stat:nth-child(1) { animation: fvh-stat-in .4s .1s var(--fvh-ease) both; }
.fv-hero-stat:nth-child(2) { animation: fvh-stat-in .4s .18s var(--fvh-ease) both; }
.fv-hero-stat:nth-child(3) { animation: fvh-stat-in .4s .26s var(--fvh-ease) both; }
.fv-hero-stat:nth-child(4) { animation: fvh-stat-in .4s .34s var(--fvh-ease) both; }
@keyframes fvh-stat-in {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.fv-kc:nth-child(1) { animation: fvh-stat-in .4s .2s var(--fvh-ease) both; }
.fv-kc:nth-child(2) { animation: fvh-stat-in .4s .28s var(--fvh-ease) both; }
.fv-kc:nth-child(3) { animation: fvh-stat-in .4s .36s var(--fvh-ease) both; }
.fv-kc:nth-child(4) { animation: fvh-stat-in .4s .44s var(--fvh-ease) both; }

.fv-sub-card { animation: fvh-sub-in .4s .15s var(--fvh-ease) both; }
@keyframes fvh-sub-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
/* ══════════════════════════════════════════════════════════════
   SECTION 16 — SETTINGS DROPDOWN (gear button)
   ══════════════════════════════════════════════════════════════ */

.fv-settings-dropdown-wrap {
  position: relative;
  display: inline-flex;
}

.fv-settings-dropdown {
  display: none;
  position: fixed;
  min-width: 220px;
  background: #1a2235;
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,.55), 0 4px 16px rgba(0,0,0,.3);
  z-index: 99999;
  overflow: hidden;
  animation: fvh-dropdown-in .16s var(--fvh-ease);
}

.fv-settings-dropdown-wrap.open .fv-settings-dropdown {
  display: block;
}

.fv-settings-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  color: rgba(255,255,255,.75);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  font-family: inherit;
  text-align: left;
}

.fv-settings-dropdown-item:hover {
  background: rgba(139,92,246,.13);
  color: #fff;
}

.fv-sddi-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  transition: background .15s;
}

.fv-settings-dropdown-item:hover .fv-sddi-icon {
  background: rgba(139,92,246,.2);
}

.fv-sddi-vip .fv-sddi-icon {
  background: rgba(245,158,11,.15);
  color: #f59e0b;
}
.fv-sddi-vip:hover .fv-sddi-icon {
  background: rgba(245,158,11,.25);
}
.fv-sddi-vip {
  color: rgba(255,255,255,.88);
}

.fv-sddi-danger {
  color: rgba(251,113,133,.85) !important;
}
.fv-sddi-danger .fv-sddi-icon {
  background: rgba(239,68,68,.1);
  color: #fb7185;
}
.fv-sddi-danger:hover {
  background: rgba(239,68,68,.1) !important;
  color: #fb7185 !important;
}

.fv-sddi-badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
  letter-spacing: .5px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.fv-sddi-badge-dark {
  background: rgba(99,102,241,.15);
  color: #a5b4fc;
  border: 1px solid rgba(99,102,241,.25);
}

.fv-sddi-badge-vip {
  background: linear-gradient(135deg, rgba(245,158,11,.2), rgba(251,191,36,.15));
  color: #fbbf24;
  border: 1px solid rgba(245,158,11,.3);
}

.fv-settings-dropdown-divider {
  height: 1px;
  background: rgba(255,255,255,.06);
  margin: 4px 0;
}

/* Dark mode: settings dropdown inherits hero dark bg so looks fine */
[data-theme="light"] .fv-settings-dropdown {
  background: #fff;
  border-color: rgba(0,0,0,.1);
  box-shadow: 0 16px 48px rgba(0,0,0,.15), 0 4px 16px rgba(0,0,0,.08);
}
[data-theme="light"] .fv-settings-dropdown-item {
  color: #374151;
}
[data-theme="light"] .fv-settings-dropdown-item:hover {
  background: rgba(99,102,241,.07);
  color: #111;
}
[data-theme="light"] .fv-sddi-icon {
  background: rgba(0,0,0,.05);
  color: #6b7280;
}
[data-theme="light"] .fv-settings-dropdown-item:hover .fv-sddi-icon {
  background: rgba(99,102,241,.12);
  color: #6366f1;
}
[data-theme="light"] .fv-sddi-vip .fv-sddi-icon {
  background: rgba(245,158,11,.12);
  color: #d97706;
}
[data-theme="light"] .fv-settings-dropdown-divider {
  background: rgba(0,0,0,.07);
}
[data-theme="light"] .fv-sddi-badge-dark {
  background: rgba(99,102,241,.1);
  color: #6366f1;
}

/* ══════════════════════════════════════════════════════════════
   SECTION 17 — VIP PLAN POPUP MODAL
   ══════════════════════════════════════════════════════════════ */

.fv-vip-plan-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fvh-overlay-in .2s var(--fvh-ease);
}

.fv-vip-plan-modal-overlay.open {
  display: flex;
}

@keyframes fvh-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.fv-vip-plan-modal {
  background: #1a2235;
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 20px;
  box-shadow: 0 32px 80px rgba(0,0,0,.6), 0 8px 32px rgba(0,0,0,.4);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
  animation: fvh-modal-in .2s var(--fvh-spring);
  position: relative;
}

/* Accent top stripe */
.fv-vip-plan-modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #f59e0b);
}

@keyframes fvh-modal-in {
  from { opacity: 0; transform: scale(.94) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.fv-vip-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.fv-vip-modal-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.fv-vip-modal-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #d97706, #f59e0b);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  box-shadow: 0 4px 14px rgba(245,158,11,.3);
  flex-shrink: 0;
}

.fv-vip-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255,255,255,.07);
  border-radius: 8px;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all .15s var(--fvh-ease);
  flex-shrink: 0;
}
.fv-vip-modal-close:hover {
  background: rgba(239,68,68,.15);
  color: #fb7185;
}

.fv-vip-modal-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.fv-vip-modal-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.fv-vip-modal-days {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(99,102,241,.07);
  border: 1.5px solid rgba(99,102,241,.15);
  border-radius: 14px;
  padding: 16px 20px;
  color: rgba(255,255,255,.6);
}

.fv-vip-modal-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fv-vip-modal-progress .fv-pb-track {
  height: 10px;
  background: rgba(255,255,255,.08);
}

.fv-vip-modal-progress .fv-pb-meta {
  font-size: 11px;
  color: rgba(255,255,255,.4);
}

.fv-vip-modal-cta {
  display: flex;
  gap: 10px;
  padding-top: 4px;
}

.fv-vip-modal-cta .fv-sub-btn {
  flex: 1;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  font-size: 13px;
  border-radius: 10px;
}

/* Light theme modal */
[data-theme="light"] .fv-vip-plan-modal {
  background: #fff;
  border-color: rgba(0,0,0,.1);
}
[data-theme="light"] .fv-vip-modal-header {
  border-bottom-color: rgba(0,0,0,.07);
}
[data-theme="light"] .fv-vip-modal-title-row {
  color: #111827;
}
[data-theme="light"] .fv-vip-modal-close {
  background: rgba(0,0,0,.05);
  color: #6b7280;
}
[data-theme="light"] .fv-vip-modal-days {
  background: rgba(99,102,241,.05);
  border-color: rgba(99,102,241,.12);
  color: #6b7280;
}
[data-theme="light"] .fv-vip-modal-progress .fv-pb-track {
  background: #f0f0f0;
}
[data-theme="light"] .fv-vip-modal-progress .fv-pb-meta {
  color: #9ca3af;
}
[data-theme="light"] .fv-vip-plan-modal-overlay {
  background: rgba(0,0,0,.35);
}
[data-theme="light"] .fv-sub-since {
  color: #9ca3af;
}

/* ══════════════════════════════════════════════════════════════
   SECTION 18 — RESPONSIVE: Settings Dropdown + VIP Modal
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
  .fv-settings-dropdown {
    right: -10px;
    min-width: 190px;
  }
  .fv-vip-plan-modal {
    max-width: 100%;
    border-radius: 16px;
  }
  .fv-vip-modal-days {
    padding: 12px 14px;
  }
  .fv-vip-modal-cta {
    flex-direction: column;
  }
  .fv-vip-modal-cta .fv-sub-btn {
    width: 100%;
  }
}

/* RTL support for new elements */
[dir="rtl"] .fv-settings-dropdown {
  right: auto;
  left: 0;
}
[dir="rtl"] .fv-sddi-badge {
  margin-left: 0;
  margin-right: auto;
}

/* ═══════════════════════════════════════════════════════════════
   28. MOBILE CARDS LAYOUT — Comfortable near-edge spacing
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .ftvip-cards-grid {
    padding-left: 8px; padding-right: 8px;
  }
  .ftc-card,
  .ftvip-task-card,
  .ftvip-note-card {
    width: calc(100% - 16px) !important;
    margin-left: 8px;
    margin-right: 8px;
  }
}
/* ═══════════════════════════════════════════════════════════════
   29. API KEY STATUS INDICATOR
   ═══════════════════════════════════════════════════════════════ */

/* Wrapper for key input + dot + test button */
.fv-api-key-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.fv-api-key-wrap .fv-api-key-inp {
  flex: 1;
  min-width: 0;
}

/* The status dot */
.fv-api-dot {
  flex-shrink: 0;
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: background 0.3s, box-shadow 0.3s;
  cursor: help;
}

.fv-api-dot--idle {
  background: #9ca3af;
  border-color: #d1d5db;
}

.fv-api-dot--testing {
  background: #f59e0b;
  border-color: #fbbf24;
  animation: fv-dot-pulse 0.8s infinite alternate;
}

.fv-api-dot--ok {
  background: #22c55e;
  border-color: #16a34a;
  box-shadow: 0 0 6px 2px rgba(34,197,94,0.45);
}

.fv-api-dot--error {
  background: #ef4444;
  border-color: #dc2626;
  box-shadow: 0 0 6px 2px rgba(239,68,68,0.45);
}

@keyframes fv-dot-pulse {
  from { opacity: 1; }
  to   { opacity: 0.4; }
}

/* Test button */
.fv-api-test-btn {
  flex-shrink: 0;
  padding: 5px 10px;
  font-size: 12px;
  white-space: nowrap;
}

/* Status message under the field */
.fv-api-status-msg {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  transition: color 0.3s;
}

.fv-api-status-msg.is-ok {
  color: #16a34a;
  font-weight: 500;
}

.fv-api-status-msg.is-error {
  color: #dc2626;
  font-weight: 500;
}

/* Dark mode */
[data-theme="dark"] .fv-api-dot--idle {
  background: #6b7280;
  border-color: #4b5563;
}

[data-theme="dark"] .fv-api-dot--ok {
  background: #4ade80;
  border-color: #22c55e;
}

[data-theme="dark"] .fv-api-dot--error {
  background: #f87171;
  border-color: #ef4444;
}

/* Mobile */
@media (max-width: 480px) {
  .fv-api-key-wrap {
    flex-wrap: wrap;
  }
  .fv-api-key-wrap .fv-api-key-inp {
    flex: 1 1 100%;
  }
}

/* ═══════════════════════════════════════════════════════════════
   30. GEMINI MODEL HINT
   ═══════════════════════════════════════════════════════════════ */
.fv-gemini-model-hint {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: #7c3aed;
  font-weight: 500;
  min-height: 18px;
  transition: color 0.2s;
}
[data-theme="dark"] .fv-gemini-model-hint {
  color: #a78bfa;
}

/* ═══════════════════════════════════════════════════════════════
   31. AI COPILOT — MARKDOWN OUTPUT STYLES
   ═══════════════════════════════════════════════════════════════ */
#ftai-output-text,
#ftai-modal-output-text {
  line-height: 1.75;
  font-size: 14px;
  color: var(--fv-text, #1f2937);
  unicode-bidi: plaintext;
}

/* Headings */
#ftai-output-text .ftai-h1,
#ftai-modal-output-text .ftai-h1 {
  font-size: 18px; font-weight: 700; margin: 12px 0 6px;
  color: var(--fv-primary, #7c3aed);
}
#ftai-output-text .ftai-h2,
#ftai-modal-output-text .ftai-h2 {
  font-size: 16px; font-weight: 700; margin: 10px 0 5px;
  color: var(--fv-primary, #7c3aed);
}
#ftai-output-text .ftai-h3,
#ftai-modal-output-text .ftai-h3 {
  font-size: 14px; font-weight: 700; margin: 8px 0 4px;
  color: var(--fv-text, #374151);
}

/* List items */
#ftai-output-text .ftai-list-item,
#ftai-modal-output-text .ftai-list-item {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 5px 0;
  padding: 3px 0;
}
#ftai-output-text[dir="rtl"] .ftai-list-item,
#ftai-modal-output-text[dir="rtl"] .ftai-list-item {
  flex-direction: row-reverse;
  text-align: right;
}
#ftai-output-text[dir="rtl"] .ftai-list-num,
#ftai-modal-output-text[dir="rtl"] .ftai-list-num,
#ftai-output-text[dir="rtl"] .ftai-list-bull,
#ftai-modal-output-text[dir="rtl"] .ftai-list-bull {
  order: 1;
}
#ftai-output-text[dir="rtl"] .ftai-list-item > span:not(.ftai-list-num):not(.ftai-list-bull),
#ftai-modal-output-text[dir="rtl"] .ftai-list-item > span:not(.ftai-list-num):not(.ftai-list-bull) {
  order: 0;
  text-align: right;
}
#ftai-output-text .ftai-list-num,
#ftai-modal-output-text .ftai-list-num {
  font-weight: 700;
  color: var(--fv-primary, #7c3aed);
  min-width: 22px;
  flex-shrink: 0;
}
#ftai-output-text .ftai-list-bull,
#ftai-modal-output-text .ftai-list-bull {
  color: var(--fv-primary, #7c3aed);
  font-size: 16px;
  min-width: 16px;
  flex-shrink: 0;
}

/* Paragraph gap */
#ftai-output-text .ftai-para-gap,
#ftai-modal-output-text .ftai-para-gap {
  height: 10px;
}

/* Dark mode */
[data-theme="dark"] #ftai-output-text,
[data-theme="dark"] #ftai-modal-output-text {
  color: var(--fv-text, #e5e7eb);
}

/* ═══════════════════════════════════════════════════════════════
   32. GENERATE TITLE + AI LOADING + PREVIEW AI BOX
   ═══════════════════════════════════════════════════════════════ */

/* Title row with Generate Title button */
.fv-title-ai-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}
.fv-title-ai-wrap .fv-title-inp { flex: 1; min-width: 0; }
.fv-gen-title-btn {
  flex-shrink: 0;
  font-size: 12px;
  padding: 6px 10px;
  white-space: nowrap;
  border-color: #7c3aed44;
  color: #7c3aed;
}
.fv-gen-title-btn:hover { background: #f5f3ff; }

/* AI textarea wrapper */
.fv-ai-textarea-wrap { position: relative; width: 100%; }
.fv-textarea-ai { transition: opacity 0.3s; }

/* Loading bar */
.fv-ai-loading-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f5f3ff;
  border-radius: 8px;
  margin-top: 6px;
  font-size: 13px;
  color: #7c3aed;
  font-weight: 500;
}
.fv-ai-loading-pulse {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #7c3aed;
  animation: fv-pulse-dot 0.9s ease-in-out infinite alternate;
  flex-shrink: 0;
}
@keyframes fv-pulse-dot {
  from { transform: scale(1);   opacity: 1;   box-shadow: 0 0 0 0 #7c3aed55; }
  to   { transform: scale(1.5); opacity: 0.6; box-shadow: 0 0 0 6px #7c3aed00; }
}

/* AI button row */
.fv-ai-btn-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.fv-ai-status-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #16a34a;
  font-weight: 500;
}
.fv-ai-btn-done {
  animation: fv-btn-success 0.4s ease;
}
@keyframes fv-btn-success {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); background: #22c55e22; }
  100% { transform: scale(1); }
}

/* ── Preview modal — AI suggestion box ─── */
.fvp-ai-box {
  background: #fdf4ff;
  border: 1px solid #e9d5ff;
  border-left: 4px solid #a855f7;
  border-radius: 10px;
  margin-top: 14px;
  overflow: hidden;
}
.fvp-ai-header {
  background: #f3e8ff;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #7c3aed;
  display: flex;
  align-items: center;
  gap: 6px;
}
.fvp-ai-content {
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.75;
  color: #374151;
}
.fvp-ai-item {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 4px 0;
}
.fvp-ai-num {
  font-weight: 700;
  color: #7c3aed;
  min-width: 22px;
  flex-shrink: 0;
}
.fvp-ai-bull {
  color: #a855f7;
  min-width: 16px;
  flex-shrink: 0;
}

/* Dark mode */
[data-theme="dark"] .fvp-ai-box    { background: #1e1b2e; border-color: #4c1d95; }
[data-theme="dark"] .fvp-ai-header { background: #2d1b69; color: #c4b5fd; }
[data-theme="dark"] .fvp-ai-content{ color: #e5e7eb; }
[data-theme="dark"] .fv-ai-loading-bar { background: #2d1b69; color: #c4b5fd; }

/* Mobile */
@media (max-width: 480px) {
  .fv-title-ai-wrap { flex-wrap: wrap; }
  .fv-title-ai-wrap .fv-title-inp { flex: 1 1 100%; }
  .fv-gen-title-btn { width: 100%; justify-content: center; }
}

/* ══════════════════════════════════════════════════════════════════════════
 * MULTI API KEYS MANAGEMENT SYSTEM
 * ══════════════════════════════════════════════════════════════════════════ */
.fv-mk-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--fv-surface, #f9fafb);
  border: 1px solid var(--fv-border, #e5e7eb);
  border-radius: 10px;
  padding: 10px 12px;
  transition: border-color .2s, box-shadow .2s;
}
.fv-mk-item:hover { border-color: #a78bfa; box-shadow: 0 0 0 2px #ede9fe; }
.fv-mk-item.is-active { border-color: #7c3aed; background: #f5f3ff; }
.fv-mk-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.fv-mk-badge-openai  { background:#d1fae5;color:#065f46; }
.fv-mk-badge-claude  { background:#fef3c7;color:#92400e; }
.fv-mk-badge-gemini  { background:#dbeafe;color:#1e40af; }
.fv-mk-keyval {
  font-family: monospace;
  font-size: 13px;
  color: var(--fv-text-secondary, #6b7280);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fv-mk-status {
  font-size: 15px;
  flex-shrink: 0;
  cursor: default;
}
.fv-mk-actions { display: flex; gap: 4px; flex-shrink: 0; }
.fv-mk-btn {
  background: none;
  border: 1px solid var(--fv-border, #e5e7eb);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 12px;
  cursor: pointer;
  color: var(--fv-text-secondary, #6b7280);
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.fv-mk-btn:hover { background: #f3f4f6; border-color: #d1d5db; color: #111827; }
.fv-mk-btn.is-active-btn { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.fv-mk-btn.is-active-btn:hover { background: #6d28d9; }
.fv-mk-btn-del { color: #ef4444; border-color: #fca5a5; }
.fv-mk-btn-del:hover { background: #fef2f2; border-color: #ef4444; }
.fv-mk-empty {
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
  padding: 20px 0 8px;
}
/* Dark mode */
[data-theme="dark"] .fv-mk-item { background: #1e1b2e; border-color: #374151; }
[data-theme="dark"] .fv-mk-item.is-active { background: #2d1b69; border-color: #7c3aed; }
[data-theme="dark"] .fv-mk-keyval { color: #9ca3af; }
[data-theme="dark"] .fv-mk-btn { border-color: #374151; color: #9ca3af; }
[data-theme="dark"] .fv-mk-btn:hover { background: #374151; color: #f9fafb; }
[data-theme="dark"] .fv-mk-empty { color: #6b7280; }
/* ══════════════════════════════════════════════════════════════
   SECTION: MOBILE TABS FIX — Icon-only tabs on small screens
   Fixes: Private Space / Trash / Settings hidden on mobile
   All tabs visible at once — no horizontal scroll required
   ══════════════════════════════════════════════════════════════ */

/* Wrap the text label inside a span we can hide */
.fv-tab-text { display: inline; }

/* ── ≤640px: icon-only tabs, evenly distributed ── */
@media (max-width: 640px) {
  .fv-hero-tabs {
    padding: 0;
    justify-content: stretch;
    overflow-x: hidden; /* no scroll — all tabs fit as icons */
    gap: 0;
  }

  /* Each tab button takes equal width */
  .fv-hero-tab-btn {
    flex: 1 1 0;
    padding: 10px 4px;
    font-size: 0;          /* hide text via font-size trick (keeps layout) */
    gap: 0;
    justify-content: center;
    min-width: 0;
  }

  /* Keep the icon dot visible and slightly larger */
  .fv-hero-tab-btn .fv-tab-dot {
    width: 24px;
    height: 24px;
    font-size: 12px;
    flex-shrink: 0;
  }

  /* Hide the text label, keep icon */
  .fv-tab-text { display: none; }

  /* Tab groups (Tasks + add-btn, Notes + add-btn) — also stretch */
  .fvh-tab-group {
    flex: 1 1 0;
    justify-content: center;
  }

  /* Always show Add New Task / Add New Note in tabs menu on mobile */
  .fvh-tab-add-btn {
    display: inline-flex !important;
    font-size: 10px !important;
    padding: 4px 8px !important;
    height: auto !important;
    min-width: 0 !important;
    border-radius: 6px !important;
  }
  .fvh-tab-add-label {
    display: inline !important;
    font-size: 10px !important;
    white-space: nowrap !important;
  }
  .fvh-tab-add-icon {
    font-size: 10px !important;
  }
  /* Tab groups shrink-wrap around tab + add-btn pair */
  .fvh-tab-group {
    flex-wrap: nowrap !important;
    gap: 3px !important;
  }

  /* Active tab indicator: thicker bottom border for clarity */
  .fv-hero-tab-btn.active {
    border-bottom-width: 3px;
    background: rgba(139,92,246,.08);
  }

  /* Tooltip on long-press / title attr shown as native tooltip */
  .fv-hero-tab-btn { -webkit-tap-highlight-color: transparent; }
}

/* ── ≤400px: even tighter — scale down dot icon ── */
@media (max-width: 400px) {
  .fv-hero-tab-btn { padding: 9px 2px; }
  .fv-hero-tab-btn .fv-tab-dot { width: 22px; height: 22px; font-size: 11px; }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE-FIRST RESPONSIVE PATCH  (v5-mobile-fix)
   Fixes: hidden elements, broken layout, card overflow, images,
          text truncation, spacing. Desktop unaffected.
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Global box-sizing safety ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* ── 2. Root container: prevent horizontal scroll ────────────── */
/* NOTE: overflow-x:hidden removed — it clips position:fixed children
   (the sidebar) in some browsers. Horizontal scroll is prevented by
   the layout structure (flex row + sidebar fixed outside flow). */
#ftvip-wrap {
  max-width: 100%;
}

/* ── 3. Images — always responsive ──────────────────────────── */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── 4. "Read more" expandable text utility ─────────────────── */
.ft-read-more-wrap { position: relative; }

.ft-read-more-toggle {
  display: none; /* shown only on mobile */
  background: none;
  border: none;
  padding: 0;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ft-primary, #7c3aed);
  cursor: pointer;
  font-family: var(--ft-font, system-ui, sans-serif);
}
.ft-read-more-toggle:hover { text-decoration: underline; }

/* Collapsed state (mobile only — applied by JS or media query) */
@media (max-width: 640px) {
  .ft-read-more-toggle { display: inline-block; }

  .ftvip-task-desc.ft-collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .ftvip-note-content.ft-collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .ftvip-task-desc.ft-expanded,
  .ftvip-note-content.ft-expanded {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
  }
}

/* ── 5. Mobile breakpoint — primary (≤ 640px) ───────────────── */
@media (max-width: 640px) {

  /* 5a. Inner wrap — remove any fixed height / overflow breaking scroll */
  #ftvip-wrap-inner {
    padding: 8px 0 80px !important;
    overflow: visible !important;
    height: auto !important;
    min-height: unset !important;
    max-height: unset !important;
  }

  /* 5b. Cards grid — single column, flush */
  .ftvip-cards-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  /* 5c. Task cards — full width, no broken radius/border */
  .ftvip-task-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: 1px solid var(--ft-border, #e5e7eb) !important;
    box-shadow: none !important;
    margin: 0 !important;
    height: auto !important;
    min-height: unset !important;
    overflow: visible !important;
    transform: none !important;
  }
  .ftvip-task-card:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  .ftvip-task-card[data-card-color] {
    border-left: 4px solid var(--ftc-card-border) !important;
    border-radius: 0 !important;
  }

  /* 5d. Note cards — same treatment */
  .ftvip-note-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: 1px solid var(--ft-border, #e5e7eb) !important;
    box-shadow: none !important;
    margin: 0 !important;
    height: auto !important;
    min-height: unset !important;
    overflow: visible !important;
    transform: none !important;
  }
  .ftvip-note-card:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  /* 5e. Card internals — proper stacking & padding */
  .ftvip-task-card-header,
  .ftvip-card-toprow {
    padding: 12px 14px 6px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .ftvip-task-card-body {
    padding: 6px 14px 12px;
    overflow: visible !important;
    min-height: unset !important;
    max-height: unset !important;
    height: auto !important;
  }
  .ftvip-task-card-footer {
    padding: 10px 14px 12px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .ftvip-footer-left  { width: 100%; flex-wrap: wrap; }
  .ftvip-footer-right { width: 100%; justify-content: flex-end; }

  /* 5f. Task title & desc — don't clip on mobile */
  .ftvip-task-title {
    font-size: 16px;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    display: block;
    width: 100%;
  }
  .ftvip-task-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
  }
  .ftvip-note-content {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
    padding: 0 14px 12px;
  }

  /* 5g. Toolbar — full-width stacking */
  .fv-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 10px 12px !important;
    margin-bottom: 0 !important;
  }
  .fv-toolbar-left,
  .fv-toolbar-right {
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
  }
  .fv-toolbar-right {
    justify-content: flex-end;
  }
  .fv-toolbar-form {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
  }
  .fv-toolbar-form .fv-inp,
  .fv-toolbar-form .fv-inp-select,
  .fv-toolbar-form .fv-inp-icon {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .fv-inp-select { min-width: 0 !important; width: 100% !important; }
  .fv-toolbar-form button { align-self: flex-start; }

  /* 5h. KPI cards — 2-col grid */
  .fv-kpi {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    padding: 0 12px !important;
    margin-bottom: 12px !important;
  }
  .fv-kc {
    padding: 12px !important;
    gap: 8px !important;
  }
  .fv-kv { font-size: 18px !important; }
  .fv-kl { font-size: 10px !important; }
  .fv-ki { width: 34px !important; height: 34px !important; font-size: 14px !important; }

  /* 5i. Progress section */
  .fv-prog,
  .ft-prog-overview {
    margin: 0 12px 12px !important;
    border-radius: 12px !important;
    overflow: visible !important;
  }
  .ft-prog-legend {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .fv-prog-legs {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  /* 5j. Category panel */
  .fv-cat-panel { margin: 0 0 8px !important; border-radius: 0 !important; }
  .fv-cat-panel-head { padding: 10px 12px !important; flex-wrap: wrap; gap: 6px; }
  .fv-cat-scroll-wrap { padding: 0 36px !important; }
  .fv-cat-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 8px !important;
    padding: 4px 2px 8px !important;
    scroll-snap-type: x mandatory;
  }
  .fv-cat-card {
    flex: 0 0 auto !important;
    min-width: 140px !important;
    max-width: 180px !important;
    width: auto !important;
    scroll-snap-align: start;
  }

  /* 5k. Filter wrapper sticky — keep usable */
  .ftvip-filter-wrapper {
    position: sticky;
    top: 0;
    z-index: 90;
    padding: 0 !important;
  }

  /* 5l. ftc-card (alternative card style) */
  .ftc-card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    margin: 0 !important;
    box-shadow: none !important;
  }
  .ftc-topbar { padding: 10px 12px 4px !important; flex-wrap: wrap; gap: 4px; }
  .ftc-badges { padding: 4px 12px 6px !important; flex-wrap: wrap; }
  .ftc-body   { padding: 0 12px 12px !important; }
  .ftc-footer,
  .ftc-footer-2row { padding: 8px 12px 12px !important; flex-wrap: wrap; gap: 4px; }
  .ftc-footer-right { width: 100%; justify-content: flex-end; }

  /* 5m. Tasks inner container */
  .ftvip-tasks-inner {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 0 !important;
  }

  /* 5n. Modal — full screen on mobile */
  .ftvip-modal-overlay .ftvip-modal-inner,
  .ft-modal {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    max-height: 100vh !important;
    overflow-y: auto !important;
  }
  .ft-modal-body,
  .fv-modal-body {
    max-height: calc(100vh - 120px) !important;
  }

  /* 5o. Bulk action bar */
  .ftvip-bulk-bar { flex-wrap: wrap; gap: 6px; }

  /* 5p. Actions row buttons */
  .ftvip-task-actions-row { padding: 8px 12px 6px !important; flex-wrap: wrap; gap: 4px; }
  .ftvip-task-actions     { flex-wrap: wrap; gap: 2px; }

  /* 5q. Image — always fit container */
  .ftvip-note-card img,
  .ftvip-task-card img,
  .ftc-card img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
  }

  /* 5r. Tabs — horizontally scrollable, don't clip */
  .fv-hero-tabs {
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap !important;
    display: flex !important;
  }
  .fv-hero-tabs::-webkit-scrollbar { display: none; }
  .fv-hero-tab-btn { flex-shrink: 0; white-space: nowrap; }

  /* 5s. Hero stats — 2-col */
  .fv-hero-stats { display: grid !important; grid-template-columns: repeat(2,1fr) !important; gap: 6px !important; }
  .fv-hero-stat  { min-width: 0; box-sizing: border-box; }

  /* 5t. Section padding for inner content */
  #fv-tab-tasks,
  #fv-tab-notes,
  #fv-tab-private,
  #fv-tab-trash,
  #fv-tab-settings,
  #fv-tab-aicopilot {
    overflow: visible !important;
    height: auto !important;
    min-height: unset !important;
  }
}

/* ── 6. Mid-range (641–768px) — comfortable spacing ─────────── */
@media (min-width: 641px) and (max-width: 768px) {
  .ftvip-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 0 12px !important;
  }
  .ftvip-task-card,
  .ftvip-note-card,
  .ftc-card {
    width: 100% !important;
    border-radius: 12px !important;
  }
  .fv-toolbar-form {
    flex-wrap: wrap;
    gap: 6px;
  }
  .fv-inp-select { min-width: 120px; }
}

/* ── 7. Touch: remove hover animations that break layout ─────── */
@media (hover: none) and (pointer: coarse) {
  .ftvip-task-card:hover,
  .ftvip-note-card:hover,
  .fv-kc:hover,
  .ftvip-card-actions button:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  /* Ensure tooltips never appear on touch (they stay stuck) */
  .ftvip-icon-btn::after { display: none !important; }
}

/* ── Private Trash & Display Settings — v4.1 ─────────────────────────── */
#fv-inline-display-settings .fv-inp { font-size: 14px; }
#ftvault-trash-type { max-width: 160px; font-size: 13px; }
.ftvault-trash-cb { accent-color: #7c3aed; }
.ftvip-badge-danger { background: #fee2e2; color: #991b1b; }
.ftvault-inner .ftvip-bulk-bar { margin-bottom: 14px; }

/* ── Issue #11 Fix: Category nav buttons always visible if overflow ──── */
.fv-cat-nav {
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
}
/* On mobile: show nav inside the row, not absolute positioned */
@media (max-width: 768px) {
  .fv-cat-scroll-wrap {
    padding: 0 40px !important;
    position: relative;
  }
  .fv-cat-nav {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    z-index: 5 !important;
    width: 34px !important;
    height: 34px !important;
  }
  .fv-cat-nav-prev { left: 0 !important; right: auto !important; }
  .fv-cat-nav-next { right: 0 !important; left: auto !important; }
}

/* ── Issue #12: Public card click fix — ensure card is above neighbours when menu open ── */
.ftc-card { position: relative; }
.ftc-menu-wrap { position: relative; z-index: 1; }
.ftvip-dropdown-menu {
  z-index: 9999 !important;
  position: absolute !important;
}
/* Prevent cards behind open dropdown from catching clicks */
.ftc-card:has(.ftvip-dropdown-menu[style*="display: block"]),
.ftc-card:has(.ftvip-dropdown-menu:not([style*="none"])) {
  z-index: 50;
  position: relative;
}

/* ── Issue #8: General mobile button touch fixes ─────────────────────── */
@media (max-width: 768px) {
  button, .fvbtn, .ftc-icon-btn, .ftvip-icon-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
  }
  /* Fix dropdown not showing on mobile due to overflow:hidden on card */
  .ftvip-task-card,
  .ftvip-note-card {
    overflow: visible !important;
  }
  .ftc-card {
    overflow: visible !important;
  }
}

/* ── Issue #9 Fix: Layout — fix text line breaks everywhere ─────────── */
.ftvip-task-title,
.ftvip-task-desc,
.ftvip-note-title,
.ftc-title,
.ftc-desc {
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  white-space: normal !important;
}
.ftvip-note-content {
  word-break: break-word !important;
  overflow-wrap: break-word !important;
}
/* Cards should not clip text */
.ftvip-task-card,
.ftvip-note-card,
.ftc-card {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ── Issue #8 Fix: Mobile button touch speed improvement ────────────── */
@media (max-width: 768px) {
  .ftc-icon-btn,
  .ftvip-icon-btn,
  .ftc-pin-btn,
  .ftc-preview-btn,
  .ftc-menu-trigger,
  .fv-cat-card-btn,
  .fvbtn,
  select.ftc-status-select,
  select.ftvip-status-select {
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
    cursor: pointer !important;
  }

  /* Larger tap targets on mobile */
  .ftc-icon-btn,
  .ftvip-icon-btn {
    min-width: 32px !important;
    min-height: 32px !important;
  }

  /* Prevent overflow:hidden on cards clipping dropdown on mobile */
  .ftc-card,
  .ftvip-task-card,
  .ftvip-note-card {
    overflow: visible !important;
  }
}


/* ═══════════════════════════════════════════════════════════════
   FIX v19 — All 4 requested fixes
   ═══════════════════════════════════════════════════════════════ */

/* ── FIX 4: Mobile Logo — FlowTaskv5.7.9 on first line + Smart Task Manager below ── */
@media (max-width: 768px) {
  .fv-hero-brand-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
  }
  .fv-hero-brand-top {
    display: flex !important;
    align-items: baseline !important;
    gap: 3px !important;
  }
  .fv-hero-brand-name {
    font-size: 13px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
  }
  .fv-hero-brand-ver {
    font-size: 9px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    display: inline !important;
  }
  .fv-hero-brand-tagline {
    display: block !important;
    font-size: 8.5px !important;
    letter-spacing: .6px !important;
    white-space: nowrap !important;
    margin-top: 1px !important;
    opacity: .75;
  }
}
/* Landscape: also show tagline */
@media (max-width: 768px) and (orientation: landscape) and (max-height: 500px) {
  .fv-hero-brand-tagline {
    display: block !important;
    font-size: 7.5px !important;
  }
}

/* ── FIX 2: Desktop categories prev/next — ensure wrap has overflow visible ── */
@media (min-width: 769px) {
  .fv-cat-scroll-wrap {
    overflow: visible !important;
    margin-left: 22px !important;
    margin-right: 22px !important;
  }
  .fv-cat-panel {
    overflow: visible !important;
  }
  .fv-cat-nav {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    z-index: 5 !important;
    width: 30px !important;
    height: 30px !important;
  }
  .fv-cat-nav-prev { left: -22px !important; right: auto !important; }
  .fv-cat-nav-next { right: -22px !important; left: auto !important; }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE CLICK FIX — main CSS patch
   Fixes: modal close buttons, header interaction, z-index
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* ── Dashboard hero: decorative layers must not block clicks ── */
  .fv-dashboard-hero {
    overflow: visible !important;
  }
  .fv-dashboard-hero::before,
  .fv-dashboard-hero::after {
    pointer-events: none !important;
    z-index: 0 !important;
  }
  .fv-hero-noise {
    pointer-events: none !important;
    z-index: 0 !important;
  }

  /* ── Topbar: proper stacking ── */
  .fv-hero-topbar {
    position: relative !important;
    z-index: 20 !important;
  }

  /* ── All modals: ensure they are above hero and tabs ── */
  .ft-modal,
  .fv-modal {
    z-index: 999999 !important;
    pointer-events: auto !important;
    touch-action: auto !important;
  }

  .ft-modal-box,
  .fv-modal-box {
    pointer-events: auto !important;
    touch-action: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* ── Modal close buttons ── */
  .ft-modal-close,
  .fv-modal-close {
    pointer-events: auto !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 10 !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  /* ── Modal footer buttons ── */
  .ft-modal-footer button,
  .fv-modal-foot button,
  .ft-modal-footer a,
  .fv-modal-foot a {
    pointer-events: auto !important;
    touch-action: manipulation !important;
    cursor: pointer !important;
  }

  /* ── Modal body: scrollable ── */
  .ft-modal-body,
  .fv-modal-body {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    pointer-events: auto !important;
    touch-action: pan-y !important;
    max-height: calc(100vh - 140px) !important;
  }

  /* ── Tabs: always above page content, below modals ── */
  .fv-hero-tabs {
    z-index: 100 !important;
    pointer-events: auto !important;
  }
  .fv-hero-tab-btn {
    pointer-events: auto !important;
    touch-action: manipulation !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  /* ── Ensure tab pane content is scrollable and tappable ── */
  .fv-tab-pane {
    overflow: visible !important;
    pointer-events: auto !important;
    touch-action: auto !important;
  }

  /* ── Dropdowns above everything ── */
  .fv-settings-dropdown {
    z-index: 999999 !important;
    pointer-events: auto !important;
    touch-action: auto !important;
  }

  .fv-notif-dropdown {
    z-index: 999999 !important;
    pointer-events: auto !important;
    touch-action: auto !important;
  }

  /* ── Dropdown items ── */
  .fv-settings-dropdown a,
  .fv-settings-dropdown button,
  .fv-notif-dropdown a,
  .fv-notif-dropdown button {
    pointer-events: auto !important;
    touch-action: manipulation !important;
    cursor: pointer !important;
    min-height: 40px !important;
  }

  /* ── Settings cards: interactive ── */
  .fv-settings-card {
    pointer-events: auto !important;
    touch-action: auto !important;
  }

  /* ── VIP plan modal ── */
  .fv-vip-plan-modal-overlay {
    z-index: 999999 !important;
    pointer-events: auto !important;
    touch-action: auto !important;
  }
  .fv-vip-plan-modal {
    pointer-events: auto !important;
    touch-action: auto !important;
  }
  .fv-vip-modal-close {
    pointer-events: auto !important;
    touch-action: manipulation !important;
    cursor: pointer !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  /* ── All interactive elements: base fix ── */
  button:not([disabled]),
  input[type="submit"]:not([disabled]),
  input[type="button"]:not([disabled]),
  select:not([disabled]),
  textarea:not([disabled]),
  [role="button"]:not([aria-disabled="true"]) {
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
  }

}


/* ═══════════════════════════════════════════════════════════════
   MOBILE UX + PERFORMANCE FIX v2
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* ── Hero container: respect safe area ── */
  .fv-dashboard-hero {
    padding-top: env(safe-area-inset-top, 0) !important;
    box-sizing: border-box !important;
  }

  /* ── Tab content: always scrollable after modal close ── */
  .fv-tab-pane {
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    touch-action: pan-y !important;
  }

  /* ── Modals: add safe-area padding ── */
  .ft-modal-box,
  .fv-modal-box {
    padding-bottom: env(safe-area-inset-bottom, 0) !important;
    box-sizing: border-box !important;
  }

  /* ── Button performance: reduce repaints ── */
  .fvbtn,
  .ftbtn,
  .ftvip-icon-btn,
  .ftc-icon-btn {
    will-change: auto !important;
    contain: layout style !important;
  }

  /* ── Remove hover transitions that fire on tap ── */
  .ftvip-task-card,
  .ftvip-note-card,
  .ftc-card {
    transition: none !important;
  }

  /* ── Prevent invisible overflow overlays ── */
  .fv-dashboard-hero {
    overflow: visible !important;
  }

}

/* ── ftview modal: safe area ── */
@media (max-width: 768px) {
  .ftview-modal-overlay {
    padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0) !important;
    box-sizing: border-box !important;
    pointer-events: auto !important;
    z-index: 999999 !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,.6) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .ftview-modal {
    pointer-events: auto !important;
    position: relative !important;
    z-index: 1 !important;
    max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 20px) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .ftview-modal-close,
  .ftview-modal-action-btn {
    pointer-events: auto !important;
    touch-action: manipulation !important;
    cursor: pointer !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }
}
/* ================================================================
   FLOWTASK AI — SETTINGS TAB PROFESSIONAL REDESIGN
   ارفع هذا الملف على السيرفر وأضف رابطه في dashboard.php
   أو انسخ محتواه وألصقه في نهاية flowtask.css
   ================================================================ */

/* ── 1. TOPBAR ─────────────────────────────────────────────────── */
.ft-topbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 22px 28px !important;
  background: linear-gradient(130deg, #1e1b4b 0%, #312e81 55%, #4c1d95 100%) !important;
  border-radius: 0 0 20px 20px !important;
  box-shadow: 0 8px 28px rgba(79,36,213,.3) !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  position: relative !important;
  overflow: hidden !important;
}
.ft-topbar::after {
  content: '' !important;
  position: absolute !important;
  top: -60px !important;
  right: -60px !important;
  width: 220px !important;
  height: 220px !important;
  border-radius: 50% !important;
  background: rgba(139,92,246,.15) !important;
  pointer-events: none !important;
}
.ft-topbar h2 {
  font-size: 19px !important;
  font-weight: 800 !important;
  color: #fff !important;
  margin: 0 !important;
  letter-spacing: -0.01em !important;
}
.ft-topbar-meta {
  font-size: 12px !important;
  color: rgba(196,181,253,.85) !important;
  margin-top: 2px !important;
}
.ft-brand-icon {
  width: 46px !important;
  height: 46px !important;
  background: rgba(255,255,255,.12) !important;
  border: 1px solid rgba(255,255,255,.2) !important;
  border-radius: 13px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 20px !important;
  color: #c4b5fd !important;
}

/* ── 2. STAT CARDS ─────────────────────────────────────────────── */
.ft-stats-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)) !important;
  gap: 12px !important;
  margin: 20px 24px !important;
}
.ft-stat-card {
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 14px !important;
  padding: 18px 20px !important;
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  transition: transform .18s ease, box-shadow .18s ease !important;
  cursor: default !important;
}
.ft-stat-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.09) !important;
  border-color: rgba(124,58,237,.25) !important;
}
.ft-stat-icon {
  width: 46px !important;
  height: 46px !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 18px !important;
  flex-shrink: 0 !important;
}
.ft-stat-todo .ft-stat-icon     { background: rgba(99,102,241,.1) !important; color: #6366f1 !important; }
.ft-stat-progress .ft-stat-icon { background: rgba(245,158,11,.12) !important; color: #d97706 !important; }
.ft-stat-done .ft-stat-icon     { background: rgba(16,185,129,.1) !important; color: #059669 !important; }
.ft-stat-total .ft-stat-icon    { background: rgba(124,58,237,.1) !important; color: #7c3aed !important; }
.ft-stat-val {
  font-size: 28px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: -0.03em !important;
  color: #111827 !important;
}
.ft-stat-lbl {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .6px !important;
  color: #6b7280 !important;
  margin-top: 5px !important;
}

/* ── 3. TABS ───────────────────────────────────────────────────── */
.ft-tabs {
  display: flex !important;
  gap: 2px !important;
  padding: 0 24px !important;
  border-bottom: 1.5px solid #e5e7eb !important;
  background: #fff !important;
  overflow-x: auto !important;
}
.ft-tab {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 13px 18px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #6b7280 !important;
  text-decoration: none !important;
  border-bottom: 2.5px solid transparent !important;
  margin-bottom: -1.5px !important;
  white-space: nowrap !important;
  transition: color .15s, border-color .15s, background .15s !important;
  border-radius: 8px 8px 0 0 !important;
}
.ft-tab:hover {
  color: #7c3aed !important;
  background: rgba(124,58,237,.05) !important;
  text-decoration: none !important;
}
.ft-tab.active {
  color: #7c3aed !important;
  border-bottom-color: #7c3aed !important;
  background: transparent !important;
}

/* ── 4. SETTINGS FORM WRAPPER ──────────────────────────────────── */
.ft-settings-form {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  padding: 24px 24px 40px !important;
  max-width: 740px !important;
}

/* ── 5. SECTION CARDS — stacked with rounded corners ──────────── */
.ft-field-group {
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  transition: box-shadow .2s !important;
}
.ft-field-group + .ft-field-group {
  border-top: none !important;
}
.ft-field-group:first-of-type {
  border-radius: 14px 14px 0 0 !important;
}
.ft-field-group:last-of-type {
  border-radius: 0 0 14px 14px !important;
}
.ft-field-group:only-of-type {
  border-radius: 14px !important;
}
.ft-field-group:hover {
  box-shadow: 0 0 0 2.5px rgba(124,58,237,.12), 0 4px 14px rgba(0,0,0,.05) !important;
  z-index: 1 !important;
  position: relative !important;
}

/* ── 6. SECTION HEADER h3 ──────────────────────────────────────── */
.ft-field-group h3 {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 15px 20px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #111827 !important;
  letter-spacing: .01em !important;
  background: #f9fafb !important;
  border-bottom: 1px solid #e5e7eb !important;
}
.ft-field-group h3 .fa-solid,
.ft-field-group h3 .fa-brands,
.ft-field-group h3 .fa-regular {
  width: 28px !important;
  height: 28px !important;
  background: rgba(124,58,237,.1) !important;
  color: #7c3aed !important;
  border-radius: 7px !important;
  font-size: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

/* ── 7. FIELD GROUPS INNER CONTENT ────────────────────────────── */
.ft-field-group > label,
.ft-field-group > p,
.ft-field-group > div {
  padding-left: 20px !important;
  padding-right: 20px !important;
}

/* Labels — normal rows */
.ft-field-group label {
  display: flex !important;
  flex-direction: column !important;
  gap: 7px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #6b7280 !important;
  text-transform: uppercase !important;
  letter-spacing: .55px !important;
  margin: 0 !important;
  padding: 15px 20px !important;
  border-bottom: 1px solid #f3f4f6 !important;
}
.ft-field-group label:last-of-type {
  border-bottom: none !important;
}

/* Toggle rows — horizontal */
.ft-field-group label[style*="flex-direction:row"],
.ft-field-group label[style*="flex-direction: row"] {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 18px 20px !important;
}
.ft-field-group label[style*="flex-direction:row"] > div,
.ft-field-group label[style*="flex-direction: row"] > div {
  padding: 0 !important;
}

/* ── 8. INPUTS & SELECTS ───────────────────────────────────────── */
.ft-field-group input[type="text"],
.ft-field-group input[type="password"],
.ft-field-group input[type="number"],
.ft-field-group input[type="date"],
.ft-field-group select {
  appearance: none !important;
  -webkit-appearance: none !important;
  padding: 9px 13px !important;
  border: 1.5px solid #d1d5db !important;
  border-radius: 9px !important;
  font-size: 13px !important;
  color: #111827 !important;
  background: #f9fafb !important;
  width: 100% !important;
  box-sizing: border-box !important;
  transition: border-color .15s, box-shadow .15s, background .15s !important;
  font-family: inherit !important;
}
.ft-field-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  padding-right: 38px !important;
}
.ft-field-group input:focus,
.ft-field-group select:focus {
  outline: none !important;
  border-color: #7c3aed !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(124,58,237,.12) !important;
}
/* Password keys — green when filled */
.ft-field-group input[type="password"]:not(:placeholder-shown) {
  border-color: rgba(16,185,129,.45) !important;
  background: rgba(16,185,129,.04) !important;
  color: #065f46 !important;
}

/* ── 9. TOGGLE SWITCH ──────────────────────────────────────────── */
.ft-toggle {
  position: relative !important;
  display: inline-flex !important;
  width: 50px !important;
  height: 27px !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
}
.ft-toggle-slider {
  position: absolute !important;
  inset: 0 !important;
  background: #d1d5db !important;
  border-radius: 99px !important;
  border: 1.5px solid #c4c4c4 !important;
  transition: all .22s cubic-bezier(.4,0,.2,1) !important;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.1) !important;
}
.ft-toggle-slider::before {
  content: '' !important;
  position: absolute !important;
  top: 3px !important;
  left: 3px !important;
  width: 17px !important;
  height: 17px !important;
  background: #fff !important;
  border-radius: 50% !important;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1) !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.22) !important;
}
.ft-toggle input:checked + .ft-toggle-slider {
  background: #7c3aed !important;
  border-color: #6d28d9 !important;
}
.ft-toggle input:checked + .ft-toggle-slider::before {
  transform: translateX(23px) !important;
}

/* ── 10. DATE/TIME RADIO LABELS ────────────────────────────────── */
.ft-field-group label[style*="display:flex;align-items:center;gap:8px;margin-bottom:7px"],
.ft-field-group label[style*="display: flex; align-items: center; gap: 8px"] {
  flex-direction: row !important;
  align-items: center !important;
  padding: 4px 0 !important;
  margin-bottom: 5px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: #374151 !important;
  border-bottom: none !important;
  cursor: pointer !important;
  gap: 8px !important;
}
.ft-field-group input[type="radio"] {
  width: 15px !important;
  height: 15px !important;
  accent-color: #7c3aed !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
}
/* Date/Time section inner wrap */
.ft-field-group > div[style*="display:flex;gap:40px"],
.ft-field-group > div[style*="gap:40px"] {
  padding: 18px 20px !important;
}
/* Section sub-labels DATE / TIME */
.ft-field-group p[style*="font-size:12px;font-weight:700;color:var(--ft-text-muted)"] {
  padding: 0 !important;
  margin: 0 0 10px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .5px !important;
  color: #9ca3af !important;
  border-bottom: none !important;
}

/* ── 11. RANGE SLIDER ──────────────────────────────────────────── */
.ft-field-group input[type="range"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  height: 4px !important;
  border-radius: 4px !important;
  background: #e5e7eb !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer !important;
  padding: 0 !important;
  width: 100% !important;
  accent-color: #7c3aed !important;
}
.ft-field-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  background: #7c3aed !important;
  box-shadow: 0 0 0 3px rgba(124,58,237,.2) !important;
  cursor: pointer !important;
  transition: box-shadow .15s !important;
}
.ft-field-group input[type="range"]:hover::-webkit-slider-thumb {
  box-shadow: 0 0 0 5px rgba(124,58,237,.25) !important;
}

/* ── 12. TYPOGRAPHY SECTION ────────────────────────────────────── */
#ft-typography-section > div[style*="display:flex;gap:24px"] {
  padding: 16px 20px !important;
}
#ft-typography-section > div[style*="margin-bottom:20px"] {
  padding: 14px 20px !important;
}
#ft-font-preview-box {
  border: 1.5px solid #e5e7eb !important;
  border-radius: 10px !important;
  overflow: hidden !important;
}
/* Typography action buttons row */
#ft-typography-section > div[style*="display:flex;gap:10px"] {
  padding: 14px 20px 18px !important;
  border-top: 1px solid #f3f4f6 !important;
  background: #f9fafb !important;
}

/* ── 13. DATA MANAGEMENT CARD — warning ────────────────────────── */
.ft-field-group[style*="border:1.5px solid #fde68a"],
.ft-field-group[style*="border: 1.5px solid #fde68a"] {
  border: 1px solid #fde68a !important;
  background: linear-gradient(to bottom right, rgba(254,243,199,.5), rgba(255,251,235,.7)) !important;
}
.ft-field-group[style*="border:1.5px solid #fde68a"] h3,
.ft-field-group[style*="border: 1.5px solid #fde68a"] h3 {
  background: rgba(254,243,199,.6) !important;
  border-bottom-color: #fde68a !important;
}
.ft-field-group[style*="border:1.5px solid #fde68a"] h3 .fa-solid,
.ft-field-group[style*="border: 1.5px solid #fde68a"] h3 .fa-solid {
  background: rgba(245,158,11,.15) !important;
  color: #d97706 !important;
}

/* ── 14. CODE TAGS ─────────────────────────────────────────────── */
.ft-field-group code,
code {
  font-size: 11.5px !important;
  background: rgba(124,58,237,.08) !important;
  color: #7c3aed !important;
  padding: 2px 7px !important;
  border-radius: 5px !important;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace !important;
}

/* ── 15. INFO TEXT ─────────────────────────────────────────────── */
.ft-field-group > p {
  font-size: 12px !important;
  color: #6b7280 !important;
  line-height: 1.65 !important;
  margin: 0 !important;
  padding: 10px 20px 14px !important;
  border-top: 1px solid #f3f4f6 !important;
  background: #f9fafb !important;
}

/* ── 16. SAVE BUTTON ───────────────────────────────────────────── */
.ft-settings-form > button[type="submit"],
.ft-settings-form > .ft-btn[type="submit"] {
  margin-top: 20px !important;
  padding: 13px 36px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, #7c3aed, #6d28d9) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(124,58,237,.35) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  transition: all .2s ease !important;
  letter-spacing: .02em !important;
}
.ft-settings-form > button[type="submit"]:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 22px rgba(124,58,237,.45) !important;
  filter: brightness(1.07) !important;
}

/* ── 17. SUCCESS FLASH ─────────────────────────────────────────── */
.ft-settings-form + div[style*="d1fae5"],
div[style*="background:#d1fae5"],
div[style*="background: #d1fae5"] {
  border-radius: 10px !important;
  border: 1.5px solid rgba(16,185,129,.3) !important;
  padding: 13px 18px !important;
  margin-bottom: 16px !important;
  animation: ftFadeDown .3s ease !important;
}
@keyframes ftFadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 18. AI PROVIDER GRID LAYOUT ───────────────────────────────── */
.ft-field-group .ft-field-grid,
.ft-field-group > div[style*="display:grid"] {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
  padding: 16px 20px !important;
}

/* ── 19. DARK MODE ─────────────────────────────────────────────── */
[data-theme="dark"] .ft-field-group {
  background: #18181b !important;
  border-color: #2d2d3a !important;
}
[data-theme="dark"] .ft-field-group h3 {
  background: rgba(255,255,255,.03) !important;
  border-bottom-color: #2d2d3a !important;
  color: #f9fafb !important;
}
[data-theme="dark"] .ft-field-group label {
  color: #9ca3af !important;
  border-bottom-color: rgba(255,255,255,.05) !important;
}
[data-theme="dark"] .ft-field-group input,
[data-theme="dark"] .ft-field-group select {
  background: #27272a !important;
  border-color: #3f3f46 !important;
  color: #f3f4f6 !important;
}
[data-theme="dark"] .ft-field-group input:focus,
[data-theme="dark"] .ft-field-group select:focus {
  background: #1c1c1f !important;
  border-color: #8b5cf6 !important;
}
[data-theme="dark"] .ft-stat-card {
  background: #18181b !important;
  border-color: #2d2d3a !important;
}
[data-theme="dark"] .ft-stat-val {
  color: #f9fafb !important;
}
[data-theme="dark"] .ft-tab {
  color: #9ca3af !important;
}
[data-theme="dark"] .ft-tab:hover,
[data-theme="dark"] .ft-tab.active {
  color: #a78bfa !important;
}
[data-theme="dark"] .ft-tab.active {
  border-bottom-color: #8b5cf6 !important;
}
[data-theme="dark"] .ft-tabs {
  background: #1c1c1f !important;
  border-bottom-color: #2d2d3a !important;
}
[data-theme="dark"] .ft-field-group > p {
  background: rgba(255,255,255,.02) !important;
  border-top-color: rgba(255,255,255,.05) !important;
  color: #9ca3af !important;
}
[data-theme="dark"] #ft-typography-section > div[style*="display:flex;gap:10px"] {
  background: rgba(255,255,255,.025) !important;
  border-top-color: rgba(255,255,255,.05) !important;
}
[data-theme="dark"] #ft-font-preview-box {
  border-color: #2d2d3a !important;
}
[data-theme="dark"] .ft-toggle-slider {
  background: #3f3f46 !important;
  border-color: #52525b !important;
}

/* ── 20. RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .ft-settings-form {
    padding: 16px 14px 36px !important;
  }
  .ft-field-group h3 {
    padding: 13px 16px !important;
  }
  .ft-field-group label {
    padding: 12px 16px !important;
  }
  .ft-field-group > p,
  .ft-field-group > div {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .ft-stats-grid {
    margin: 16px 14px !important;
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .ft-settings-form > button[type="submit"] {
    width: 100% !important;
    justify-content: center !important;
  }
  .ft-field-group > div[style*="display:flex;gap:40px"] {
    flex-direction: column !important;
    gap: 20px !important;
    padding: 14px 16px !important;
  }
}

/* ── Category drag-to-reorder ── */
.fv-cat-card[draggable="true"] { cursor: grab; }
.fv-cat-card[draggable="true"]:active { cursor: grabbing; }
.fv-cat-card.fv-cat-drag-over {
  outline: 2px dashed var(--ft-primary,#7c3aed);
  outline-offset: 2px;
  background: rgba(124,58,237,.04);
}
