/* VGo — Project Management, Simplified */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700;900&display=swap');

:root {
  --bg: #F6F1E7;
  --surface: #FFFFFF;
  --surface-2: #FBFAF7;
  --text: #3D2E22;
  --text-2: #6B5A4A;
  --muted: #9A8A78;
  --border: rgba(61,46,34,.08);
  --border-2: rgba(61,46,34,.16);
  --primary: #7e6549;
  --primary-dark: #5C4A38;
  --primary-bg: #F0E8DC;
  --gold: #7e6549;
  --gold-light: #A89278;
  --gold-bg: #F0E8DC;
  --sage: #6B8E5A;
  --sage-bg: #E8F0E4;
  --ochre: #C99520;
  --ochre-bg: #F8E6B8;
  --barn: #B0432B;
  --barn-bg: #F4D6CC;
  --sand: #EDE4D6;
  --cream: #FBFAF7;
  --red: #C54B3C;
  --green: #5B8C5A;
  --blue: #4A7C9B;
  --serif: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
  --sans: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
*::selection { background: #E8DCC8; }

html, body { height: 100%; }
body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

@keyframes vgFade { from { transform: translateY(7px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes vgPop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes vgOverlay { from { opacity: 0; } to { opacity: 1; } }
@keyframes vgSlideR { from { transform: translateX(100%); } to { transform: none; } }
@keyframes vgToast { from { opacity:0; transform: translateY(-12px); } to { opacity:1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: rgba(126,101,73,.18); border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ===== LOGIN SPLIT SCREEN ===== */
.login-root { min-height: 100vh; display: flex; }

/* Left panel — brand */
.login-left { flex: 1; background: linear-gradient(145deg, #3d2e22 0%, #2a1f17 60%, #1a1209 100%); display: flex; flex-direction: column; padding: 48px 56px; position: relative; overflow: hidden; }
.login-left::before { content: ''; position: absolute; top: -80px; left: -80px; width: 360px; height: 360px; border-radius: 50%; background: rgba(201,149,32,.12); pointer-events: none; }
.login-left::after { content: ''; position: absolute; bottom: -100px; right: -60px; width: 400px; height: 400px; border-radius: 50%; background: rgba(201,149,32,.06); pointer-events: none; }

.login-brand { display: none; }
.login-logo-mark { width: 48px; height: 48px; background: var(--gold); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-family: var(--sans); font-size: 20px; font-weight: 700; color: #FFF; letter-spacing: -0.5px; flex: none; }
.login-brand-name { font-family: var(--sans); font-size: 32px; color: #FFF; letter-spacing: -0.5px; font-weight: 700; }

.login-left-content { flex: 1; display: flex; flex-direction: column; justify-content: center; position: relative; z-index: 1; }
.login-tagline { font-family: var(--sans); font-size: 44px; line-height: 1.15; color: #FFF; margin-bottom: 18px; letter-spacing: -1px; font-weight: 700; }
.login-desc { font-size: 16px; color: rgba(255,255,255,.55); margin-bottom: 40px; line-height: 1.5; }
.login-features { display: flex; flex-direction: column; gap: 14px; }
.login-feature { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.75); font-size: 15px; }
.login-feature-icon { width: 28px; height: 28px; background: rgba(201,149,32,.2); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--gold); flex: none; }
.login-feature-icon svg { width: 14px; height: 14px; }
.login-left-footer { position: relative; z-index: 1; font-size: 13px; color: rgba(255,255,255,.3); }

/* Right panel — form */
.login-right { width: 480px; min-height: 100vh; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 48px 56px; }
.login-card { width: 100%; max-width: 380px; }
.login-card .login-tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 3px; margin-bottom: 28px; }
.login-tab { flex: 1; padding: 10px; border: none; background: none; border-radius: 9px; font-family: var(--sans); font-size: 14px; font-weight: 700; cursor: pointer; color: var(--muted); transition: all .15s; }
.login-tab.active { background: var(--gold); color: #FFF; }
.login-card .input-group { margin-bottom: 18px; }
.login-card .input-label { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 7px; display: block; }
.login-card .input-field { width: 100%; border: 1px solid var(--border-2); border-radius: 10px; padding: 12px 16px; font-family: var(--sans); font-size: 15px; color: var(--text); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
.login-card .input-field:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,149,32,.12); }
.btn-login { width: 100%; padding: 14px; border-radius: 12px; border: none; background: var(--gold); color: #FFF; font-family: var(--sans); font-size: 15px; font-weight: 700; cursor: pointer; transition: background .15s, transform .1s; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; }
.btn-login:hover { background: #b8861e; }
.btn-login:active { transform: scale(.99); }
.btn-login:disabled { opacity: .65; cursor: not-allowed; }
.login-error { background: #FEF2F2; color: var(--barn); border-radius: 10px; padding: 11px 14px; font-size: 14px; margin-bottom: 18px; display: none; border: 1px solid #fecaca; }
.login-error.show { display: block; }
.login-spinner svg { animation: spin .8s linear infinite; width: 18px; height: 18px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 768px) {
  .login-root { flex-direction: column; }
  .login-left { padding: 36px 28px; min-height: auto; }
  .login-tagline { font-size: 30px; }
  .login-right { width: auto; padding: 36px 28px; align-items: flex-start; }
}

/* ===== APP LAYOUT ===== */
.app { display: flex; height: 100vh; width: 100%; overflow: hidden; }
.app { height: 100dvh; } /* mobile-friendly */

/* Sidebar — white */
.sidebar { width: 240px; flex: none; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 22px 16px; }
.sidebar-logo { display: flex; align-items: center; gap: 0; padding: 4px 8px 22px 8px; }
.sidebar-logo img { height: 52px; width: auto; }
.nav-section { min-height: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav-btn { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; border: none; padding: 10px 12px; border-radius: 10px; cursor: pointer; text-align: left; font-family: var(--sans); font-size: 14.5px; font-weight: 700; color: var(--text-2); background: none; transition: background .15s, color .15s; }
.nav-btn:hover { background: var(--gold-bg); }
.nav-btn.active { background: var(--gold-bg); color: var(--gold); }
.nav-btn svg { flex: none; }
.nav-badge { margin-left: auto; background: #B0432B; color: #FFF; font-size: 11px; font-weight: 700; border-radius: 99px; min-width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; padding: 0 5px; line-height: 1; flex: none; }
.module-nav-group + .module-nav-group { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.module-nav-toggle { width: 100%; border: 0; background: none; display: flex; align-items: center; gap: 9px; padding: 7px 8px; color: var(--text); font: 900 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.module-nav-mark { width: 21px; height: 21px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; letter-spacing: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.module-nav-mark.workflow { background: var(--primary); }
.module-nav-mark.crm { background: linear-gradient(145deg, #C99520, #8E6B3A); }
.module-nav-chevron { margin-left: auto; color: var(--muted); font-size: 16px; transform: rotate(-90deg); transition: transform .18s ease; }
.module-nav-chevron.open { transform: rotate(0); }
.module-nav-items { display: flex; flex-direction: column; max-height: 620px; overflow: hidden; transition: max-height .2s ease, opacity .18s ease; opacity: 1; }
.module-nav-items.collapsed { max-height: 0; opacity: 0; }
.module-nav-items .nav-btn { padding-left: 15px; }

/* --- sidebar reordering ------------------------------------------------- */
.module-nav-items .nav-btn { padding-right: 26px; }
.nav-drag-handle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 22px; border-radius: 5px; cursor: grab;
  color: var(--muted, #9a8a78); opacity: 0; transition: opacity .14s, background .14s;
  touch-action: none;
}
.nav-btn:hover .nav-drag-handle,
.nav-btn:focus-visible .nav-drag-handle { opacity: .75; }
.nav-drag-handle:hover { opacity: 1; background: rgba(0,0,0,.06); }
.nav-drag-handle:active { cursor: grabbing; }
.nav-btn.nav-dragging {
  opacity: .95; cursor: grabbing;
  background: var(--gold-bg, #f6f1e6);
  box-shadow: 0 6px 18px rgba(0,0,0,.16); position: relative; z-index: 3;
}
.nav-btn.nav-dragging .nav-drag-handle { opacity: 1; cursor: grabbing; }
/* The container grows a touch so the lifted row has somewhere to go, and the
   max-height transition from the collapse animation must not clip it. */
.module-nav-items.nav-reordering { max-height: none; }
.module-nav-items.nav-reordering .nav-btn:not(.nav-dragging) { transition: transform .16s ease; }
body.nav-drag-active { user-select: none; -webkit-user-select: none; }
body.nav-drag-active .nav-btn { cursor: grabbing; }

.nav-reset {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; margin-left: 2px; border-radius: 5px;
  font-size: 13px; line-height: 1; color: var(--muted, #9a8a78);
  cursor: pointer; flex: none; transition: background .14s, color .14s;
}
.nav-reset:hover, .nav-reset:focus-visible { background: rgba(0,0,0,.07); color: var(--text-2, #4a443c); }
.nav-reset[hidden] { display: none; }

@media (hover: none) {
  /* No hover on touch, so the handle is always visible and long-press drags. */
  .nav-drag-handle { opacity: .55; }
}
@media (prefers-reduced-motion: reduce) {
  .module-nav-items.nav-reordering .nav-btn { transition: none; }
}
.crm-group .nav-btn.active { background: linear-gradient(90deg, #F8E6B8 0%, rgba(248,230,184,.35) 100%); color: #74540F; }
.sidebar-projects { margin-top: 26px; padding: 0 8px; overflow-y: auto; flex: 1; }
.sidebar-projects-label { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.sidebar-project { display: flex; align-items: center; gap: 9px; width: 100%; border: none; background: none; padding: 7px 8px; border-radius: 8px; cursor: pointer; text-align: left; color: var(--text-2); font-family: var(--sans); font-size: 14px; transition: background .15s; }
.sidebar-project:hover { background: var(--gold-bg); }
.sidebar-project .dot { width: 7px; height: 7px; border-radius: 99px; flex: none; }
.sidebar-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-top: 1px solid var(--border); }
.avatar { border-radius: 99px; display: flex; align-items: center; justify-content: center; color: #FFF; font-weight: 700; flex: none; }
.avatar-sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar-md { width: 30px; height: 30px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }

/* Main */
.main { flex: 1; overflow-y: auto; position: relative; background: var(--bg); }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: 16px 32px; background: rgba(246,241,231,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar-date { font-size: 13px; color: var(--muted); }
.ask-btn { display: flex; align-items: center; gap: 9px; padding: 9px 16px 9px 13px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; font-family: var(--sans); font-size: 14px; color: var(--text-2); box-shadow: 0 1px 2px rgba(61,46,34,.04); transition: border-color .15s, color .15s; }
.ask-btn:hover { border-color: var(--gold); color: var(--gold); }
.ask-btn .kbd { font-size: 11px; font-family: var(--mono); color: var(--muted); border: 1px solid var(--border-2); border-radius: 5px; padding: 1px 5px; }
.content { max-width: 1280px; margin: 0 auto; padding: 24px 32px 80px 32px; }

/* Typography */
.section-label { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.page-title { font-family: var(--sans); font-size: 42px; line-height: 1.08; color: var(--gold); margin-bottom: 22px; font-weight: 700; }
.page-title-sm { font-family: var(--sans); font-size: 38px; line-height: 1.1; color: var(--gold); margin: 0; font-weight: 700; }
.page-desc { font-size: 15px; line-height: 1.5; color: var(--text-2); margin: 8px 0 0 0; max-width: 640px; }
.card-title { font-family: var(--sans); font-size: 22px; color: var(--gold); font-weight: 700; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 1px 3px rgba(61,46,34,.04); }
.card-pad { padding: 24px 26px; }
/* A card whose children run to the edges (lists, tables) and manage their own
   padding. Named so a page can say which it wants instead of inlining styles. */
.card-flush { padding: 0; overflow: hidden; }
.card + .card { margin-top: 16px; }

/* Page header: title and description on the left, actions on the right.
   Used by eight screens and defined by none of them until now — which is why
   the action buttons were dropping underneath the description. */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head > div:first-child, .page-head-main { flex: 1; min-width: 260px; }
.page-head h1 { margin: 0; font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1.15; }
.page-head .page-desc { margin-top: 6px; }
.page-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: none; }

/* A row of fields that sit side by side and stack on a narrow screen. Was only
   ever defined inside .api-key-form, so it did nothing everywhere else. */
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row > .form-field { flex: 1; min-width: 180px; }
/* A footer of actions inside a card. */
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.card-pad-sm { padding: 20px; }

/* AI summary */
.ai-summary { margin-bottom: 26px; }
.ai-badge { width: 24px; height: 24px; border-radius: 7px; background: var(--gold); display: flex; align-items: center; justify-content: center; flex: none; }
.ai-text { font-family: var(--sans); font-size: 20px; line-height: 1.5; color: var(--text); margin: 0 0 18px 0; font-weight: 700; }
.chip-row { display: flex; flex-wrap: wrap; gap: 9px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--bg); cursor: pointer; font-family: var(--sans); font-size: 13.5px; font-weight: 700; color: var(--text); transition: background .15s; }
.chip:hover { background: var(--gold-bg); border-color: var(--gold); }

/* Task items */
.task-item { display: flex; align-items: flex-start; gap: 13px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 15px 17px; cursor: pointer; box-shadow: 0 1px 2px rgba(61,46,34,.04); transition: box-shadow .2s, transform .2s; }
.task-item:hover { box-shadow: 0 8px 22px -8px rgba(61,46,34,.12); transform: translateY(-2px); }
.checkbox { width: 20px; height: 20px; border-radius: 7px; flex: none; margin-top: 1px; border: 2px solid var(--border-2); background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.checkbox.done { border-color: var(--green); background: var(--green); }
.checkbox svg { opacity: 0; }
.checkbox.done svg { opacity: 1; }
.task-title { font-size: 15px; font-weight: 700; line-height: 1.35; color: var(--text); }
.task-title.done { color: var(--muted); text-decoration: line-through; }
.task-meta { display: flex; align-items: center; gap: 10px; margin-top: 5px; font-size: 12px; color: var(--muted); }
.ai-flag { font-size: 11px; font-weight: 700; color: var(--gold); background: var(--gold-bg); border-radius: 999px; padding: 3px 9px; flex: none; }

/* Stats */
.stat-row { display: flex; flex-direction: column; gap: 13px; }
.stat-row .stat { display: flex; align-items: baseline; justify-content: space-between; }
.stat-row .stat .label { font-size: 14px; color: var(--text-2); }
.stat-row .stat .value { font-family: var(--sans); font-size: 28px; color: var(--gold); font-weight: 700; }
.stat-divider { height: 1px; background: var(--border); }

/* Project cards */
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.project-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 24px; cursor: pointer; box-shadow: 0 1px 3px rgba(61,46,34,.04); transition: box-shadow .2s, transform .2s; }
.project-card:hover { box-shadow: 0 8px 28px -10px rgba(61,46,34,.14); transform: translateY(-2px); }
/* B6 — per-user drag-to-arrange */
.card-drag-handle { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px; color: var(--muted); cursor: grab; opacity: 0; transition: opacity .15s, background .15s; z-index: 2; }
.project-card:hover .card-drag-handle { opacity: .55; }
.card-drag-handle:hover { opacity: 1; background: var(--gold-bg); color: var(--gold-dark); }
.card-drag-handle:active { cursor: grabbing; }
.project-card.card-dragging { opacity: .5; box-shadow: 0 12px 32px -8px rgba(61,46,34,.28); transform: none; }
.project-card.card-drag-over { outline: 2px dashed var(--gold); outline-offset: 2px; }
.project-card .pc-title { font-family: var(--sans); font-size: 28px; color: var(--gold); margin-bottom: 8px; line-height: 1.1; font-weight: 700; }
.project-card .pc-desc { font-size: 14px; line-height: 1.5; color: var(--text-2); margin: 0 0 16px 0; min-height: 40px; }
.health-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 10px; }
.health-pill .dot { width: 7px; height: 7px; border-radius: 99px; }
.progress-bar { height: 7px; border-radius: 99px; background: var(--sand); overflow: hidden; margin-bottom: 10px; }
.progress-bar .fill { height: 100%; border-radius: 99px; }
.project-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.pc-metrics { display: flex; gap: 16px; margin-bottom: 14px; }
.pc-metric { display: flex; flex-direction: column; gap: 2px; }
.pc-metric .num { font-family: var(--sans); font-size: 20px; color: var(--gold); line-height: 1; font-weight: 700; }
.pc-metric .label { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.pc-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.pc-team { display: flex; align-items: center; }
.pc-team .avatar { border: 2px solid var(--surface); margin-left: -7px; }

/* Status chips */
.status-chips { display: flex; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.status-chip { display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 11px 16px; flex: 1; min-width: 140px; }
.status-chip .num { font-family: var(--sans); font-size: 22px; color: var(--gold); font-weight: 700; }
.status-chip .label { font-size: 13px; color: var(--text-2); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; font-family: var(--sans); font-size: 13.5px; font-weight: 700; color: var(--gold); transition: background .15s; }
.btn:hover { background: var(--gold-bg); }
.btn-primary { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 10px; border: none; background: var(--gold); color: #FFF; cursor: pointer; font-family: var(--sans); font-size: 13.5px; font-weight: 700; box-shadow: 0 2px 8px rgba(126,101,73,.2); transition: background .15s; flex: none; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border-2); background: none; cursor: pointer; font-family: var(--sans); font-size: 13.5px; font-weight: 700; color: var(--text-2); }
.btn-secondary:hover { background: var(--gold-bg); }
.btn-danger { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; border-radius: 12px; border: none; background: var(--red); color: #FFF; cursor: pointer; font-family: var(--sans); font-size: 14px; font-weight: 700; }
.btn-danger:hover { filter: brightness(.9); }
.btn-ghost { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px; border: none; background: none; cursor: pointer; font-family: var(--sans); font-size: 13.5px; font-weight: 700; color: var(--text-2); }
.btn-ghost:hover { background: var(--gold-bg); }

/* Small variant. Was previously defined only inside .crm-native and .acc-page,
   so the same class rendered as an unstyled browser button anywhere else. */
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 8px; gap: 5px; }

/* The save/cancel pair used by the settings connection forms had no styling at
   all — they are the primary and secondary buttons under different names. */
.btn-save { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 10px; border: none; background: var(--gold); color: #FFF; cursor: pointer; font-family: var(--sans); font-size: 13.5px; font-weight: 700; box-shadow: 0 2px 8px rgba(126,101,73,.2); transition: background .15s; }
.btn-save:hover { background: var(--primary-dark); }
.btn-cancel { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; font-family: var(--sans); font-size: 13.5px; font-weight: 700; color: var(--text-2); transition: background .15s; }
.btn-cancel:hover { background: var(--gold-bg); }

/* Anything disabled reads as disabled, whichever button it is. */
.btn:disabled, .btn-primary:disabled, .btn-secondary:disabled, .btn-ghost:disabled,
.btn-danger:disabled, .btn-save:disabled, .btn-cancel:disabled {
  opacity: .5; cursor: not-allowed; box-shadow: none;
}

/* A link that has to sit in a row of buttons — the browser will not style an
   <a> like a <button>, so every page that mixed the two looked broken. */
a.btn, a.btn-primary, a.btn-secondary, a.btn-ghost, a.btn-danger, a.btn-save, a.btn-cancel {
  text-decoration: none; line-height: 1.2;
}

/* Forms */
.form-field { margin-bottom: 16px; }
.form-label { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; display: block; text-transform: uppercase; letter-spacing: .06em; }
.form-input { width: 100%; border: 1px solid var(--border-2); border-radius: 10px; padding: 11px 15px; font-family: var(--sans); font-size: 15px; color: var(--text); background: var(--bg); outline: none; transition: border-color .15s; }
.form-input:focus { border-color: var(--gold); }
.form-textarea { width: 100%; border: 1px solid var(--border-2); border-radius: 10px; padding: 11px 15px; font-family: var(--sans); font-size: 15px; color: var(--text); background: var(--bg); outline: none; resize: vertical; min-height: 80px; transition: border-color .15s; }
.form-textarea:focus { border-color: var(--gold); }
.form-select { width: 100%; border: 1px solid var(--border-2); border-radius: 10px; padding: 11px 15px; font-family: var(--sans); font-size: 15px; color: var(--text); background: var(--bg); outline: none; }

/* Add task form */
.add-task-form { background: var(--surface); border: 1px solid var(--border-2); border-radius: 14px; padding: 18px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(61,46,34,.04); }
.add-task-form > input#new-task-title { width: 100%; border: none; outline: none; background: none; font-family: var(--sans); font-size: 16px; color: var(--text); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.add-task-fields { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.add-task-field { display: flex; flex-direction: column; }
.add-task-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; display: block; margin-bottom: 6px; }
.add-task-date { border: 1px solid var(--border-2); border-radius: 8px; padding: 8px 12px; font-size: 14px; color: var(--text); background: var(--bg); font-family: var(--sans); }
.add-task-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
@media (max-width: 640px) {
  .add-task-fields { flex-direction: column; gap: 14px; }
  .add-task-field { width: 100%; }
}
.assignee-row { display: flex; align-items: center; gap: 7px; }
.assignee-btn { width: 30px; height: 30px; border-radius: 99px; border: none; padding: 0; cursor: pointer; color: #FFF; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.assignee-btn.selected { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--gold); }

/* Task groups */
.task-group { margin-bottom: 22px; }
.task-group-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.task-group-header .dot { width: 9px; height: 9px; border-radius: 99px; }
.task-group-header .label { font-size: 13px; font-weight: 700; color: var(--text); }
.task-group-header .count { font-size: 12px; color: var(--muted); }
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-row { position: relative; display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px; cursor: pointer; transition: box-shadow .2s, transform .2s; }
.task-row:hover { box-shadow: 0 6px 16px -8px rgba(61,46,34,.12); transform: translateY(-1px); }
.task-row .task-checkbox { width: 18px; height: 18px; border-radius: 6px; flex: none; cursor: pointer; border: 2px solid var(--border-2); background: transparent; display: flex; align-items: center; justify-content: center; }
.task-row .task-checkbox.done { border-color: var(--green); background: var(--green); }
.task-row .task-checkbox svg { opacity: 0; }
.task-row .task-checkbox.done svg { opacity: 1; }
.task-row .task-name { flex: 1; font-size: 14.5px; color: var(--text); }
.task-row .task-name.done { color: var(--muted); text-decoration: line-through; }
.task-name-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.task-name-wrap .task-name { flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-crm-context { overflow: hidden; color: #8C6510; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.comment-indicator { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }

/* Files */
.file-row { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 11px 14px; }
.file-icon { width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.file-icon span { font-size: 9.5px; font-weight: 700; color: #FFF; letter-spacing: .03em; }
.file-name { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.file-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
/* One upload zone for every files panel (project / workspace / task). It used to
   be duplicated as .task-upload-zone, which is why only the task page lit up on
   drag. No margin here — .cat-toggle-body owns the spacing via its row gap. */
.upload-zone, .task-upload-zone { display: flex; align-items: center; justify-content: center; gap: 9px; border: 1.5px dashed rgba(126,101,73,.25); border-radius: 14px; padding: 18px; cursor: pointer; color: var(--muted); font-size: 13.5px; background: var(--surface-2); transition: border-color .15s, color .15s, background .15s; }
.upload-zone:hover, .upload-zone.drag-over,
.task-upload-zone:hover, .task-upload-zone.drag-over { border-color: var(--gold); color: var(--gold); background: var(--gold-bg); }

/* File folders (B4b) */
.folder-block { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.folder-header { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; }
.folder-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer; padding: 9px 8px; text-align: left; font-family: var(--sans); color: var(--text); }
.folder-toggle:hover { color: var(--gold-dark); }
.folder-chevron { display: inline-flex; color: var(--muted); flex: none; }
.folder-icon { display: inline-flex; color: var(--gold); flex: none; }
.folder-name { font-size: 14.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-count { font-size: 12px; color: var(--muted); background: var(--bg); border-radius: 99px; padding: 1px 8px; flex: none; }
.folder-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.folder-body { padding: 4px 12px 12px 12px; display: flex; flex-direction: column; gap: 8px; }

/* Chat */
.chat-panel { position: sticky; top: 84px; display: flex; flex-direction: column; height: calc(100vh - 168px); max-height: 620px; min-height: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.chat-header { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); flex: none; }
.chat-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.chat-msg { display: flex; gap: 10px; }
.chat-msg .msg-bubble { font-size: 14px; line-height: 1.45; border-radius: 12px; padding: 9px 12px; display: inline-block; }
.chat-msg.me { flex-direction: row-reverse; }
.chat-msg.me .msg-bubble { background: var(--gold-bg); border: 1px solid rgba(126,101,73,.15); }
.chat-msg:not(.me) .msg-bubble { background: var(--bg); border: 1px solid var(--border); }
.chat-input-row { flex: none; padding: 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: center; background: var(--surface); }
.chat-input-wrap { flex: 1; min-width: 0; position: relative; }
.chat-input { width: 100%; flex: 1; border: 1px solid var(--border-2); border-radius: 999px; padding: 11px 16px; outline: none; background: var(--bg); font-family: var(--sans); font-size: 14px; color: var(--text); }
.chat-input:focus { border-color: var(--gold); }
.chat-send { width: 38px; height: 38px; border-radius: 999px; border: none; background: var(--gold); color: #FFF; cursor: pointer; display: flex; align-items: center; justify-content: center; flex: none; }
.chat-send:hover { background: var(--primary-dark); }

/* Messages layout */
.msg-layout { display: grid; grid-template-columns: 260px 1fr; height: calc(100vh - 210px); max-height: 680px; min-height: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.chat-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.conv-list { border-right: 1px solid var(--border); overflow-y: auto; padding: 16px 12px; background: var(--surface-2); }
.conv-list-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 6px; margin-bottom: 8px; }
.conv-btn { display: flex; align-items: center; gap: 10px; width: 100%; border: none; padding: 9px 11px; border-radius: 10px; cursor: pointer; text-align: left; font-family: var(--sans); font-size: 14px; color: var(--text-2); background: none; transition: background .15s; }
.conv-btn:hover { background: var(--gold-bg); }
.conv-btn.active { background: var(--gold-bg); color: var(--gold); font-weight: 700; }
/* Channel row with an on-hover delete button */
.conv-row { position: relative; display: flex; align-items: center; }
.conv-row .conv-btn { flex: 1; min-width: 0; padding-right: 34px; }
.conv-delete { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: none; background: none; cursor: pointer; color: var(--muted); padding: 5px; border-radius: 7px; display: none; align-items: center; justify-content: center; line-height: 0; transition: background .12s, color .12s; }
.conv-delete svg { width: 15px; height: 15px; }
.conv-row:hover .conv-delete { display: flex; }
.conv-delete:hover { background: #F4D6CC; color: #B0432B; }

/* C2 — collapsible conversation sections */
.conv-section { margin-bottom: 6px; }
.conv-sec-header { display: flex; align-items: center; gap: 8px; width: 100%; border: none; background: none; cursor: pointer; padding: 7px 6px; border-radius: 8px; font-family: var(--sans); text-align: left; transition: background .15s; }
.conv-sec-header:hover { background: var(--gold-bg); }
.conv-sec-chevron { font-size: 11px; color: var(--muted); width: 12px; flex: none; text-align: center; }
.conv-sec-label { flex: 1; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-sec-badge { flex: none; font-size: 11px; font-weight: 700; color: #fff; background: var(--gold); border-radius: 99px; padding: 1px 8px; min-width: 18px; text-align: center; }
.conv-section.open .conv-sec-chevron { color: var(--gold); }
.conv-sec-body { padding: 4px 0 6px 4px; }

/* Settings */
.settings-page { max-width: 960px; }
.settings-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 24px; box-shadow: 0 1px 3px rgba(61,46,34,.04); margin-bottom: 18px; }
.settings-card h3 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.settings-card .desc { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.settings-index { position: sticky; top: 73px; z-index: 4; display: flex; flex-wrap: wrap; gap: 5px; width: fit-content; padding: 5px; margin-bottom: 18px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.9); backdrop-filter: blur(8px); }
.settings-index a, .settings-index button { padding: 7px 12px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font-family: var(--sans); font-size: 11.5px; font-weight: 800; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .14s, color .14s; }
.settings-index a:hover, .settings-index button:hover { background: var(--gold-bg); color: var(--gold); }
.settings-index button.active { background: var(--gold); color: #FFF; }
.settings-index button.active:hover { background: var(--primary-dark); color: #FFF; }
.settings-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }.settings-section-kicker { display: block; margin-bottom: 5px; color: #8C6510; font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }.workflow-always-pill { padding: 6px 10px; border-radius: 999px; background: #E8F0E4; color: #3F6A3B; font-size: 10px; font-weight: 900; white-space: nowrap; }
.module-access-table { margin-top: 8px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }.module-access-row { display: grid; grid-template-columns: 190px 1fr; gap: 18px; padding: 16px; border-bottom: 1px solid var(--border); }.module-access-row:last-child { border-bottom: 0; }.module-access-person strong,.module-access-person small { display: block; }.module-access-person strong { font-size: 13px; }.module-access-person small { max-width: 180px; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }.module-access-options { display: flex; flex-wrap: wrap; gap: 6px; }.module-access-chip { position: relative; display: inline-flex; align-items: center; padding: 6px 9px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface); color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 800; transition: all .14s; }.module-access-chip input { position: absolute; opacity: 0; pointer-events: none; }.module-access-chip.checked { border-color: rgba(201,149,32,.4); background: #F8EED2; color: #74540F; }.module-access-chip.locked { border-color: #CFE0D1; background: #E8F0E4; color: #3F6A3B; cursor: default; }.settings-check-row { display: flex; align-items: center; gap: 11px; margin-top: 15px; padding: 12px; border: 1px solid var(--border); border-radius: 11px; cursor: pointer; }.settings-check-row input { width: 18px; height: 18px; accent-color: var(--gold); }.settings-check-row strong,.settings-check-row small { display: block; }.settings-check-row strong { font-size: 12px; }.settings-check-row small { color: var(--muted); font-size: 10px; }.settings-subsection { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border); }.settings-subsection h4 { margin: 0 0 5px; font-size: 15px; }.crm-rolemap-list { margin-top: 12px; }.crm-rolemap-row { display: grid; grid-template-columns: minmax(180px,1fr) 22px minmax(130px,180px); gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); }.crm-rolemap-row > div { display: flex; flex-direction: column; gap: 2px; }.crm-rolemap-row small { color: var(--muted); font-size: 12px; }.crm-rolemap-row > span { color: var(--muted); text-align: center; }
.crm-advanced-settings summary { cursor:pointer;color:var(--text);font-size:14px;font-weight:800; }.crm-advanced-settings[open] summary { margin-bottom:7px; }.crm-advanced-settings iframe { display:block;width:100%;height:1200px;margin-top:14px;border:1px solid var(--border);border-radius:13px;background:#fbfaf7; }
@media (max-width: 720px) { .module-access-row { grid-template-columns:1fr;gap:10px; }.settings-section-head { flex-direction:column; }.settings-index { top:62px;max-width:100%;overflow-x:auto;flex-wrap:nowrap; }.settings-index a { white-space:nowrap; } }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-top: 1px solid var(--border); }
.setting-row .label { font-size: 14.5px; color: var(--text); }
.toggle { width: 44px; height: 26px; border-radius: 999px; border: none; cursor: pointer; position: relative; flex: none; transition: background .2s; }
.toggle.on { background: var(--gold); }
.toggle.off { background: #D9CDB8; }
.toggle .knob { position: absolute; top: 3px; width: 20px; height: 20px; border-radius: 99px; background: #FFF; box-shadow: 0 1px 2px rgba(0,0,0,.15); transition: left .2s; }
.toggle.on .knob { left: 21px; }
.toggle.off .knob { left: 3px; }

/* AI API keys */
.api-provider { display: flex; align-items: center; gap: 14px; padding: 18px 0; border-top: 1px solid var(--border); }
.api-provider:first-of-type { border-top: none; }
.api-provider .provider-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none; background: var(--gold-bg); }
.api-provider .provider-info { flex: 1; }
.api-provider .provider-name { font-size: 15px; font-weight: 700; color: var(--text); }
.api-provider .provider-desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.api-provider .status-pill { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 4px 10px; }
.status-pill.connected { background: var(--sage-bg); color: #4F6B3F; }
.status-pill.not-connected { background: var(--sand); color: var(--text-2); }
.api-key-form { display: none; margin-top: 14px; padding: 16px; background: var(--bg); border-radius: 12px; }
.api-key-form.show { display: block; }
.api-key-form .form-row { display: flex; gap: 12px; margin-bottom: 12px; }
.api-key-form .form-field { flex: 1; }
.api-key-form input { width: 100%; border: 1px solid var(--border-2); border-radius: 10px; padding: 10px 14px; font-family: var(--sans); font-size: 14px; color: var(--text); background: var(--surface); outline: none; }
.api-key-form input:focus { border-color: var(--gold); }
.api-key-form .actions { display: flex; gap: 10px; justify-content: flex-end; }
.btn-connect { padding: 8px 16px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; font-family: var(--sans); font-size: 13.5px; font-weight: 700; color: var(--gold); }
.btn-connect:hover { background: var(--gold-bg); }
.btn-disconnect { padding: 8px 16px; border-radius: 10px; border: 1px solid var(--border-2); background: none; cursor: pointer; font-family: var(--sans); font-size: 13.5px; font-weight: 700; color: var(--text-2); }
.btn-disconnect:hover { background: var(--bg); }

/* Ask VGo modal */
.ask-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(61,46,34,.25); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; animation: vgOverlay .18s ease both; }
.ask-modal { width: 600px; max-width: 92vw; background: var(--surface); border-radius: 20px; box-shadow: 0 24px 48px -16px rgba(61,46,34,.2), 0 4px 12px rgba(61,46,34,.06); overflow: hidden; animation: vgPop .24s cubic-bezier(.34,1.56,.64,1) both; }
.ask-header { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.ask-input { flex: 1; border: none; outline: none; background: none; font-family: var(--sans); font-size: 17px; color: var(--text); }
.ask-esc { font-size: 11px; font-family: var(--mono); color: var(--muted); border: 1px solid var(--border-2); border-radius: 5px; padding: 2px 6px; }
.ask-body { padding: 16px 20px 22px 20px; }
.ask-suggestions { display: flex; flex-direction: column; gap: 4px; }
.ask-suggestion { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: none; background: none; padding: 11px 12px; border-radius: 11px; cursor: pointer; font-family: var(--sans); }
.ask-suggestion:hover { background: var(--gold-bg); }
.ask-suggestion .icon { width: 30px; height: 30px; border-radius: 8px; background: var(--gold-bg); display: flex; align-items: center; justify-content: center; flex: none; color: var(--gold); }
.ask-suggestion .label { font-size: 14.5px; color: var(--text); }
.ask-answer { padding: 20px 22px 24px 22px; }
.ask-answer-text { font-family: var(--sans); font-size: 19px; line-height: 1.5; margin-bottom: 16px; color: var(--text); font-weight: 700; }

/* Task drawer */
.drawer-overlay { position: fixed; inset: 0; z-index: 40; background: rgba(61,46,34,.2); animation: vgOverlay .18s ease both; display: flex; justify-content: flex-end; }
.task-drawer { width: 440px; max-width: 94vw; height: 100%; background: var(--surface); border-left: 1px solid var(--border); box-shadow: -24px 0 48px -16px rgba(61,46,34,.15); display: flex; flex-direction: column; animation: vgSlideR .26s cubic-bezier(.22,1,.36,1) both; }
.drawer-header { flex: none; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px; }
.drawer-footer { flex: none; padding: 14px 18px; border-top: 1px solid var(--border); display: flex; gap: 9px; align-items: center; }
.drawer-close { width: 30px; height: 30px; border-radius: 8px; border: none; background: none; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.drawer-close:hover { background: var(--gold-bg); color: var(--gold); }

/* Member list */
.member-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.role-pill { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 12px; }
.invite-row { display: flex; gap: 9px; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 9px 9px 9px 15px; margin-bottom: 18px; flex-wrap: wrap; }
.invite-row input { flex: 1; min-width: 160px; border: none; outline: none; background: none; font-family: var(--sans); font-size: 14.5px; color: var(--text); }
.role-toggle { display: flex; background: var(--surface); border: 1px solid var(--border-2); border-radius: 9px; padding: 2px; }
.role-toggle button { padding: 6px 13px; border-radius: 7px; border: none; cursor: pointer; font-family: var(--sans); font-size: 13px; font-weight: 700; }
.role-toggle button.active { background: var(--gold); color: #FFF; }
.role-toggle button:not(.active) { background: transparent; color: var(--text-2); }

/* ===== IN-APP MODAL ===== */
.modal-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(61,46,34,.25); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; animation: vgOverlay .15s ease both; }
.modal { background: var(--surface); border-radius: 20px; box-shadow: 0 24px 48px -16px rgba(61,46,34,.2), 0 4px 12px rgba(61,46,34,.06); width: 520px; max-width: 92vw; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; animation: vgPop .2s cubic-bezier(.34,1.56,.64,1) both; }
.modal-header { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-family: var(--sans); font-size: 24px; color: var(--gold); font-weight: 700; }
.modal-body { flex: 1; overflow-y: auto; padding: 24px; }
.modal-footer { flex: none; display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--border); }

/* ===== TOAST ===== */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--gold); border-radius: 12px; padding: 14px 18px; box-shadow: 0 8px 24px -8px rgba(61,46,34,.15); font-size: 14px; font-weight: 700; color: var(--text); animation: vgToast .25s ease both; max-width: 360px; }
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast .toast-msg { display: flex; align-items: center; gap: 8px; }

/* ===== EMPTY STATES ===== */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state svg { margin-bottom: 12px; opacity: .4; }
.empty-state .title { font-family: var(--sans); font-size: 20px; color: var(--text-2); margin-bottom: 6px; font-weight: 700; }
.empty-state .desc { font-size: 14px; }

/* Utility */
.grid-2 { display: grid; grid-template-columns: 1fr 320px; gap: 26px; align-items: start; }
.grid-2-proj { display: grid; grid-template-columns: 1fr 360px; gap: 26px; align-items: start; }
.hidden { display: none !important; }
.back-link { display: inline-flex; align-items: center; gap: 7px; background: #3D2E22; border: none; cursor: pointer; color: #FFFFFF; font-family: var(--sans); font-size: 13px; font-weight: 700; padding: 8px 14px; border-radius: 8px; margin-bottom: 16px; transition: background .15s, transform .1s; }
.back-link:hover { background: #5C4A38; color: #FFFFFF; }
.back-link:active { transform: scale(.97); }

/* C3 — multi-level project breadcrumbs */
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 13px; margin: -6px 0 16px 2px; }
.crumb-link { background: none; border: none; cursor: pointer; color: var(--muted); font-family: var(--sans); font-size: 13px; font-weight: 600; padding: 2px 4px; border-radius: 6px; transition: color .15s, background .15s; }
.crumb-link:hover { color: var(--gold); background: var(--gold-bg); }
.crumb-sep { color: var(--muted); opacity: .55; font-size: 12px; }
.crumb-current { color: var(--text); font-weight: 700; padding: 2px 4px; }

.fade-in { animation: vgFade .3s ease both; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.font-bold { font-weight: 700; }
.font-serif { font-family: var(--serif); }

/* Danger zone */
.danger-zone { border: 1px solid var(--barn-bg); border-radius: 14px; padding: 20px; margin-top: 16px; background: #FFF8F5; }
.danger-zone h4 { font-size: 15px; font-weight: 700; color: var(--red); margin-bottom: 6px; }
.danger-zone p { font-size: 13px; color: var(--muted); margin-bottom: 14px; }

/* Responsive */
@media (max-width: 1200px) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}
/* Mobile menu button — hidden on desktop */
.mobile-menu-btn { display: none; }

/* Mobile bottom nav — hidden on desktop */
.mobile-nav { display: none; }

/* Sidebar overlay for mobile drawer */
.mobile-sidebar-overlay { display: none; }

@media (max-width: 768px) {
  /* ===== PREVENT HORIZONTAL SCROLL ===== */
  html, body { overflow-x: hidden; max-width: 100vw; position: relative; }
  *, *::before, *::after { box-sizing: border-box; }
  .app { width: 100%; max-width: 100vw; overflow-x: hidden; overflow-y: hidden; }
  .fade-in { max-width: 100%; overflow-x: hidden; }

  /* ===== HAMBURGER BUTTON ===== */
  .mobile-menu-btn {
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer; padding: 8px;
    border-radius: 8px; color: var(--text-2); margin-right: 8px;
    flex-shrink: 0; width: 40px; height: 40px;
  }
  .mobile-menu-btn:active { background: var(--gold-bg); }

  /* ===== SIDEBAR AS DRAWER ===== */
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 100;
    transform: translateX(-100%); transition: transform .25s cubic-bezier(.22,1,.36,1);
    box-shadow: 2px 0 16px rgba(61,46,34,.12);
    display: flex; max-width: 85vw;
  }
  .sidebar.sidebar-open { transform: translateX(0); }

  .mobile-sidebar-overlay {
    display: block; position: fixed; inset: 0; z-index: 99;
    background: rgba(61,46,34,.3); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none; transition: opacity .25s;
  }
  .mobile-sidebar-overlay.visible { opacity: 1; pointer-events: auto; }

  /* ===== TOPBAR ===== */
  .topbar { padding: 8px 12px; min-width: 0; gap: 6px; }
  .topbar > div { min-width: 0; }
  .topbar-date { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
  .topbar-search { display: none; }
  .ask-btn { padding: 6px 8px; flex-shrink: 0; }
  .ask-btn .kbd { display: none; }
  .ask-btn span:nth-child(2) { display: none; }
  .ask-btn span:nth-child(1) { display: none; }
  .notif-btn { padding: 5px !important; flex-shrink: 0; }
  .notif-panel { position: fixed; right: 8px; left: 8px; width: auto !important; }

  /* ===== SCROLLING ===== */
  .app { height: 100dvh; }
  .main { height: 100dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 64px; }

  /* ===== CONTENT ===== */
  .content { padding: 12px 12px 80px 12px; max-width: 100%; overflow-x: hidden; }
  .page-title { font-size: 22px; }
  .page-title-sm { font-size: 18px; }
  .back-link { font-size: 13px; }

  /* ===== GRIDS ===== */
  .project-grid { grid-template-columns: 1fr; gap: 12px; }
  .grid-2, .grid-2-proj { grid-template-columns: 1fr; gap: 16px; }
  .pc-metrics { flex-wrap: wrap; gap: 8px; }
  .meeting-stats { grid-template-columns: 1fr 1fr; gap: 10px; }

  /* ===== CARDS ===== */
  .project-card { padding: 14px; }
  .project-card .pc-title { font-size: 18px; }
  .cat-card { width: 100%; }
  .card-pad { padding: 12px; }
  .settings-card { padding: 14px; margin-bottom: 14px; }

  /* ===== TASKS ===== */
  .task-row { padding: 10px 12px; }
  .task-row .task-title { font-size: 14px; }
  .status-chip { min-width: 0; font-size: 12px; padding: 8px 10px; flex: 1; }
  .task-group-header { padding: 8px 12px; }
  .board-view { padding-bottom: 80px; gap: 10px; }
  .board-column { width: 260px; max-height: none; }
  .task-quick-menu { min-width: 120px; }

  /* ===== CHAT — show below content on mobile ===== */
  .grid-2-proj { grid-template-columns: 1fr; }
  .chat-panel {
    display: flex !important; position: static; height: 400px;
    margin-top: 20px; min-height: 300px;
  }

  /* ===== MESSAGES ===== */
  .msg-layout { grid-template-columns: 1fr; height: calc(100dvh - 140px); }
  .conv-list { display: none; }
  .chat-messages { padding: 12px; }
  .chat-input { font-size: 15px; }
  .chat-input-row { padding: 0; gap: 8px; }

  /* ===== SETTINGS ===== */
  .settings-page { max-width: 100%; }
  .settings-form { padding: 0; }
  .settings-section { padding: 12px; }
  .form-row { flex-direction: column; gap: 10px; }
  .password-form { max-width: 100%; }

  /* ===== BOTTOM NAV — bigger touch targets ===== */
  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 50; background: var(--surface); border-top: 1px solid var(--border);
    padding: 0 0 env(safe-area-inset-bottom, 0px) 0;
    height: 56px;
  }
  .mobile-nav-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; background: none; border: none; cursor: pointer;
    padding: 0; font-family: var(--sans); font-size: 10px; font-weight: 700;
    color: var(--muted); transition: color .15s; flex: 1; height: 100%;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-nav-btn:active { color: var(--gold); background: var(--gold-bg); }
  .mobile-nav-btn.active { color: var(--gold); }
  .mobile-nav-btn svg { width: 22px; height: 22px; }

  /* ===== DRAWERS / MODALS ===== */
  .task-drawer { width: 100%; max-width: 100vw; }
  .drawer-overlay { width: 100%; }
  .modal-card, .modal { width: 94vw; max-width: 94vw; }
  .modal-body { padding: 14px; }

  /* ===== MEETING ===== */
  .meeting-item { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px; }
  .meeting-section { padding: 14px; margin-bottom: 12px; }

  /* ===== INPUTS — 16px prevents iOS auto-zoom ===== */
  input, textarea, select { font-size: 16px; }
  .add-task-form input { font-size: 16px; }
  .form-input { font-size: 16px; }

  /* ===== SIDEBAR USER — prevent overflow ===== */
  .sidebar-user { overflow: hidden; max-width: 100%; }
  .sidebar-user > div { overflow: hidden; min-width: 0; }
  .sidebar-user > div > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }

  /* ===== PROJECT HEADER ===== */
  .pc-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .proj-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 0; }
  .proj-tab { white-space: nowrap; padding: 8px 12px; }

  /* ===== DAY PLAN ===== */
  .day-plan-card { padding: 12px; }
  .day-plan-content { font-size: 14px; max-width: 100%; }

  /* ===== MISC OVERFLOW PREVENTION ===== */
  .toast { max-width: calc(100vw - 24px); }
  .search-results { position: fixed; left: 8px; right: 8px; top: 56px; max-height: 300px; }
  .upload-zone, .task-upload-zone { padding: 16px; }
  .health-pill { font-size: 11px; padding: 3px 8px; }
  .progress-bar { max-width: 100%; }
  .pc-metrics > * { min-width: 0; }
  .invite-row { flex-wrap: wrap; gap: 8px; }
  .invite-row input { min-width: 0; }
  .role-toggle { flex-wrap: wrap; }

  /* ===== MESSAGES MOBILE ===== */
  .mobile-conv-toggle { display: flex !important; }
  .mobile-hide { display: none; }
  .conv-list {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 64px;
    z-index: 80; background: var(--surface); padding: 60px 16px 16px;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .conv-list.conv-list-mobile-open { display: block; }
  .msg-layout { grid-template-columns: 1fr; height: calc(100dvh - 140px); }
}
/* ===== MEETING POINTS ===== */
.meeting-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 28px; }
.meeting-stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(61,46,34,.04); }
.meeting-stat-num { font-family: var(--sans); font-size: 32px; line-height: 1; margin-bottom: 4px; font-weight: 700; }
.meeting-stat-label { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.meeting-section { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 22px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(61,46,34,.04); }
.meeting-section.meeting-urgent { border: 1px solid var(--border); }
.meeting-section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.meeting-priority-badge { font-size: 12px; font-weight: 700; letter-spacing: .1em; padding: 5px 14px; border-radius: 8px; }
.meeting-priority-badge.urgent { background: #B0432B; color: #FFF; }
.meeting-priority-badge.normal { background: var(--gold-bg); color: var(--gold); }
.meeting-section-count { font-size: 13px; color: var(--muted); }
.meeting-list { display: flex; flex-direction: column; gap: 10px; }
.meeting-item { display: flex; align-items: center; gap: 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; cursor: pointer; transition: box-shadow .2s, transform .2s; overflow: hidden; }
.meeting-item:hover { box-shadow: 0 6px 16px -8px rgba(61,46,34,.12); transform: translateY(-1px); }
.meeting-item-main { flex: 1; min-width: 0; }
.meeting-item-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.meeting-item-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.meeting-status { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.meeting-item-assignee { display: flex; align-items: center; gap: 8px; flex: none; }
.meeting-item-assignee span { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; }
@media (max-width: 768px) { .meeting-stats { grid-template-columns: 1fr 1fr; } .meeting-item { flex-direction: column; align-items: flex-start; gap: 10px; } }

/* ===== MY TASKS ===== */

/* ===== INLINE EDIT ===== */
.editable-text { cursor: text; border-radius: 6px; padding: 2px 6px; margin: -2px -6px; transition: background .15s; }
.editable-text:hover { background: var(--gold-bg); }
.inline-edit-input { width: 100%; border: 1px solid var(--gold); border-radius: 6px; padding: 2px 6px; font: inherit; color: inherit; background: var(--surface); outline: none; }
.inline-edit-area { width: 100%; border: 1px solid var(--gold); border-radius: 8px; padding: 8px 10px; font: inherit; color: inherit; background: var(--surface); outline: none; resize: vertical; min-height: 60px; }
.edit-icon { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .15s; }
.editable-text:hover .edit-icon { opacity: 1; }
.task-title-editable:hover { background: var(--gold-bg); cursor: text; }

/* ===== MEETING ITEM CHECKBOX ===== */
.meeting-item { position: relative; }
.meeting-item-checkbox { flex: none; display: flex; align-items: center; }
.meeting-item-checkbox .task-checkbox { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border-2); background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.meeting-item-checkbox .task-checkbox:hover { border-color: var(--green); background: var(--green); }
.meeting-item-checkbox .task-checkbox svg { opacity: 0; }
.meeting-item-checkbox .task-checkbox:hover svg { opacity: 1; }

/* ===== DAY PLAN ===== */
.day-plan-card { padding: 30px 40px; box-shadow: 0 2px 8px rgba(61,46,34,.06); }
.day-plan-content { font-size: 16px; line-height: 1.7; color: var(--text); max-width: 760px; }
.day-plan-content h3 { font-family: var(--sans); font-size: 20px; color: var(--gold); margin: 20px 0 10px; font-weight: 700; }
.day-plan-content h3:first-child { margin-top: 0; }
.day-plan-content p { margin-bottom: 12px; }
.day-plan-content ul { margin: 8px 0 16px 0; padding-left: 0; list-style: none; }
.day-plan-content li { position: relative; padding-left: 22px; margin-bottom: 8px; }
.day-plan-content li::before { content: ''; position: absolute; left: 0; top: 9px; width: 8px; height: 8px; border-radius: 99px; background: var(--gold); }
.day-plan-content b { color: var(--gold); }
.ai-link { color: var(--gold); text-decoration: none; font-weight: 700; border-bottom: 1px dashed var(--gold); cursor: pointer; transition: background .15s; padding: 1px 3px; border-radius: 3px; }
.ai-link:hover { background: var(--gold-bg); }

/* Day plan completed tasks */
.day-plan-content .completed-task { text-decoration: line-through; opacity: 0.45; }
.day-plan-content a[data-completed="1"] { pointer-events: none; cursor: default; }
.day-plan-content li:has(a[data-completed="1"]) { opacity: 0.5; }
.day-plan-content li:has(a[data-completed="1"]) i { text-decoration: line-through; }

/* ===== SUB-PROJECTS ===== */
.pc-subs { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 12px 0; }
.pc-sub { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: none; background: var(--bg); padding: 7px 10px; border-radius: 8px; cursor: pointer; font-family: var(--sans); font-size: 13px; color: var(--text-2); transition: background .15s; }
.pc-sub:hover { background: var(--gold-bg); color: var(--gold); }
.pc-sub .dot { width: 6px; height: 6px; border-radius: 99px; flex: none; }
.pc-sub-progress { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--muted); }
.pc-subs-empty { font-size: 12px; color: var(--muted); padding: 6px 0; font-style: italic; }
.pc-add-sub { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--muted); background: none; border: 1px dashed var(--border-2); border-radius: 7px; padding: 4px 8px; cursor: pointer; transition: all .15s; font-family: var(--sans); }
.pc-add-sub:hover { color: var(--gold); border-color: var(--gold); background: var(--gold-bg); }

/* ===== CATEGORY CARDS ===== */
.category-card { position: relative; padding: 22px 24px; }
.category-card .pc-title { margin-bottom: 16px; }
.cat-delete-btn {
  position: absolute;
  top: 9px; right: 44px;
  width: 24px; height: 24px;
  padding: 0;
  border: none; background: transparent;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .15s, background .15s, color .15s;
  z-index: 2;
}
.cat-delete-btn svg { width: 13px; height: 13px; }
.category-card:hover .cat-delete-btn,
.project-card:hover .cat-delete-btn { opacity: .7; }
.cat-delete-btn:hover { opacity: 1 !important; background: #fde8e8; color: #c33; }
.cat-stats { display: flex; gap: 28px; margin-bottom: 18px; }
.cat-stat { display: flex; flex-direction: column; gap: 2px; }
.cat-stat-num { font-family: var(--sans); font-size: 28px; color: var(--gold); line-height: 1; font-weight: 700; }
.cat-stat-label { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

/* ===== SEARCH BAR ===== */
.topbar-search { flex: 1; max-width: 480px; position: relative; margin: 0 20px; }
.topbar-search input { width: 100%; border: 1px solid var(--border-2); border-radius: 999px; padding: 8px 16px; font-family: var(--sans); font-size: 14px; color: var(--text); background: var(--surface); outline: none; transition: border-color .15s; }
.topbar-search input:focus { border-color: var(--gold); }
.search-results { position: absolute; top: 100%; left: 0; right: 0; margin-top: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 32px -8px rgba(61,46,34,.15); max-height: 400px; overflow-y: auto; display: none; z-index: 20; }
.search-results.show { display: block; }
.search-group { padding: 8px 0; }
.search-group-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 4px 16px; }
.search-item { display: flex; align-items: center; gap: 10px; padding: 8px 16px; cursor: pointer; transition: background .12s; }
.search-item:hover { background: var(--gold-bg); }
.search-item-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: none; background: var(--gold-bg); color: var(--gold); }
.search-item-title { font-size: 14px; font-weight: 700; color: var(--text); }
.search-item-meta { font-size: 12px; color: var(--muted); }
.search-empty { padding: 20px; text-align: center; color: var(--muted); font-size: 14px; }

/* ===== VIEW TOGGLE ===== */
.view-toggle { display: flex; background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; padding: 2px; }
.view-toggle-btn { padding: 6px 14px; border-radius: 7px; border: none; cursor: pointer; font-family: var(--sans); font-size: 13px; font-weight: 700; background: none; color: var(--text-2); }
.view-toggle-btn.active { background: var(--gold); color: #FFF; }

/* ===== BOARD VIEW ===== */
.board-view { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 12px; }
.board-column { flex: none; width: 300px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; display: flex; flex-direction: column; max-height: calc(100vh - 340px); }
.board-column-header { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex: none; }
.board-column-title { font-size: 14px; font-weight: 700; color: var(--text); flex: 1; }
.board-column-count { font-size: 12px; color: var(--muted); background: var(--bg); border-radius: 99px; padding: 2px 9px; }
.board-column-body { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.board-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; transition: box-shadow .2s, transform .2s; }
.board-card:hover { box-shadow: 0 4px 12px -4px rgba(61,46,34,.12); transform: translateY(-1px); }
.board-card-title { font-size: 13.5px; font-weight: 700; color: var(--text); margin-bottom: 8px; line-height: 1.35; }
.board-card-meta { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.board-card-footer { display: flex; align-items: center; justify-content: space-between; }

.meeting-stat-active { box-shadow: 0 0 0 2px var(--gold); }
.status-chip { cursor: pointer; transition: box-shadow .15s, opacity .15s; }
.status-chip:hover { box-shadow: 0 0 0 1px var(--border-2); }

/* ===== 3-DOT QUICK ACTIONS ===== */
.task-row-actions { position: relative; flex: none; }
.meeting-item-actions { position: relative; flex: none; }
.task-row-dots { background: none; border: none; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: background .12s, color .12s; }
.task-row-dots:hover { background: var(--gold-bg); color: var(--gold); }
.task-quick-menu { position: absolute; top: 100%; right: 0; margin-top: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px -8px rgba(61,46,34,.18); display: none; z-index: 9999; min-width: 150px; overflow: visible; }
.task-quick-menu.show { display: block; }
.task-quick-menu button { display: block; width: 100%; text-align: left; border: none; background: none; padding: 9px 14px; font-family: var(--sans); font-size: 13px; color: var(--text); cursor: pointer; transition: background .12s; }
.task-quick-menu button:hover { background: var(--gold-bg); }

/* ===== REMOVE CHECKBOX FROM MEETING ITEMS ===== */
.meeting-item { gap: 12px; }
.meeting-item-checkbox { display: none; }

.status-chip-active { box-shadow: 0 0 0 2px var(--gold); }
.meeting-stat-card { cursor: pointer; transition: box-shadow .15s; }
.meeting-stat-card:hover { box-shadow: 0 0 0 1px var(--border-2); }

/* ===== NOTIFICATION BELL ===== */
.notif-btn { position: relative; }
.notif-btn:hover { background: var(--gold-bg); }
#notif-badge { display: none; }
.notif-panel { position: absolute; top: calc(100% + 10px); right: 0; width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 16px 40px -12px rgba(61,46,34,.2); z-index: 100; overflow: hidden; }
.notif-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; cursor: pointer; transition: background .12s; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--gold-bg); }
.notif-item.unread { background: rgba(201,149,32,.04); }
.notif-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--border); flex: none; margin-top: 5px; }
.notif-dot.active { background: var(--gold); }
.notif-title { font-size: 13.5px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.notif-body { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time { font-size: 11.5px; color: var(--muted); }

/* ===== MSG COMPOSER + @MENTIONS ===== */
.msg-composer {
  flex: 1; min-height: 40px; max-height: 120px; overflow-y: auto;
  border: 1px solid var(--border-2); border-radius: 10px; padding: 10px 14px;
  font-family: var(--sans); font-size: 14px; color: var(--text);
  background: var(--bg); outline: none; cursor: text;
  transition: border-color .15s;
  word-break: break-word;
}
.msg-composer:focus { border-color: var(--gold); }
.msg-composer:empty::before { content: attr(placeholder); color: var(--muted); pointer-events: none; }
.msg-composer[contenteditable="false"] { opacity: .5; cursor: default; }
.mention-dropdown {
  position: absolute; bottom: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 24px -8px rgba(61,46,34,.18);
  z-index: 50; overflow: hidden; max-height: 220px; overflow-y: auto;
}
.mention-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; cursor: pointer; font-size: 14px; }
.mention-item:hover, .mention-item.highlighted { background: var(--gold-bg); }

/* ===== PASSWORD FORM ===== */
.password-form { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
.pw-error { background: var(--barn-bg); color: var(--barn); border-radius: 8px; padding: 9px 12px; font-size: 14px; border: 1px solid #fecaca; }

/* ===== NOTIFICATION PREFERENCE RADIO ===== */
.notif-pref-group { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.notif-pref-option { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 2px solid var(--border); border-radius: 12px; cursor: pointer; transition: all .15s; }
.notif-pref-option:hover { border-color: var(--gold); }
.notif-pref-option.selected { border-color: var(--gold); background: var(--gold-bg); }
.notif-pref-option input { accent-color: var(--gold); width: 18px; height: 18px; flex: none; }
.notif-pref-icon { font-size: 22px; flex: none; }
.notif-pref-title { font-size: 14.5px; font-weight: 700; }
.notif-pref-desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ===== SMTP FORM ===== */
.smtp-form { margin-top: 14px; }

/* ===== USER MANAGEMENT ===== */
.member-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.member-row:last-child { border-bottom: none; }
.btn-icon-danger { background: none; border: none; color: var(--red); cursor: pointer; padding: 6px; border-radius: 6px; opacity: .6; font-size: 16px; }
.btn-icon-danger:hover { opacity: 1; background: var(--barn-bg); }
.role-toggle { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.role-toggle button { padding: 6px 12px; border: none; background: none; cursor: pointer; font-size: 13px; color: var(--text-2); }
.role-toggle button.active { background: var(--gold); color: white; font-weight: 600; }

/* ===== MULTI-ASSIGNEE ===== */
.task-assignees { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.assignee-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 2px; background: var(--surface-2); border-radius: 999px; font-size: 12px; }
.assignee-badge .avatar { width: 20px; height: 20px; font-size: 10px; }

/* ===== LOGIN LOGO ===== */
.login-logo-wrap { display: flex; justify-content: center; margin-bottom: 24px; }
.login-logo-img { width: 170px; min-width: 170px; height: auto; display: block; background: transparent; }
.login-title { font-family: var(--sans); font-size: 28px; font-weight: 700; text-align: center; margin-bottom: 6px; }
.login-subtitle { font-size: 14px; color: var(--muted); text-align: center; margin-bottom: 24px; }

/* ===== SIDEBAR BOTTOM ===== */
.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.logout-btn { color: var(--muted) !important; }
.logout-btn:hover { color: var(--red) !important; background: var(--barn-bg) !important; }

/* ===== ASSIGNEE MULTI-SELECT ===== */
.assignee-btn.selected { outline: 2px solid var(--gold); outline-offset: 2px; }
.assignee-btn { transition: outline .1s; }

/* ===== FILE ACTIONS ===== */
.file-actions { display: flex; gap: 4px; align-items: center; }
.file-action-btn { background: none; border: none; cursor: pointer; padding: 6px; border-radius: 6px; color: var(--muted); transition: all .15s; }
.file-action-btn:hover { background: var(--gold-bg); color: var(--gold-dark); }
.file-action-btn.danger:hover { background: var(--barn-bg); color: var(--red); }

/* ===== LOGIN TEXT LOGO (CSS-based, no image needed) ===== */
.login-text-logo { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.login-text-logo-mark {
  width: 72px; height: 72px;
  background: var(--gold);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: 30px; font-weight: 700;
  color: #FFF; letter-spacing: -1px;
  box-shadow: 0 4px 12px rgba(201,149,32,.3);
}
.login-text-logo-name {
  font-family: var(--sans);
  font-size: 36px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -1px;
}

/* ===== VGO NATIVE CRM ===== */
.crm-page { max-width: 1180px; }
.crm-page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 24px; }
.crm-hero { position: relative; min-height: 228px; overflow: hidden; display: grid; grid-template-columns: minmax(0,1fr) 250px; align-items: center; gap: 42px; padding: 36px 40px; margin-bottom: 18px; border: 1px solid rgba(61,46,34,.12); border-radius: 24px; color: #fff; background: radial-gradient(circle at 78% 22%, rgba(201,149,32,.28), transparent 28%), linear-gradient(128deg, #302219, #5C4A38 72%, #7A5D31); box-shadow: 0 22px 50px -34px rgba(47,32,23,.8); }
.crm-hero::after { content: ''; position: absolute; width: 390px; height: 390px; right: -195px; bottom: -260px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; box-shadow: 0 0 0 34px rgba(255,255,255,.025), 0 0 0 68px rgba(255,255,255,.018); }
.crm-hero .section-label { color: #E7C56D; }
.crm-hero h1 { max-width: 680px; margin: 3px 0 12px; font-size: clamp(30px,4vw,50px); line-height: 1.02; letter-spacing: -.035em; }
.crm-hero p { max-width: 660px; color: rgba(255,255,255,.7); font-size: 15px; line-height: 1.65; }
.crm-bridge-seal { position: relative; z-index: 1; width: 210px; height: 106px; justify-self: end; display: grid; grid-template-columns: 1fr 34px 1fr; align-items: center; padding: 0 18px; border: 1px solid rgba(255,255,255,.22); border-radius: 53px; background: rgba(255,255,255,.07); backdrop-filter: blur(6px); font-size: 10px; font-weight: 900; letter-spacing: .13em; text-align: center; }
.crm-bridge-seal i { height: 42px; position: relative; }
.crm-bridge-seal i::before,.crm-bridge-seal i::after { content:''; position:absolute; left: 16px; width: 1px; height: 24px; background:#E7C56D; transform-origin:center; }
.crm-bridge-seal i::before { top: 0; transform: rotate(34deg); }
.crm-bridge-seal i::after { bottom: 0; transform: rotate(-34deg); }
.crm-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 18px; }
.crm-stat { min-height: 108px; border: 1px solid var(--border); border-radius: 17px; padding: 18px 20px; background: var(--surface); text-align: left; cursor: pointer; transition: transform .16s, box-shadow .16s; }
.crm-stat:hover { transform: translateY(-2px); box-shadow: 0 10px 28px -20px rgba(61,46,34,.5); }
.crm-stat-value { display: block; font-size: 32px; line-height: 1; font-weight: 900; }
.crm-stat-label { display: block; margin-top: 11px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.crm-stat.gold .crm-stat-value { color: #8C6510; }.crm-stat.ink .crm-stat-value { color: var(--text); }.crm-stat.red .crm-stat-value { color: var(--barn); }.crm-stat.green .crm-stat-value { color: var(--sage); }
.crm-action-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.crm-action-card { min-height: 190px; display: flex; flex-direction: column; align-items: flex-start; padding: 23px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.crm-action-card:hover { border-color: rgba(201,149,32,.45); }
.crm-action-card.bridge { background: #F8EED2; border-color: rgba(201,149,32,.24); }
.crm-action-kicker { margin-bottom: 20px; color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.crm-action-card strong { font-size: 20px; }.crm-action-card > span:not(.crm-action-kicker) { margin-top: 7px; color: var(--text-2); font-size: 13px; line-height: 1.5; }.crm-action-card b { margin-top: auto; padding-top: 22px; color: #8C6510; font-size: 12px; }
.crm-toolbar { display: flex; align-items: center; gap: 10px; padding: 12px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 15px; }
.crm-search { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 10px; }.crm-search span { font-size: 23px; color: var(--muted); }.crm-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: 14px var(--sans); }
.crm-toolbar select { min-width: 175px; padding: 9px 12px; border: 1px solid var(--border-2); border-radius: 9px; background: var(--surface); color: var(--text); }
.crm-table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 17px; }
.crm-table { width: 100%; border-collapse: collapse; min-width: 820px; }.crm-table th { padding: 13px 16px; background: #FAF7F1; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; text-align: left; }.crm-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--text-2); font-size: 13px; }.crm-table tr:last-child td { border-bottom: 0; }.crm-table tbody tr:hover { background: rgba(248,230,184,.14); }
.crm-lead-link { display: flex; align-items: center; gap: 11px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; }.crm-lead-link strong,.crm-lead-link small { display: block; }.crm-lead-link strong { font-size: 14px; }.crm-lead-link small { max-width: 190px; margin-top: 2px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }.crm-lead-avatar { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: #F0E8DC; color: #745A3F; font-size: 11px; font-weight: 900; }
.crm-status,.crm-priority { display: inline-flex; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }.crm-status { background: #EEE9E1; }.crm-status.won { color:#2F6A46;background:#E4F1E8;}.crm-status.lost,.crm-status.not-interested { color:#98402C;background:#F7E1DB;}.crm-status.interested,.crm-status.negotiation { color:#74540F;background:#F8E6B8;}.crm-priority.urgent { color:#9B3024;background:#F8DDD6;}.crm-priority.high { color:#8C6510;background:#F8E6B8;}
.crm-row-action { padding: 6px 10px; font-size: 11px; white-space: nowrap; }.crm-table-empty,.crm-empty-list { padding: 54px 24px; color: var(--muted); text-align: center; }
.crm-bridge-note { display: flex; align-items: center; gap: 15px; padding: 15px 18px; margin-bottom: 18px; border: 1px solid rgba(201,149,32,.25); border-radius: 15px; background: #F8EED2; }.crm-bridge-icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; background: #8E6B3A; color: #fff; font-size: 20px; }.crm-bridge-note strong { font-size: 13px; }.crm-bridge-note p { margin-top: 2px; color: var(--text-2); font-size: 12px; }
.crm-interaction-list { display: grid; gap: 11px; }.crm-interaction-card { position: relative; overflow: hidden; display: grid; grid-template-columns: 5px 1fr auto; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }.crm-interaction-rail { background:#9A8A78;}.crm-interaction-rail.type-follow-up { background:#C99520;}.crm-interaction-rail.type-call,.crm-interaction-rail.type-whatsapp { background:#5B8C5A;}.crm-interaction-rail.type-email { background:#4A7C9B;}.crm-interaction-main { padding: 18px 20px; }.crm-interaction-top { display:flex; align-items:center; gap:10px; }.crm-interaction-top time { color:var(--muted);font-size:11px;}.crm-type { color:#7A5D31;font-size:10px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;}.crm-interaction-main h3 { margin-top:7px;font-size:17px;}.crm-company { color:var(--muted);font-size:12px;}.crm-subject { margin-top:10px;font-weight:700;font-size:13px;}.crm-notes { max-width:760px;margin-top:4px;color:var(--text-2);font-size:13px;line-height:1.55;}.crm-interaction-user { padding:18px;color:var(--muted);font-size:11px;white-space:nowrap;}
.crm-followup { width: min(620px,100%); display:flex; align-items:center; gap:10px; margin-top:13px; padding:11px 13px; border:1px solid rgba(201,149,32,.24); border-radius:11px; background:#FFF9E9; color:var(--text); text-align:left; cursor:pointer;}.crm-followup > span:first-child { width:24px;height:24px;display:grid;place-items:center;border-radius:8px;background:#C99520;color:#fff;}.crm-followup b,.crm-followup small { display:block;}.crm-followup b { font-size:12px;}.crm-followup small { margin-top:2px;color:var(--muted);font-size:10px;}.crm-followup.complete { opacity:.68;}.crm-followup.complete b { text-decoration:line-through;}
.crm-form-grid { display:grid;grid-template-columns:1fr 1fr;gap:14px;}.crm-form-wide { grid-column:1/-1;}.crm-followup-fields { padding:16px;border:1px solid rgba(201,149,32,.24);border-radius:13px;background:#FFF9E9;}.crm-followup-label { display:flex;justify-content:space-between;gap:14px;margin-bottom:12px;}.crm-followup-label span { font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.08em;color:#74540F;}.crm-followup-label small { color:var(--muted);}
.crm-module-workbench { min-height:320px;display:grid;grid-template-columns:120px 1fr;align-items:center;gap:34px;padding:38px;background:var(--surface);border:1px solid var(--border);border-radius:22px;}.crm-module-monogram { width:110px;height:110px;display:grid;place-items:center;border-radius:34px;background:linear-gradient(145deg,#3D2E22,#8E6B3A);color:#E7C56D;font-size:28px;font-weight:900;letter-spacing:-.04em;}.crm-native-badge { display:inline-flex;padding:4px 9px;border-radius:999px;background:#E8F0E4;color:#436A3E;font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.08em;}.crm-module-workbench h2 { margin-top:10px;font-size:27px;}.crm-module-workbench p { max-width:680px;margin-top:8px;color:var(--text-2);line-height:1.6;}.crm-feature-row { display:flex;flex-wrap:wrap;gap:8px;margin-top:22px;}.crm-feature-row span { padding:7px 10px;border:1px solid var(--border);border-radius:9px;background:var(--surface-2);font-size:12px;font-weight:700;}.crm-empty { max-width:580px;margin:60px auto;text-align:center;}.crm-empty-mark { width:58px;height:58px;margin:0 auto 16px;display:grid;place-items:center;border-radius:18px;background:#3D2E22;color:#E7C56D;font-weight:900;}.crm-empty p { margin-top:8px;color:var(--muted);}
.crm-embedded-head { display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin-bottom:14px; }.crm-embedded-tabs { display:flex;flex-wrap:wrap;gap:5px;padding:5px;border:1px solid var(--border);border-radius:11px;background:var(--surface); }.crm-embedded-tabs button { border:0;border-radius:8px;padding:7px 11px;background:transparent;color:var(--text-2);cursor:pointer;font:800 11px var(--sans); }.crm-embedded-tabs button:hover,.crm-embedded-tabs button.active { background:var(--gold-bg);color:var(--gold-dark); }.crm-embedded-frame-wrap { overflow:hidden;min-height:calc(100vh - 165px);border:1px solid var(--border);border-radius:15px;background:#fbfaf7;box-shadow:0 8px 30px rgba(61,46,34,.06); }.crm-embedded-frame { display:block;width:100%;height:calc(100vh - 165px);min-height:720px;border:0;background:#fbfaf7; }

@media (max-width: 900px) { .crm-stats { grid-template-columns:1fr 1fr; }.crm-action-grid { grid-template-columns:1fr; }.crm-hero { grid-template-columns:1fr; }.crm-bridge-seal { display:none; } }
@media (max-width: 640px) { .crm-page-head { align-items:stretch;flex-direction:column; }.crm-page-head .btn-primary { width:100%;justify-content:center; }.crm-hero { padding:26px 22px;min-height:0; }.crm-hero h1 { font-size:30px; }.crm-stats { grid-template-columns:1fr 1fr; }.crm-stat { min-height:88px;padding:14px; }.crm-stat-value { font-size:26px; }.crm-toolbar { flex-direction:column;align-items:stretch; }.crm-search { min-height:40px; }.crm-toolbar select { width:100%; }.crm-interaction-card { grid-template-columns:5px 1fr; }.crm-interaction-user { display:none; }.crm-form-grid { grid-template-columns:1fr; }.crm-form-wide { grid-column:auto; }.crm-followup-fields.crm-form-wide { grid-column:auto; }.crm-module-workbench { grid-template-columns:1fr;padding:24px; }.crm-module-monogram { width:72px;height:72px;border-radius:22px; }.crm-followup-label { flex-direction:column;gap:3px; } }
@media (max-width: 800px) { .crm-embedded-head { align-items:flex-start;flex-direction:column; }.crm-embedded-tabs { max-width:100%;overflow-x:auto;flex-wrap:nowrap; }.crm-embedded-tabs button { white-space:nowrap; }.crm-embedded-frame,.crm-embedded-frame-wrap { min-height:calc(100vh - 190px);height:calc(100vh - 190px); } }

/* Assignee Picker Component */
.ap-wrap { position: relative; width: 100%; }
.ap-control { display:flex; align-items:center; justify-content:space-between; gap:6px;
  min-height:40px; padding:6px 10px; border:1px solid var(--border,#d9dce1); border-radius:8px; cursor:pointer; background:var(--surface,#fff); }
.ap-control:focus { outline:2px solid var(--primary,#4F5635); outline-offset:-1px; }
.ap-chips { display:flex; flex-wrap:wrap; gap:6px; align-items:center; flex:1; min-width:0; }
.ap-placeholder { color:var(--muted); font-size:14px; }
.ap-chip { display:inline-flex; align-items:center; gap:5px; padding:3px 8px; max-width:100%;
  background:var(--surface-2,#f1f3f5); border-radius:12px; font-size:12.5px; white-space:nowrap; }
.ap-chip > span { overflow:hidden; text-overflow:ellipsis; }
.ap-chip-x { border:none; background:none; cursor:pointer; font-size:14px; line-height:1; color:var(--muted); padding:0; }
.ap-chip-x:hover { color:var(--barn,#c33); }
.ap-caret { color:var(--muted); font-size:12px; margin-left:4px; flex:none; }
.ap-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ap-dropdown { position:absolute; z-index:200; top:calc(100% + 4px); left:0; right:0; min-width:240px;
  background:var(--surface,#fff); border:1px solid var(--border,#d9dce1); border-radius:8px; box-shadow:0 6px 20px rgba(0,0,0,.12); }
.ap-search { width:100%; box-sizing:border-box; padding:8px 10px; border:none; border-bottom:1px solid var(--border,#eee); outline:none; background:transparent; color:var(--text); font-size:14px; }
.ap-list { max-height:240px; overflow-y:auto; }
.ap-option { display:flex; align-items:center; gap:8px; padding:8px 10px; cursor:pointer; }
.ap-option:hover { background:var(--surface-2,#f5f7f9); }
.ap-selected { background:var(--primary-bg,#eef4ee); }
.ap-check { margin-left:auto; color:var(--primary-dark,#2563eb); font-weight:700; }
.ap-empty { padding:12px; color:var(--muted); text-align:center; font-size:13px; }
.ap-avatar { display:inline-flex; align-items:center; justify-content:center;
  width:24px; height:24px; border-radius:50%; color:#fff; font-size:11px; font-weight:600; flex:none; }

/* Task assignee avatars on task rows */
.task-avatars { display:inline-flex; }
.task-avatar { display:inline-flex; align-items:center; justify-content:center;
  width:24px; height:24px; border-radius:50%; color:#fff; font-size:11px; font-weight:600; }
.task-avatars .task-avatar { margin-left:-6px; border:2px solid var(--surface,#fff); }
.task-avatars .task-avatar:first-child { margin-left:0; }
.task-avatars .more { background:var(--muted,#9aa0a6); }

/* Members management modal */
.modal-box { background: var(--surface, #fff); border-radius: 20px; box-shadow: 0 24px 48px -16px rgba(61,46,34,.2), 0 4px 12px rgba(61,46,34,.06); width: 520px; max-width: 92vw; max-height: 90vh; overflow-y: auto; padding: 24px; }

/* ===== COLLAPSIBLE CATEGORY SECTIONS ===== */
.cat-toggle-section { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.cat-toggle-header { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 16px 20px; border: none; background: none; cursor: pointer; font-family: var(--sans); font-size: 15px; font-weight: 700; color: var(--text); transition: background .15s; }
.cat-toggle-header:hover { background: var(--gold-bg); }
.cat-toggle-chevron { display: inline-flex; align-items: center; justify-content: center; transition: transform .2s ease; }
.cat-toggle-body { padding: 0 20px 16px 20px; display: flex; flex-direction: column; gap: 8px; }

/* ===== Push notification states */
.push-state-on, .push-state-denied, .push-state-default {
  display: flex; align-items: center; gap: 8px; font-size: 14px;
}
.push-dot {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0;
}
.push-dot.on { background: #22c55e; }
.push-dot.denied { background: #ef4444; }
.settings-hint { font-size: 12px; color: #888; margin-top: 4px; line-height: 1.4; }

/* ===== AGENDA ITEMS */
.meeting-section[style*="border-color"] { border: 2px solid var(--gold); }
.agenda-item { display: flex; align-items: center; gap: 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
.agenda-item.completed { opacity: 0.5; text-decoration: line-through; }

/* ===================================================================
   ACCESSIBILITY & MOBILE POLISH (A2, A4)
   =================================================================== */

/* Visible keyboard focus for all interactive elements. Uses :focus-visible so
   mouse clicks don't show the ring, but Tab navigation always does. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible,
.btn:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-ghost:focus-visible,
.btn-danger:focus-visible,
.btn-login:focus-visible {
  outline: 3px solid var(--ochre);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Fallback for browsers without :focus-visible support */
.btn:focus,
.btn-primary:focus,
.btn-secondary:focus {
  outline: none; /* superseded by :focus-visible above where supported */
}

/* Screen-reader-only utility (labels for icon-only controls) */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Skip-to-content link for keyboard users */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 2000;
  background: var(--gold); color: #fff; padding: 10px 16px;
  border-radius: 0 0 10px 0; font-weight: 700; font-size: 14px; text-decoration: none;
}
.skip-link:focus { left: 0; }

/* High-contrast focus inside dropdowns/menus */
[role="menu"] [role="menuitem"]:focus-visible,
.search-result-item:focus-visible,
.notif-item:focus-visible {
  outline: 2px solid var(--ochre);
  outline-offset: -2px;
  background: var(--gold-bg);
}

/* A4 — larger touch targets and readable fonts on mobile/touch devices */
@media (max-width: 768px) {
  .btn, .btn-primary, .btn-secondary, .btn-ghost, .btn-danger,
  button, .assignee-btn, .task-item, .file-row, .cat-toggle-header {
    min-height: 44px;
  }
  .btn, .btn-primary, .btn-secondary, .btn-ghost {
    padding-top: 11px; padding-bottom: 11px;
  }
  /* Bump the smallest metadata fonts up for legibility on small screens */
  .task-meta, .file-meta, .project-meta, .comment-indicator,
  .conv-list-label, .sidebar-projects-label { font-size: 13px; }
  .ai-flag, .status-pill, .health-pill { font-size: 12px; }
}

/* Pointer: coarse (touch) — ensure tap targets regardless of width */
@media (pointer: coarse) {
  a[role="button"], button, .btn, .btn-primary, .btn-secondary, .btn-ghost {
    min-height: 44px;
  }
}

/* A5 — keyboard highlight for search results */
.search-result-item.kb-active { background: var(--gold-bg); outline: 2px solid var(--ochre); outline-offset: -2px; }
.notif-item { cursor: pointer; }

/* ===== UX enhancements: editable fields, file search ===== */

/* Editable field affordance (task/project description) */
.editable-field {
  border: 1px dashed var(--border-2, #d8cbb6);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: text;
  color: var(--text);
  transition: border-color .15s, background .15s, box-shadow .15s;
  position: relative;
}
.editable-field:hover {
  border-color: var(--gold);
  background: var(--gold-bg, #F0E8DC);
}
.editable-field.is-empty {
  color: var(--muted);
  font-style: italic;
}
.editable-field:focus-within {
  border-style: solid;
  border-color: var(--gold);
}

/* "Click to edit" hint next to a section label */
.edit-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  opacity: .8;
}
.edit-hint svg { width: 13px; height: 13px; }

/* File search box inside collapsible file sections */
.file-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border-2, #d8cbb6);
  border-radius: 10px;
  background: var(--surface, #fff);
  color: var(--muted);
}
.file-search-wrap svg { flex: none; }
.file-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
}
.file-search-input::placeholder { color: var(--muted); }
.file-search-wrap:focus-within {
  border-color: var(--gold);
}

/* ===== ALL TASKS — User cards ===== */
.user-cards-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  margin-bottom: 24px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.user-cards-row::-webkit-scrollbar { height: 6px; }
.user-cards-row::-webkit-scrollbar-track { background: transparent; }
.user-cards-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.user-card {
  flex: 0 0 auto;
  flex-shrink: 0;
  width: 190px;
  min-width: 190px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all .15s;
}
.user-card:hover { border-color: var(--gold); background: var(--gold-bg); }
.user-card-active { border-color: var(--gold); background: var(--gold-bg); }
.user-card-info { min-width: 0; flex: 1; }
.user-card-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.user-card-stats { font-size: 11px; color: var(--muted); margin-top: 2px; }
.user-card-progress {
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: var(--sand);
  overflow: hidden;
  margin-top: 6px;
}
.user-card-progress-bar {
  height: 100%;
  background: var(--gold);
  border-radius: 99px;
  transition: width .3s;
}

/* ===== AGENDA UNIFIED LIST ===== */
.agenda-list-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  position: relative;
  z-index: 1;
}
.agenda-list-item:hover { background: var(--surface-2); }
.agenda-list-item:has(.task-quick-menu.show) { z-index: 100; }
.agenda-list-item.completed { opacity: 0.65; }
.agenda-list-item.completed .agenda-item-title { text-decoration: line-through; }
.agenda-check {
  flex: none;
  width: 20px; height: 20px;
  border: 2px solid var(--border-2);
  border-radius: 6px;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  margin-top: 2px;
  transition: all .15s;
}
.agenda-check:hover { border-color: var(--gold); }
.agenda-list-item.completed .agenda-check { background: var(--gold); border-color: var(--gold); }
.agenda-check-empty { width: 12px; height: 12px; }
.agenda-item-content { flex: 1; min-width: 0; }
.agenda-item-title { font-size: 15px; font-weight: 600; color: var(--text); cursor: text; border-radius: 6px; padding: 1px 4px; margin: -1px -4px; }
.agenda-item-title:hover { background: var(--gold-bg); }
.agenda-item-desc { font-size: 13px; color: var(--muted); margin-top: 4px; }
.agenda-item-link { font-size: 12px; color: var(--gold); cursor: pointer; margin-top: 4px; text-decoration: underline; text-underline-offset: 2px; }
.agenda-item-assignee { display: flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.agenda-item-dots { background: none; border: none; cursor: pointer; padding: 4px; color: var(--muted); flex: none; margin-top: 2px; }
.agenda-item-dots:hover { background: var(--gold-bg); border-radius: 6px; color: var(--gold); }
.agenda-item-actions { position: relative; flex: none; z-index: 10; }
.agenda-menu { right: 0; left: auto; z-index: 9999; position: absolute; top: 100%; margin-top: 4px; }

/* Agenda add input */
.agenda-add-row {
  display: flex;
  gap: 8px;
  padding: 14px;
  border-bottom: 2px solid var(--border);
  background: var(--surface-2);
}
.agenda-add-input {
  flex: 1;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--sans);
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color .15s;
}
.agenda-add-input:focus { border-color: var(--gold); }

.agenda-list-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: visible;
}
.agenda-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 2px solid var(--gold);
  background: var(--gold-bg);
}
.agenda-list-header h3 { font-size: 18px; font-weight: 700; color: var(--gold); }
.agenda-count-badge { background: var(--gold); color: #FFF; border-radius: 99px; padding: 2px 10px; font-size: 13px; font-weight: 700; }
.agenda-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 14px; }

/* ============================================================================
   Shared UI primitives
   ----------------------------------------------------------------------------
   These class names were in use across Workflow, CRM, Accounting and Settings
   but defined in no stylesheet, so the elements rendered with no styling at all.
   They live here rather than beside each screen so there is one definition per
   idea, and a new page gets the look by using the name.
   ============================================================================ */

/* The quiet second line under a title, in a table cell or a list row. */
.ct-secline { font-size: 12px; color: var(--muted); line-height: 1.45; margin-top: 2px; }

/* A settings card that needs the full column rather than the reading measure. */
.settings-card-wide { max-width: none; }

/* Two fields side by side inside a form or modal body. */
.ct-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .ct-two { grid-template-columns: 1fr; } }

/* A boxed block of configuration inside a card. */
.ct-cfgbox {
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg); margin-top: 12px;
}

/* A row of filters and search above a table. */
.ct-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Pill tabs. Same shape as the accounting ones so the app reads as one thing. */
.ct-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.ct-tab {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; display: inline-flex; align-items: center;
  gap: 7px; transition: background .12s, border-color .12s, color .12s;
}
.ct-tab:hover { border-color: var(--border-2); }
.ct-tab.active { background: var(--gold); border-color: var(--gold); color: #FFF; }

/* Buttons that sit at the right-hand end of a table row. */
.ct-actions-cell { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

/* An uppercase label introducing a group of fields. */
.ct-section-label {
  display: block; margin: 18px 0 8px; color: var(--muted);
  font-size: 10.5px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase;
}

/* "Nothing here" inside a table cell that spans the row. */
.ct-empty-cell { padding: 28px 20px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* Identifiers, references and anything that should line up digit for digit. */
.ct-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* An inline proportion bar in a report row. */
.ct-bar-track {
  display: inline-block; width: 100%; min-width: 60px; height: 8px;
  border-radius: 999px; background: var(--border); overflow: hidden; vertical-align: middle;
}
.ct-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--gold); transition: width .3s; }
