/**
 * WorkBase V2 — Design System
 * Scientific Premium aesthetic with glassmorphism
 * Dark/Light mode with CSS custom properties
 */

/* ═══ Fonts ═══ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ═══ Design Tokens ═══ */
:root {
    /* Colors — Light */
    --bg-app: #f8f9fb;
    --bg-sidebar: #0c111d;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.72);
    --bg-glass-border: rgba(255, 255, 255, 0.2);
    --bg-input: #f1f5f9;
    --bg-input-focus: #ffffff;
    --stroke: #e2e8f0;
    --stroke-subtle: #f1f5f9;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-dim: #94a3b8;
    --text-inverse: #ffffff;

    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-subtle: rgba(37, 99, 235, 0.08);
    --accent-glow: rgba(37, 99, 235, 0.25);

    --success: #10b981;
    --success-subtle: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-subtle: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-subtle: rgba(239, 68, 68, 0.1);
    --info: #6366f1;
    --info-subtle: rgba(99, 102, 241, 0.1);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 24px var(--accent-glow);

    /* Sidebar */
    --sidebar-width: 260px;

    /* Z-index */
    --z-sidebar: 100;
    --z-overlay: 90;
    --z-modal: 200;
    --z-toast: 300;
    --z-mobile-header: 250;

    /* Transition */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --duration: 0.25s;
}

/* ═══ Dark Mode ═══ */
[data-theme="dark"] {
    --bg-app: #0a0e1a;
    --bg-sidebar: #060a14;
    --bg-card: #111827;
    --bg-card-hover: #1e293b;
    --bg-glass: rgba(17, 24, 39, 0.8);
    --bg-glass-border: rgba(255, 255, 255, 0.06);
    --bg-input: #1e293b;
    --bg-input-focus: #111827;
    --stroke: #1e293b;
    --stroke-subtle: #1e293b;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-dim: #64748b;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-app);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
}

/* ═══ App Layout ═══ */
#v2-app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ═══ Sidebar ═══ */
.v2-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #0F172A 0%, #020617 100%);
    color: var(--text-inverse);
    display: flex;
    flex-direction: column;
    z-index: var(--z-sidebar);
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 1px 0 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* Subtle top highlight (from V1) */
.v2-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.2), transparent);
    z-index: 1;
}

/* Sidebar scrollbar */
.v2-sidebar::-webkit-scrollbar { width: 4px; }
.v2-sidebar::-webkit-scrollbar-track { background: transparent; }
.v2-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.v2-sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

.v2-sidebar-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.v2-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #2563EB 0%, #0F172A 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.v2-sidebar-ws-name {
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v2-sidebar-ws-plan {
    font-size: 0.6rem;
    font-weight: 700;
    color: #60a5fa;
    letter-spacing: 0.1em;
    font-family: 'Inter', sans-serif;
}

/* Nav */
.v2-nav {
    flex: 1;
    padding: 0.5rem 0.75rem;
    overflow-y: auto;
}

.v2-nav-section {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.3);
    padding: var(--space-lg) 0.75rem var(--space-xs);
    text-transform: uppercase;
    font-family: 'Inter', sans-serif;
}

.v2-nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 2px;
    position: relative;
    overflow: hidden;
}

/* Hover slide-in background (from V1) */
.v2-nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.v2-nav-item:hover::before {
    transform: scaleX(1);
}

.v2-nav-item:hover {
    color: rgba(255, 255, 255, 0.85);
}

.v2-nav-item:hover .v2-nav-icon {
    opacity: 0.9;
    transform: translateX(2px);
}

/* Active state with left accent bar (from V1) */
.v2-nav-item.active {
    background: rgba(37, 99, 235, 0.15);
    color: #fff;
    font-weight: 500;
}

.v2-nav-item.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(135deg, #2563EB 0%, #6366f1 100%);
    animation: v2-slideInLeft 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.v2-nav-item.active::before {
    transform: scaleX(0);
}

@keyframes v2-slideInLeft {
    from { transform: scaleY(0); opacity: 0; }
    to   { transform: scaleY(1); opacity: 1; }
}

.v2-nav-item.active .v2-nav-icon {
    opacity: 1;
}

.v2-nav-item.active svg { stroke: var(--accent); opacity: 1; }

/* Nav icon */
.v2-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.55;
    transition: opacity 0.2s, transform 0.2s;
    font-size: 0.9rem;
}

.v2-nav-item svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    opacity: 0.55;
    transition: opacity 0.2s, stroke 0.2s, transform 0.2s;
}

/* Nav badge (overdue tasks, unread counts) */
.v2-nav-badge {
    position: absolute;
    top: 4px;
    right: 6px;
    min-width: 16px;
    height: 16px;
    background: #EF4444;
    color: #fff;
    border-radius: 99px;
    font-size: 0.55rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    animation: v2-badgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes v2-badgePop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

/* Nav text */
.v2-nav-text {
    position: relative;
    z-index: 1;
}

/* Sidebar Footer */
.v2-sidebar-footer {
    padding: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.v2-sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.v2-sidebar-user-name {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v2-sidebar-user-role {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ═══ Main Content ═══ */
.v2-main {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-xl);
    transition: opacity var(--duration) ease, transform var(--duration) var(--ease-out);
}

/* ═══ Mobile Header ═══ */
.v2-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--stroke);
    z-index: var(--z-mobile-header);
    align-items: center;
    padding: 0 var(--space-md);
    gap: var(--space-sm);
}

.v2-mobile-title {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
}

.v2-hamburger {
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 6px;
}

.v2-hamburger span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.2s;
}

/* Overlay */
.v2-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-overlay);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s;
}

.v2-overlay.open {
    display: block;
    opacity: 1;
}

/* ═══ Responsive ═══ */
@media (max-width: 768px) {
    .v2-mobile-header { display: flex; }

    .v2-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        transition: left 0.3s var(--ease-out);
        box-shadow: var(--shadow-lg);
    }

    .v2-sidebar.open { left: 0; z-index: calc(var(--z-mobile-header) + 10); }

    .v2-overlay.open { z-index: calc(var(--z-mobile-header) + 5); }

    .v2-main {
        padding: var(--space-md);
        padding-top: calc(56px + var(--space-md));
    }
}

/* ═══ Avatar ═══ */
.v2-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent), #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.v2-avatar-sm { width: 28px; height: 28px; font-size: 0.7rem; }

/* ═══ Cards ═══ */
.v2-card {
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}

.v2-card h3 {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.v2-card-glass {
    background: var(--bg-glass);
    border: 1px solid var(--stroke);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}

.v2-card-hover {
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
}

.v2-card-hover:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.v2-card-compact { padding: var(--space-sm) var(--space-md); }

.v2-card-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-xs);
}

.v2-card-title {
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: var(--space-xs);
}

/* ═══ Badges ═══ */
.v2-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.v2-badge-task { background: var(--accent-subtle); color: var(--accent); }
.v2-badge-meeting { background: var(--info-subtle); color: var(--info); }
.v2-badge-call { background: var(--warning-subtle); color: var(--warning); }
.v2-badge-milestone { background: var(--success-subtle); color: var(--success); }
.v2-badge-note { background: var(--bg-input); color: var(--text-dim); }

.v2-badge-status-todo { background: var(--bg-input); color: var(--text-secondary); }
.v2-badge-status-in_progress { background: var(--accent-subtle); color: var(--accent); }
.v2-badge-status-done { background: var(--success-subtle); color: var(--success); }

.v2-badge-stage-prospect { background: var(--bg-input); color: var(--text-secondary); }
.v2-badge-stage-proposal { background: var(--info-subtle); color: var(--info); }
.v2-badge-stage-negotiation { background: var(--warning-subtle); color: var(--warning); }
.v2-badge-stage-active { background: var(--accent-subtle); color: var(--accent); }
.v2-badge-stage-completed { background: var(--success-subtle); color: var(--success); }
.v2-badge-stage-lost { background: var(--danger-subtle); color: var(--danger); }

.v2-badge-priority-low { background: var(--bg-input); color: var(--text-dim); }
.v2-badge-priority-high { background: var(--warning-subtle); color: var(--warning); }
.v2-badge-priority-urgent { background: var(--danger-subtle); color: var(--danger); }

.v2-badge-plan-free { background: var(--bg-input); color: var(--text-dim); }
.v2-badge-plan-pro { background: var(--accent-subtle); color: var(--accent); }
.v2-badge-plan-enterprise { background: var(--info-subtle); color: var(--info); }

/* ═══ Buttons ═══ */
.v2-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
    white-space: nowrap;
}

.v2-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.v2-btn-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.v2-btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.v2-btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--stroke);
}

.v2-btn-outline:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.v2-btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.v2-btn-sm { padding: 0.3rem 0.6rem; font-size: 0.72rem; }
.v2-btn-lg { padding: 0.65rem 1.4rem; font-size: 0.9rem; border-radius: var(--radius-lg); }

/* ═══ Forms — Scientific Premium ═══ */
.v2-form { display: flex; flex-direction: column; gap: 1.15rem; }

.v2-form-group { display: flex; flex-direction: column; gap: 0.4rem; }

.v2-form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

/* Universal input reset — all types including date/time/textarea */
.v2-form-group input,
.v2-form-group select,
.v2-form-group textarea,
.v2-input,
.v2-textarea,
input[type="date"],
input[type="time"],
input[type="datetime-local"],
textarea {
    width: 100%;
    padding: 0.72rem 0.95rem;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.92rem;
    line-height: 1.5;
    min-height: 44px;
    transition: border-color var(--duration), background var(--duration), box-shadow var(--duration);
    outline: none;
    box-sizing: border-box;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Restore select chevron after appearance reset */
.v2-form-group select,
select.v2-input,
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 13px;
    padding-right: 2.2rem;
    cursor: pointer;
}

/* Date/time inputs — calendar icon styling */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    opacity: 0.5;
    cursor: pointer;
    filter: var(--calendar-icon-filter, none);
}

[data-theme="dark"] {
    --calendar-icon-filter: invert(1) opacity(0.4);
}

.v2-form-group input::placeholder,
.v2-form-group textarea::placeholder,
.v2-input::placeholder,
.v2-textarea::placeholder,
textarea::placeholder {
    color: var(--text-dim);
    font-style: italic;
    opacity: 0.7;
}

.v2-form-group input:hover:not(:focus),
.v2-form-group select:hover:not(:focus),
.v2-form-group textarea:hover:not(:focus),
.v2-input:hover:not(:focus),
.v2-textarea:hover:not(:focus) {
    border-color: rgba(37, 99, 235, 0.3);
    background: var(--bg-input-focus);
}

.v2-form-group input:focus,
.v2-form-group select:focus,
.v2-form-group textarea:focus,
.v2-input:focus,
.v2-textarea:focus {
    border-color: var(--accent);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 4px var(--accent-glow), inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .v2-form-group input,
[data-theme="dark"] .v2-form-group select,
[data-theme="dark"] .v2-form-group textarea,
[data-theme="dark"] .v2-input,
[data-theme="dark"] .v2-textarea {
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .v2-form-group select,
[data-theme="dark"] select.v2-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

[data-theme="dark"] .v2-form-group input:focus,
[data-theme="dark"] .v2-form-group select:focus,
[data-theme="dark"] .v2-form-group textarea:focus,
[data-theme="dark"] .v2-input:focus,
[data-theme="dark"] .v2-textarea:focus {
    box-shadow: 0 0 0 4px var(--accent-glow), inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

.v2-textarea,
textarea {
    resize: vertical;
    min-height: 100px;
}

/* ═══ Search ═══ */
.v2-search {
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8rem;
    outline: none;
    transition: all var(--duration);
    width: 180px;
}

.v2-search:focus {
    border-color: var(--accent);
    width: 240px;
}

/* ═══ Tabs ═══ */
.v2-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 3px;
    margin-bottom: var(--space-md);
}

.v2-tab {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration);
}

.v2-tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.v2-tab:hover:not(.active) { color: var(--text-secondary); }

.v2-tabs-inline {
    display: flex;
    gap: var(--space-xs);
}

.v2-tab-sm {
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration);
}

.v2-tab-sm.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ═══ Segment Control (Pill-style Toggle) ═══ */
.v2-segment-control {
    display: flex;
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(15, 23, 42, 0.02);
    border-radius: 30px;
    padding: 3px;
    gap: 2px;
    align-items: center;
    position: relative;
    flex-shrink: 0;
}
.v2-segment-btn {
    border: none;
    background: transparent;
    padding: 6px 16px;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-dim);
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.28s var(--ease-out), color 0.22s var(--ease-out), transform 0.22s var(--ease-out), box-shadow 0.28s var(--ease-out);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.v2-segment-btn .v2-icon { font-size: 0.78rem; line-height: 1; }
.v2-segment-btn.active {
    background: #ffffff;
    color: var(--accent);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.10);
    transform: translateY(-0.5px);
}
.v2-segment-btn:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.04);
}
.v2-team-toggle {
    margin-left: auto;
}

/* ═══ Productivity KPI Panel (floats centered between toggles) ═══ */
.v2-productivity-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    padding: 4px 16px;
    font-size: 0.72rem;
    color: var(--text-secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    height: 28px;
    flex-shrink: 0;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    transition: background 0.3s, box-shadow 0.3s;
}
.v2-productivity-panel:empty {
    display: none;
}
.v2-productivity-panel:hover {
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
    transform: translate(-50%, -50%) scale(1.01);
}
.v2-kpi-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.v2-kpi-item strong {
    font-weight: 800;
    color: var(--text-primary);
    margin-left: 2px;
    font-variant-numeric: tabular-nums;
}
.v2-kpi-divider {
    color: rgba(15, 23, 42, 0.1);
    margin: 0 4px;
    font-weight: 400;
    user-select: none;
}

/* ═══ Premium Rank Badge ═══ */
.v2-rank-badge {
    font-weight: 900;
    font-size: 0.72rem;
    padding: 2px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.2;
    white-space: nowrap;
}
.v2-rank-badge.rank-s {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: kpiPulse 2s infinite;
}
.v2-rank-badge.rank-a {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.v2-rank-badge.rank-b {
    background: linear-gradient(135deg, #10b981, #047857);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.v2-rank-badge.rank-c {
    background: linear-gradient(135deg, #64748b, #475569);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(71, 85, 105, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.14);
}
.v2-rank-badge.rank-d {
    background: linear-gradient(135deg, #b45309, #78350f);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(120, 53, 15, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
}
/* E rank — スレートブロンズ (要改善) */
.v2-rank-badge.rank-e {
    background: linear-gradient(135deg, #78716c, #44403c);
    color: #f5f5f4;
    box-shadow: 0 2px 6px rgba(68, 64, 60, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.10);
}
.v2-rank-badge.rank-f {
    background: linear-gradient(135deg, #475569, #1e293b);
    color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(30, 41, 59, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes kpiPulse {
    0% { transform: scale(1); opacity: 0.95; }
    50% { transform: scale(1.03); opacity: 1; box-shadow: 0 2px 12px rgba(245, 158, 11, 0.6); }
    100% { transform: scale(1); opacity: 0.95; }
}

@media (max-width: 768px) {
    .v2-productivity-panel {
        display: none;
    }
}

/* ═══ Header Dashboard Card (segment toggle + productivity KPI + team toggle) — 二重分離カード上段 ═══ */
.v2-header-dashboard-card {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 10px 18px;
    box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.06), inset 0 1px 1px rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    position: relative;
    margin-top: -14px;
    margin-bottom: 12px;
    min-height: 52px;
    transition: background 0.3s, box-shadow 0.3s, backdrop-filter 0.3s;
}
.v2-header-dashboard-card:hover {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 14px 32px -12px rgba(0, 0, 0, 0.10), inset 0 1px 1px rgba(255, 255, 255, 0.9);
}
[data-theme="dark"] .v2-header-dashboard-card {
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ═══ Quick Bar — Premium Glassmorphism Card (二重分離カード下段) ═══ */
.v2-quickbar-card {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 12px 20px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.06), inset 0 1px 1px rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
    transition: background 0.3s, box-shadow 0.3s, backdrop-filter 0.3s;
}
.v2-quickbar-card:hover {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.10), inset 0 1px 1px rgba(255, 255, 255, 0.9);
}
[data-theme="dark"] .v2-quickbar-card {
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.v2-quickbar-split-container {
    display: flex;
    width: 100%;
    align-items: stretch;
}

@media (max-width: 768px) {
    .v2-quickbar-split-container {
        flex-direction: column;
        gap: 16px;
    }
    .v2-qb-left-side {
        width: 100% !important;
        padding-right: 0 !important;
    }
    .v2-qb-vertical-divider {
        display: none !important;
    }
    .v2-qb-right-side {
        width: 100% !important;
        padding-left: 0 !important;
        border-top: 1px solid var(--stroke);
        padding-top: 12px;
    }
}

.v2-qb-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
    width: 100%;
    min-width: 0;
}

.v2-qb-label {
    font-size: 0.94rem !important;
    font-weight: 900 !important;
    color: var(--text-primary) !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    min-width: 80px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Horizontal scroll wrapper for chip rows */
.v2-qb-scroll-wrapper {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    flex: 1;
    align-items: center;
    padding: 2px 0;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    min-width: 0;
}
.v2-qb-scroll-wrapper::-webkit-scrollbar { display: none; }

/* Minimal inline filter input (search) */
.v2-qb-filter-input {
    width: 130px;
    padding: 6px 12px;
    border: 1px solid var(--stroke-subtle);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.4);
    font-family: inherit;
    font-size: 0.78rem !important;
    color: var(--text-primary);
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}
.v2-qb-filter-input::placeholder {
    color: var(--text-dim);
    opacity: 0.6;
}
.v2-qb-filter-input:focus {
    width: 180px;
    border-color: var(--accent);
    background: #ffffff;
    box-shadow: 0 0 0 2px var(--accent-glow);
}
.v2-qb-inline-add-btn:hover {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: white !important;
    transform: translateY(-0.5px);
    box-shadow: 0 2px 6px rgba(37,99,235,0.2);
}
.v2-qb-inline-add-btn:active {
    transform: scale(0.95);
}

.v2-qb-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Base chip */
.v2-qb-chip {
    padding: 7px 15px !important;
    border: 1px solid var(--stroke);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.55);
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.80rem !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: all 0.18s var(--ease-out);
    white-space: nowrap;
    min-height: unset;
    box-shadow: none;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    flex-shrink: 0;
}
.v2-qb-chip:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: var(--accent);
    color: var(--text-primary);
    transform: translateY(-1px);
}
.v2-qb-chip.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 2px 6px rgba(37,99,235,0.2);
}
.v2-qb-chip.filtered-out {
    display: none !important;
}

/* Type chips: per-category colors on active */
.v2-qb-type-chip { border-radius: 20px; }
.v2-qb-type-chip.active[data-color="blue"]   { background: #2563eb !important;  color: #ffffff !important; border-color: #1d4ed8 !important; box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35); }
.v2-qb-type-chip.active[data-color="green"]  { background: #10b981 !important; color: #ffffff !important; border-color: #059669 !important; box-shadow: 0 3px 8px rgba(16, 185, 129, 0.35); }
.v2-qb-type-chip.active[data-color="purple"] { background: #8b5cf6 !important; color: #ffffff !important; border-color: #7c3aed !important; box-shadow: 0 3px 8px rgba(139, 92, 246, 0.35); }
.v2-qb-type-chip.active[data-color="amber"]  { background: #f59e0b !important; color: #ffffff !important; border-color: #d97706 !important; box-shadow: 0 3px 8px rgba(245, 158, 11, 0.35); }
.v2-qb-type-chip.active[data-color="indigo"] { background: #4f46e5 !important;  color: #ffffff !important; border-color: #3730a3 !important; box-shadow: 0 3px 8px rgba(79, 70, 229, 0.35); }
.v2-qb-type-chip.active[data-color="pink"]   { background: #ec4899 !important; color: #ffffff !important; border-color: #c91a70 !important; box-shadow: 0 3px 8px rgba(236, 72, 153, 0.35); }
.v2-qb-type-chip.active[data-color="orange"] { background: #f97316 !important; color: #ffffff !important; border-color: #ea580c !important; box-shadow: 0 3px 8px rgba(249, 115, 22, 0.35); }
.v2-qb-type-chip.active[data-color="red"]    { background: #ef4444 !important;  color: #ffffff !important; border-color: #b91c1c !important; box-shadow: 0 3px 8px rgba(239, 68, 68, 0.35); }

/* Term chips: circular badges */
.v2-qb-term {
    width: 26px !important;
    height: 26px !important;
    border-radius: 50%;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.74rem !important;
    font-weight: 800;
    border: 1px solid var(--stroke-subtle);
    background: rgba(255, 255, 255, 0.55);
    color: var(--text-dim);
}
.v2-qb-term:hover { transform: translateY(-1px); }
.v2-qb-term.active {
    font-weight: 900;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.10);
}
.v2-qb-term.active[data-term="short"]  { background: #ef4444; color: #ffffff; border-color: #ef4444; }
.v2-qb-term.active[data-term="mid"]    { background: #f59e0b; color: #ffffff; border-color: #f59e0b; }
.v2-qb-term.active[data-term="long"]   { background: #6366f1; color: #ffffff; border-color: #6366f1; }
.v2-qb-term.active[data-term="noterm"] { background: #94a3b8; color: #ffffff; border-color: #94a3b8; }

/* Client chips: rounded rectangles */
.v2-qb-client-chip {
    border-radius: 6px;
}
.v2-qb-client-chip.active {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
    font-weight: 700;
}

.v2-qb-client-more {
    padding: 6px 12px;
    border: 1px solid var(--stroke-subtle);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.4);
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.78rem !important;
    cursor: pointer;
    min-height: unset;
    box-shadow: none;
    flex-shrink: 0;
}

/* Add button */
.v2-qb-add {
    padding: 8px 18px !important;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover, #1d4ed8));
    color: white;
    font-family: inherit;
    font-size: 0.84rem !important;
    font-weight: 900 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.18s;
    min-height: unset;
    box-shadow: 0 4px 12px rgba(37,99,235,0.25);
    gap: 4px;
    white-space: nowrap;
}
.v2-qb-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37,99,235,0.35);
}

/* ═══ Toolbar ═══ */
.v2-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

/* ═══ Lists ═══ */
.v2-list { display: flex; flex-direction: column; }

.v2-list-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 0.08em;
    padding: var(--space-md) 0 var(--space-xs);
    text-transform: uppercase;
}

.v2-list-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: background var(--duration);
    cursor: pointer;
}

.v2-list-item:hover { background: var(--bg-card-hover); }

.v2-list-item-content { flex: 1; min-width: 0; }

.v2-list-item-title {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ═══ Pipeline Board ═══ */
.v2-pipeline-board {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    padding-bottom: var(--space-md);
}

.v2-pipeline-column {
    min-width: 220px;
    flex: 1;
}

.v2-pipeline-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    margin-bottom: var(--space-sm);
}

/* ═══ Grid ═══ */
.v2-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
}

/* ═══ Section ═══ */
.v2-section { margin-bottom: var(--space-xl); }

.v2-section-title {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: var(--space-md);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--stroke-subtle);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.v2-section-title::before {
    content: '';
    width: 3px;
    height: 12px;
    background: var(--accent);
    border-radius: 2px;
    flex-shrink: 0;
}

/* ═══ Actions Bar ═══ */
.v2-actions-bar {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* ═══ Event Groups ═══ */
.v2-event-group { margin-bottom: var(--space-lg); }

.v2-event-group-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--stroke-subtle);
}

/* ═══ Settings ═══ */
.v2-settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--stroke-subtle);
    font-size: 0.82rem;
}

.v2-settings-row:last-child { border-bottom: none; }

/* ═══ DU Header ═══ */
.v2-du-header {
    margin-bottom: var(--space-md);
}

.v2-du-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

/* ═══ Empty State ═══ */
.v2-empty {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-dim);
    font-size: 0.88rem;
    line-height: 1.6;
}

/* ═══ Text Utilities ═══ */
.v2-text-dim { color: var(--text-dim); }
.v2-text-sm { font-size: 0.78rem; }
.v2-text-xs { font-size: 0.68rem; }
.v2-text-danger { color: var(--danger); }

/* ═══ Toast (top-right compact alert) ═══ */
.v2-toast {
    position: fixed;
    top: 16px;
    right: 16px;
    left: auto;
    transform: translateX(120%);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 0.78rem;
    font-weight: 600;
    z-index: var(--z-toast);
    opacity: 0;
    transition: transform 0.35s var(--ease-out), opacity 0.25s;
    pointer-events: none;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    max-width: 340px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v2-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.v2-toast-success { background: rgba(16, 185, 129, 0.95); color: white; }
.v2-toast-error { background: rgba(239, 68, 68, 0.95); color: white; }
.v2-toast-info { background: rgba(99, 102, 241, 0.95); color: white; }

/* ═══ Loading ═══ */
.v2-loading-pulse {
    animation: v2-pulse 1.5s ease-in-out infinite;
    color: var(--text-dim);
    font-size: 0.82rem;
    padding: var(--space-lg);
}

@keyframes v2-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ═══ Onboarding ═══ */
.v2-onboard {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--space-xl);
}

.v2-onboard-card {
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.v2-onboard-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.v2-onboard-card h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: var(--space-sm);
}

.v2-onboard-card p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: var(--space-xl);
}

/* ═══ Scrollbar ═══ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--stroke); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ═══ Print ═══ */
@media print {
    .v2-sidebar, .v2-mobile-header { display: none !important; }
    .v2-main { padding: 0; }
}

/* ═══ Modal ═══ */
.v2-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    opacity: 0;
    transition: opacity 0.2s;
}

.v2-modal-overlay.open { opacity: 1; }

/* Mobile: modal must not block the hamburger menu */
@media (max-width: 768px) {
    .v2-modal-overlay {
        top: 56px; /* below mobile header */
        padding: var(--space-sm);
        align-items: flex-start;
        padding-top: var(--space-lg);
    }
    .v2-modal {
        max-height: calc(100vh - 56px - 2rem);
    }
}

.v2-modal {
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-xl);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 620px;
    max-height: 88vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.96);
    transition: transform 0.25s var(--ease-out);
}

.v2-modal-overlay.open .v2-modal {
    transform: translateY(0) scale(1);
}

.v2-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--stroke);
}

.v2-modal-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v2-modal-close {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.v2-modal-close:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.v2-modal-body {
    padding: 1.25rem 1.5rem;
}

.v2-modal-body .v2-form-group {
    margin-bottom: 1.1rem;
}

.v2-modal-body .v2-form-group:last-child {
    margin-bottom: 0;
}

.v2-modal-body .v2-form-group label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    letter-spacing: 0.01em;
}

.v2-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--stroke);
}

/* ═══ Step 1-13: UI Polish ═══ */

/* Page transition animation */
@keyframes v2-pageIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

#v2-main { animation: v2-pageIn 0.35s var(--ease-out); }

/* Page Header — gradient accent */
.v2-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--stroke-subtle);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.v2-page-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

/* Stat Card */
.v2-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transition: all var(--duration) var(--ease-out);
}

.v2-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.v2-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.v2-stat-icon-accent { background: var(--accent-subtle); }
.v2-stat-icon-success { background: var(--success-subtle); }
.v2-stat-icon-warning { background: var(--warning-subtle); }
.v2-stat-icon-info { background: var(--info-subtle); }

.v2-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.v2-stat-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Sticky modal header */
.v2-modal-header {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

/* DU Progress Steps */
.v2-du-steps {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.v2-du-step {
    flex: 1;
    text-align: center;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    border: 2px solid var(--stroke);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-dim);
    transition: all 0.3s;
}

.v2-du-step.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-subtle);
}

.v2-du-step.completed {
    border-color: var(--success);
    color: var(--success);
    background: var(--success-subtle);
}

/* FAB (mobile) */
.v2-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent), #6366f1);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px var(--accent-glow);
    transition: all 0.3s var(--ease-out);
    z-index: 50;
}

.v2-fab:hover { transform: scale(1.08); box-shadow: 0 6px 24px var(--accent-glow); }

@media (max-width: 768px) { .v2-fab { display: flex; } }

/* Nav count badge */
.v2-nav-count {
    background: var(--accent);
    color: white;
    font-size: 0.55rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0 4px;
}

/* Status dot */
.v2-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.v2-status-dot-active { background: var(--success); box-shadow: 0 0 8px var(--success); }
.v2-status-dot-pending { background: var(--warning); }
.v2-status-dot-inactive { background: var(--text-dim); }

/* Skeleton loading */
.v2-skeleton {
    background: linear-gradient(90deg, var(--bg-card-hover) 25%, var(--stroke) 50%, var(--bg-card-hover) 75%);
    background-size: 200% 100%;
    animation: v2-skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes v2-skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Legacy emoji empty icon (when used as text/font-size context) */
.v2-empty .v2-empty-icon { font-size: 3rem; margin-bottom: var(--space-md); opacity: 0.5; width: auto; height: auto; background: transparent; border: none; box-shadow: none; }

/* Micro-interactions */
.v2-btn-primary:active { transform: scale(0.96); transition: transform 0.1s; }

/* Focus-visible */
.v2-btn:focus-visible, .v2-nav-item:focus-visible, .v2-tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Code text */
.v2-mono { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; }

/* Modal scrollbar */
.v2-modal::-webkit-scrollbar { width: 4px; }
.v2-modal::-webkit-scrollbar-track { background: transparent; }
.v2-modal::-webkit-scrollbar-thumb { background: var(--stroke); border-radius: 2px; }

/* ═══ Search Modal ═══ */
.v2-search-overlay {
    align-items: flex-start;
    padding-top: 15vh;
}

.v2-search-modal {
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 560px;
    max-height: 60vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.v2-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--stroke);
}

.v2-search-input-wrap input {
    flex: 1;
    border: none;
    background: none;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
}

.v2-search-input-wrap kbd {
    font-size: 0.62rem;
    padding: 2px 6px;
    border: 1px solid var(--stroke);
    border-radius: 4px;
    color: var(--text-dim);
    font-family: inherit;
}

.v2-search-results {
    overflow-y: auto;
    padding: 0.5rem;
}

.v2-search-category {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.75rem 0.75rem 0.25rem;
}

.v2-search-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--duration);
}

.v2-search-item:hover {
    background: var(--bg-card-hover);
}

.v2-search-item-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.v2-search-item-title {
    font-size: 0.82rem;
    font-weight: 600;
}

.v2-search-item-sub {
    font-size: 0.68rem;
    color: var(--text-dim);
}

.v2-search-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-dim);
    font-size: 0.82rem;
}

/* ═══ Recurring / Template UI ═══ */
.v2-recurrence-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(99, 102, 241, 0.04);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-md);
    margin-top: 0.75rem;
    cursor: pointer;
    transition: all var(--duration);
}

.v2-recurrence-toggle:hover {
    background: rgba(99, 102, 241, 0.08);
}

.v2-recurrence-toggle.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent);
}

.v2-recurrence-options {
    display: none;
    padding: 0.75rem 1rem;
    background: var(--bg-card-alt, var(--bg-input));
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
}

.v2-recurrence-options.active {
    display: block;
}

.v2-template-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    transition: all var(--duration);
}

.v2-template-card:hover {
    border-color: var(--accent);
}

.v2-template-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--accent-primary, var(--accent));
    background: rgba(99, 102, 241, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ═══ Performance Dashboard ═══ */
.v2-perf-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
@media (min-width: 768px) {
    .v2-perf-grid { grid-template-columns: repeat(4, 1fr); }
}

.v2-perf-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--stroke, #e2e8f0);
    border-radius: var(--radius-lg);
    transition: box-shadow 0.2s;
}

.v2-perf-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.v2-perf-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.v2-perf-card-body {
    min-width: 0;
}

.v2-perf-value {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.v2-perf-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.v2-perf-sub {
    font-size: 0.65rem;
    color: var(--text-dim, #94a3b8);
    margin-top: 1px;
}

.v2-perf-trend {
    padding: 14px 16px;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--stroke, #e2e8f0);
    border-radius: var(--radius-lg);
}

/* ═══ Analytics Dashboard ═══ */
.v2-analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
@media (min-width: 768px) {
    .v2-analytics-grid { grid-template-columns: repeat(4, 1fr); }
}
.v2-stat-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    transition: all var(--duration);
}
.v2-stat-card:hover {
    border-color: color-mix(in srgb, var(--accent-primary, var(--accent)) 40%, transparent);
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.06);
}
.v2-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.v2-stat-body { min-width: 0; }
.v2-stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}
.v2-stat-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}
.v2-stat-sub {
    font-size: 0.62rem;
    color: var(--text-dim);
    margin-top: 2px;
}

/* Funnel */
.v2-analytics-funnel {
    grid-column: 1 / -1;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
}
.v2-funnel-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.v2-funnel-label {
    font-size: 0.7rem;
    font-weight: 600;
    width: 56px;
    flex-shrink: 0;
    text-align: right;
    color: var(--text-secondary);
}
.v2-funnel-bar-bg {
    flex: 1;
    height: 18px;
    background: rgba(99, 102, 241, 0.06);
    border-radius: 4px;
    overflow: hidden;
}
.v2-funnel-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #818cf8);
    border-radius: 4px;
    transition: width 0.6s ease;
    min-width: 2px;
}
.v2-funnel-count {
    font-size: 0.7rem;
    font-weight: 700;
    width: 24px;
    text-align: right;
    color: var(--text-primary);
}

/* Trend Chart */
.v2-analytics-trend {
    grid-column: 1 / -1;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
}
.v2-trend-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 80px;
}
.v2-trend-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}
.v2-trend-bar {
    width: 100%;
    background: linear-gradient(180deg, #6366f1, #818cf8);
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.4s ease;
}
.v2-trend-day {
    font-size: 0.5rem;
    color: var(--text-dim);
    margin-top: 2px;
    white-space: nowrap;
}

/* DU Member Rates */
.v2-analytics-du-rates {
    grid-column: 1 / -1;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
}
.v2-du-member-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.v2-du-member-name {
    font-size: 0.7rem;
    font-weight: 600;
    width: 80px;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.v2-du-bar-bg {
    flex: 1;
    height: 14px;
    background: rgba(99, 102, 241, 0.06);
    border-radius: 4px;
    overflow: hidden;
}
.v2-du-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.v2-du-rate {
    font-size: 0.68rem;
    font-weight: 700;
    width: 32px;
    text-align: right;
}

/* ═══ Pipeline Rules ═══ */
.v2-rule-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

.v2-rule-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.v2-rule-badge.active { background: rgba(34,197,94,0.1); color: #22c55e; }
.v2-rule-badge.inactive { background: rgba(156,163,175,0.1); color: #9ca3af; }

/* ═══ Project Templates ═══ */
.v2-template-select-card {
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration);
    margin-bottom: 0.5rem;
}

.v2-template-select-card:hover {
    border-color: var(--accent-primary, var(--accent));
    background: var(--bg-card-hover);
}

.v2-template-task-count {
    font-size: 0.68rem;
    color: var(--text-dim);
}

/* ═══ Business Documents (Phase 2.5) ═══ */
.v2-bdoc-container {
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    color: #111;
    padding: 3rem 4rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}
.v2-bdoc-header { display: flex; justify-content: space-between; margin-bottom: 2rem; border-bottom: 2px solid #000; padding-bottom: 1rem; }
.v2-bdoc-title { font-size: 1.8rem; font-weight: 800; letter-spacing: 0.1em; color: #000; text-transform: uppercase; }
.v2-bdoc-meta { text-align: right; font-size: 0.85rem; color: #333; line-height: 1.5; }
.v2-bdoc-parties { display: flex; justify-content: space-between; margin-bottom: 3rem; }
.v2-bdoc-issuer, .v2-bdoc-recipient { width: 45%; }
.v2-bdoc-party-title { font-size: 0.7rem; color: #666; text-transform: uppercase; margin-bottom: 0.5rem; letter-spacing: 0.05em; }
.v2-bdoc-party-name { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; }
.v2-bdoc-table { width: 100%; border-collapse: collapse; margin-bottom: 2rem; }
.v2-bdoc-table th { border-bottom: 1px solid #000; padding: 0.5rem; text-align: left; font-size: 0.75rem; text-transform: uppercase; color: #555; }
.v2-bdoc-table td { border-bottom: 1px solid #eee; padding: 0.75rem 0.5rem; font-size: 0.9rem; }
.v2-bdoc-table th.num, .v2-bdoc-table td.num { text-align: right; }
.v2-bdoc-totals { width: 300px; margin-left: auto; border-top: 1px solid #000; padding-top: 1rem; }
.v2-bdoc-totals-row { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.9rem; }
.v2-bdoc-totals-row.grand-total { font-weight: 800; font-size: 1.2rem; border-top: 2px solid #000; padding-top: 0.5rem; }
.v2-checkout-bridge { position: fixed; inset: 0; background: rgba(10,14,26,0.9); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1000; opacity: 0; transition: opacity 0.5s; pointer-events: none; }
.v2-checkout-bridge.show { opacity: 1; pointer-events: all; }
.v2-bridge-spinner { width: 50px; height: 50px; border: 3px solid rgba(255,255,255,0.1); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 1rem; }
.v2-bridge-text { color: white; font-weight: 600; font-size: 1.1rem; letter-spacing: 0.05em; }

@media print {
    body { background: white; }
    .v2-sidebar, .v2-mobile-header, .v2-toolbar, .v2-bdoc-actions { display: none !important; }
    .v2-main { padding: 0 !important; overflow: visible; height: auto; }
    .v2-bdoc-container { box-shadow: none; border-radius: 0; padding: 0; max-width: 100%; width: 100%; }
}

/* ═══ Sessions Calendar View ═══ */
.v2-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.v2-cal-nav-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.v2-cal-nav-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all var(--duration);
}
.v2-cal-nav-btn:hover { background: var(--bg-card-hover); }
.v2-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}
.v2-cal-day-header {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 6px 0;
}
.v2-cal-cell {
    min-height: 80px;
    background: var(--bg-card);
    border: 1px solid var(--stroke-subtle, var(--stroke));
    border-radius: var(--radius-sm);
    padding: 4px 5px;
    transition: background var(--duration);
    cursor: default;
}
.v2-cal-cell:hover { background: var(--bg-card-hover); }
.v2-cal-cell.v2-cal-other-month { opacity: 0.3; }
.v2-cal-cell.v2-cal-today {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}
.v2-cal-date-num {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 3px;
}
.v2-cal-cell.v2-cal-today .v2-cal-date-num {
    color: var(--accent);
}
.v2-cal-dot {
    font-size: 0.6rem;
    padding: 2px 4px;
    border-radius: 3px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    line-height: 1.2;
}
.v2-cal-dot:hover { filter: brightness(1.2); }
.v2-cal-dot-pending   { background: #F59E0B20; color: #F59E0B; border-left: 2px solid #F59E0B; }
.v2-cal-dot-confirmed { background: #05996020; color: #059960; border-left: 2px solid #059960; }
.v2-cal-dot-completed { background: #6366F120; color: #6366F1; border-left: 2px solid #6366F1; }

/* ═══ Deals Kanban View ═══ */
.v2-kanban {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    min-height: 400px;
}
.v2-kanban-col {
    flex: 0 0 220px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.v2-kanban-col-header {
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    position: sticky;
    top: 0;
    z-index: 1;
}
.v2-kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    cursor: pointer;
    transition: all var(--duration);
    font-size: 0.82rem;
}
.v2-kanban-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.v2-kanban-card-title {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 5px;
}
.v2-kanban-card-meta {
    font-size: 0.7rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.v2-kanban-card-amount {
    font-weight: 700;
    font-size: 0.78rem;
}
.v2-kanban-add {
    padding: 8px;
    border: 1px dashed var(--stroke);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-dim);
    font-size: 0.78rem;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: all var(--duration);
    font-family: inherit;
}
.v2-kanban-add:hover { border-color: var(--accent); color: var(--accent); background: var(--bg-card-hover); }

/* View Toggle Buttons */
.v2-view-toggle {
    display: flex;
    gap: 2px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 2px;
}
.v2-view-btn {
    padding: 5px 10px;
    border: none;
    border-radius: calc(var(--radius-md) - 2px);
    background: transparent;
    color: var(--text-dim);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration);
    font-family: inherit;
}
.v2-view-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* ═══ Wide Modal (Detail Views) ═══ */
.v2-modal-wide {
    max-width: 960px;
}

/* ═══ Detail View Components ═══ */
.v2-detail-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--stroke);
}

.v2-detail-section {
    margin-bottom: 1.25rem;
}

.v2-detail-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}

.v2-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.v2-detail-field {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.v2-detail-field-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.v2-detail-note-box {
    padding: 0.65rem 0.85rem;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.v2-detail-relation-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-sm);
    transition: background var(--duration);
}

.v2-detail-relation-row:hover {
    background: var(--bg-card-hover);
}

/* Detail Tabs */
.v2-detail-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 3px;
    margin-bottom: 1.25rem;
}

.v2-detail-tab {
    flex: 1;
    padding: 0.45rem 0.75rem;
    border: none;
    border-radius: calc(var(--radius-md) - 2px);
    background: transparent;
    color: var(--text-dim);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration);
    font-family: inherit;
    text-align: center;
}

.v2-detail-tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.v2-detail-tab:hover:not(.active) {
    color: var(--text-primary);
}

/* Stage Progress */
.v2-stage-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
}

.v2-stage-step {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    border: 2px solid var(--stroke);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-dim);
    transition: all 0.3s;
}

.v2-stage-step.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-subtle);
}

.v2-stage-step.completed {
    border-color: var(--success);
    color: var(--success);
    background: var(--success-subtle);
}

.v2-stage-arrow {
    color: var(--text-dim);
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* ═══ DU Rich UI ═══ */
.v2-du-card-title {
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--stroke);
}

.v2-du-structured-section {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.v2-du-struct-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1.4rem;
}

.v2-du-energy-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.v2-du-energy-opt {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.v2-du-energy-opt input[type="radio"] {
    display: none;
}

.v2-du-energy-label {
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    border: 2px solid var(--stroke);
    transition: all 0.2s;
    color: var(--text-dim);
}

.v2-du-energy-opt input[type="radio"]:checked + .v2-du-energy-label {
    border-color: var(--accent);
    background: var(--accent-subtle);
    color: var(--accent);
}

/* DU Timeline */
.v2-du-timeline-section {
    max-width: 800px;
    margin: 0 auto;
}

.v2-du-tl-day {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 1.5rem;
    border-left: 2px solid var(--stroke);
}

.v2-du-tl-day::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

.v2-du-tl-date {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.v2-du-tl-card {
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    overflow: hidden;
    transition: border-color var(--duration);
}

.v2-du-tl-card:hover {
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

.v2-du-tl-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card-hover);
    font-size: 0.75rem;
    font-weight: 600;
}

.v2-du-tl-card-body {
    padding: 0.5rem 0.75rem;
}

.v2-du-tl-field {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.78rem;
    line-height: 1.5;
}

.v2-du-tl-label {
    font-weight: 700;
    font-size: 0.68rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-width: 80px;
    flex-shrink: 0;
    padding-top: 0.1rem;
}

/* ═══ Add Panel (unified add UI) ═══ */
.v2-add-panel {
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: 16px;
    margin-bottom: 1.25rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    position: relative;
}

.v2-add-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--info));
    opacity: 0.85;
}

.v2-add-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    background: linear-gradient(180deg, var(--bg-card-hover), var(--bg-card));
    border-bottom: 1px solid var(--stroke-subtle);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.005em;
}

.v2-add-panel-header svg {
    color: var(--accent);
    flex-shrink: 0;
}

.v2-add-panel-body {
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.v2-add-panel-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 4px;
    border-top: 1px dashed var(--stroke-subtle);
    margin-top: 4px;
}

.v2-add-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    min-height: 44px;
    background: var(--bg-input);
    border: 1px solid var(--stroke);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary);
    transition: all 0.15s;
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

.v2-add-action-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-subtle);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.v2-add-action-btn:active {
    transform: translateY(0);
}

.v2-add-action-btn svg {
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.v2-add-action-btn:hover svg {
    opacity: 1;
}

/* ═══ Chat Template Buttons ═══ */
.v2-chat-tpl-btn {
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.v2-chat-tpl-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-subtle);
}

/* ═══ Chat Input Area ═══ */
#v2-chat-input-area {
    background: var(--bg-card);
    padding: 0.75rem 1rem !important;
    gap: 10px !important;
    min-height: 64px;
    box-sizing: border-box;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)) !important;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.03);
    position: relative;
    z-index: 2;
}

#v2-chat-input-area #v2-chat-input {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 16px !important;
    font-size: 0.9rem !important;
    border-radius: var(--radius-full);
    background: var(--bg-input);
    border: 1px solid var(--stroke);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

#v2-chat-input-area #v2-chat-input:focus {
    border-color: var(--accent);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

#v2-chat-input-area > button {
    flex-shrink: 0;
    height: 42px;
}

#v2-chat-input-area > button.v2-btn-primary {
    padding: 0 22px !important;
    border-radius: var(--radius-full) !important;
    font-weight: 600;
    box-shadow: 0 2px 8px var(--accent-glow);
}

/* Chat page viewport fix to prevent input clipping */
.v2-page[style*="height:calc(100vh - 104px)"],
.v2-page[style*="height: calc(100vh - 104px)"] {
    max-height: calc(100dvh - 104px);
}

@media (max-width: 768px) {
    .v2-page[style*="height:calc(100vh - 104px)"],
    .v2-page[style*="height: calc(100vh - 104px)"] {
        max-height: calc(100dvh - 88px);
    }
    #v2-chat-input-area {
        padding: 0.6rem 0.75rem !important;
        padding-bottom: calc(0.6rem + env(safe-area-inset-bottom, 0px)) !important;
    }
    #v2-chat-input-area > button.v2-btn-primary {
        padding: 0 16px !important;
    }
}

/* ═══ Kanban Board (Tasks Page) ═══ */
.v2-kanban {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.v2-kanban-col {
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.v2-kanban-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--stroke);
    background: var(--bg-card-hover);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.v2-kanban-col-body {
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    flex: 1;
    overflow-y: auto;
}

.v2-kanban-card {
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 12px;
    padding: 8px 12px 6px;
    cursor: pointer;
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), border-color 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 0 0 0.5px rgba(0,0,0,0.02), inset 0 1px 0 rgba(255,255,255,0.5);
    position: relative;
    overflow: hidden;
}

.v2-kanban-card::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0; left: 0;
    width: 3px;
    background: var(--text-dim);
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 0;
}

/* Status-based left accent (column order: open / in_progress / done) */
.v2-kanban > .v2-kanban-col:nth-child(1) .v2-kanban-card::before { background: var(--warning); }
.v2-kanban > .v2-kanban-col:nth-child(2) .v2-kanban-card::before { background: var(--accent); }
.v2-kanban > .v2-kanban-col:nth-child(3) .v2-kanban-card::before { background: var(--success); }
.v2-kanban-card::before { opacity: 0.55; }

.v2-kanban-card:hover {
    border-color: rgba(37, 99, 235, 0.3);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.1), 0 2px 6px rgba(0,0,0,0.05), inset 0 1px 0 rgba(255,255,255,0.6);
    transform: translateY(-2px);
}

.v2-kanban-card:hover::before {
    opacity: 1;
}

.v2-kanban-card-top {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.v2-kanban-card-content {
    cursor: pointer;
    padding-bottom: 2px;
}

.v2-kanban-card-title {
    font-size: 1.02rem !important;
    font-weight: 700;
    line-height: 1.3;
    flex: 1;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v2-kanban-card-info {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.v2-kanban-card-client,
.v2-kanban-card-project,
.v2-kanban-card-due {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    line-height: 1.3;
}

.v2-kanban-card-client {
    color: var(--accent);
    font-weight: 600;
}

.v2-kanban-card-project {
    color: var(--text-secondary);
}

.v2-kanban-card-due {
    color: var(--text-dim);
}

.v2-kanban-card-assignee {
    font-size: 0.72rem;
    color: var(--text-dim);
    background: var(--bg-input);
    padding: 1px 6px;
    border-radius: var(--radius-full);
}

.v2-kanban-card-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
    flex-wrap: wrap;
}

/* Card avatar (left) */
.v2-card-avatar {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    color: #fff;
    font-size: 0.85rem !important;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

/* Compact bottom-right avatar override */
.v2-card-bottom-right .v2-card-avatar {
    width: 22px !important;
    height: 22px !important;
    font-size: 0.60rem !important;
    box-shadow: none;
}

.v2-card-memo-btn-mini {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--stroke);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    color: var(--text-dim);
    transition: all 0.15s ease;
    padding: 0;
}
.v2-card-memo-btn-mini:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--accent);
}
.v2-card-memo-btn-mini.active {
    background: var(--accent-subtle);
    color: var(--accent);
    border-color: var(--accent);
}

/* Priority badge — prominent */
.v2-card-priority {
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    flex-shrink: 0;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.v2-card-priority-urgent { background: #ef444418; color: #ef4444; }
.v2-card-priority-high   { background: #f59e0b18; color: #d97706; }
.v2-card-priority-low    { background: #94a3b818; color: #94a3b8; }

/* === Card header (basic 1-line view) === */
.v2-card-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.v2-card-header-spacer { flex: 1; min-width: 0; }

.v2-card-client-badge {
    font-size: 0.62rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--accent-subtle);
    color: var(--accent);
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.02em;
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v2-card-type-badge {
    font-size: 0.62rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: var(--text-secondary);
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}
[data-theme="dark"] .v2-card-type-badge {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
}

.v2-card-memo-preview {
    font-size: 0.68rem;
    color: var(--text-dim);
    opacity: 0.7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-left: 4px;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 50%;
    font-weight: 400;
}

/* === Monochrome SVG icon — universal inline marker === */
.v2-svg-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    stroke-width: 2;
    width: 13px;
    height: 13px;
    color: inherit;
    flex-shrink: 0;
}

/* メモ drilldown trigger — lives inside カラム3 (所要時間), centered under the time block control */
.v2-card-memo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: var(--bg-glass);
    border: 1px solid var(--stroke);
    border-radius: 6px;
    padding: 4px 10px;
    margin-top: 10px;
    width: 100%;
    max-width: 80px;
    text-align: center;
    font-size: 0.70rem;
    font-weight: 700;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    flex-shrink: 0;
    font-family: inherit;
}
.v2-card-memo-btn:hover {
    background: var(--accent-subtle);
    color: var(--accent);
    border-color: var(--accent);
    transform: scale(1.02);
}
.v2-card-memo-btn.active {
    background: var(--accent-subtle);
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}
.v2-card-memo-btn.active:hover {
    transform: scale(1.04);
}

/* Memo drilldown container — accordion */
.v2-card-memo-drilldown {
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(15, 23, 42, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.04);
    overflow: hidden;
    transition: height 0.28s ease, opacity 0.25s ease;
    opacity: 0;
}
.v2-card-memo-drilldown.open {
    opacity: 1;
}
[data-theme="dark"] .v2-card-memo-drilldown {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

.v2-card-header-row .v2-kanban-card-title {
    flex: 1 1 auto;
    min-width: 0;
}

/* === Ultra-compact KPI rows (replaces old 3-col controls) === */
.v2-card-kpi-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 4px 0;
    border-top: 1px dashed rgba(15,23,42,0.06);
    font-size: 0.72rem;
    color: var(--text-secondary);
    width: 100%;
}

.v2-card-kpi-row:not(:last-child) { border-bottom: none; }

.v2-kpi-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.v2-kpi-value {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.v2-card-kpi-row .v2-kpi-divider {
    color: var(--text-dim);
    opacity: 0.4;
    font-weight: 400;
    padding: 0 2px;
    margin: 0;
}

.v2-kpi-spacer { flex: 1; min-width: 0; }

.v2-time-picker {
    cursor: pointer;
    position: relative;
}
.v2-time-picker:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* === 3-Column Card Controls (期日 | 期限 | 実行) === */
.v2-card-controls {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 8px;
    width: 100%;
    margin-top: 4px;
    padding: 4px 0 2px 0;
    border-top: 1px dashed rgba(15,23,42,0.08);
    align-items: stretch;
}

[data-theme="dark"] .v2-card-controls {
    border-top-color: rgba(255,255,255,0.08);
}

.v2-ctrl-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    gap: 4px;
    min-width: 0;
}

.v2-ctrl-sep {
    width: 1px;
    background: rgba(15,23,42,0.06);
    align-self: stretch;
    margin: 4px 0;
}

[data-theme="dark"] .v2-ctrl-sep {
    background: rgba(255,255,255,0.08);
}

.v2-ctrl-label {
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.v2-ctrl-value-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    justify-content: center;
    min-width: 0;
}

.v2-ctrl-value {
    font-size: 1.02rem !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    cursor: pointer;
}

/* Common minimal [-] / [+] adjust button — paired next to date/time displays */
.v2-adjust-btn {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid var(--stroke-subtle);
    background: var(--bg-glass);
    color: var(--text-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    line-height: 1;
    padding: 0;
    font-family: inherit;
    user-select: none;
}
.v2-adjust-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--text-primary);
}
.v2-adjust-btn:active {
    transform: scale(0.92);
}

.v2-ctrl-btn-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.v2-ctrl-time-select {
    margin-top: 4px;
    font-size: 0.68rem !important;
    padding: 2px 16px 2px 6px !important;
    font-weight: 700;
}

/* Mini variant of glass button — for tight kpi rows */
.v2-glass-btn-mini {
    padding: 2px 6px !important;
    font-size: 0.62rem !important;
    border-radius: 5px !important;
    line-height: 1.2;
}

/* Glassmorphism buttons */
.v2-glass-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: inherit;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px) saturate(1.4);
    -webkit-backdrop-filter: blur(10px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    touch-action: manipulation;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07), inset 0 1px 0 rgba(255,255,255,0.8);
}

.v2-glass-btn:hover {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.3);
    color: var(--accent, #2563eb);
    box-shadow: 0 2px 8px rgba(37,99,235,0.15), inset 0 1px 0 rgba(255,255,255,0.5);
    transform: translateY(-1px);
}

.v2-glass-btn:active {
    background: rgba(37, 99, 235, 0.2);
    transform: translateY(0) scale(0.96);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.v2-glass-btn.accent {
    color: var(--accent, #2563eb);
    border-color: rgba(37, 99, 235, 0.25);
    background: rgba(37, 99, 235, 0.08);
}

[data-theme="dark"] .v2-glass-btn {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.06);
}

[data-theme="dark"] .v2-glass-btn:hover {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(37, 99, 235, 0.4);
}

/* Date picker clickable value */
.v2-date-picker {
    cursor: pointer;
    position: relative;
}
.v2-date-picker:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Time block select — compact dropdown */
.v2-time-select {
    display: inline-flex;
    align-items: center;
    padding: 3px 18px 3px 6px;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 6px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L4 4L7 1' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    transition: all 0.18s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.8);
    margin-top: 0;
}

.v2-time-select:hover {
    background-color: rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.3);
    color: #06b6d4;
}

.v2-time-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

[data-theme="dark"] .v2-time-select {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.06);
}

/* Bold variant of time-select — used in card 所要 cell */
.v2-time-select.v2-time-select-bold {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    padding: 4px 20px 4px 8px;
    letter-spacing: -0.02em;
}

/* In slim kpi row: right-align the duration select */
.v2-card-kpi-row .v2-time-select {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 2px 16px 2px 6px;
    font-weight: 700;
}

/* Card edit (pen) button in title row */
.v2-card-edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-dim, #94a3b8);
    cursor: pointer;
    border-radius: 6px;
    opacity: 0.3;
    transition: all 0.15s;
    flex-shrink: 0;
}
.v2-card-edit-btn:hover {
    opacity: 0.8;
    background: rgba(37, 99, 235, 0.08);
    color: var(--accent, #2563eb);
}

/* ═══ Pen-mark "mode toggle" at left of title — all-inline edit ═══ */
.v2-card-mode-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-dim, #94a3b8);
    cursor: pointer;
    border-radius: 6px;
    opacity: 0.3;
    transition: all 0.18s var(--ease-out);
    flex-shrink: 0;
    padding: 0;
}
.v2-card-mode-toggle:hover {
    opacity: 1;
    background: rgba(37, 99, 235, 0.08);
    color: var(--accent, #2563eb);
    transform: scale(1.06);
}
.v2-card-mode-toggle.active {
    opacity: 1;
    color: var(--accent, #2563eb);
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}
.v2-card-mode-toggle .v2-svg-icon { width: 14px; height: 14px; }

/* Editing card visual cue */
.v2-kanban-card.v2-card-editing {
    border-color: rgba(37, 99, 235, 0.32) !important;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.18), 0 8px 22px -10px rgba(37, 99, 235, 0.30);
}

/* ═══ Inline edit inputs — used in pen-mark edit mode (title / date / time / block) ═══ */
.v2-card-title-input {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: 6px;
    padding: 3px 8px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.v2-card-title-input:focus {
    background: rgba(255, 255, 255, 0.85);
    border-color: var(--accent, #2563eb);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
}

.v2-dp-input,
.v2-tp-input {
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 5px;
    padding: 1px 4px;
    line-height: 1.2;
    outline: none;
    min-width: 0;
    max-width: 100%;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.v2-dp-input { width: 110px; }
.v2-tp-input { width: 72px; }
.v2-tp-input.v2-block-input { width: 60px; text-align: center; }
.v2-dp-input:focus,
.v2-tp-input:focus {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--accent, #2563eb);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}
[data-theme="dark"] .v2-card-title-input,
[data-theme="dark"] .v2-dp-input,
[data-theme="dark"] .v2-tp-input {
    background: rgba(30, 41, 59, 0.55);
    border-color: rgba(255, 255, 255, 0.10);
    color: var(--text-primary);
}

/* ═══ 3-Column variant of card controls (期日・期限 / 実行 / 所要時間) ═══ */
.v2-card-controls.v2-card-controls-3col {
    grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1fr) auto minmax(0, 0.85fr);
    gap: 10px;
    align-items: stretch;
}
.v2-ctrl-col-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    gap: 8px;
    min-width: 0;
}

/* 所要時間 (column 3) — text display + overlay select */
.v2-block-row {
    position: relative;
    gap: 8px;
}
.v2-block-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 56px;
    justify-content: center;
}
.v2-block-text {
    font-size: 1.02rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.1;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px dashed transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.v2-block-text:hover {
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.35);
    transform: translateY(-1px);
}
.v2-block-custom-select {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 4px;
    z-index: 20;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(124, 58, 237, 0.30);
    border-radius: 8px;
    padding: 4px 22px 4px 8px;
    box-shadow: 0 6px 20px -6px rgba(124, 58, 237, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    outline: none;
    cursor: pointer;
    min-width: 84px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L4 4L7 1' stroke='%237c3aed' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
}
[data-theme="dark"] .v2-block-custom-select {
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(167, 139, 250, 0.30);
    color: var(--text-primary);
}

/* Card memo (below progress bar) — vertically expandable */
.v2-card-memo {
    margin-top: 8px;
    padding: 8px 2px 2px;
    border-top: 1px solid rgba(15,23,42,0.04);
    font-size: 0.72rem;
    color: var(--text-primary);
    line-height: 1.4;
    word-break: break-all;
    min-height: 24px;
    cursor: pointer;
    transition: background 0.15s;
}
.v2-card-memo:hover {
    background: rgba(0, 0, 0, 0.02);
}
.v2-memo-text {
    color: var(--text-secondary, #64748b);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    display: block;
}
.v2-memo-placeholder {
    color: var(--text-dim, #94a3b8);
    opacity: 0.5;
    font-style: italic;
}

/* Inline memo textarea */
.v2-memo-input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 0.72rem;
    font-family: inherit;
    color: var(--text-primary);
    resize: none;
    outline: 2px solid var(--accent);
    border-radius: 4px;
    padding: 4px 6px;
    line-height: 1.4;
    min-height: 36px;
}

/* Exec timing — clickable value in 所要 column */
.v2-ctrl-exec {
    cursor: pointer;
    transition: color 0.15s;
    font-size: 0.88rem !important;
}
.v2-ctrl-exec:hover {
    color: #10b981 !important;
}

/* Archive section — collapsible */
.v2-archive-section {
    margin-top: 0.5rem;
    border-top: 1px dashed var(--stroke, #e2e8f0);
    padding-top: 0.75rem;
}

.v2-archive-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: inherit;
    color: var(--text-secondary, #64748b);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.7);
}

.v2-archive-toggle-btn:hover {
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.3);
    color: #059669;
}

.v2-archive-arrow {
    transition: transform 0.25s ease;
}

.v2-archive-arrow.open {
    transform: rotate(90deg);
}

.v2-archive-count {
    font-size: 0.68rem;
    font-weight: 800;
    color: #059669;
    background: #05966912;
    padding: 1px 6px;
    border-radius: 10px;
}

.v2-archive-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease;
    opacity: 0;
    margin-top: 0;
}

.v2-archive-body.open {
    max-height: 3000px;
    opacity: 1;
    margin-top: 0.75rem;
}

[data-theme="dark"] .v2-archive-toggle-btn {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

.v2-kanban-empty {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-dim);
    font-size: 0.78rem;
}

/* Task checkbox */
.v2-task-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    margin-top: 1px;
}

.v2-task-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.v2-task-check-mark {
    width: 16px;
    height: 16px;
    border: 2px solid var(--stroke);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.v2-task-checkbox input:checked + .v2-task-check-mark {
    background: var(--success);
    border-color: var(--success);
}

.v2-task-checkbox input:checked + .v2-task-check-mark::after {
    content: '';
    width: 5px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -1px;
}

/* Task list item */
.v2-task-list-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

/* Quick add bar v2 (command-bar style) */
.v2-task-quick-add-v2 {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    max-width: 540px;
    min-height: 44px;
    background: var(--bg-input);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    padding: 4px 4px 4px 16px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    flex-wrap: wrap;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.v2-task-quick-add-v2:hover {
    border-color: var(--text-dim);
}

.v2-task-quick-add-v2:focus-within {
    border-color: var(--accent);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.v2-task-quick-add-v2 input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    padding: 8px 0;
    min-width: 140px;
}

.v2-task-quick-add-v2 input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

[data-theme="dark"] .v2-task-quick-add-v2 {
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
}

/* Time Block Pills */
.v2-time-block-pills {
    display: flex;
    gap: 2px;
    padding: 2px 4px;
}

.v2-time-block-pill {
    padding: 2px 8px;
    font-size: 0.62rem;
    font-weight: 700;
    font-family: inherit;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.v2-time-block-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.v2-time-block-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.v2-task-quick-add-v2 > button:last-child {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.v2-task-quick-add-v2 > button:last-child:hover {
    background: var(--accent-hover);
    transform: scale(1.06);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.v2-task-quick-add-v2 > button:last-child:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Time Block Badge (on cards) */
.v2-time-block-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    font-size: 0.58rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--stroke);
    font-variant-numeric: tabular-nums;
}

/* Archive Section */
.v2-archive-toggle {
    margin-top: var(--space-md);
    text-align: center;
}

.v2-archive-toggle button {
    gap: 6px;
}

.v2-archive-list {
    display: none;
    margin-top: var(--space-sm);
    padding: var(--space-sm);
    background: var(--bg-card);
    border: 1px dashed var(--stroke);
    border-radius: var(--radius-lg);
    opacity: 0.7;
}

.v2-archive-list.active {
    display: block;
}

/* Task Breakdown Rows */
.v2-breakdown-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    border-bottom: 1px solid var(--stroke-subtle);
}

.v2-breakdown-row:last-child {
    border-bottom: none;
}

.v2-breakdown-row-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-subtle);
    color: var(--accent);
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.v2-bd-title {
    flex: 1;
    min-width: 80px;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    padding: 5px 8px;
    font-size: 0.78rem;
    font-family: inherit;
    background: var(--bg-input);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s;
}

.v2-bd-title:focus {
    border-color: var(--accent);
}

.v2-breakdown-block-group {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.v2-bd-assignee {
    width: 100px;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    padding: 4px 6px;
    font-size: 0.68rem;
    font-family: inherit;
    background: var(--bg-input);
    color: var(--text-primary);
    outline: none;
    flex-shrink: 0;
}

.v2-bd-remove {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.v2-bd-remove:hover {
    background: var(--danger-subtle, rgba(239,68,68,0.1));
    color: var(--danger);
}

@media (max-width: 600px) {
    .v2-breakdown-row {
        flex-wrap: wrap;
    }
    .v2-bd-title {
        min-width: 100%;
    }
}

/* Interactive Progress Slider */
.v2-progress-slider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 6px 8px 4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(12px) saturate(1.3);
    -webkit-backdrop-filter: blur(12px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 1px 3px rgba(0,0,0,0.04);
    position: relative;
}

[data-theme="dark"] .v2-progress-slider {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 1px 3px rgba(0,0,0,0.2);
}

.v2-progress-bar-interactive {
    flex: 1;
    height: 6px;
    background: rgba(0,0,0,0.06);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    transition: height 0.2s var(--ease-out);
    overflow: hidden;
}

/* Invisible touch target expander */
.v2-progress-bar-interactive::before {
    content: '';
    position: absolute;
    top: -8px;
    bottom: -8px;
    left: 0;
    right: 0;
}

.v2-progress-bar-interactive:hover,
.v2-progress-slider.dragging .v2-progress-bar-interactive {
    height: 10px;
}

.v2-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s var(--ease-out), background 0.25s;
    pointer-events: none;
    position: relative;
}

.v2-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    border-radius: inherit;
    pointer-events: none;
}

.v2-progress-thumb {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.15s, transform 0.15s;
    pointer-events: none;
    box-shadow: 0 1px 6px rgba(0,0,0,0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.v2-progress-bar-interactive:hover .v2-progress-thumb,
.v2-progress-slider.dragging .v2-progress-thumb {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.v2-progress-slider.dragging .v2-progress-thumb {
    transform: translate(-50%, -50%) scale(1.2);
}

.v2-progress-pct {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text-dim);
    min-width: 28px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    transition: color 0.15s;
    user-select: none;
}

.v2-progress-slider.dragging .v2-progress-pct {
    color: var(--accent);
}

/* Task completion button */
.v2-task-complete-btn {
    width: 24px;
    height: 24px;
    border: 2px solid var(--stroke);
    border-radius: var(--radius-full);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.25s var(--ease-out);
    color: transparent;
    padding: 0;
}

.v2-task-complete-btn:hover {
    border-color: var(--success);
    color: var(--success);
    transform: scale(1.1);
}

.v2-task-complete-btn.done {
    background: var(--success);
    border-color: var(--success);
    color: white;
    animation: v2-completePop 0.35s var(--ease-out);
}

@keyframes v2-completePop {
    0% { transform: scale(0.5); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Card completing animation */
.v2-task-completing {
    animation: v2-taskComplete 0.4s ease forwards;
}

@keyframes v2-taskComplete {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.97); background: var(--success-subtle); }
    100% { opacity: 0.6; transform: scale(0.95); }
}

.v2-kanban-card-done {
    opacity: 0.6;
}

.v2-task-done {
    opacity: 0.6;
}

/* ═══ Weekly Calendar (Schedule Page) ═══ */
.v2-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--stroke);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: var(--space-md);
}

.v2-calendar-col {
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.v2-calendar-col-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-sm) var(--space-xs);
    background: var(--bg-card-hover);
    border-bottom: 1px solid var(--stroke);
    cursor: pointer;
    transition: background var(--duration);
}

.v2-calendar-col-header:hover {
    background: var(--accent-subtle);
}

.v2-calendar-day-name {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
}

.v2-calendar-day-num {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 2px;
}

.v2-calendar-day-num.today {
    background: var(--accent);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.v2-calendar-today {
    background: var(--accent-subtle) !important;
}

.v2-calendar-weekend .v2-calendar-day-name {
    color: var(--danger);
}

.v2-calendar-col-body {
    padding: var(--space-xs);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
}

.v2-calendar-event {
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.72rem;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: opacity var(--duration);
    border-left: 3px solid transparent;
}

.v2-calendar-event:hover { opacity: 0.8; }

.v2-calendar-event-task { background: var(--accent-subtle); border-left-color: var(--accent); }
.v2-calendar-event-meeting { background: var(--info-subtle); border-left-color: var(--info); }
.v2-calendar-event-call { background: var(--warning-subtle); border-left-color: var(--warning); }
.v2-calendar-event-milestone { background: var(--success-subtle); border-left-color: var(--success); }
.v2-calendar-event-note { background: var(--bg-input); border-left-color: var(--text-dim); }

.v2-calendar-event-time {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-dim);
}

.v2-calendar-event-title {
    font-weight: 500;
    word-break: break-word;
}

/* Always-visible add button in week calendar */
.v2-calendar-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    margin-top: auto;
    color: var(--text-dim);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    border-radius: var(--radius-sm);
}

.v2-calendar-col:hover .v2-calendar-add-btn {
    opacity: 0.5;
}

.v2-calendar-add-btn:hover {
    opacity: 1 !important;
    color: var(--accent);
    background: var(--accent-subtle);
}

/* Schedule nav */
.v2-schedule-nav {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
}

/* ── Day View (Timeline Grid) ── */
.v2-day-view {
    margin-top: var(--space-md);
}

.v2-day-allday {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--stroke);
    margin-bottom: var(--space-sm);
}

.v2-day-allday-events {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    flex: 1;
}

.v2-day-timeline {
    position: relative;
    border: 1px solid var(--stroke);
    border-radius: 12px;
    overflow: hidden;
}

.v2-day-timeline-row {
    display: flex;
    align-items: flex-start;
    min-height: 60px;
    border-bottom: 1px solid var(--stroke, #e2e8f0);
}

.v2-day-timeline-row:last-child {
    border-bottom: none;
}

.v2-day-timeline-hour {
    width: 60px;
    padding: 8px;
    font-size: 0.7rem;
    color: var(--text-dim);
    font-weight: 600;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.v2-day-timeline-slot {
    flex: 1;
    min-height: 60px;
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.v2-day-timeline-slot:hover {
    background: rgba(37,99,235,0.06);
    border: 1px dashed rgba(37,99,235,0.25);
    margin: -1px;
}

.v2-day-timeline-slot:hover::after {
    content: '+';
    font-size: 1rem;
    font-weight: 600;
    color: rgba(37,99,235,0.35);
    pointer-events: none;
}

.v2-day-event-card {
    position: absolute;
    left: 68px;
    right: 8px;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(37,99,235,0.08);
    border-left: 3px solid var(--accent);
    cursor: pointer;
    z-index: 5;
    pointer-events: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-day-event-card:hover {
    background: rgba(37,99,235,0.14);
}

.v2-day-event-card .v2-day-event-time {
    font-size: 0.68rem;
    color: var(--text-dim);
    margin-right: 6px;
}

.v2-day-event-card .v2-day-event-title {
    color: var(--text-primary);
}

.v2-day-now-line {
    position: absolute;
    left: 60px;
    right: 0;
    height: 2px;
    background: #ef4444;
    z-index: 3;
    pointer-events: none;
}

.v2-day-now-line::before {
    content: '';
    position: absolute;
    left: -4px;
    top: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
}

/* Legacy day view fallback */
.v2-day-hours {
    display: flex;
    flex-direction: column;
}

.v2-day-hour-row {
    display: flex;
    border-bottom: 1px solid var(--stroke-subtle);
    min-height: 48px;
}

.v2-day-hour-label {
    width: 56px;
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-dim);
    padding: 6px 8px 6px 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.v2-day-hour-content {
    flex: 1;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: flex-start;
    transition: background 0.15s;
}

.v2-day-hour-content:hover {
    background: var(--bg-card-hover);
}

.v2-day-hour-now {
    background: var(--accent-subtle) !important;
    border-left: 3px solid var(--accent);
}

/* ── Month View ── */
.v2-month-grid {
    margin-top: var(--space-md);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.v2-month-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--bg-card-hover);
    border-bottom: 1px solid var(--stroke);
}

.v2-month-day-name {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim);
    padding: 6px 0;
    text-transform: uppercase;
}

.v2-month-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid var(--stroke-subtle);
}

.v2-month-row:last-child {
    border-bottom: none;
}

/* Month layout: calendar + detail panel */
.v2-month-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: var(--space-md);
    margin-top: var(--space-md);
    align-items: start;
}

@media (max-width: 900px) {
    .v2-month-layout {
        grid-template-columns: 1fr;
    }
}

.v2-month-calendar-side {
    min-width: 0;
}

.v2-month-cell {
    min-height: 90px;
    padding: 4px 6px;
    cursor: pointer;
    background: var(--bg-card);
    transition: background 0.15s, box-shadow 0.15s;
    border-right: 1px solid var(--stroke-subtle);
}

.v2-month-cell:last-child {
    border-right: none;
}

.v2-month-cell:hover {
    background: var(--bg-card-hover);
}

.v2-month-today {
    background: var(--accent-subtle) !important;
}

.v2-month-selected {
    box-shadow: inset 0 0 0 2px var(--accent);
    background: var(--accent-subtle) !important;
}

.v2-month-outside {
    opacity: 0.35;
}

.v2-month-date {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
}

.v2-month-date.today {
    background: var(--accent);
    color: white;
}

/* Event chips inside month cells */
.v2-month-events {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 2px;
}

.v2-month-event-chip {
    font-size: 0.6rem;
    line-height: 1.3;
    padding: 1px 4px;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 3px;
    transition: opacity 0.15s;
}

.v2-month-event-chip:hover {
    opacity: 0.7;
}

.v2-month-event-task { background: var(--accent-subtle); color: var(--accent); border-left: 2px solid var(--accent); }
.v2-month-event-meeting { background: var(--info-subtle); color: var(--info); border-left: 2px solid var(--info); }
.v2-month-event-call { background: var(--warning-subtle); color: var(--warning); border-left: 2px solid var(--warning); }
.v2-month-event-milestone { background: var(--success-subtle); color: var(--success); border-left: 2px solid var(--success); }
.v2-month-event-note { background: var(--bg-input); color: var(--text-dim); border-left: 2px solid var(--text-dim); }

.v2-month-event-time {
    font-weight: 700;
    font-size: 0.55rem;
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
}

.v2-month-event-more {
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--text-dim);
    padding: 1px 4px;
}

/* Detail panel (right side) */
.v2-month-detail-panel {
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    position: sticky;
    top: var(--space-md);
    min-height: 300px;
}

.v2-month-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--stroke);
}

.v2-month-panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
}

.v2-month-panel-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) 0;
    color: var(--text-dim);
    font-size: 0.78rem;
}

.v2-month-panel-events {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.v2-month-panel-event {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s;
    border-left: 3px solid transparent;
}

.v2-month-panel-event:hover {
    background: var(--bg-card-hover);
}

.v2-month-panel-event-time {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-dim);
    min-width: 36px;
    font-variant-numeric: tabular-nums;
    padding-top: 1px;
}

.v2-month-panel-event-info {
    flex: 1;
    min-width: 0;
}

.v2-month-panel-event-title {
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 2px;
}

/* ── Time Presets (Quick Add Modal) ── */
.v2-time-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.v2-time-preset {
    padding: 4px 10px;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-variant-numeric: tabular-nums;
}

.v2-time-preset:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.v2-time-preset.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* ── Participants Picker ── */
.v2-participants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px;
    background: var(--bg-input);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    border: 1px solid var(--stroke);
    border-top: none;
    max-height: 140px;
    overflow-y: auto;
}

.v2-participant-search {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--stroke);
    border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    background: var(--bg-input);
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s;
}

.v2-participant-search:focus {
    border-color: var(--accent);
}

.v2-participant-search::placeholder {
    color: var(--text-dim);
}

.v2-participant-check {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 6px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    transition: background 0.15s;
    user-select: none;
    border: 1px solid transparent;
}

.v2-participant-check:hover {
    background: var(--bg-card-hover);
}

.v2-participant-check:has(input:checked) {
    background: var(--accent-subtle);
    border-color: var(--accent);
}

.v2-participant-check input[type="checkbox"] {
    display: none;
}

.v2-participant-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--stroke);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-dim);
    flex-shrink: 0;
}

.v2-participant-check:has(input:checked) .v2-participant-avatar {
    background: var(--accent);
    color: white;
}

/* Participants in Detail View */
.v2-detail-participants {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.v2-detail-participant {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 4px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    border: 1px solid var(--stroke);
}
/* ═══ DU Status Badges ═══ */
.v2-du-status-badges {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.v2-du-status-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--stroke);
    background: var(--bg-card);
}

.v2-du-status-done {
    background: var(--success-subtle);
    border-color: var(--success);
    color: var(--success);
}

.v2-du-status-pending {
    background: var(--bg-input);
    color: var(--text-dim);
}

/* DU readonly card */
.v2-du-readonly {
    opacity: 0.9;
}

.v2-du-readonly-body {
    padding: var(--space-sm) 0;
}

/* DU step completed indicator */
.v2-du-step.completed::after {
    content: '✓';
    margin-left: 6px;
    font-size: 0.7rem;
    color: var(--success);
    font-weight: 700;
}

@media (max-width: 768px) {
    .v2-modal-wide { max-width: 100%; }
    .v2-detail-grid { grid-template-columns: 1fr; }
    .v2-du-structured-section { flex-direction: column; }
    .v2-du-struct-icon { margin-top: 0; }
    .v2-du-tl-field { flex-direction: column; gap: 0.15rem; }
    .v2-du-tl-label { min-width: auto; }

    /* Kanban stacks vertically on mobile */
    .v2-kanban {
        grid-template-columns: 1fr;
    }
    .v2-kanban-col {
        min-height: auto;
    }

    /* Calendar stacks on mobile */
    .v2-calendar-grid {
        grid-template-columns: 1fr;
    }
    .v2-calendar-col {
        min-height: 80px;
    }
    .v2-calendar-col-header {
        flex-direction: row;
        justify-content: space-between;
        padding: var(--space-xs) var(--space-sm);
    }

    /* Task quick add stacks */
    .v2-task-quick-add {
        max-width: 100%;
    }
}

/* ═══════════════════════════════════════════════════ */
/* Shirota-A + Kuroda-C CSS Additions                  */
/* ═══════════════════════════════════════════════════ */

/* ── Task Term Classification Stats ── */
.v2-term-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.v2-term-card {
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.v2-term-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.v2-term-card-short::before { background: var(--danger); }
.v2-term-card-mid::before { background: var(--warning); }
.v2-term-card-long::before { background: var(--accent); }
.v2-term-card-noterm::before { background: var(--text-dim); }

.v2-term-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.v2-term-card.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.v2-term-count {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
}

.v2-term-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.v2-term-icon {
    display: inline-flex;
    align-items: center;
}

.v2-term-icon svg {
    width: 14px;
    height: 14px;
}

.v2-term-sub {
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-top: 2px;
}

.v2-term-filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--accent-subtle);
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.v2-term-filter-badge:hover {
    background: var(--accent);
    color: white;
}

/* ── Kanban Card: Dark Mode Glassmorphism ── */
[data-theme="dark"] .v2-kanban-card {
    background: rgba(30, 30, 50, 0.55);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.06);
}

[data-theme="dark"] .v2-kanban-card:hover {
    border-color: rgba(99,102,241,0.4);
    box-shadow: 0 6px 22px rgba(99,102,241,0.2), 0 2px 8px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.08);
}

[data-theme="dark"] .v2-progress-bar-interactive {
    background: rgba(255,255,255,0.08);
}

[data-theme="dark"] .v2-progress-slider {
    border-top-color: rgba(255,255,255,0.06);
}

[data-theme="dark"] .v2-kanban-card-client {
    color: #818cf8;
}

[data-theme="dark"] .v2-kanban-card-assignee {
    background: rgba(255,255,255,0.06);
}

/* ── Badge: status-open (was missing) ── */
.v2-badge-status-open { background: #dbeafe; color: #1d4ed8; }

[data-theme="dark"] .v2-badge-status-open { background: rgba(37, 99, 235, 0.15); color: #60a5fa; }

/* ── Unified Empty State Component ── */
.v2-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 2rem;
    text-align: center;
    gap: 0.75rem;
    position: relative;
    background:
        radial-gradient(circle at 50% 20%, var(--accent-subtle) 0%, transparent 60%);
    border-radius: var(--radius-lg);
}

.v2-empty-state::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--stroke) 1px, transparent 1px);
    background-size: 18px 18px;
    opacity: 0.35;
    pointer-events: none;
    border-radius: inherit;
    mask-image: radial-gradient(circle at center, black 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(circle at center, black 0%, transparent 75%);
}

.v2-empty-state > * { position: relative; z-index: 1; }

.v2-empty-icon {
    opacity: 0.4;
    margin-bottom: 0.35rem;
    color: var(--text-dim);
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--stroke-subtle);
    box-shadow: var(--shadow-sm);
}

.v2-empty-icon svg { width: 26px; height: 26px; }

.v2-empty-title { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.01em; }
.v2-empty-desc { font-size: 0.85rem; color: var(--text-dim); max-width: 380px; line-height: 1.6; }
.v2-empty-action { margin-top: 0.75rem; }

/* (Toast styles consolidated above) */

/* ── Modal Animation Enhancement ── */
.v2-modal-overlay {
    opacity: 0;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.v2-modal-overlay.open { opacity: 1; }

.v2-modal-overlay .v2-modal {
    transform: scale(0.95) translateY(8px);
    opacity: 0;
    transition: transform 0.25s var(--ease-out), opacity 0.2s ease;
}

.v2-modal-overlay.open .v2-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ── Project Detail Sections (Kuroda-C) ── */
.v2-proj-detail-section {
    padding-top: 0.75rem;
    border-top: 1px solid var(--stroke);
}

.v2-proj-detail-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.v2-proj-task-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 6px 0;
    border-bottom: 1px solid var(--stroke-subtle);
    font-size: 0.82rem;
}

.v2-proj-task-item:last-child { border-bottom: none; }

/* ── Mobile Responsive Additions ── */
@media (max-width: 768px) {
    .v2-term-stats { grid-template-columns: repeat(2, 1fr); }
    .v2-actions-bar { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .v2-term-stats { grid-template-columns: 1fr 1fr; gap: 0.4rem; }
    .v2-term-count { font-size: 1.2rem; }
}

/* ═══ Notification Panel — Phase 2 ═══ */
.v2-notif-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1099;
    transition: opacity 0.25s ease;
    opacity: 0;
}
.v2-notif-overlay.open {
    display: block;
    opacity: 1;
}
@media (max-width: 768px) {
    .v2-notif-overlay { top: 56px; }
    .v2-notif-panel { top: 56px; height: calc(100vh - 56px); }
}

.v2-notif-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 90vw;
    height: 100vh;
    background: var(--bg-card, #ffffff);
    border-left: 1px solid var(--stroke, #e2e8f0);
    box-shadow: -8px 0 32px rgba(0,0,0,0.12);
    z-index: 1100;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.v2-notif-panel.open {
    transform: translateX(0);
}

.v2-notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--stroke, #e2e8f0);
    flex-shrink: 0;
}

.v2-notif-list {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.v2-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--stroke-subtle, rgba(0,0,0,0.05));
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
}
.v2-notif-item:hover {
    background: rgba(37,99,235,0.04);
}
.v2-notif-item-unread {
    background: rgba(37,99,235,0.03);
}

.v2-notif-item-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-card-alt, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim, #64748b);
}
.v2-notif-item-unread .v2-notif-item-icon {
    background: rgba(37,99,235,0.08);
    color: var(--accent, #2563eb);
}

.v2-notif-item-body {
    flex: 1;
    min-width: 0;
}

.v2-notif-item-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary, #0f172a);
    line-height: 1.4;
}

.v2-notif-item-desc {
    font-size: 0.75rem;
    color: var(--text-sub, #64748b);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v2-notif-item-time {
    font-size: 0.68rem;
    color: var(--text-dim, #94a3b8);
    margin-top: 3px;
}

.v2-notif-unread-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent, #2563eb);
    margin-top: 6px;
}

/* Bell hover in sidebar */
#v2-notif-bell:hover {
    background: rgba(255,255,255,0.1);
    color: #fff !important;
}

@media (max-width: 768px) {
    .v2-notif-panel { width: 100vw; max-width: 100vw; }
}

/* ═══ Quick Add Section ═══ */
.v2-quick-add-section {
    margin-bottom: var(--space-md);
}
.v2-quick-add-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}
.v2-quick-add-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.v2-quick-add-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}
.v2-quick-add-actions .v2-btn {
    display: flex;
    align-items: center;
    gap: 5px;
}

.v2-quick-add-input {
    flex: 1;
    min-width: 200px;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    outline: none;
    transition: border-color var(--duration), background var(--duration), box-shadow var(--duration);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.v2-quick-add-input::placeholder {
    color: var(--text-dim);
    font-style: italic;
    opacity: 0.85;
}

.v2-quick-add-input:hover:not(:focus) {
    border-color: var(--text-dim);
}

.v2-quick-add-input:focus {
    border-color: var(--accent);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 4px var(--accent-glow), inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .v2-quick-add-input {
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
}

/* ═══ Quick Type Toggle (Small Tabs) ═══ */
.v2-tab-sm {
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.v2-tab-sm:hover {
    background: var(--accent-subtle);
    color: var(--accent);
}
.v2-tab-sm.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ═══ Inline Edit Fields ═══ */
.v2-inline-edit {
    width: 100%;
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    font-family: inherit;
    color: var(--text-primary);
    resize: vertical;
    outline: none;
}
.v2-inline-edit:hover {
    border-color: var(--text-dim) !important;
}
.v2-inline-edit:focus {
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ═══ Filter Bar ═══ */
.v2-filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.v2-filter-search {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8rem;
    outline: none;
    transition: all var(--duration);
    min-width: 180px;
}

.v2-filter-search:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.v2-filter-chips {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.v2-filter-chip {
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.v2-filter-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.v2-filter-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* ═══ Schedule Empty Day ═══ */
.v2-schedule-empty-day .v2-day-view {
    opacity: 0.6;
}

/* ═══ Mobile Responsive — 768px ═══ */
@media (max-width: 768px) {
    .v2-kanban {
        flex-direction: column;
        grid-template-columns: 1fr !important;
    }
    .v2-kanban-col {
        flex: 1 1 auto;
    }
    .v2-perf-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .v2-table-wrap,
    .v2-data-grid {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ═══ Mobile Responsive — 480px ═══ */
@media (max-width: 480px) {
    .v2-perf-grid {
        grid-template-columns: 1fr !important;
    }
    .v2-btn {
        min-height: 44px;
    }
    .v2-quick-add-bar {
        flex-wrap: wrap;
    }
    .v2-modal {
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 90vh !important;
    }
    .v2-day-timeline-hour {
        width: 44px;
        padding: 6px 4px;
        font-size: 0.65rem;
    }
    .v2-day-event-card {
        left: 50px;
    }
    .v2-day-now-line {
        left: 44px;
    }
}

/* ═══ Column Add Button (カラムヘッダー+ボタン) ═══ */
.v2-col-add-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px dashed var(--stroke);
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    transition: all 0.2s var(--ease-out);
    margin-left: auto;
    padding: 0;
    flex-shrink: 0;
}
.v2-col-add-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-subtle);
    border-style: solid;
}
.v2-kanban-col-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ═══ Kanban Empty State (空カード構造) ═══ */
.v2-kanban-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: var(--space-sm);
}
.v2-kanban-empty-box {
    width: 100%;
    border: 1px dashed var(--stroke);
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    text-align: center;
    background: transparent;
}

/* ═══ Stage Card Filter (フェーズカードフィルター) ═══ */
.v2-stage-card {
    transition: all 0.2s var(--ease-out);
}
.v2-stage-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.v2-stage-card-active {
    box-shadow: 0 0 0 1px var(--accent);
}

/* ═══ Bulk Add Modal Table ═══ */
#bulk-tasks-table td,
#bulk-projects-table td,
#bulk-actors-table td {
    padding: 3px 4px;
}
#bulk-tasks-table .v2-input,
#bulk-projects-table .v2-input,
#bulk-actors-table .v2-input {
    width: 100%;
    padding: 6px 8px;
    font-size: 0.82rem;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    box-sizing: border-box;
}
#bulk-tasks-table .v2-input:focus,
#bulk-projects-table .v2-input:focus,
#bulk-actors-table .v2-input:focus {
    border-color: var(--accent);
    outline: none;
    background: var(--bg-input-focus);
}

/* ═══ Contract List (Phase 2.5-04) ═══ */
.v2-contract-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--stroke);
}
.v2-contract-card:last-child {
    border-bottom: none;
}

/* ═══ Invitation List (Phase 4-01) ═══ */
#v2-settings-invitations .v2-list-item:last-child {
    border-bottom: none;
}
.v2-invite-status-pending {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}
.v2-invite-status-accepted {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}
.v2-invite-status-expired {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
}

/* External invite project list */
.ext-inv-proj-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    padding: 8px;
}
.ext-inv-proj-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--stroke-subtle);
}
.ext-inv-proj-list label:last-child {
    border-bottom: none;
}

/* ═══ Phase 7: Marketplace ═══ */
.v2-mp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}
.v2-mp-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.v2-mp-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.v2-mp-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.v2-mp-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent-subtle);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.v2-mp-card-title {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.v2-mp-card-category {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}
.v2-mp-trust {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    font-weight: 800;
    flex-shrink: 0;
}
.v2-mp-card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.v2-mp-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.v2-mp-tag {
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--accent-subtle);
    color: var(--accent);
    font-weight: 600;
}
.v2-mp-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--stroke-subtle);
}
.v2-mp-card-stats {
    display: flex;
    gap: 0.75rem;
    font-size: 0.72rem;
    color: var(--text-dim);
    font-weight: 600;
}
.v2-mp-card-stats span {
    display: flex;
    align-items: center;
    gap: 3px;
}
.v2-mp-rate {
    color: var(--accent);
    font-weight: 700;
}

/* ═══ Phase Final: Loading Spinner ═══ */
.v2-loading-spinner-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.v2-loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--stroke);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: v2-spin 0.7s linear infinite;
}
@keyframes v2-spin {
    to { transform: rotate(360deg); }
}

/* ═══ Phase Final: KPI Charts ═══ */
.v2-kpi-chart-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--stroke, #e2e8f0);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}
.v2-revenue-chart {
    display: flex;
    align-items: flex-end;
    gap: 0;
    height: 120px;
    padding-bottom: 1.5rem;
    position: relative;
}
.v2-revenue-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    position: relative;
}
.v2-revenue-bar {
    width: 60%;
    background: var(--accent);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.5s ease;
}
.v2-revenue-label {
    font-size: 0.68rem;
    color: var(--text-dim);
    font-weight: 600;
    margin-top: 6px;
    position: absolute;
    bottom: -18px;
}
.v2-revenue-value {
    font-size: 0.62rem;
    color: var(--text-dim);
    font-weight: 500;
    position: absolute;
    top: -14px;
}
.v2-kpi-diff {
    display: inline-flex;
    align-items: center;
}

/* Dark mode adjustments for KPI */
[data-theme="dark"] .v2-kpi-chart-card {
    background: var(--bg-card);
    border-color: var(--stroke);
}

/* ═══ Project Detail — Redesigned ═══ */
.v2-proj-detail-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    min-height: 420px;
}

/* Left sidebar with key info */
.v2-proj-detail-sidebar {
    background: var(--bg-input);
    border-right: 1px solid var(--stroke);
    border-radius: var(--radius-xl) 0 0 var(--radius-xl);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.v2-proj-detail-sidebar .v2-proj-sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    word-break: break-word;
}

.v2-proj-sidebar-client {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.v2-proj-sidebar-meta {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--stroke);
}

.v2-proj-sidebar-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.v2-proj-sidebar-field .v2-field-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.v2-proj-sidebar-field .v2-field-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.v2-proj-sidebar-field .v2-field-value.v2-field-empty {
    color: var(--text-dim);
    font-weight: 400;
    font-style: italic;
}

/* Right main content */
.v2-proj-detail-main {
    padding: 1.25rem;
    overflow-y: auto;
    max-height: 75vh;
}

/* Stage Progress Bar (horizontal) */
.v2-proj-stage-bar {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--bg-input);
    border-radius: var(--radius-md);
}

.v2-proj-stage-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--stroke);
    flex-shrink: 0;
    transition: all 0.2s;
}

.v2-proj-stage-dot.completed {
    background: var(--success);
}

.v2-proj-stage-dot.active {
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    width: 12px;
    height: 12px;
}

.v2-proj-stage-line {
    flex: 1;
    height: 2px;
    background: var(--stroke);
    min-width: 8px;
}

.v2-proj-stage-line.completed {
    background: var(--success);
}

.v2-proj-stage-label {
    font-size: 0.62rem;
    color: var(--text-dim);
    white-space: nowrap;
    margin-top: 0.25rem;
    text-align: center;
}

.v2-proj-stage-label.active {
    color: var(--accent);
    font-weight: 700;
}

.v2-proj-stage-label.completed {
    color: var(--success);
}

/* Timeline / Activity Log */
.v2-proj-timeline {
    position: relative;
    padding-left: 1.5rem;
}

.v2-proj-timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--stroke);
}

.v2-proj-timeline-item {
    position: relative;
    margin-bottom: 1rem;
    padding-left: 0.75rem;
}

.v2-proj-timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--accent);
}

.v2-proj-timeline-item.completed::before {
    background: var(--success);
    border-color: var(--success);
}

.v2-proj-timeline-date {
    font-size: 0.68rem;
    color: var(--text-dim);
    font-weight: 500;
}

.v2-proj-timeline-content {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-top: 0.15rem;
    line-height: 1.5;
}

.v2-proj-timeline-stage {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--accent-subtle);
    color: var(--accent);
    margin-right: 0.35rem;
}

/* Note add inline */
.v2-proj-add-note {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    align-items: flex-start;
}

.v2-proj-add-note textarea {
    flex: 1;
    min-height: 60px;
    font-size: 0.85rem;
    padding: 0.6rem;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    resize: vertical;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .v2-proj-detail-layout {
        grid-template-columns: 1fr;
    }
    .v2-proj-detail-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--stroke);
        border-radius: 0;
    }
}

/* ─────────────────────────────────────────
 * Task page v10 — accordion-style add UI
 * ───────────────────────────────────────── */
.v2-task-header-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0 0 0.5rem;
}
.v2-task-add-toggle {
    gap: 6px;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
}

.v2-task-accordion {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease, margin 0.25s ease;
    opacity: 0;
    margin-bottom: 0;
}
.v2-task-accordion.open {
    max-height: 600px;
    opacity: 1;
    margin-bottom: 1rem;
}
.v2-accordion-inner {
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
[data-theme="dark"] .v2-accordion-inner {
    background: rgba(30,41,59,0.5);
    border-color: rgba(255,255,255,0.1);
}

/* Accordion header row */
.v2-accordion-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 0 6px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    margin-bottom: 4px;
}

/* Accordion rows */
.v2-accordion-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
}
.v2-acc-type {
    width: 60px;
    padding: 6px 2px;
    font-size: 0.72rem;
    font-family: inherit;
    border: 1px solid var(--stroke, #e2e8f0);
    border-radius: 6px;
    background: var(--bg-input, #fff);
    color: var(--text-primary);
    flex-shrink: 0;
}
.v2-acc-client {
    width: 80px;
    padding: 6px 2px;
    font-size: 0.72rem;
    font-family: inherit;
    border: 1px solid var(--stroke, #e2e8f0);
    border-radius: 6px;
    background: var(--bg-input, #fff);
    color: var(--text-primary);
    flex-shrink: 0;
}
.v2-acc-project {
    width: 90px;
    padding: 6px 2px;
    font-size: 0.72rem;
    font-family: inherit;
    border: 1px solid var(--stroke, #e2e8f0);
    border-radius: 6px;
    background: var(--bg-input, #fff);
    color: var(--text-primary);
    flex-shrink: 0;
}
.v2-acc-title {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    font-size: 0.82rem;
    font-family: inherit;
    border: 1px solid var(--stroke, #e2e8f0);
    border-radius: 6px;
    background: var(--bg-input, #fff);
    color: var(--text-primary);
}
.v2-acc-title:focus { outline: 2px solid var(--accent); border-color: transparent; }
.v2-acc-duration {
    width: 56px;
    padding: 6px 2px;
    font-size: 0.72rem;
    font-family: inherit;
    border: 1px solid var(--stroke, #e2e8f0);
    border-radius: 6px;
    background: var(--bg-input, #fff);
    color: var(--text-primary);
    flex-shrink: 0;
    text-align: center;
}
.v2-acc-due {
    width: 130px;
    max-width: 130px;
    padding: 6px 4px;
    font-size: 0.72rem;
    font-family: inherit;
    border: 1px solid var(--stroke, #e2e8f0);
    border-radius: 6px;
    background: var(--bg-input, #fff);
    color: var(--text-primary);
    flex-shrink: 0;
}

.v2-type-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.v2-type-btn {
    padding: 4px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: inherit;
    border: 1.5px solid color-mix(in srgb, var(--type-color) 30%, transparent);
    border-radius: 20px;
    background: transparent;
    color: var(--type-color);
    cursor: pointer;
    transition: all 0.15s;
}
.v2-type-btn:hover {
    background: color-mix(in srgb, var(--type-color) 8%, transparent);
}
.v2-type-btn.active {
    background: var(--type-color);
    color: #fff;
    border-color: var(--type-color);
    box-shadow: 0 2px 6px color-mix(in srgb, var(--type-color) 30%, transparent);
}

.v2-accordion-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}
.v2-acc-title {
    flex: 1;
    padding: 6px 10px;
    font-size: 0.82rem;
    font-family: inherit;
    border: 1px solid var(--stroke, #e2e8f0);
    border-radius: 8px;
    background: var(--bg-input, #fff);
    color: var(--text-primary);
}
.v2-acc-title:focus { outline: 2px solid var(--accent); border-color: transparent; }
.v2-acc-duration, .v2-acc-due {
    padding: 6px 8px;
    font-size: 0.75rem;
    font-family: inherit;
    border: 1px solid var(--stroke, #e2e8f0);
    border-radius: 8px;
    background: var(--bg-input, #fff);
    color: var(--text-primary);
    width: 80px;
}
.v2-acc-remove {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}
.v2-acc-remove:hover { background: #ef444415; color: #ef4444; }
.v2-accordion-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* === Dynamic Inline Dropdowns (Card Top-Right) === */
.v2-card-inline-select-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.v2-card-inline-select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(15, 23, 42, 0.04);
    border: 1px dashed var(--stroke-subtle);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-dim);
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
    text-align: center;
    line-height: 1.2;
}
.v2-card-inline-select:hover {
    background: rgba(15, 23, 42, 0.08);
    color: var(--text-primary);
    border-color: var(--text-dim);
}
[data-theme="dark"] .v2-card-inline-select {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
}
[data-theme="dark"] .v2-card-inline-select:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}
