/* ==========================================================================
   Taskyard Mobile & WhatsApp Style Design System
   ========================================================================== */
:root {
    --bg-main: #f4f6f8;
    --bg-surface: #ffffff;
    --bg-subtle: #edf2f7;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --border-color: #e2e8f0;

    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);

    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --danger-text: #991b1b;
    --warning: #f59e0b;
    --success: #10b981;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 16px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.2);

    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
    --bg-main: #0b0f19;
    --bg-surface: #131b2e;
    --bg-subtle: #1e293b;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;

    --border-color: #1e293b;

    --primary: #6366f1;
    --primary-light: rgba(99, 102, 241, 0.18);

    --danger-bg: rgba(239, 68, 68, 0.15);
    --danger-text: #fca5a5;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* Application Shell */
.mobile-app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    position: relative;
    overflow: hidden;
}

/* WhatsApp Style Top App Bar */
.app-header {
    height: 60px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    flex-shrink: 0;
    z-index: 30;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-logo-sm {
    width: 32px;
    height: 32px;
    background: var(--primary-gradient);
    color: white;
    font-weight: 800;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-title {
    font-size: 1.15rem;
    font-weight: 800;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary-gradient);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.icon-btn:active {
    background-color: var(--bg-subtle);
}

/* Collapsible Mobile Search & Filter */
.mobile-search-bar {
    padding: 0.75rem 1rem;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
}

.search-input-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.search-input-wrapper svg {
    position: absolute;
    left: 0.75rem;
    color: var(--text-muted);
}

.search-input-wrapper input {
    width: 100%;
    padding: 0.55rem 0.75rem 0.55rem 2.25rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.filter-select {
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background-color: var(--bg-main);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Column Segment Tabs */
.column-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.tab-pill {
    padding: 0.4rem 0.875rem;
    border-radius: var(--radius-full);
    background-color: var(--bg-main);
    color: var(--text-secondary);
    font-size: 0.825rem;
    font-weight: 700;
    border: 1px solid var(--border-color);
    white-space: nowrap;
    cursor: pointer;
}

.tab-pill.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Main View */
.main-view {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem 1rem 80px;
}

/* Task Cards List */
.tlist {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card[data-priority="high"] { border-left: 4px solid var(--danger); }
.card[data-priority="medium"] { border-left: 4px solid var(--warning); }
.card[data-priority="low"] { border-left: 4px solid var(--success); }

.card b {
    font-size: 0.95rem;
    font-weight: 700;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.tag {
    background-color: var(--bg-subtle);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
}

.late { color: var(--danger-text); font-weight: 700; }

/* Floating Action Button (FAB) */
.fab-btn {
    position: fixed;
    bottom: 72px;
    right: 18px;
    width: 54px;
    height: 54px;
    border-radius: var(--radius-full);
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 45;
}

.fab-btn:active {
    transform: scale(0.94);
}

/* WhatsApp Style Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 50;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.725rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    width: 50%;
    height: 100%;
}

.nav-tab.active {
    color: var(--primary);
    font-weight: 800;
}

.badge {
    position: absolute;
    top: 6px;
    right: 32%;
    background-color: var(--primary);
    color: white;
    font-size: 0.675rem;
    font-weight: 800;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-full);
}

/* Native-feel Bottom Sheets */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    max-width: 100%;
    border: none;
    border-radius: 20px 20px 0 0;
    background-color: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    margin: 0;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bottom-sheet::backdrop {
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.sheet-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
}

.sheet-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 65vh;
    overflow-y: auto;
}

.sheet-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.field-group label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.field-group input, .field-group textarea, .field-group select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-main);
    color: var(--text-primary);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.grow { flex-grow: 1; }

.btn {
    padding: 0.65rem 1.15rem;
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
}

.btn.primary { background: var(--primary-gradient); color: white; }
.btn.danger { background-color: var(--danger-bg); color: var(--danger-text); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.775rem; }

/* Project Drawer Items */
.project-sheet-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.project-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem;
    background-color: var(--bg-main);
    border-radius: var(--radius-md);
    font-weight: 700;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 72px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--text-primary);
    color: var(--bg-main);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-full);
    font-size: 0.825rem;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 100;
}

.toast-container.on { opacity: 1; }

/* Subtask Checklist UI */
.subtask-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.subtask-progress-bar {
    width: 100%;
    height: 6px;
    background-color: var(--bg-main);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.subtask-progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
}

.subtask-input-row {
    display: flex;
    gap: 0.5rem;
}

.subtask-input-row input {
    flex-grow: 1;
    padding: 0.55rem 0.85rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-main);
    color: var(--text-primary);
}

.subtask-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 200px;
    overflow-y: auto;
}

.subtask-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-main);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.subtask-item.completed span {
    text-decoration: line-through;
    color: var(--text-muted);
}

.subtask-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.subtask-item span {
    flex-grow: 1;
    font-size: 0.875rem;
    word-break: break-word;
}

.subtask-del-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 0.25rem;
    line-height: 1;
}

.subtask-del-btn:hover {
    color: var(--danger);
}

/* Card Badge Indicator */
.subtask-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.725rem;
    font-weight: 600;
    color: var(--text-muted);
    background-color: var(--bg-subtle);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
}

/* Authentication */
.auth-body {
    --auth-ink: #183b35;
    --auth-muted: #75827c;
    --auth-line: #e3e9e3;
    --auth-green: #18785e;
    --auth-soft: #f2f5ef;
    min-height: 100vh;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    background: #f7f8f4;
    color: var(--auth-ink);
    font-family: 'DM Sans', sans-serif;
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(440px, 0.91fr) minmax(480px, 1.09fr);
    min-height: 100vh;
}

.auth-main {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 34px clamp(34px, 7vw, 108px) 27px;
    background: #fbfcf9;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 10px;
    color: var(--auth-ink);
    text-decoration: none;
    font-family: 'Manrope', sans-serif;
    font-size: 18px;
    font-weight: 800;
}

.auth-brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    background: #c8e1c8;
    color: #245b43;
    font-family: 'Manrope', sans-serif;
    font-size: 22px;
    font-weight: 800;
}

.auth-form-wrap {
    width: min(100%, 410px);
    margin: auto;
    padding: 46px 0 52px;
    animation: auth-rise 500ms cubic-bezier(.2,.7,.2,1) both;
}

.auth-heading { margin-bottom: 28px; }

.auth-eyebrow {
    margin-bottom: 15px;
    color: #65816d;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
}

.auth-heading h1 {
    color: #173b34;
    font-family: 'Manrope', sans-serif;
    font-size: clamp(34px, 3.15vw, 45px);
    font-weight: 700;
    line-height: 1.15;
}

.auth-intro {
    margin-top: 12px;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.6;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: -8px 0 18px;
    padding: 12px 14px;
    border: 1px solid #f1c7bc;
    border-radius: 7px;
    background: #fff5f1;
    color: #a34430;
    font-size: 13px;
    line-height: 1.45;
}

.auth-alert svg { flex: none; margin-top: 1px; }

.auth-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 24px;
    padding: 4px;
    border: 1px solid var(--auth-line);
    border-radius: 7px;
    background: #f1f4ef;
}

.auth-mode label {
    position: relative;
    display: grid;
    min-height: 39px;
    place-items: center;
    border-radius: 4px;
    color: #738078;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.auth-mode label.active {
    background: #fff;
    color: #214c3a;
    box-shadow: 0 1px 4px rgba(30, 56, 39, .09);
}

.auth-mode input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.auth-mode input:focus-visible + span { outline: 2px solid #278365; outline-offset: 4px; }

.auth-fields { display: flex; flex-direction: column; gap: 17px; }
.auth-field { display: flex; flex-direction: column; gap: 7px; }
.auth-field[hidden], .password-guidance[hidden] { display: none; }

.auth-field > label, .auth-label-row label {
    color: #344b40;
    font-size: 12px;
    font-weight: 700;
}

.auth-field input {
    width: 100%;
    height: 48px;
    padding: 0 13px;
    border: 1px solid #dce4dd;
    border-radius: 5px;
    outline: none;
    background: #fff;
    color: #1b352c;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.auth-field input::placeholder { color: #a2ada5; }
.auth-field input:hover { border-color: #b7c9bc; }
.auth-field input:focus { border-color: #438d6e; box-shadow: 0 0 0 3px rgba(67, 141, 110, .12); }
.auth-field input:user-invalid { border-color: #c45b43; }

.auth-label-row { display: flex; align-items: center; justify-content: space-between; }
.secure-note { display: inline-flex; align-items: center; gap: 5px; color: #849189; font-size: 11px; }
.secure-note[hidden] { display: none; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 46px; }

.password-toggle {
    position: absolute;
    top: 0;
    right: 0;
    display: grid;
    width: 44px;
    height: 48px;
    place-items: center;
    border: 0;
    background: transparent;
    color: #819087;
    cursor: pointer;
}

.password-toggle:hover { color: #286349; }
.password-toggle:focus-visible { outline: 2px solid #278365; outline-offset: -5px; border-radius: 5px; }
.password-toggle .eye-closed { display: none; }
.password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle[aria-pressed="true"] .eye-closed { display: block; }

.password-guidance { display: flex; align-items: center; gap: 10px; color: #829087; font-size: 10px; }
.strength-track { display: block; width: 48px; height: 4px; flex: none; overflow: hidden; border-radius: 9px; background: #e7ece6; }
.strength-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: #69a76c; transition: width 180ms ease; }
.field-error { color: #a34430; font-size: 11px; }

.auth-submit {
    display: flex;
    width: 100%;
    min-height: 49px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
    border: 1px solid #1d6d52;
    border-radius: 5px;
    background: #207457;
    color: #fff;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.auth-submit:hover { transform: translateY(-1px); background: #185e47; box-shadow: 0 5px 12px rgba(23, 93, 69, .18); }
.auth-submit:active { transform: translateY(0); }
.auth-submit:focus-visible { outline: 3px solid rgba(44, 134, 96, .35); outline-offset: 3px; }
.auth-terms { margin-top: 16px; color: #8a968d; font-size: 11px; line-height: 1.6; text-align: center; }

.auth-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #929c94;
    font-size: 10px;
}

.auth-footer span:last-child { display: inline-flex; align-items: center; gap: 6px; }
.auth-footer i, .board-status i { width: 6px; height: 6px; border-radius: 50%; background: #62a876; }

.auth-visual {
    position: relative;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 35px clamp(34px, 5.8vw, 88px) 28px;
    background-color: #dce8d3;
    background-image: radial-gradient(ellipse at 82% 10%, rgba(255,255,255,.5), transparent 34%), linear-gradient(145deg, #e4eddb 0%, #d2e1cd 100%);
}

.auth-visual::before {
    position: absolute;
    top: 15%;
    right: -160px;
    width: 420px;
    height: 420px;
    border: 1px solid rgba(57, 104, 71, .1);
    border-radius: 50%;
    content: '';
}

.auth-visual::after {
    position: absolute;
    right: -80px;
    bottom: -200px;
    width: 480px;
    height: 480px;
    border: 1px solid rgba(57, 104, 71, .09);
    border-radius: 50%;
    content: '';
}

.visual-topline, .visual-copy, .board-preview, .visual-foot { position: relative; z-index: 1; }
.visual-topline { display: flex; align-items: center; gap: 11px; color: #58735d; font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.visual-mark { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; background: #315d42; color: white; font-family: 'Manrope', sans-serif; font-size: 15px; font-weight: 800; }
.visual-copy { margin-top: auto; padding: 42px 0 27px; animation: auth-rise 600ms 80ms cubic-bezier(.2,.7,.2,1) both; }
.visual-copy p { color: #264f39; font-family: 'Manrope', sans-serif; font-size: clamp(36px, 4.2vw, 58px); font-weight: 600; line-height: 1.08; }
.visual-copy em { color: #5c8859; font-style: normal; }
.visual-copy > span { display: block; margin-top: 14px; color: #637d67; font-size: 13px; line-height: 1.65; }

.board-preview {
    width: 100%;
    max-width: 620px;
    align-self: center;
    padding: 18px 18px 12px;
    border: 1px solid rgba(46, 77, 52, .1);
    border-radius: 8px;
    background: rgba(255, 255, 252, .92);
    box-shadow: 0 22px 55px rgba(39, 72, 45, .12), 0 3px 8px rgba(39, 72, 45, .05);
    animation: auth-rise 700ms 140ms cubic-bezier(.2,.7,.2,1) both;
}

.board-top { display: flex; align-items: center; justify-content: space-between; padding: 0 1px 14px; color: #283a2d; }
.board-title { font-family: 'Manrope', sans-serif; font-size: 12px; font-weight: 800; }
.board-menu { color: #9aa49b; font-size: 14px; letter-spacing: 1px; }
.board-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.board-column { min-width: 0; padding: 10px; border-radius: 5px; background: #f3f5f1; }
.column-label { display: flex; align-items: center; gap: 6px; margin-bottom: 9px; color: #667467; font-size: 9px; font-weight: 700; }
.column-label > span { display: grid; width: 15px; height: 15px; place-items: center; margin-left: auto; border-radius: 50%; background: #e5eae1; color: #728073; font-size: 8px; }
.dot { width: 6px; height: 6px; border-radius: 50%; }
.dot-sage { background: #7da47a; }
.dot-yellow { background: #d2a94f; }
.task-tile { margin-bottom: 7px; padding: 9px 9px 8px; border: 1px solid #e8ece5; border-radius: 4px; background: white; box-shadow: 0 1px 2px rgba(40,60,40,.03); }
.task-tile b { display: block; overflow: hidden; color: #344638; font-size: 9px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.task-tile small { display: flex; align-items: center; gap: 5px; margin-top: 8px; color: #8c978c; font-size: 8px; }
.task-tile small > span { margin-left: auto; }
.avatar { display: grid; width: 16px; height: 16px; place-items: center; border-radius: 50%; color: #fff; font-size: 7px; font-style: normal; font-weight: 700; }
.avatar-coral { background: #d88e79; }
.avatar-yellow { background: #b9984d; }
.avatar-blue { background: #7695a5; }
.task-focus { border-color: #d9e7d8; }
.task-progress { height: 3px; margin-top: 10px; overflow: hidden; border-radius: 4px; background: #edf0ea; }
.task-progress i { display: block; width: 64%; height: 100%; border-radius: inherit; background: #72a576; }
.add-task { padding: 5px 0 1px; color: #8c978c; font-size: 8px; }
.board-status { display: flex; justify-content: space-between; gap: 10px; padding: 13px 1px 0; color: #8c978c; font-size: 8px; }
.board-status span:first-child { display: inline-flex; align-items: center; gap: 6px; color: #68816b; }
.board-status i { width: 5px; height: 5px; }
.visual-foot { display: flex; justify-content: space-between; margin-top: 27px; color: #69806b; font-size: 9px; }

@keyframes auth-rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
    .auth-layout { grid-template-columns: minmax(390px, .95fr) minmax(360px, 1.05fr); }
    .auth-main { padding-right: 42px; padding-left: 42px; }
    .auth-visual { padding-right: 34px; padding-left: 34px; }
}

@media (max-width: 760px) {
    .auth-layout { display: block; }
    .auth-main { min-height: 100svh; padding: 22px 24px 19px; }
    .auth-form-wrap { width: min(100%, 410px); padding: 36px 0; }
    .auth-heading h1 { font-size: 37px; }
    .auth-visual { display: none; }
    .auth-footer { max-width: 410px; width: 100%; align-self: center; }
}

@media (max-width: 380px) {
    .auth-main { padding-right: 18px; padding-left: 18px; }
    .auth-heading h1 { font-size: 33px; }
    .auth-footer { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-form-wrap, .visual-copy, .board-preview { animation: none; }
    .auth-mode label, .auth-field input, .auth-submit, .strength-track span { transition: none; }
}

/* Workspace application */
body.app-body {
    --bg-main: #f5f7f4;
    --bg-surface: #ffffff;
    --bg-subtle: #edf2ec;
    --text-primary: #20392e;
    --text-secondary: #52675b;
    --text-muted: #839087;
    --border-color: #e3e9e2;
    --primary: #24775a;
    --primary-hover: #195d45;
    --primary-light: #e7f1e9;
    --primary-gradient: linear-gradient(135deg, #328565, #206b50);
    --danger: #c25643;
    --danger-bg: #fbefec;
    --danger-text: #9d4738;
    --warning: #c99438;
    --success: #5f9b6b;
    --radius-sm: 5px;
    --radius-md: 7px;
    --radius-lg: 9px;
    --shadow-sm: 0 1px 3px rgba(29, 52, 38, .05);
    --shadow-md: 0 8px 24px rgba(29, 52, 38, .11);
    --shadow-lg: 0 16px 38px rgba(20, 40, 28, .18);
    min-height: 100vh;
    overflow: hidden;
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
}

[data-theme="dark"] body.app-body {
    --bg-main: #151d19;
    --bg-surface: #1d2822;
    --bg-subtle: #27352d;
    --text-primary: #edf3ed;
    --text-secondary: #c0cec2;
    --text-muted: #91a196;
    --border-color: #314137;
    --primary: #74b38d;
    --primary-hover: #89c29e;
    --primary-light: #2a3d31;
    --primary-gradient: linear-gradient(135deg, #3c8c68, #28684e);
    --danger-bg: #482c29;
    --danger-text: #f0aaa0;
    --danger: #e28271;
    --warning: #e0b764;
    --success: #7ab889;
}

.mobile-app-shell {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    width: 100%;
    height: 100dvh;
    min-height: 520px;
    overflow: hidden;
    background: var(--bg-main);
}

.workspace-sidebar {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 24px 15px 17px;
    border-right: 1px solid var(--border-color);
    background: var(--bg-surface);
}

.workspace-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 9px 30px;
    color: var(--text-primary);
    font-family: 'Manrope', sans-serif;
    font-size: 16px;
    font-weight: 800;
    text-decoration: none;
}

.brand-logo-sm {
    display: grid;
    width: 33px;
    height: 33px;
    flex: none;
    place-items: center;
    border-radius: 8px;
    background: #d8e9d5;
    color: #285c42;
    font-family: 'Manrope', sans-serif;
    font-size: 18px;
    font-weight: 800;
}

.sidebar-caption, .sidebar-project-heading {
    padding: 0 10px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
}

.sidebar-caption { margin-bottom: 9px; letter-spacing: 1px; }
.sidebar-nav, .sidebar-project-list { display: flex; flex-direction: column; gap: 3px; }
.sidebar-link, .sidebar-project {
    display: flex;
    width: 100%;
    min-height: 39px;
    align-items: center;
    gap: 11px;
    padding: 0 10px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    transition: background 140ms ease, color 140ms ease;
}

.sidebar-link:hover, .sidebar-project:hover { background: var(--bg-main); color: var(--text-primary); }
.sidebar-link.active, .sidebar-project.active { background: var(--primary-light); color: var(--primary); }
.sidebar-link svg { flex: none; }
.sidebar-link > span:nth-child(2) { flex: 1; }
.sidebar-count, .sidebar-project-count { color: var(--text-muted); font-size: 10px; font-weight: 600; }
.sidebar-link.active .sidebar-count, .sidebar-project.active .sidebar-project-count { color: var(--primary); }

.sidebar-project-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 29px 0 7px;
    letter-spacing: .75px;
}

.sidebar-add {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
}

.sidebar-add:hover { border-color: var(--primary); color: var(--primary); }
.sidebar-project { min-height: 36px; gap: 9px; }
.project-swatch { width: 9px; height: 9px; flex: none; border-radius: 3px; background: var(--project-color, #6d9877); }
.sidebar-project-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-empty { padding: 8px 10px; color: var(--text-muted); font-size: 11px; }
.sidebar-bottom { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 15px 10px 0; border-top: 1px solid var(--border-color); color: var(--text-muted); font-size: 10px; }
.sidebar-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #69a777; }

.workspace-main { display: flex; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; }
.app-header {
    position: relative;
    z-index: 2;
    display: flex;
    min-height: 78px;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(24px, 4vw, 58px);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
}

.header-left { min-width: 0; gap: 12px; }
.header-titles { min-width: 0; }
.header-kicker { margin-bottom: 3px; color: var(--text-muted); font-size: 9px; font-weight: 700; letter-spacing: .9px; }
.header-title { overflow: hidden; color: var(--text-primary); font-family: 'Manrope', sans-serif; font-size: 19px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.mobile-brand-mark { display: none; }
.header-actions { gap: 7px; }
.header-actions .icon-btn { width: 36px; height: 36px; border: 1px solid transparent; border-radius: 5px; color: var(--text-secondary); }
.header-actions .icon-btn:hover { border-color: var(--border-color); background: var(--bg-main); color: var(--primary); }
.user-avatar { width: 34px; height: 34px; margin-left: 5px; border-radius: 50%; background: #d6e7d3; color: #315d42; font-size: 12px; }

.mobile-search-bar {
    display: flex;
    min-height: 66px;
    align-items: center;
    gap: 10px;
    padding: 12px clamp(24px, 4vw, 58px);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
}

.search-input-wrapper { min-width: 180px; max-width: 520px; }
.search-input-wrapper svg { left: 12px; color: var(--text-muted); }
.search-input-wrapper input, .filter-select {
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    outline: none;
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
}

.search-input-wrapper input { padding: 0 12px 0 37px; }
.filter-select { min-width: 140px; padding: 0 29px 0 10px; font-weight: 600; }
.search-input-wrapper input:focus, .filter-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }
.column-tabs { display: none; }

.main-view {
    min-height: 0;
    flex: 1;
    overflow: auto;
    padding: 28px clamp(24px, 4vw, 58px) 54px;
    scrollbar-color: #c9d5ca transparent;
    scrollbar-width: thin;
}

.view-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.view-eyebrow { margin-bottom: 6px; color: var(--text-muted); font-size: 9px; font-weight: 700; letter-spacing: .8px; }
.view-description { color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.view-count { display: flex; flex: none; align-items: baseline; gap: 7px; color: var(--text-muted); font-size: 10px; }
.view-count b { color: var(--text-primary); font-family: 'Manrope', sans-serif; font-size: 20px; font-weight: 800; }

.kanban-board { display: grid; grid-auto-columns: minmax(218px, 1fr); grid-auto-flow: column; align-items: start; gap: 14px; min-width: max-content; padding-bottom: 14px; }
.kanban-column { width: min(265px, 24vw); min-width: 218px; min-height: 220px; padding: 0 9px 10px; border: 1px solid transparent; border-radius: 7px; background: #edf1eb; transition: border-color 130ms ease, background 130ms ease; }
[data-theme="dark"] .kanban-column { background: #202d25; }
.kanban-column.drag-over { border-color: var(--primary); background: var(--primary-light); }
.kanban-column-header { display: flex; min-height: 46px; align-items: center; gap: 8px; padding: 0 2px; }
.column-indicator { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--column-color, #85a3a0); }
.kanban-column-header h2 { min-width: 0; flex: 1; overflow: hidden; color: var(--text-secondary); font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.column-count { display: grid; min-width: 21px; height: 21px; place-items: center; border-radius: 4px; background: rgba(127, 145, 128, .13); color: var(--text-muted); font-size: 9px; font-weight: 700; }
.kanban-column-body { display: flex; min-height: 164px; flex-direction: column; gap: 8px; }
.mobile-project-list { display: none; }

.card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--bg-surface);
    box-shadow: 0 1px 2px rgba(30, 54, 38, .04);
    cursor: pointer;
    transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.card:hover { transform: translateY(-1px); border-color: #c8d8ca; box-shadow: var(--shadow-sm); }
.card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.card.dragging { opacity: .4; transform: rotate(1deg); }
.task-card-top { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 7px; }
.priority-label { display: inline-flex; align-items: center; gap: 5px; color: var(--text-muted); font-size: 8px; font-weight: 700; text-transform: capitalize; }
.priority-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--warning); }
.priority-high i { background: var(--danger); }
.priority-low i { background: var(--success); }
.task-due { overflow: hidden; color: var(--text-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.task-due.late { color: var(--danger-text); font-weight: 700; }
.task-title { color: var(--text-primary); font-size: 12px; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.task-description { display: -webkit-box; overflow: hidden; color: var(--text-muted); font-size: 10px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.meta { align-items: center; gap: 5px; margin-top: 1px; font-size: 9px; }
.tag, .subtask-badge, .task-project { padding: 3px 6px; border-radius: 3px; background: var(--bg-subtle); color: var(--text-secondary); font-size: 8px; font-weight: 600; }
.subtask-badge { color: #62806a; }
.task-project { color: var(--primary); }
.kanban-add { display: flex; min-height: 31px; align-items: center; gap: 7px; padding: 0 7px; border: 0; border-radius: 4px; background: transparent; color: var(--text-muted); cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 10px; text-align: left; }
.kanban-add:hover { background: rgba(255,255,255,.62); color: var(--primary); }
.kanban-add span { font-size: 16px; }
.tlist { max-width: 840px; gap: 9px; }
.tlist .card { padding: 14px 16px; }
.empty-state { display: flex; min-height: 250px; flex-direction: column; align-items: center; justify-content: center; padding: 30px 18px; text-align: center; }
.empty-mark { display: grid; width: 48px; height: 48px; place-items: center; margin-bottom: 14px; border: 1px solid var(--border-color); border-radius: 50%; background: var(--bg-surface); color: #719077; }
.empty-state h2 { color: var(--text-primary); font-family: 'Manrope', sans-serif; font-size: 17px; font-weight: 700; }
.empty-state p { max-width: 300px; margin-top: 7px; color: var(--text-muted); font-size: 11px; line-height: 1.6; }
.empty-add { margin-top: 17px; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 5px; background: var(--bg-surface); color: var(--primary); cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 700; }
.empty-add:hover { border-color: var(--primary); background: var(--primary-light); }

.fab-btn {
    position: fixed;
    right: 32px;
    bottom: 28px;
    z-index: 45;
    display: inline-flex;
    width: auto;
    min-width: 130px;
    height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 15px;
    border: 1px solid #1d6d52;
    border-radius: 5px;
    background: #207457;
    box-shadow: 0 5px 15px rgba(27, 89, 65, .2);
    color: white;
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 700;
}

.fab-btn:hover { background: #185e47; transform: translateY(-1px); }
.fab-btn:focus-visible { outline: 3px solid rgba(44, 134, 96, .35); outline-offset: 3px; }
.bottom-nav { display: none; }
.toast-container { bottom: 24px; border-radius: 5px; background: #20392e; color: white; font-size: 11px; }

.bottom-sheet { max-height: min(82vh, 760px); overflow: auto; border: 1px solid var(--border-color); border-radius: 8px 8px 0 0; }
.sheet-header { position: sticky; top: 0; z-index: 1; background: var(--bg-surface); }
.field-group input, .field-group textarea, .field-group select, .subtask-input-row input { border-radius: 5px; outline: none; }
.field-group input:focus, .field-group textarea:focus, .field-group select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }

@media (max-width: 899px) {
    .mobile-app-shell { display: block; min-height: 0; height: 100dvh; }
    .workspace-sidebar { display: none; }
    .workspace-main { height: 100%; }
    .app-header { min-height: 64px; padding: 0 17px; }
    .mobile-brand-mark { display: grid; width: 31px; height: 31px; font-size: 16px; }
    .header-kicker { display: none; }
    .header-title { font-size: 17px; }
    .header-actions { gap: 2px; }
    .header-actions .icon-btn { width: 35px; height: 35px; }
    .mobile-search-bar { display: none; min-height: 60px; padding: 10px 14px; }
    .search-open .mobile-search-bar { display: flex; }
    .search-input-wrapper { min-width: 0; }
    .search-input-wrapper input, .filter-select { height: 38px; font-size: 10px; }
    .filter-select { min-width: 107px; max-width: 128px; padding-right: 22px; }
    .column-tabs { display: flex; min-height: 53px; gap: 6px; padding: 9px 14px; border-bottom: 1px solid var(--border-color); background: var(--bg-surface); overflow-x: auto; scrollbar-width: none; }
    .column-tabs::-webkit-scrollbar { display: none; }
    .tab-pill { flex: none; padding: 6px 11px; border-radius: 4px; font-size: 10px; }
    .kanban-board { display: none; }
    .mobile-project-list { display: block; }
    .main-view { padding: 19px 16px 100px; }
    .view-intro { align-items: center; margin-bottom: 14px; }
    .view-eyebrow { font-size: 8px; }
    .view-description { font-size: 10px; }
    .view-count { gap: 5px; font-size: 8px; }
    .view-count b { font-size: 17px; }
    .tlist { gap: 8px; }
    .tlist .card { padding: 13px; }
    .task-title { font-size: 12px; }
    .fab-btn { right: 17px; bottom: calc(78px + env(safe-area-inset-bottom)); min-width: 48px; width: 48px; height: 48px; padding: 0; border-radius: 50%; }
    .fab-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
    .bottom-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 50; display: flex; height: calc(58px + env(safe-area-inset-bottom)); align-items: center; justify-content: space-around; padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--border-color); background: var(--bg-surface); }
    .nav-tab { width: 50%; gap: 3px; color: var(--text-muted); font-size: 9px; }
    .nav-tab.active { color: var(--primary); }
    .bottom-sheet { max-height: 82dvh; }
    .toast-container { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

@media (max-width: 420px) {
    .app-header { padding: 0 12px; }
    .header-left { gap: 8px; }
    .header-actions .icon-btn { width: 32px; }
    .user-avatar { width: 30px; height: 30px; margin-left: 1px; }
    .mobile-search-bar { gap: 7px; padding-right: 10px; padding-left: 10px; }
    .filter-select { min-width: 98px; max-width: 110px; }
    .main-view { padding-right: 12px; padding-left: 12px; }
    .view-description { max-width: 225px; }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-link, .sidebar-project, .card, .kanban-column, .fab-btn { transition: none; }
}