/* ─────────────────────────────────────────────────────────────────────────
   WBoard · ClickUp-inspired UI · v2
   ───────────────────────────────────────────────────────────────────────── */

:root {
    /* Brand */
    --green:        #2E7C1A;
    --green-dark:   #1F5C10;
    --green-soft:   rgba(46, 124, 26, 0.08);
    --green-soft-2: rgba(46, 124, 26, 0.16);

    /* Neutrals */
    --bg:           #f6f8fb;
    --bg-soft:      #eef2f7;
    --surface:      #ffffff;
    --surface-2:    #fafbfd;
    --line:         #e5e9f0;
    --line-strong:  #d6dde7;

    /* Text */
    --text:         #14202b;
    --text-soft:    #475467;
    --muted:        #6b7785;
    --muted-2:      #8a94a3;

    /* Status colors */
    --st-todo:      #64748b;
    --st-doing:     #2563eb;
    --st-review:    #d97706;
    --st-done:      #16a34a;

    /* Priority */
    --pr-low:       #94a3b8;
    --pr-medium:    #0ea5e9;
    --pr-high:      #f59e0b;
    --pr-critical:  #dc2626;

    /* Accent (project-driven, default green) */
    --accent:       #2E7C1A;

    /* Effects */
    --danger:       #dc2626;
    --danger-soft:  #fee2e2;
    --purple:       #7c3aed;
    --purple-soft:  #ede9fe;

    --shadow-sm:    0 1px 2px rgba(20, 32, 43, 0.04);
    --shadow:       0 1px 3px rgba(20, 32, 43, 0.06), 0 8px 24px rgba(20, 32, 43, 0.04);
    --shadow-lg:    0 16px 40px rgba(20, 32, 43, 0.10);

    --radius-xs:    8px;
    --radius-sm:    10px;
    --radius:       14px;
    --radius-lg:    20px;
    --radius-xl:    28px;
}

/* ─── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--bg);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; color: var(--text); }
h1 { font-size: clamp(1.6rem, 2vw + 1rem, 2.4rem); letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }
p  { margin: 0 0 8px; color: var(--text-soft); }
small { color: var(--muted); }
a  { color: inherit; text-decoration: none; }
em { font-style: normal; }

input, select, textarea, button { font-family: inherit; font-size: inherit; color: inherit; }

code {
    background: var(--green-soft);
    color: var(--green-dark);
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 0.85em;
    font-family: 'SF Mono', 'Menlo', monospace;
}

/* ─── Inputs ────────────────────────────────────────────────────── */
input[type=text], input[type=email], input[type=password], input[type=date],
select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
input[type=color] {
    width: 60px; height: 40px; padding: 4px;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--green-soft);
}
textarea { resize: vertical; min-height: 80px; }
label { display: grid; gap: 6px; }
label > span { font-size: 0.78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* ─── Buttons ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: 0;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
    background: linear-gradient(180deg, #3a9622 0%, var(--green) 100%);
    color: #fff;
    box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 4px 12px rgba(46,124,26,0.25);
}
.btn-primary:hover { box-shadow: 0 1px 0 rgba(255,255,255,0.3) inset, 0 6px 16px rgba(46,124,26,0.35); }
.btn-ghost {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line-strong);
}
.btn-ghost:hover { background: var(--bg-soft); }
.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid #fecaca;
}
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 6px 10px; font-size: 0.86rem; }
.btn-full { width: 100%; }

/* ─── Auth (login) ─────────────────────────────────────────────── */
.auth-shell {
    min-height: 100vh;
    background:
        radial-gradient(1000px 600px at -10% -10%, rgba(46,124,26,0.16), transparent 50%),
        radial-gradient(800px 600px at 110% 110%, rgba(124,58,237,0.10), transparent 50%),
        var(--bg);
    display: grid;
    place-items: center;
    padding: 24px;
}
.auth-grid {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1.1fr 460px;
    gap: 48px;
    align-items: center;
}
.auth-copy h1 {
    margin: 16px 0 12px;
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    letter-spacing: -0.03em;
    line-height: 1.05;
}
.auth-copy .lead { color: var(--text-soft); font-size: 1.05rem; max-width: 520px; }
.feature-grid {
    margin-top: 32px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.feature-card {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.feature-card strong { display: block; margin: 12px 0 4px; font-size: 0.95rem; }
.feature-card p { margin: 0; font-size: 0.85rem; color: var(--muted); }
.feature-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: grid; place-items: center;
    font-size: 18px; font-weight: 700;
}
.auth-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-lg);
}
.card-header { margin-bottom: 18px; }
.card-header h2 { margin-top: 8px; }
.demo-box {
    margin-top: 18px;
    padding: 14px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface-2);
}
.demo-box p { margin: 4px 0; font-size: 0.86rem; color: var(--muted); }

.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; background: #fff; padding: 4px; border: 1px solid var(--line); }
.brand-logo.large-logo { width: 64px; height: 64px; }
.brand-name { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em; }

.eyebrow {
    display: inline-block;
    margin: 0 0 6px;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    font-weight: 700;
}

.stack-form { display: grid; gap: 14px; }

/* ─── App shell ────────────────────────────────────────────────── */
.app {
    display: grid;
    grid-template-columns: 256px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky; top: 0;
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--line);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 6px 10px;
}
.sidebar-brand img { width: 32px; height: 32px; object-fit: contain; border-radius: 8px; background: #fff; padding: 3px; border: 1px solid var(--line); }
.sidebar-brand strong { display: block; font-size: 1rem; font-weight: 800; }
.sidebar-brand span { display: block; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-weight: 500;
    transition: background 0.12s, color 0.12s;
}
.sidebar-nav a:hover { background: var(--bg-soft); color: var(--text); }
.sidebar-nav a.active {
    background: var(--green-soft);
    color: var(--green-dark);
    font-weight: 600;
}
.sidebar-nav a.active svg { color: var(--green); }
.sidebar-nav a span { flex: 1; }
.nav-badge {
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    line-height: 1.4;
}

.sidebar-section { display: flex; flex-direction: column; gap: 4px; }
.sidebar-label {
    margin: 0;
    padding: 0 12px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--muted-2);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.sidebar-projects { display: flex; flex-direction: column; gap: 1px; }
.sidebar-project {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-size: 0.9rem;
    transition: background 0.12s;
}
.sidebar-project:hover { background: var(--bg-soft); }
.sidebar-project.active { background: var(--green-soft); color: var(--green-dark); font-weight: 600; }
.sidebar-project span:not(.project-dot) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-project-new { color: var(--muted); }
.project-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 4px;
    background: var(--green);
    flex-shrink: 0;
    text-align: center; line-height: 10px;
    font-size: 10px; font-weight: 700;
}

.sidebar-foot {
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.profile { display: flex; align-items: center; gap: 10px; flex: 1; padding: 0 8px; min-width: 0; }
.profile strong { display: block; font-size: 0.88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile span { display: block; color: var(--muted); font-size: 0.74rem; }

/* ─── Avatars ──────────────────────────────────────────────────── */
.avatar {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 30px; height: 30px;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 0.78rem;
    flex-shrink: 0;
    border: 2px solid #fff;
}
.avatar-sm { width: 26px; height: 26px; font-size: 0.72rem; border-width: 2px; }
.avatar-xs { width: 22px; height: 22px; font-size: 0.66rem; border-width: 2px; }
.avatar-more { background: var(--bg-soft) !important; color: var(--muted) !important; }
.avatars { display: inline-flex; }
.avatars .avatar { margin-left: -6px; }
.avatars .avatar:first-child { margin-left: 0; }
.avatar-row { display: inline-flex; align-items: center; gap: 8px; }

/* ─── Main ─────────────────────────────────────────────────────── */
.main {
    padding: 24px 28px 48px;
    max-width: 100%;
    overflow-x: hidden;
}

.page-head {
    display: flex; justify-content: space-between; align-items: end; gap: 24px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.page-head .lead { margin: 8px 0 0; color: var(--muted); max-width: 600px; }
.page-actions { display: flex; gap: 8px; }

.kpi-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}
.kpi {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.12s, box-shadow 0.12s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi span { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }
.kpi strong { display: block; margin-top: 6px; font-size: 1.8rem; letter-spacing: -0.02em; font-weight: 700; }
.kpi-alert strong { color: var(--danger); }

/* ─── Cards ────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}
.card.alert-card { border-color: #fecaca; background: #fff7f7; }
.card-head {
    display: flex; justify-content: space-between; align-items: end; gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.card-head p { margin: 4px 0 0; }
.card-head .muted { color: var(--muted); font-size: 0.86rem; }

.muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.empty { color: var(--muted); padding: 28px; text-align: center; font-style: normal; }
.link { color: var(--green-dark); font-weight: 600; }
.link:hover { text-decoration: underline; }
.link.strong { font-weight: 700; color: var(--text); }
.link.strong:hover { color: var(--green); }
.link-sm { color: var(--green-dark); font-size: 0.86rem; font-weight: 600; }

.grid-2-cols {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

/* ─── Workspace tiles ──────────────────────────────────────────── */
.workspace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.workspace-grid.lg-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.workspace-tile {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.14s, box-shadow 0.14s, border-color 0.14s;
    color: var(--text);
    border-top: 3px solid var(--accent, var(--green));
}
.workspace-tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--line-strong);
}
.workspace-tile h3, .workspace-tile h4 { margin: 12px 0 6px; }
.workspace-tile.lg h3 { font-size: 1.2rem; }
.workspace-tile p { margin: 0 0 14px; color: var(--muted); font-size: 0.88rem; min-height: 2.6em; }
.workspace-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.progress-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-soft);
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar span { display: block; height: 100%; background: var(--green); border-radius: 999px; transition: width 0.3s; }
.progress-row em { font-size: 0.78rem; font-weight: 700; color: var(--muted); min-width: 36px; text-align: right; }

.tile-foot {
    display: flex; justify-content: space-between; align-items: center;
    color: var(--muted); font-size: 0.84rem;
}

/* ─── Project banner ───────────────────────────────────────────── */
.project-banner {
    border-radius: var(--radius-lg);
    color: #fff;
    padding: 28px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    align-items: end;
}
.project-banner h1 { color: #fff; margin: 12px 0 6px; }
.project-banner p { color: rgba(255,255,255,0.92); max-width: 720px; margin: 0; }
.banner-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.banner-stats {
    display: flex;
    gap: 20px;
}
.banner-stats > div { text-align: center; }
.banner-stats strong { display: block; font-size: 1.6rem; line-height: 1; }
.banner-stats span { display: block; color: rgba(255,255,255,0.88); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }

/* ─── Tabs ─────────────────────────────────────────────────────── */
.tab-nav {
    display: flex; gap: 2px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    width: fit-content;
    box-shadow: var(--shadow-sm);
}
.tab-nav a {
    padding: 8px 14px;
    border-radius: var(--radius-xs);
    color: var(--muted);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.12s, color 0.12s;
    display: inline-flex; align-items: center; gap: 6px;
}
.tab-nav a:hover { background: var(--bg-soft); color: var(--text); }
.tab-nav a.active { background: var(--green-soft); color: var(--green-dark); }

/* ─── Board (kanban) ───────────────────────────────────────────── */
.board {
    display: grid;
    grid-template-columns: repeat(4, minmax(260px, 1fr));
    gap: 14px;
}
.board-col {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    min-height: 240px;
}
.board-col-head {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 4px 12px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
}
.board-col-head h4 { margin: 0; font-size: 0.92rem; flex: 1; }
.board-col-head em {
    background: var(--surface);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--muted);
}
.board-col-body { display: flex; flex-direction: column; gap: 8px; }
.col-empty { color: var(--muted); font-size: 0.85rem; padding: 16px 8px; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }

.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.status-todo   { background: var(--st-todo); }
.status-doing  { background: var(--st-doing); }
.status-review { background: var(--st-review); }
.status-done   { background: var(--st-done); }

/* ─── Task card ────────────────────────────────────────────────── */
.task-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px;
    color: var(--text);
    transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
    border-left: 3px solid var(--accent, var(--green));
    cursor: pointer;
}
.task-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--line-strong);
}
.task-card-top { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.task-card-id { color: var(--muted-2); font-size: 0.74rem; font-weight: 600; }
.task-card-title { font-size: 0.92rem; font-weight: 600; line-height: 1.35; margin-bottom: 10px; }
.task-card-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.meta-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px;
    background: var(--bg-soft);
    border-radius: 999px;
    font-size: 0.72rem;
    color: var(--text-soft);
    font-weight: 500;
}
.meta-chip.muted { color: var(--muted); }
.meta-chip.overdue { background: var(--danger-soft); color: var(--danger); }

.task-priority-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.task-priority-dot.priority-low      { background: var(--pr-low); }
.task-priority-dot.priority-medium   { background: var(--pr-medium); }
.task-priority-dot.priority-high     { background: var(--pr-high); }
.task-priority-dot.priority-critical { background: var(--pr-critical); box-shadow: 0 0 0 2px rgba(220,38,38,0.18); }

/* ─── Badges ───────────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid transparent;
    white-space: nowrap;
}
.badge-xs { padding: 1px 6px; font-size: 0.66rem; }
.badge-neutral { background: var(--bg-soft); color: var(--muted); }
.badge-light { background: rgba(255,255,255,0.18); color: #fff; border-color: rgba(255,255,255,0.18); backdrop-filter: blur(4px); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

.badge-todo    { background: rgba(100,116,139,0.12);  color: var(--st-todo); }
.badge-doing   { background: rgba(37,99,235,0.10);    color: var(--st-doing); }
.badge-review  { background: rgba(217,119,6,0.10);    color: var(--st-review); }
.badge-done    { background: rgba(22,163,74,0.10);    color: var(--st-done); }
.badge-pending { background: rgba(217,119,6,0.10);    color: var(--st-review); }
.badge-approved{ background: rgba(22,163,74,0.10);    color: var(--st-done); }
.badge-rejected{ background: rgba(220,38,38,0.08);    color: var(--danger); }

.badge-priority-low      { background: rgba(148,163,184,0.12); color: var(--pr-low); }
.badge-priority-medium   { background: rgba(14,165,233,0.10);  color: var(--pr-medium); }
.badge-priority-high     { background: rgba(245,158,11,0.10);  color: var(--pr-high); }
.badge-priority-critical { background: rgba(220,38,38,0.10);   color: var(--pr-critical); }

/* ─── Lists ────────────────────────────────────────────────────── */
.task-list { display: flex; flex-direction: column; gap: 6px; }
.row-task {
    display: grid;
    grid-template-columns: 16px 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    transition: background 0.12s, border-color 0.12s;
}
.row-task:hover { background: var(--surface-2); border-color: var(--line-strong); }
.row-task-body { min-width: 0; }
.row-task strong { display: block; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-task small { display: block; color: var(--muted); font-size: 0.76rem; }
.row-due { color: var(--muted); font-size: 0.82rem; font-weight: 600; min-width: 50px; text-align: right; }
.row-due.overdue { color: var(--danger); }

/* ─── Tables ───────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.ctable { width: 100%; min-width: 720px; border-collapse: collapse; }
.ctable th, .ctable td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.ctable th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-2); font-weight: 600; }
.ctable tbody tr:hover { background: var(--surface-2); }
.empty-cell { text-align: center; color: var(--muted); padding: 32px 12px !important; }

.select-pill {
    padding: 4px 8px !important;
    border-radius: 999px !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    border: 1px solid transparent !important;
    background: var(--bg-soft);
    color: var(--text-soft);
}
.select-todo   { background: rgba(100,116,139,0.12); color: var(--st-todo); }
.select-doing  { background: rgba(37,99,235,0.10);   color: var(--st-doing); }
.select-review { background: rgba(217,119,6,0.10);   color: var(--st-review); }
.select-done   { background: rgba(22,163,74,0.10);   color: var(--st-done); }

.inline-pill-form { display: inline-flex; }

/* ─── Forms (form-grid) ────────────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.form-grid .span-2 { grid-column: span 2; }
.form-foot { display: flex; gap: 10px; justify-content: flex-end; padding-top: 4px; }
.form-grid small { color: var(--muted); font-size: 0.76rem; }

/* ─── Quick task / details ────────────────────────────────────── */
.quick-task {
    margin-bottom: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}
.quick-task summary {
    cursor: pointer;
    padding: 10px 14px;
    list-style: none;
    color: var(--green-dark);
    font-weight: 600;
    user-select: none;
}
.quick-task summary::-webkit-details-marker { display: none; }
.quick-task[open] summary { border-bottom: 1px solid var(--line); }
.quick-task .form-grid { padding: 16px; }

.info-banner {
    background: var(--green-soft);
    border: 1px solid var(--green-soft-2);
    color: var(--green-dark);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 0.9rem;
}

/* ─── Filter bar ───────────────────────────────────────────────── */
.filter-bar {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 16px;
}
.filter-pill {
    padding: 6px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 500;
    transition: background 0.12s;
}
.filter-pill:hover { background: var(--bg-soft); }
.filter-pill.active { background: var(--green); color: #fff; border-color: var(--green); }

/* ─── Members ──────────────────────────────────────────────────── */
.member-stack { display: flex; flex-direction: column; gap: 8px; }
.member-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}
.member-row strong { display: block; font-size: 0.92rem; }
.member-row small { display: block; color: var(--muted); font-size: 0.76rem; }
.inline-form-rt { display: inline-flex; }

/* ─── Activity ─────────────────────────────────────────────────── */
.activity { display: flex; flex-direction: column; gap: 12px; }
.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.activity-item p { margin: 0; }
.activity-item small { color: var(--muted); font-size: 0.74rem; }

/* ─── Requests ─────────────────────────────────────────────────── */
.request-stack { display: flex; flex-direction: column; gap: 12px; }
.request-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent, var(--green));
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}
.request-card.status-pending { border-left-color: var(--st-review); }
.request-card.status-approved { border-left-color: var(--st-done); }
.request-card.status-rejected { border-left-color: var(--danger); opacity: 0.92; }
.request-card h4 { margin: 4px 0 8px; }
.request-card p { margin: 0 0 8px; }
.request-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.request-head small { margin-left: auto; color: var(--muted); }
.request-actions {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1.2fr 1.6fr auto auto;
    gap: 8px;
    align-items: center;
}
.request-actions input, .request-actions select { padding: 8px 10px; }

/* ─── Task detail ──────────────────────────────────────────────── */
.breadcrumb {
    display: flex; gap: 8px; align-items: center;
    margin-bottom: 12px;
    font-size: 0.86rem;
    color: var(--muted);
}
.breadcrumb a { color: var(--text-soft); font-weight: 500; }
.breadcrumb a:hover { color: var(--green-dark); }

.task-detail-head {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent, var(--green));
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.task-detail-head h1 { margin: 8px 0 4px; }
.task-detail-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.grid-detail {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 16px;
}
.task-side { position: sticky; top: 16px; align-self: start; }
.task-notes { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; color: var(--text); }

/* ─── Comments ─────────────────────────────────────────────────── */
.comments { display: flex; flex-direction: column; gap: 12px; }
.comment {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.comment-head small { color: var(--muted); font-size: 0.74rem; margin-left: auto; }
.comment p { margin: 0; }

.comment-form {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}
.comment-form button { justify-self: end; }

/* ─── Flash ────────────────────────────────────────────────────── */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    font-weight: 500;
}
.flash-app { margin-bottom: 16px; }
.flash-success { background: rgba(22,163,74,0.08); border-color: rgba(22,163,74,0.20); color: #166534; }
.flash-error   { background: rgba(220,38,38,0.06); border-color: rgba(220,38,38,0.20); color: #991b1b; }

/* ─── Empty state panel (errors) ──────────────────────────────── */
.shell { padding: 24px; max-width: 1480px; margin: 0 auto; }
.shell-center { display: grid; place-items: center; min-height: 100vh; }
.empty-state-panel {
    max-width: 480px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    padding: 36px;
    text-align: center;
    box-shadow: var(--shadow);
}
.pill {
    display: inline-flex; align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green-dark);
    font-size: 0.76rem;
    font-weight: 700;
}
.pill-solid { background: var(--green); color: #fff; }

/* ─── Client mode tweaks (lighter feel) ───────────────────────── */
body.is-client .sidebar-nav a.active { background: rgba(124, 58, 237, 0.08); color: #6b21a8; }
body.is-client .sidebar-nav a.active svg { color: var(--purple); }
body.is-client .btn-primary {
    background: linear-gradient(180deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 4px 12px rgba(124,58,237,0.25);
}
body.is-client .filter-pill.active {
    background: var(--purple); color: #fff; border-color: var(--purple);
}
body.is-client .link, body.is-client .link.strong:hover { color: var(--purple); }

/* ─── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1280px) {
    .kpi-row { grid-template-columns: repeat(3, 1fr); }
    .grid-2-cols { grid-template-columns: 1fr; }
    .grid-detail { grid-template-columns: 1fr; }
    .task-side { position: static; }
    .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .request-actions { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 880px) {
    .app { grid-template-columns: 1fr; }
    .sidebar {
        position: relative;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 12px;
        gap: 10px;
    }
    .sidebar-section, .sidebar-foot { width: 100%; }
    .sidebar-nav { flex-direction: row; flex-wrap: wrap; flex: 1; }
    .sidebar-nav a span { display: none; }
    .sidebar-nav a { padding: 10px 12px; }
    .sidebar-projects { flex-direction: row; flex-wrap: wrap; gap: 4px; }
    .sidebar-project { width: auto; }
    .sidebar-foot { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 0; }

    .main { padding: 16px; }
    .auth-grid { grid-template-columns: 1fr; gap: 24px; }
    .feature-grid { grid-template-columns: 1fr; }
    .kpi-row { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: span 1; }
    .board { grid-template-columns: 1fr; }
    .request-actions { grid-template-columns: 1fr; }
    .banner-stats { width: 100%; justify-content: flex-start; }
}