/* =====================================================================
   TaskForge -- site.css
   Dark-first SaaS design system.
   Brand:    deep wine #480c0f -> rose #b94854 (gradient, decorative).
   Primary CTA: cool blue #5aa9ff (per UX rule). Accent violet #8b5cf6.
   Success: #22c55e. Warn: #f59e0b. Danger: #ef4444 (warnings only).
   ===================================================================== */

:root {
    --col-bg-0:        #0c1018;
    --col-bg-1:        #131825;
    --col-bg-2:        #1a2030;
    --col-bg-3:        #232a3d;
    --col-bg-4:        #2e3650;
    --col-surface:     #181e2c;
    --col-surface-2:   #1f2638;
    --col-surface-3:   #283045;

    --col-border:      #2a3147;
    --col-border-2:    #3a4360;

    --col-text:        #e7ecf3;
    --col-text-muted:  #95a0b3;
    --col-text-dim:    #6c768c;

    --col-primary:     #5aa9ff;
    --col-primary-2:   #4393f0;
    --col-primary-soft:#1e3552;

    --col-accent:      #8b5cf6;
    --col-accent-soft: #2c1e4c;

    /* Brand palette — cool decorative gradient (logo, hero highlight,
       sidebar-active, tooltip glow). Never used for CTAs. */
    --col-brand-1:     #480c0f;
    --col-brand-2:     #b94854;
    --col-brand-glow:  rgba(185,72,84,.45);
    --col-brand-glow-2:rgba(185,72,84,.30);
    --grad-brand:      linear-gradient(135deg, #480c0f 0%, #b94854 100%);
    --grad-brand-h:    linear-gradient(90deg,  #480c0f 0%, #b94854 100%);

    --col-success:     #22c55e;
    --col-success-soft:#143a26;
    --col-warn:        #f59e0b;
    --col-warn-soft:   #3f2c0d;
    --col-danger:      #ef4444;
    --col-danger-soft: #401717;

    --col-pri-low:     #94a3b8;
    --col-pri-med:     #5aa9ff;
    --col-pri-high:    #f59e0b;
    --col-pri-urgent:  #f97316;
    --col-pri-crit:    #ef4444;

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.02);
    --shadow:    0 4px 16px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.03);
    --shadow-lg: 0 20px 50px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.04);

    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:    'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

    --sidebar-width: 248px;
    --sidebar-collapsed-width: 60px;
    --topbar-height: 56px;

    --t-fast: 120ms ease-out;
    --t:      200ms ease-out;
}

* { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    background: var(--col-bg-0);
    color: var(--col-text);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body { min-height: 100vh; position: relative; }

/* Ambient brand atmosphere — three overlapping radial washes per the
   warmth-recipe pattern, ported to cyan/lavender. Fixed-attachment so
   it stays put while content scrolls; sits behind everything. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 90% 60% at 15% -10%, rgba(185,72,84,.18) 0%, transparent 55%),
        radial-gradient(ellipse 80% 50% at 100% 0%,  rgba(230,150,160,.10) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 50% 100%, rgba(185,72,84,.06) 0%, transparent 60%);
}
/* Top accent strip — thin brand gradient line that runs across the
   very top of every page like a stage light. */
body::after {
    content: '';
    position: fixed;
    left: 0; right: 0; top: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--col-brand-1) 28%,
        var(--col-brand-2) 72%,
        transparent 100%);
    opacity: .55;
    z-index: 100;
    pointer-events: none;
}

a { color: var(--col-primary); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--col-primary-2); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; margin: 0 0 .4em; color: var(--col-text); }
h1 { font-size: 28px; line-height: 1.2; }
h2 { font-size: 22px; line-height: 1.25; }
h3 { font-size: 18px; line-height: 1.3; }
h4 { font-size: 15px; line-height: 1.4; }

p { margin: 0 0 .8em; color: var(--col-text-muted); }
code, kbd {
    font-family: var(--font-mono); font-size: .92em;
    background: linear-gradient(180deg, rgba(185,72,84,.06) 0%, transparent 100%), var(--col-bg-2);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(185,72,84,.22);
    color: #c8f4fb;
}

hr { border: 0; border-top: 1px solid var(--col-border); margin: 24px 0; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--col-bg-1); }
::-webkit-scrollbar-thumb { background: var(--col-bg-3); border-radius: 8px; border: 2px solid var(--col-bg-1); }
::-webkit-scrollbar-thumb:hover { background: var(--col-bg-4); }

/* ====== buttons ====== */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 16px;
    font-family: var(--font-display);
    font-size: 13.5px; font-weight: 500;
    border: 1px solid var(--col-border-2);
    background: var(--col-surface-3);
    color: var(--col-text);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--t-fast);
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
}
.btn:hover { background: var(--col-bg-4); border-color: var(--col-text-dim); color: var(--col-text); }
.btn:active { transform: translateY(1px); }

/* PRIMARY = SOLID BRAND (changed 2026-06-08 from blue per
   feedback-brand-warmth-recipe). Workhorse CTA: Save/Submit/Update/Create. */
.btn-primary {
    background: var(--col-brand-1);
    border-color: var(--col-brand-2);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 14px var(--col-brand-glow);
}
.btn-primary:hover {
    background: var(--col-brand-2);
    border-color: var(--col-brand-2);
    color: #fff;
    box-shadow: 0 6px 18px rgba(185,72,84,.55);
}

/* BRAND = GRADIENT — hero / brand-marketing moments only (Add, Start free,
   Upgrade). Heavier than .btn-primary; use sparingly (~1-2 per page). */
.btn-brand {
    background: var(--grad-brand);
    border-color: var(--col-brand-2);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 14px var(--col-brand-glow);
}
.btn-brand:hover {
    filter: brightness(1.10);
    color: #fff;
}

/* SECONDARY = NEUTRAL DARK — paired with primary (Cancel, Back, Dismiss). */
.btn-secondary {
    background: var(--col-bg-3);
    color: var(--col-text);
    border-color: var(--col-border);
}
.btn-secondary:hover { background: var(--col-bg-4); }

.btn-ghost {
    background: transparent;
    border-color: var(--col-border);
}
.btn-ghost:hover { background: var(--col-surface-3); }

.btn-danger {
    background: var(--col-danger);
    border-color: var(--col-danger);
    color: #fff;
}
.btn-danger:hover { background: #dc3030; }

.btn-success {
    background: var(--col-success);
    border-color: var(--col-success);
    color: #fff;
}

.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn-xl { padding: 14px 26px; font-size: 16px; font-weight: 600; }

.btn svg { width: 16px; height: 16px; }

/* ====== forms ====== */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--col-brand-2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; }
.field .help { font-size: 12px; color: var(--col-text-dim); margin-top: 4px; }
.input, .textarea, .select {
    width: 100%;
    padding: 10px 12px;
    background: var(--col-bg-1);
    color: var(--col-text);
    border: 1px solid var(--col-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus, .textarea:focus, .select:focus {
    outline: none;
    border-color: var(--col-brand-1);
    box-shadow: 0 0 0 3px rgba(185,72,84,.18), 0 0 12px rgba(230,150,160,.18);
}
.textarea { min-height: 100px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2395a0b3' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }

.checkbox, .radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--col-text); }
.checkbox input, .radio input { accent-color: var(--col-brand-1); }

.error-msg { background: var(--col-danger-soft); color: var(--col-danger); padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid rgba(239,68,68,.3); font-size: 13.5px; margin-bottom: 16px; }
.flash-msg { background: var(--col-success-soft); color: var(--col-success); padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid rgba(34,197,94,.3); font-size: 13.5px; margin-bottom: 16px; }
.info-msg { background: var(--col-primary-soft); color: var(--col-primary); padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid rgba(90,169,255,.3); font-size: 13.5px; margin-bottom: 16px; }

/* ====== cards / panels ====== */
.card {
    background:
        linear-gradient(180deg, rgba(185,72,84,.05) 0%, transparent 40%),
        var(--col-surface);
    border: 1px solid rgba(185,72,84,.14);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: 0 1px 0 rgba(230,150,160,.06) inset, var(--shadow-sm);
    position: relative;
    transition: border-color var(--t-fast);
}
.card:hover { border-color: rgba(185,72,84,.28); }
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--col-border);
    margin-bottom: 14px;
}
.card-header h2, .card-header h3 { margin: 0; position: relative; padding-left: 12px; color: #fff; }
.card-header h2::before, .card-header h3::before {
    content: '';
    position: absolute;
    left: 0; top: 4px; bottom: 4px;
    width: 3px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--col-brand-1), var(--col-brand-2));
    box-shadow: 0 0 8px var(--col-brand-glow);
}
.panel {
    background:
        linear-gradient(180deg, rgba(185,72,84,.05) 0%, transparent 40%),
        var(--col-surface);
    border: 1px solid rgba(185,72,84,.14);
    border-radius: var(--radius);
    box-shadow: 0 1px 0 rgba(230,150,160,.06) inset;
}

/* ====== badges & chips ====== */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 11.5px;
    font-weight: 500;
    background: var(--col-bg-3);
    color: var(--col-text-muted);
    border: 1px solid var(--col-border-2);
}
.badge.primary { background: var(--col-primary-soft); color: var(--col-primary); border-color: rgba(90,169,255,.3); }
.badge.success { background: var(--col-success-soft); color: var(--col-success); border-color: rgba(34,197,94,.3); }
.badge.warn    { background: var(--col-warn-soft);    color: var(--col-warn);    border-color: rgba(245,158,11,.3); }
.badge.danger  { background: var(--col-danger-soft);  color: var(--col-danger);  border-color: rgba(239,68,68,.3); }
.badge.accent  { background: var(--col-accent-soft);  color: var(--col-accent);  border-color: rgba(139,92,246,.3); }
.badge.brand   {
    background: linear-gradient(135deg, rgba(185,72,84,.18) 0%, rgba(230,150,160,.16) 100%);
    color: #c8f4fb;
    border-color: rgba(185,72,84,.45);
    box-shadow: 0 0 0 1px rgba(230,150,160,.12) inset;
}

.priority-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.priority-low      { background: rgba(148,163,184,.15); color: var(--col-pri-low); }
.priority-medium   { background: rgba(90,169,255,.15);  color: var(--col-pri-med); }
.priority-high     { background: rgba(245,158,11,.15);  color: var(--col-pri-high); }
.priority-urgent   { background: rgba(249,115,22,.15);  color: var(--col-pri-urgent); }
.priority-critical { background: rgba(239,68,68,.15);   color: var(--col-pri-crit); }

/* ====== sidebar (in-app) ====== */
.app-shell { display: grid; grid-template-columns: var(--sidebar-width) 1fr; min-height: 100vh; }
html.sidebar-collapsed .app-shell { grid-template-columns: var(--sidebar-collapsed-width) 1fr; }

.sidebar {
    background:
        radial-gradient(ellipse 150% 50% at 0% 0%,    rgba(185,72,84,.26)  0%, transparent 65%),
        radial-gradient(ellipse 130% 45% at 100% 30%, rgba(230,150,160,.12) 0%, transparent 60%),
        radial-gradient(ellipse 120% 45% at 20% 100%, rgba(185,72,84,.16)  0%, transparent 65%),
        linear-gradient(180deg, #1e0e10 0%, #160a0c 55%, #0e0a0c 100%);
    border-right: 1px solid rgba(185,72,84,.25);
    padding: 12px 12px 24px;
    overflow-y: auto;
    overflow-x: hidden;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: width var(--t);
    box-shadow: 1px 0 26px rgba(185,72,84,.10);
    scrollbar-color: #b94854 transparent;
    scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 10px; }
.sidebar::-webkit-scrollbar-track { background: rgba(72,12,15,.35); }
.sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #b94854 0%, #7a2730 100%);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #d05f6b 0%, #9a3340 100%);
    background-clip: padding-box;
}

/* Diagonal shimmer (sidebar-glisten) -- ambient brand-tinted band sweeps
   top-left -> bottom-right of the menu BG. Full recipe + bug list:
   [[feedback-sidebar-glisten-recipe]] in user auto-memory. */
.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    transparent 30%,
    rgba(255,170,180,0.07) 48%,
    rgba(255,200,210,0.11) 52%,
    transparent 70%
  );
  background-size: 250% 250%;
  background-repeat: no-repeat;
  background-position: 150% 150%;
  animation: sidebar-glisten 14s linear infinite;
  z-index: 0;
}
.sidebar > * { position: relative; z-index: 1; }
@keyframes sidebar-glisten {
  0%   { background-position: 150% 150%; }
  55%  { background-position: -150% -150%; }
  100% { background-position: -150% -150%; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar::before { animation: none; opacity: 0; }
}

.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 10px 6px 18px; border-bottom: 1px solid var(--col-border); margin-bottom: 14px; }
.sidebar-brand .logo { width: 38px; height: 38px; border-radius: 10px; background: #2c0508; border: 1px solid #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px; color: #fff; position: relative; box-shadow: 0 6px 20px rgba(220,38,38,0.40); }
.sidebar-brand .logo::after { content: ''; position: absolute; inset: -2px; border-radius: inherit; background: linear-gradient(135deg, #dc2626 0%, #f87171 100%); filter: blur(12px); opacity: 0.32; z-index: -1; }
.sidebar-brand .brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.05; }
.sidebar-brand .brand-name { font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; font-size: 17px; color: var(--col-text); line-height: 1.1; }
.sidebar-brand .brand-sub {
    font-family: var(--font-display);
    font-size: 9.5px;
    font-weight: 600;
    color: var(--col-text-dim);
    letter-spacing: .18em;
    text-transform: uppercase;
    margin-top: 6px;
}
html.sidebar-collapsed .sidebar-brand .brand-text { display: none; }

.sidebar-section-label { font-size: 10.5px; text-transform: uppercase; color: var(--col-brand-2); opacity: .75; padding: 14px 10px 6px; letter-spacing: .12em; font-weight: 700; }
html.sidebar-collapsed .sidebar-section-label { display: none; }

.sidebar-link {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--col-text-muted);
    text-decoration: none;
    font-size: 13.5px;
    margin-bottom: 1px;
    transition: background var(--t-fast), color var(--t-fast);
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-link:hover { background: var(--col-surface-3); color: var(--col-text); }
.sidebar-link.active {
    background: linear-gradient(90deg, rgba(185,72,84,.28) 0%, rgba(230,150,160,.10) 70%, transparent 100%);
    color: #fff;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(185,72,84,.25);
}
.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 7px; bottom: 7px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--col-brand-1);
}
.sidebar-link.active svg { color: currentColor; }
html.sidebar-collapsed .sidebar-link span { display: none; }

/* When collapsed, tighten left/right padding so 18px icons aren't clipped
   inside the 60px rail. Center the icon and re-anchor the active stripe. */
html.sidebar-collapsed .sidebar { padding-left: 6px; padding-right: 6px; }
html.sidebar-collapsed .sidebar-link { padding-left: 0; padding-right: 0; justify-content: center; gap: 0; }
html.sidebar-collapsed .sidebar-link.active::before { left: -6px; }
html.sidebar-collapsed .sidebar-brand { padding-left: 0; padding-right: 0; justify-content: center; }

/* ====== topbar ====== */
.topbar {
    background:
        linear-gradient(90deg, rgba(185,72,84,.10) 0%, rgba(230,150,160,.04) 40%, rgba(12,16,24,.72) 100%),
        rgba(12,16,24,.72);
    border-bottom: 1px solid rgba(185,72,84,.22);
    height: var(--topbar-height);
    display: flex; align-items: center;
    padding: 0 20px;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 8px 24px rgba(185,72,84,.04);
}
.topbar-search:focus-within {
    border-color: var(--col-brand-1);
    box-shadow: 0 0 0 3px rgba(185,72,84,.16), 0 0 14px rgba(230,150,160,.18);
}
/* (topbar-title gradient defined below near .page-header) */
.topbar-spacer { flex: 1; }
.topbar-search { display: flex; align-items: center; gap: 8px; background: var(--col-bg-2); border: 1px solid var(--col-border); padding: 6px 12px; border-radius: var(--radius-sm); width: 320px; max-width: 100%; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.topbar-search input { flex: 1; background: transparent; border: 0; outline: none; color: var(--col-text); font-size: 13px; }
.topbar-search svg { width: 14px; height: 14px; color: var(--col-text-dim); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-iconbtn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--radius-sm); color: var(--col-text-muted); background: transparent; border: 1px solid transparent; cursor: pointer; position: relative; transition: border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
.topbar-iconbtn:hover { background: transparent; color: var(--col-text); border-color: var(--col-brand-2); box-shadow: 0 0 8px rgba(185,72,84,.35); }
.topbar-iconbtn svg { width: 18px; height: 18px; }
.topbar-iconbtn .dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--col-danger); border: 2px solid var(--col-bg-1); }

/* ====== avatar / profile dropdown ====== */
.avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--col-primary);
    display: grid; place-items: center;
    font-size: 12px; font-weight: 600; color: #fff;
    text-transform: uppercase;
}
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-lg { width: 44px; height: 44px; font-size: 16px; }
.avatar-xl { width: 64px; height: 64px; font-size: 22px; }

.profile-btn { display: flex; align-items: center; gap: 8px; background: transparent; border: 0; padding: 4px 6px; border-radius: var(--radius-sm); cursor: pointer; color: var(--col-text); }
.profile-btn:hover { background: var(--col-surface-3); }

.profile-dropdown { position: relative; }
.profile-dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 6px);
    background:
        radial-gradient(220px 140px at 100% 0%, rgba(230,150,160,.10) 0%, transparent 70%),
        radial-gradient(220px 160px at 0% 100%, rgba(185,72,84,.08) 0%, transparent 70%),
        var(--col-surface);
    border: 1px solid var(--col-border);
    border-top: 1px solid transparent;
    border-radius: var(--radius);
    min-width: 240px;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(185,72,84,.10);
    padding: 6px;
    display: none;
    z-index: 100;
    position: absolute;
    background-clip: padding-box;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
}
.profile-dropdown-menu::before {
    content: '';
    position: absolute;
    left: 10px; right: 10px; top: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--grad-brand-h);
    opacity: .7;
}
.profile-dropdown-menu.open { display: block; }
.profile-dropdown-menu a {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    color: var(--col-text);
    text-decoration: none;
    border-radius: 5px;
    font-size: 13px;
}
.profile-dropdown-menu a:hover { background: var(--col-surface-3); }
.profile-dropdown-menu a.profile-admin { color: #f97316; }
.profile-dropdown-section { padding: 8px 10px 4px; font-size: 10.5px; text-transform: uppercase; color: var(--col-text-dim); letter-spacing: .08em; font-weight: 600; }
.profile-dropdown-divider { height: 1px; background: var(--col-border); margin: 4px 0; }
.profile-dropdown-icon { width: 16px; height: 16px; color: var(--col-text-muted); }

/* ====== main area ====== */
.app-main { display: flex; flex-direction: column; min-width: 0; }
.app-content { padding: 24px; flex: 1; min-width: 0; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-header h1 {
    margin: 0;
    background: linear-gradient(135deg, #fff 0%, #fff 35%, var(--col-brand-2) 75%, var(--col-brand-1) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -.01em;
}
.page-header .subtitle { color: var(--col-text-muted); font-size: 13.5px; margin: 4px 0 0; }
.topbar-title {
    font-family: var(--font-display); font-weight: 700; font-size: 16px;
    background: linear-gradient(135deg, #fff 0%, var(--col-brand-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.crumbs { font-size: 12.5px; color: var(--col-text-dim); margin-bottom: 4px; }
.crumbs a { color: var(--col-text-dim); }
.crumbs a:hover { color: var(--col-text); }
.crumbs .sep { margin: 0 6px; }

/* ====== KPI tiles ====== */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi {
    background:
        linear-gradient(140deg, rgba(185,72,84,.10) 0%, transparent 55%),
        var(--col-surface);
    border: 1px solid rgba(185,72,84,.22);
    border-radius: var(--radius);
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(185,72,84,.06);
    transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.kpi:hover {
    border-color: rgba(185,72,84,.45);
    box-shadow: 0 10px 30px rgba(185,72,84,.12);
    transform: translateY(-1px);
}
.kpi::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--grad-brand);
}
.kpi.success::before { background: var(--col-success); }
.kpi.warn::before    { background: var(--col-warn); }
.kpi.danger::before  { background: var(--col-danger); }
.kpi.accent::before  { background: var(--grad-brand); }
.kpi.brand::before   { background: var(--grad-brand); }
.kpi-label { font-size: 11.5px; text-transform: uppercase; color: var(--col-text-muted); letter-spacing: .06em; font-weight: 500; }
.kpi-value {
    font-size: 26px; font-weight: 700; margin: 6px 0 4px; font-family: var(--font-display);
    background: linear-gradient(135deg, #fff 0%, var(--col-brand-2) 130%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.kpi-delta { font-size: 12px; color: var(--col-text-dim); display: flex; align-items: center; gap: 4px; }
.kpi-delta.up   { color: var(--col-success); }
.kpi-delta.down { color: var(--col-danger); }

/* ====== tables ====== */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--col-border);
    font-size: 13.5px;
}
.table th {
    color: var(--col-brand-2);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    background: linear-gradient(180deg, rgba(185,72,84,.06) 0%, rgba(230,150,160,.04) 100%), var(--col-bg-1);
    border-bottom-color: rgba(185,72,84,.22);
}
.table tbody tr:hover { background: rgba(185,72,84,.05); }
.table tbody tr.clickable { cursor: pointer; }

/* ====== sectioned layouts (auth + simple panels) ====== */
.auth-shell { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; background: var(--col-bg-0); }
.auth-side {
    background: linear-gradient(135deg, var(--col-bg-1) 0%, var(--col-surface) 50%, var(--col-bg-2) 100%);
    padding: 56px 48px;
    display: flex; flex-direction: column; justify-content: flex-start; gap: 32px;
    border-right: 1px solid var(--col-border);
    position: relative; overflow: hidden;
}
.auth-side::after {
    content: '';
    position: absolute; right: -120px; bottom: -120px;
    width: 400px; height: 400px;
    background:
        radial-gradient(circle at 35% 40%, rgba(185,72,84,.22) 0%, transparent 55%),
        radial-gradient(circle at 65% 60%, rgba(230,150,160,.18) 0%, transparent 60%);
    pointer-events: none;
}
.auth-side .brand { display: flex; align-items: center; gap: 12px; }
.auth-side .brand .logo { width: 38px; height: 38px; border-radius: 10px; background: #2c0508; border: 1px solid #fff; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 18px; box-shadow: 0 8px 26px var(--col-brand-glow); }
.auth-side .brand-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.auth-headline { max-width: 480px; }
.auth-headline h1 { font-size: 38px; line-height: 1.15; margin-bottom: 12px; }
.auth-headline p  { font-size: 16px; color: var(--col-text-muted); line-height: 1.55; }
.auth-quote { font-size: 13.5px; color: var(--col-text-muted); border-left: 2px solid var(--col-brand-1); padding-left: 14px; }

.auth-form-wrap { padding: 56px 48px; display: flex; align-items: center; justify-content: center; }
.auth-form-inner { width: 100%; max-width: 380px; }
.auth-form-inner h2 { font-size: 22px; margin-bottom: 6px; }
.auth-form-inner > p { color: var(--col-text-muted); margin-bottom: 28px; }
.auth-form-inner .form-footer { margin-top: 18px; text-align: center; font-size: 13px; color: var(--col-text-muted); }

@media (max-width: 880px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-side { display: none; }
}

/* ====== marketing pages ====== */
.marketing-nav { display: flex; align-items: center; padding: 18px 32px; gap: 24px; max-width: 1200px; margin: 0; }
.marketing-nav .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.marketing-nav .brand .logo { width: 38px; height: 38px; border-radius: 10px; background: #2c0508; border: 1px solid #fff; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 18px; position: relative; box-shadow: 0 6px 20px rgba(220,38,38,0.40); }
.marketing-nav .brand .logo::after { content: ''; position: absolute; inset: -2px; border-radius: inherit; background: linear-gradient(135deg, #dc2626 0%, #f87171 100%); filter: blur(12px); opacity: 0.32; z-index: -1; }
.marketing-nav .brand .brand-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--col-text); }
.marketing-nav .nav-links { display: flex; gap: 18px; margin-left: 30px; }
.marketing-nav .nav-links a { color: var(--col-text-muted); font-size: 14px; }
.marketing-nav .nav-links a:hover { color: var(--col-text); }
.marketing-nav .spacer { flex: 1; }
.marketing-nav .actions { display: flex; gap: 10px; align-items: center; }

.hero {
    position: relative;
    padding: 80px 32px 100px;
    text-align: center;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 22% 18%, rgba(185,72,84,.22) 0%, transparent 42%),
        radial-gradient(circle at 78% 78%, rgba(230,150,160,.20) 0%, transparent 48%),
        radial-gradient(circle at 50% 50%, rgba(90,169,255,.08) 0%, transparent 60%);
    pointer-events: none;
}
.hero-inner { max-width: 880px; margin: 0 auto; position: relative; }
.hero h1 { font-size: 56px; line-height: 1.05; letter-spacing: -.02em; margin-bottom: 18px; }
.hero h1 .grad { background: linear-gradient(90deg, #c95560 0%, #5e1c25 50%, #c95560 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 19px; color: var(--col-text-muted); max-width: 640px; margin: 0 auto 28px; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .trust-bar { margin-top: 56px; color: var(--col-text-dim); font-size: 12.5px; text-transform: uppercase; letter-spacing: .12em; }

.section { padding: 56px 32px; max-width: 1720px; margin: 0 auto; }
.section h2 { font-size: 36px; text-align: center; margin-bottom: 12px; }
.section .section-lead { text-align: center; font-size: 17px; color: var(--col-text-muted); margin-bottom: 36px; max-width: 660px; margin-left: auto; margin-right: auto; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.feature {
    background: var(--col-surface);
    border: 1px solid var(--col-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: transform var(--t), border-color var(--t);
}
.feature:hover { transform: translateY(-2px); border-color: rgba(185,72,84,.45); box-shadow: 0 10px 30px rgba(185,72,84,.12); }
.feature .icon { width: 44px; height: 44px; border-radius: 11px; background: linear-gradient(135deg, rgba(230,150,160,.32), rgba(185,72,84,.20)); color: #ffb8c0; display: grid; place-items: center; margin-bottom: 16px; box-shadow: 0 0 16px rgba(230,150,160,.35); }
.feature .icon svg { width: 22px; height: 22px; }
.feature h3 { font-size: 17px; margin-bottom: 8px; }
.feature p { font-size: 14px; color: var(--col-text-muted); }

/* pricing cards */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(295px, 1fr)); gap: 18px; max-width: 1720px; margin: 0 auto; }
.pricing-card {
    background: var(--col-surface);
    border: 1px solid var(--col-border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    position: relative;
    display: flex; flex-direction: column;
}
.pricing-card.featured { border-color: rgba(185,72,84,.55); box-shadow: 0 12px 40px rgba(185,72,84,.20), 0 0 0 1px rgba(230,150,160,.20); transform: translateY(-4px); }
.pricing-card .featured-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--grad-brand); color: #fff; padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; box-shadow: 0 4px 14px var(--col-brand-glow); }
.pricing-card .discount-badge { position: absolute; top: 12px; right: 12px; background: linear-gradient(135deg, #16a34a, #22c55e); color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .04em; box-shadow: 0 4px 14px rgba(34,197,94,.35); }
.pricing-card .price-original { text-decoration: line-through; color: var(--col-text-dim); font-size: 18px; font-weight: 600; margin-bottom: 2px; }
.pricing-card .discount-label { font-size: 12px; color: #22c55e; font-weight: 600; margin-top: 4px; margin-bottom: 6px; }
.pricing-card .feature-extras { margin-top: -8px; margin-bottom: 12px; }
.pricing-card .feature-extras > summary { cursor: pointer; list-style: none; color: var(--col-text-muted); font-size: 12.5px; padding: 6px 0; user-select: none; display: inline-flex; align-items: center; gap: 4px; }
.pricing-card .feature-extras > summary::-webkit-details-marker { display: none; }
.pricing-card .feature-extras > summary::before { content: '\25B8'; display: inline-block; transition: transform .15s ease; font-size: 10px; }
.pricing-card .feature-extras[open] > summary::before { transform: rotate(90deg); }
.pricing-card .feature-extras > summary:hover { color: var(--col-text); }
.pricing-card .feature-extras > ul { margin-top: 4px; }
.pricing-card h3 { font-size: 17px; }
.pricing-card .price { font-size: 38px; font-weight: 700; margin: 14px 0 2px; font-family: var(--font-display); }
.pricing-card .price small { font-size: 14px; font-weight: 400; color: var(--col-text-muted); }
.pricing-card .tagline { color: var(--col-text-muted); font-size: 13px; margin-bottom: 18px; min-height: 2.4em; }
.pricing-card ul { list-style: none; padding: 0; margin: 0 0 22px; flex: 1; }
.pricing-card li { font-size: 13.5px; padding: 6px 0; display: flex; align-items: start; gap: 8px; color: var(--col-text-muted); }
.pricing-card li.included { color: var(--col-text); }
.pricing-card li::before {
    content: '';
    width: 14px; height: 14px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='3'><polyline points='20 6 9 17 4 12'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    flex-shrink: 0;
    margin-top: 3px;
}
.pricing-card li:not(.included)::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2395a0b3' stroke-width='2'><line x1='18' y1='6' x2='6' y2='18'/><line x1='6' y1='6' x2='18' y2='18'/></svg>");
    opacity: .5;
}

footer.site-footer {
    padding: 40px 32px;
    border-top: 1px solid var(--col-border);
    color: var(--col-text-dim);
    font-size: 13px;
    text-align: center;
}
footer.site-footer a { color: var(--col-text-muted); }

/* ====== impersonation banner ====== */
.impersonation-banner { display: flex; align-items: center; justify-content: space-between; padding: 8px 20px; background: var(--col-warn); color: #1a1303; font-size: 13px; font-weight: 600; }
.impersonation-banner-msg { display: flex; align-items: center; gap: 8px; }
.impersonation-banner-stop { background: rgba(0,0,0,.2); color: #1a1303; border: 1px solid rgba(0,0,0,.25); border-radius: 4px; padding: 5px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.impersonation-banner-stop:hover { background: rgba(0,0,0,.3); }

/* ====== trial banner ====== */
.trial-banner { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, rgba(185,72,84,.16), rgba(230,150,160,.10)); border: 1px solid rgba(185,72,84,.35); padding: 10px 16px; border-radius: var(--radius-sm); margin-bottom: 20px; color: var(--col-brand-2); font-size: 13px; }
.trial-banner a { color: var(--col-brand-1); font-weight: 600; text-decoration: underline; }

/* ====== kanban board ====== */
.kanban-board { display: flex; gap: 14px; padding: 8px; overflow-x: auto; min-height: calc(100vh - 200px); }
.kanban-column {
    flex: 0 0 300px;
    background: var(--col-bg-1);
    border: 1px solid var(--col-border);
    border-radius: var(--radius);
    display: flex; flex-direction: column;
    max-height: calc(100vh - 200px);
}
.kanban-column-header { padding: 12px 14px; border-bottom: 1px solid var(--col-border); display: flex; align-items: center; gap: 8px; }
.kanban-column-header .dot { width: 9px; height: 9px; border-radius: 50%; }
.kanban-column-header .title { font-weight: 600; font-size: 13.5px; flex: 1; }
.kanban-column-header .count { font-size: 11.5px; color: var(--col-text-dim); background: var(--col-bg-3); padding: 2px 7px; border-radius: 999px; }
.kanban-column-body { padding: 10px; overflow-y: auto; flex: 1; min-height: 60px; }
.kanban-column.drag-over { background: var(--col-surface-3); border-color: var(--col-brand-1); box-shadow: 0 0 0 3px rgba(185,72,84,.18); }

.kanban-card {
    background: var(--col-surface);
    border: 1px solid var(--col-border);
    border-left: 3px solid var(--col-primary);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: grab;
    transition: transform var(--t-fast), box-shadow var(--t-fast);
    user-select: none;
    -webkit-user-select: none;
    /* Kill the iOS long-press callout (Copy / Share / Save) AND the Android
       text-selection menu. Without this, a long-press on a kanban card pops
       the native context menu instead of arming our drag. */
    -webkit-touch-callout: none;
    /* Prevent iOS Safari from activating its system drag-and-drop on
       long-press (which shows its own Download/Share/Print context menu).
       Belt-and-suspenders: also remove `draggable` from the template HTML. */
    -webkit-user-drag: none;
}
.kanban-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.kanban-card.dragging { opacity: .5; cursor: grabbing; }
/* Long-press pickup cue on touch -- card lifts slightly + glows before the
   user starts moving, so they know the drag is "armed". */
.kanban-card.kanban-card-armed {
    transform: scale(1.04);
    box-shadow: 0 8px 24px rgba(185,72,84,.45), 0 0 0 1px rgba(185,72,84,.55);
}
.kanban-card .ticket { font-size: 10.5px; color: var(--col-text-dim); font-family: var(--font-mono); font-weight: 600; letter-spacing: .03em; }
.kanban-card .title { font-size: 13.5px; margin: 4px 0 8px; line-height: 1.35; color: var(--col-text); }
.kanban-card .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--col-text-dim); }
.kanban-card .labels { display: flex; gap: 4px; }
.kanban-card .label-pill { font-size: 10px; padding: 1px 6px; border-radius: 4px; }
.kanban-add-task { display: flex; align-items: center; gap: 6px; padding: 8px 10px; color: var(--col-text-dim); cursor: pointer; border-radius: 6px; font-size: 13px; }
.kanban-add-task:hover { background: var(--col-surface-3); color: var(--col-text); }

/* ====== gantt chart ====== */
.gantt-wrap { background: var(--col-surface); border: 1px solid var(--col-border); border-radius: var(--radius); overflow: hidden; }
.gantt-toolbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--col-border); background: var(--col-bg-1); }
.gantt-scroll { overflow: auto; max-height: calc(100vh - 240px); }
.gantt-table { display: grid; min-width: 100%; }
.gantt-row { display: contents; }
.gantt-cell { border-bottom: 1px solid var(--col-border); padding: 6px 10px; font-size: 13px; min-height: 32px; box-sizing: border-box; }
.gantt-cell.head { background: var(--col-bg-1); position: sticky; top: 0; z-index: 2; font-size: 11px; text-transform: uppercase; color: var(--col-text-muted); }
.gantt-task-label { font-weight: 500; }
.gantt-bar-area { position: relative; overflow: hidden; padding: 0 !important; min-height: 32px; }
.gantt-bar {
    position: absolute; top: 6px; height: 20px;
    background: linear-gradient(90deg, var(--col-primary) 0%, var(--col-primary-2) 100%);
    border-radius: 5px;
    color: #fff;
    font-size: 11px;
    padding: 2px 7px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gantt-bar:hover { transform: translateY(-1px); }
.gantt-bar-overdue {
    position: absolute; top: 6px; height: 20px;
    border-radius: 5px;
    pointer-events: none;
    background: repeating-linear-gradient(45deg,
        rgba(220, 38, 38, 0.28) 0,
        rgba(220, 38, 38, 0.28) 6px,
        rgba(239, 68, 68, 0.45) 6px,
        rgba(239, 68, 68, 0.45) 12px);
    border: 1px solid rgba(239, 68, 68, 0.55);
    box-shadow: 0 0 0 1px rgba(0,0,0,.2) inset;
}
.gantt-bar-overdue::after {
    content: '';
    position: absolute;
    top: 50%; left: 6px; transform: translateY(-50%);
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--col-danger);
    box-shadow: 0 0 6px rgba(239,68,68,.7);
    animation: tf-overdue-pulse 1.8s ease-in-out infinite;
}
@keyframes tf-overdue-pulse {
    0%, 100% { opacity: .55; transform: translateY(-50%) scale(.85); }
    50%      { opacity: 1;   transform: translateY(-50%) scale(1.15); }
}

/* Same style for the company-level Gantt overview project bars */
.gantt-ov-overdue {
    position: absolute; top: 9px; height: 26px;
    border-radius: 6px;
    pointer-events: none;
    background: repeating-linear-gradient(45deg,
        rgba(220, 38, 38, 0.28) 0,
        rgba(220, 38, 38, 0.28) 6px,
        rgba(239, 68, 68, 0.45) 6px,
        rgba(239, 68, 68, 0.45) 12px);
    border: 1px solid rgba(239, 68, 68, 0.55);
}
.gantt-ov-overdue::after {
    content: '';
    position: absolute;
    top: 50%; left: 7px; transform: translateY(-50%);
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--col-danger);
    box-shadow: 0 0 7px rgba(239,68,68,.7);
    animation: tf-overdue-pulse 1.8s ease-in-out infinite;
}
.gantt-grid-vline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--col-border); }
.gantt-today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--col-warn); z-index: 1; }
.gantt-dep-line { position: absolute; pointer-events: none; }

/* ====== modal ====== */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); z-index: 1000; display: none; align-items: center; justify-content: center; }
.modal-backdrop.open { display: flex; }
.modal {
    background:
        radial-gradient(420px 280px at 100% 0%, rgba(230,150,160,.10) 0%, transparent 60%),
        radial-gradient(420px 280px at 0% 100%, rgba(185,72,84,.08) 0%, transparent 60%),
        var(--col-surface);
    border: 1px solid var(--col-border);
    border-radius: var(--radius-lg);
    width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(185,72,84,.10), 0 0 40px rgba(230,150,160,.10);
    position: relative;
    background-clip: padding-box;
}
.modal::before {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 2px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--grad-brand-h);
    opacity: .75;
    pointer-events: none;
}
.modal.modal-lg { max-width: 880px; }
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--col-border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h2 { margin: 0; font-size: 18px; }
.modal-close { background: transparent; border: 0; color: var(--col-text-muted); cursor: pointer; padding: 4px; }
.modal-body { padding: 22px; }
.modal-footer { padding: 16px 22px; border-top: 1px solid var(--col-border); display: flex; justify-content: flex-end; gap: 10px; }

/* ====== task detail ====== */
.task-detail-grid { display: grid; grid-template-columns: 1fr 280px; gap: 24px; }
@media (max-width: 920px) { .task-detail-grid { grid-template-columns: 1fr; } }
.task-meta-table { width: 100%; font-size: 13px; }
.task-meta-table td { padding: 6px 8px; vertical-align: top; }
.task-meta-table td.lbl { color: var(--col-text-muted); width: 40%; }
.comment { background: var(--col-bg-1); border: 1px solid var(--col-border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; }
.comment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 12px; color: var(--col-text-muted); }
.comment-body { font-size: 13.5px; white-space: pre-wrap; }

/* ====== custom color picker ====== */
.tf-picker-swatch {
    display: inline-flex; align-items: center; gap: 8px;
    height: 38px; padding: 0 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--col-border-2);
    background: var(--col-primary);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 12px;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
    transition: transform var(--t-fast);
}
.tf-picker-swatch:hover { transform: translateY(-1px); }
.tf-picker-swatch .tf-picker-hex-label {
    padding: 2px 6px;
    background: rgba(0,0,0,.45);
    border-radius: 4px;
    text-shadow: 0 1px 1px rgba(0,0,0,.4);
}
.tf-picker-panel {
    position: absolute; z-index: 10000;
    min-width: 280px; max-width: 320px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(20,27,45,.98) 0%, rgba(28,22,52,.98) 100%);
    border: 1px solid var(--col-border-2);
    border-radius: var(--radius);
    box-shadow: 0 24px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(90,169,255,.25), 0 0 28px rgba(139,92,246,.2);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(6px) scale(.98);
    pointer-events: none;
    transition: opacity 150ms ease-out, transform 150ms ease-out;
}
.tf-picker-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.tf-picker-sv {
    position: relative;
    width: 200px; height: 140px;
    border-radius: 6px;
    cursor: crosshair;
    background:
        linear-gradient(to top, #000, transparent),
        linear-gradient(to right, #fff, hsl(210,100%,50%));
    overflow: hidden;
}
.tf-picker-sv-handle {
    position: absolute;
    width: 14px; height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    margin: -7px 0 0 -7px;
    box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 1px 4px rgba(0,0,0,.5);
    pointer-events: none;
}
.tf-picker-hue-wrap { display: flex; align-items: stretch; }
.tf-picker-hue {
    position: relative;
    width: 18px; height: 140px;
    border-radius: 4px;
    cursor: ns-resize;
    background: linear-gradient(to bottom,
        #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%,
        #0000ff 67%, #ff00ff 83%, #ff0000 100%);
}
.tf-picker-hue-handle {
    position: absolute; left: -3px; width: 24px; height: 6px;
    border-radius: 3px; background: #fff; border: 1px solid rgba(0,0,0,.4);
    margin-top: -3px;
    box-shadow: 0 1px 3px rgba(0,0,0,.5);
    pointer-events: none;
}
.tf-picker-out {
    display: flex; align-items: center; gap: 8px; margin-top: 10px;
}
.tf-picker-preview {
    width: 36px; height: 28px;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,.1);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.3);
    background: var(--col-primary);
}
.tf-picker-hex {
    flex: 1;
    height: 28px;
    background: var(--col-bg-1);
    border: 1px solid var(--col-border);
    color: var(--col-text);
    padding: 0 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    border-radius: 5px;
    text-transform: lowercase;
}
.tf-picker-hex:focus { outline: none; border-color: var(--col-brand-1); box-shadow: 0 0 0 2px rgba(185,72,84,.22); }
.tf-picker-label {
    font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
    color: var(--col-text-dim); margin: 12px 0 6px; font-weight: 600;
}
.tf-picker-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 4px;
}
.tf-picker-cell {
    width: 100%; aspect-ratio: 1/1; min-height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,.06);
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.4);
    transition: transform 80ms ease-out;
    padding: 0;
}
.tf-picker-cell:hover { transform: scale(1.15); border-color: rgba(255,255,255,.4); z-index: 1; }

/* Compact swatch variant for inline use in forms */
.tf-picker-compact .tf-picker-swatch { height: 32px; padding: 0 8px; font-size: 11px; }
.tf-picker-compact .tf-picker-swatch .tf-picker-hex-label { font-size: 10.5px; }

/* ====== kanban quick-edit drawer ====== */
.tf-drawer-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(3px);
    z-index: 950;
    opacity: 0;
    transition: opacity 200ms ease-out;
    pointer-events: none;
}
.tf-drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.tf-drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 560px; max-width: 92vw;
    background: var(--col-surface);
    border-left: 1px solid var(--col-border-2);
    box-shadow: -24px 0 60px rgba(0,0,0,.5);
    transform: translateX(100%);
    transition: transform 240ms cubic-bezier(.4,0,.2,1);
    z-index: 960;
    display: flex; flex-direction: column;
    overflow: hidden;
}
.tf-drawer.open { transform: translateX(0); }
.tf-drawer-header {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--col-border);
    background: var(--col-bg-1);
    flex-shrink: 0;
}
.tf-drawer-header .ticket {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--col-text-dim);
    padding: 2px 6px;
    background: var(--col-bg-3);
    border-radius: 4px;
}
.tf-drawer-header h2 { margin: 0; font-size: 16px; flex: 1; min-width: 0; }
.tf-drawer-close {
    width: 32px; height: 32px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--col-text-muted);
    border-radius: 6px;
    cursor: pointer;
}
.tf-drawer-close:hover { background: var(--col-surface-3); color: var(--col-text); }
.tf-drawer-body { flex: 1; overflow-y: auto; padding: 18px; }
.tf-drawer-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--col-border);
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    background: var(--col-bg-1);
    flex-shrink: 0;
}
.tf-drawer.loading .tf-drawer-body { opacity: .5; pointer-events: none; }

/* ====== kanban card visual rules ====== */
.kanban-card { position: relative; transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast); }
.kanban-card[data-bg-tint] {
    background: linear-gradient(to right, var(--card-tint-color, var(--col-surface)) 0%, var(--col-surface) 100%);
}

/* ====== tooltips (the POP ones) ====== */
@keyframes tf-tip-in {
    0%   { opacity: 0; transform: translateY(6px) scale(.92); filter: blur(2px); }
    60%  { opacity: 1; transform: translateY(-1px) scale(1.02); filter: blur(0); }
    100% { opacity: 1; transform: translateY(0) scale(1);      filter: blur(0); }
}
@keyframes tf-tip-glow {
    0%, 100% { box-shadow: 0 16px 40px rgba(0,0,0,.55), 0 0 0 1px rgba(90,169,255,.4), 0 0 24px rgba(90,169,255,.25), 0 0 60px rgba(139,92,246,.18); }
    50%      { box-shadow: 0 16px 40px rgba(0,0,0,.55), 0 0 0 1px rgba(139,92,246,.55), 0 0 28px rgba(139,92,246,.32), 0 0 70px rgba(90,169,255,.22); }
}

.tf-tip {
    position: absolute;
    z-index: 9999;
    pointer-events: none;
    max-width: 320px;
    padding: 11px 14px 11px 18px;
    background: linear-gradient(135deg, rgba(20,27,45,.96) 0%, rgba(28,22,52,.96) 50%, rgba(18,25,42,.96) 100%);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    color: #f1f6ff;
    font-family: var(--font-display);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: .005em;
    border-radius: 10px;
    border: 1px solid transparent;
    background-clip: padding-box;
    opacity: 0;
    transform: translateY(6px) scale(.92);
    transition: opacity 80ms ease-out;
    text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.tf-tip.open {
    opacity: 1;
    animation: tf-tip-in 240ms cubic-bezier(.22,.61,.36,1) both,
               tf-tip-glow 3.6s ease-in-out 240ms infinite;
}
.tf-tip strong { color: #fff; font-weight: 600; }
.tf-tip code {
    font-family: var(--font-mono);
    background: rgba(90,169,255,.18);
    color: #cee3ff;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 11.5px;
    border: 1px solid rgba(90,169,255,.3);
}

/* Animated gradient left bar */
.tf-tip::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    border-radius: 10px 0 0 10px;
    background: linear-gradient(180deg, var(--col-brand-1) 0%, var(--col-brand-2) 50%, var(--col-brand-1) 100%);
    background-size: 100% 200%;
    animation: tf-bar-flow 2.4s linear infinite;
}
@keyframes tf-bar-flow {
    0%   { background-position: 0 0; }
    100% { background-position: 0 -200%; }
}

/* Pointing arrow — anchored at --tf-tip-arrow (set by JS to the trigger's horiz center) */
.tf-tip::after {
    content: '';
    position: absolute;
    left: var(--tf-tip-arrow, 50%);
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, rgba(20,27,45,.96), rgba(28,22,52,.96));
    border-left: 1px solid rgba(90,169,255,.35);
    border-top:  1px solid rgba(90,169,255,.35);
    backdrop-filter: blur(10px);
}
.tf-tip[data-placement="below"]::after {
    top: -6px;
}
.tf-tip[data-placement="above"]::after {
    bottom: -6px;
    border-left: none; border-top: none;
    border-right:  1px solid rgba(139,92,246,.35);
    border-bottom: 1px solid rgba(139,92,246,.35);
}

/* The 'i' icon prefix — auto-prepended via a span when content has no <strong> already */
.tf-tip-icon {
    display: inline-block;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--grad-brand);
    color: #fff;
    text-align: center;
    line-height: 14px;
    font-size: 10px;
    font-weight: 700;
    font-style: normal;
    margin-right: 6px;
    vertical-align: -1px;
    box-shadow: 0 0 10px var(--col-brand-glow);
}

/* Subtle "has helper" indicator on focusable form fields */
.field [data-tip]:not(input):not(textarea):not(select),
label[data-tip] {
    cursor: help;
}
label[data-tip]::after {
    content: '?';
    display: inline-block;
    width: 13px; height: 13px;
    border-radius: 50%;
    background: var(--col-bg-3);
    color: var(--col-text-muted);
    font-size: 9.5px;
    font-weight: 700;
    line-height: 13px;
    text-align: center;
    margin-left: 5px;
    vertical-align: 1px;
    transition: background var(--t-fast), color var(--t-fast);
}
label[data-tip]:hover::after {
    background: var(--col-primary);
    color: #fff;
}
html.tips-off label[data-tip]::after { display: none; }

/* When tips are off, suppress entirely */
html.tips-off .tf-tip { display: none !important; }

/* ====== misc utility ====== */
.row { display: flex; gap: 16px; }
.col { flex: 1; min-width: 0; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }
.text-muted { color: var(--col-text-muted); }
.text-dim   { color: var(--col-text-dim); }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-end { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.hidden { display: none !important; }
.muted-empty { text-align: center; padding: 60px 24px; color: var(--col-text-dim); }
.muted-empty h3 {
    margin-bottom: 6px;
    background: var(--grad-brand-h);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

/* ====== Round 4 — board toolbar + filter chips + per-card gradient ====== */

.board-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 6px 8px 12px; flex-wrap: wrap; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px;
    background: var(--col-surface-2);
    border: 1px solid var(--col-border);
    color: var(--col-text-muted);
    font-size: 12.5px;
    border-radius: 999px;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s, transform .15s;
    cursor: pointer;
    line-height: 1.4;
}
.chip:hover { background: var(--col-surface-3); color: var(--col-text); border-color: var(--col-border-2); transform: translateY(-1px); }
.chip.chip-on {
    background: linear-gradient(135deg, rgba(185,72,84,.24), rgba(230,150,160,.10));
    color: var(--col-text);
    border-color: rgba(185,72,84,.55);
    box-shadow: 0 0 0 1px rgba(185,72,84,.18) inset;
}
.chip.chip-warn { color: var(--col-warn); border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.07); }
.chip.chip-warn.chip-on { background: linear-gradient(135deg, rgba(245,158,11,.25), rgba(245,158,11,.08)); }

/* Top "+" on each kanban column header */
.kanban-column-header { position: relative; }
.col-add-top {
    width: 24px; height: 24px;
    display: inline-grid; place-items: center;
    background: var(--col-surface-3);
    border: 1px solid var(--col-border-2);
    color: var(--col-text-muted);
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0 0 2px;
    transition: background .15s, color .15s, transform .15s;
}
.col-add-top:hover {
    background: linear-gradient(135deg, rgba(185,72,84,.35), rgba(230,150,160,.14));
    border-color: rgba(185,72,84,.6);
    color: #fff;
    transform: scale(1.08);
}

/* Card background gradient modes — picked by user prefs.
   --card-edge = resolved priority/custom edge color
   --card-accent = assignee color (or edge if unassigned)
   --grad-from / --grad-to = board-wide custom palette */
.kanban-board.board-grad-off  .kanban-card { background: var(--col-surface); }
.kanban-board.board-grad-priority .kanban-card {
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--card-edge) 18%, transparent) 0%,
            var(--col-surface) 72%);
}
.kanban-board.board-grad-assignee .kanban-card {
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--card-accent) 22%, transparent) 0%,
            var(--col-surface) 75%);
}
.kanban-board.board-grad-custom .kanban-card {
    background: linear-gradient(135deg, var(--grad-from) 0%, var(--grad-to) 90%);
    color: var(--col-text);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .kanban-board.board-grad-priority .kanban-card,
    .kanban-board.board-grad-assignee .kanban-card {
        background: linear-gradient(135deg, var(--col-surface-3) 0%, var(--col-surface) 75%);
    }
}

.kanban-board.density-compact .kanban-card { padding: 8px 10px; }
.kanban-board.density-comfortable .kanban-card { padding: 11px 12px; }
.kanban-board.density-spacious .kanban-card { padding: 16px 14px 14px; }

/* Card meta pills */
.kanban-card .meta-left { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kanban-card .meta-due { color: var(--col-text-dim); }
.kanban-card .meta-due.is-overdue { color: var(--col-danger); font-weight: 600; }
.meta-pill {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 10.5px; padding: 1px 6px;
    border-radius: 4px;
    background: rgba(255,255,255,.04);
    color: var(--col-text-dim);
    border: 1px solid var(--col-border);
}
.meta-pill.pill-warn  { color: var(--col-warn);  background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.3); }
.meta-pill.pill-muted { color: var(--col-text-dim); }

.kanban-card.card-pending-arch {
    background-image: repeating-linear-gradient(135deg,
        rgba(245,158,11,.10) 0 6px,
        transparent 6px 14px);
    border-color: rgba(245,158,11,.35);
}
.kanban-card.card-archived {
    opacity: .55;
    filter: grayscale(.4);
}

/* ====== Round 4 — attachments drop zone ====== */
.attach-zone {
    position: relative;
    border: 2px dashed var(--col-border-2);
    border-radius: var(--radius);
    background: var(--col-surface-2);
    padding: 22px 18px;
    text-align: center;
    color: var(--col-text-muted);
    transition: border-color .15s, background .15s, transform .15s;
    cursor: pointer;
}
.attach-zone:hover { border-color: var(--col-text-dim); background: var(--col-surface-3); }
.attach-zone.dragover {
    border-color: var(--col-brand-1);
    background: linear-gradient(135deg, rgba(185,72,84,.20), rgba(230,150,160,.08));
    color: #fff;
    transform: scale(1.01);
    box-shadow: 0 0 0 3px rgba(185,72,84,.16);
}
.attach-zone .attach-icon { font-size: 28px; display: block; margin-bottom: 6px; opacity: .8; }
.attach-zone strong { color: var(--col-text); display: block; margin-top: 2px; }
.attach-list { display: grid; gap: 6px; margin-top: 10px; }
.attach-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    background: var(--col-surface-2);
    border: 1px solid var(--col-border);
    border-radius: var(--radius-sm);
}
.attach-row .att-thumb { width: 36px; height: 36px; background: var(--col-surface-3); border-radius: 6px; display: grid; place-items: center; color: var(--col-text-dim); font-size: 14px; flex-shrink: 0; overflow: hidden; }
.attach-row .att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attach-row .att-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--col-text); }
.attach-row .att-meta { font-size: 11px; color: var(--col-text-dim); }
.attach-row .btn { padding: 4px 8px; font-size: 11.5px; }
.attach-progress { height: 4px; background: var(--col-border); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.attach-progress span { display: block; height: 100%; background: var(--grad-brand-h); transition: width .2s; }

/* ====== Round 4 — onboarding wizard ====== */
.onb-shell { max-width: 760px; margin: 30px auto; padding: 28px; background: var(--col-surface); border: 1px solid var(--col-border); border-radius: var(--radius); box-shadow: var(--shadow); }
.onb-step-dots { display: flex; gap: 6px; margin-bottom: 18px; }
.onb-step-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--col-border-2); }
.onb-step-dots span.on { background: var(--grad-brand); box-shadow: 0 0 0 2px rgba(185,72,84,.30); }
.preset-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-top: 14px; }
.preset-card {
    border: 1px solid var(--col-border);
    border-radius: var(--radius);
    background: var(--col-surface-2);
    padding: 14px;
    cursor: pointer;
    transition: border-color .15s, transform .15s, background .15s;
}
.preset-card:hover { border-color: var(--col-border-2); background: var(--col-surface-3); transform: translateY(-2px); }
.preset-card.selected {
    border-color: var(--col-brand-1);
    background: linear-gradient(135deg, rgba(185,72,84,.18), rgba(230,150,160,.06));
    box-shadow: 0 0 0 2px rgba(185,72,84,.18);
}
.preset-card h4 { font-size: 14px; margin: 0 0 4px; }
.preset-card p { font-size: 12px; margin: 0; color: var(--col-text-dim); }
.preset-card .preset-terms { font-size: 11.5px; color: var(--col-text-muted); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--col-border); }

.watchers-list { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.watcher-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 4px; background: var(--col-surface-2); border: 1px solid var(--col-border); border-radius: 999px; font-size: 12px; }
.watcher-chip .avatar { width: 18px; height: 18px; font-size: 10px; }
.watcher-chip button { background: transparent; border: 0; color: var(--col-text-dim); cursor: pointer; padding: 0 4px; font-size: 14px; }
.watcher-chip button:hover { color: var(--col-danger); }
.watcher-add { display: inline-flex; gap: 4px; align-items: center; }
.watcher-add .select { padding: 4px 8px; font-size: 12px; }

/* QR area for 2FA */
.qr-card { display: grid; place-items: center; padding: 16px; background: #fff; border-radius: var(--radius-sm); width: 220px; margin: 0 auto; }
.qr-card img { width: 188px; height: 188px; image-rendering: pixelated; }
.recovery-codes { font-family: var(--font-mono); background: var(--col-bg-2); padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--col-border); display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.recovery-codes code { background: transparent; border: 0; padding: 0; font-size: 13px; color: var(--col-text); }

/* Stripe card */
.stripe-card { background: var(--col-surface-2); border: 1px solid var(--col-border); border-radius: var(--radius); padding: 16px; }
.stripe-card .price { font-size: 28px; font-weight: 700; color: var(--col-text); }
.stripe-card .price small { font-size: 12px; color: var(--col-text-dim); font-weight: 400; }

/* Gradient swatch preview for preferences page */
.grad-preview { width: 100%; height: 64px; border-radius: var(--radius-sm); border: 1px solid var(--col-border); margin-top: 8px; }

/* User preferences mode picker */
.mode-radios { display: flex; gap: 8px; flex-wrap: wrap; }
.mode-radios label { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 12px; background: var(--col-surface-2); border: 1px solid var(--col-border); border-radius: var(--radius-sm); cursor: pointer; min-width: 84px; font-size: 12px; }
.mode-radios label:hover { background: var(--col-surface-3); border-color: var(--col-border-2); }
.mode-radios input { display: none; }
.mode-radios input:checked + .mode-swatch + span { color: var(--col-text); font-weight: 600; }
.mode-radios input:checked ~ * { color: var(--col-text); }
.mode-radios label:has(input:checked) {
    background: linear-gradient(135deg, rgba(185,72,84,.22), rgba(230,150,160,.06));
    border-color: var(--col-brand-1);
    box-shadow: 0 0 0 1px rgba(185,72,84,.22) inset;
}
.mode-swatch { width: 56px; height: 26px; border-radius: 5px; border: 1px solid var(--col-border); }

/* ======================================================================
   MOBILE / TABLET (<= 760px)
   Off-canvas sidebar, single-column page header, scrollable kanban,
   touch-tuned drag affordances.
   ====================================================================== */

/* Kanban: never let the browser steal touchstart for scroll/zoom on cards.
   Without touch-action:none, pointer drag aborts the instant the card moves. */
.kanban-card { touch-action: none; }
.gantt-bar   {
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
}

/* Mobile backdrop for the off-canvas sidebar. */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(2px);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t);
}
html.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
}
@media (min-width: 761px) { .sidebar-backdrop { display: none; } }

@media (max-width: 760px) {
    /* App shell becomes single-column; sidebar is overlaid, not gridded. */
    .app-shell { grid-template-columns: 1fr; }
    html.sidebar-collapsed .app-shell { grid-template-columns: 1fr; }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 260px;
        height: 100vh;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform .26s ease;
        /* keep its full styling; just slide it in */
    }
    html.sidebar-open .sidebar { transform: translateX(0); }
    /* While the drawer is open, force its expanded form even if global
       sidebar-collapsed is set from desktop preferences. */
    html.sidebar-collapsed.sidebar-open .sidebar-brand .brand-text,
    html.sidebar-collapsed.sidebar-open .sidebar-link span,
    html.sidebar-collapsed.sidebar-open .sidebar-section-label {
        display: revert;
    }
    html.sidebar-collapsed.sidebar-open .sidebar-link {
        padding-left: 10px; padding-right: 10px; justify-content: flex-start; gap: 12px;
    }

    /* Topbar tightens. */
    .topbar { padding: 0 12px; gap: 8px; }
    .topbar-title { font-size: 14px; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .topbar-search { display: none; }   /* hidden on phones; tap search icon instead if you add one */
    .profile-btn > div:not(.avatar) { display: none; }   /* hide name/email next to avatar */
    .profile-btn svg { display: none; }                  /* hide chevron */

    .app-content { padding: 14px; }

    /* Page header stacks. */
    .page-header { flex-direction: column; align-items: stretch; gap: 12px; }
    .page-header h1 { font-size: 22px; }
    .page-header .flex-end { flex-wrap: wrap; gap: 8px; }
    .page-header .flex-end .btn { flex: 1 1 auto; min-width: 0; }

    /* Board toolbar wraps + scrolls horizontally for filter chips. */
    .board-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
    .filter-chips { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
    .filter-chips .chip { white-space: nowrap; flex: 0 0 auto; }

    /* Kanban: slightly narrower columns, full-height scroll. */
    .kanban-board { gap: 10px; padding: 4px; min-height: calc(100vh - 240px); }
    .kanban-column { flex: 0 0 84vw; max-width: 320px; max-height: calc(100vh - 240px); }
    .kanban-column-body { padding: 8px; }

    /* Marketing/auth pages already had an 880px breakpoint -- this one
       further compresses headings on small phones. */
    .hero { padding: 56px 18px 64px; }
    .hero h1 { font-size: 36px; }
    .hero p.lead { font-size: 16px; }
    .section { padding: 56px 18px; }
    .section h2 { font-size: 26px; }

    /* Tables get horizontal scroll instead of being squashed. */
    .table { font-size: 12.5px; }
    .table-wrap, .table-scroll { overflow-x: auto; }

    /* Forms: full-width buttons. */
    .modal { max-width: 100%; border-radius: 0; max-height: 100vh; }
    .modal-footer .btn { flex: 1 1 auto; }
}

/* Phones in portrait (very narrow). */
@media (max-width: 380px) {
    .topbar-title { display: none; }
    .kpi-grid { grid-template-columns: 1fr; }
    .kanban-column { flex: 0 0 88vw; }
}

