/* FlowBoard Design System */
:root {
    --bg: #f4f6f9;
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    --border: #e8ecf1;
    --border-light: #f1f4f8;

    --text: #1a2332;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --primary: #0d9488;
    --primary-light: #ccfbf1;
    --primary-dark: #0f766e;
    --primary-subtle: #f0fdfa;

    --accent: #0284c7;
    --accent-light: #e0f2fe;

    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --info: #3b82f6;
    --info-light: #eff6ff;

    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
    --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12);

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    --sidebar-width: 0px;
    --topbar-height: 60px;
    --transition: 0.2s ease;

    --input-bg: #f8fafc;
    --input-border: #e2e8f0;
    --input-border-hover: #cbd5e1;
    --input-focus-ring: rgba(13, 148, 136, 0.14);
    --input-height: 42px;
    --input-height-sm: 36px;
    --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    overflow: hidden;
}

#app {
    display: flex;
    height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform var(--transition), width var(--transition);
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.933rem;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 2px;
}

.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.active { background: var(--primary-subtle); color: var(--primary-dark); }
.nav-item.active svg { color: var(--primary); }

.nav-section-label {
    font-size: 0.733rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 16px 12px 6px;
}

.nav-project {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.867rem;
    transition: all var(--transition);
}

.nav-project:hover { background: var(--surface-hover); color: var(--text); }

.nav-project-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 0.867rem; font-weight: 600; }
.user-role { font-size: 0.733rem; color: var(--text-muted); }

/* ── Topbar Brand & Waffle (Outlook-style) ── */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    min-width: 0;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.topbar-brand-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
}

.topbar-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.topbar-app-tagline {
    font-size: 0.6875rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.branding-preview-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    margin-bottom: 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.branding-logo-preview {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--border);
    padding: 4px;
}

.branding-logo-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    border: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.65rem;
    background: var(--surface);
}

.branding-upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.login-brand-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    margin: 0 auto 12px;
    display: block;
    border-radius: 10px;
}

.waffle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    background: #0078d4;
    color: #fff;
    cursor: pointer;
    padding: 0;
    transition: background 0.12s ease;
    flex-shrink: 0;
}

.waffle-btn:hover {
    background: #106ebe;
}

.waffle-btn.active {
    background: #005a9e;
}

.topbar-app-name {
    font-size: 1.0625rem;
    font-weight: 600;
    color: #242424;
    text-decoration: none;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.topbar-app-name:hover {
    color: #0078d4;
}

/* ── App Launcher (Microsoft 365 / Outlook style) ── */
.launcher-backdrop {
    position: fixed;
    inset: 0;
    z-index: 450;
    background: transparent;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.launcher-backdrop.open {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

.app-launcher {
    position: fixed;
    top: calc(var(--topbar-height) + 2px);
    left: 16px;
    width: 520px;
    max-height: min(520px, calc(100vh - var(--topbar-height) - 16px));
    background: #fff;
    border-radius: 8px;
    box-shadow:
        0 0 2px rgba(0, 0, 0, 0.12),
        0 4px 8px rgba(0, 0, 0, 0.08),
        0 16px 32px rgba(0, 0, 0, 0.1);
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.app-launcher.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.app-launcher-scroll {
    overflow-y: auto;
    max-height: min(520px, calc(100vh - var(--topbar-height) - 16px));
    padding: 16px 8px 12px;
}

.app-launcher-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
}

.app-launcher-sep {
    height: 1px;
    background: #edebe9;
    margin: 12px 8px;
}

.app-launcher-quick .app-launcher-sep {
    margin-top: 4px;
}

.app-launcher-sep--create {
    margin-top: 4px;
}

.app-launcher-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #605e5c;
    padding: 0 12px 8px;
}

.app-launcher-quick[hidden] {
    display: none !important;
}

.app-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 10px 4px;
    border-radius: 4px;
    border: none;
    background: transparent;
    text-decoration: none;
    color: #242424;
    cursor: pointer;
    font-family: inherit;
    min-height: 88px;
    transition: background 0.1s ease;
}

.app-tile:hover,
.app-tile.active {
    background: #f3f2f1;
}

.app-tile-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-tile-icon svg {
    width: 32px;
    height: 32px;
    display: block;
}

.app-tile-label {
    font-size: 12px;
    line-height: 16px;
    text-align: center;
    max-width: 88px;
    word-break: break-word;
    font-weight: 400;
}

.app-create-icon {
    position: relative;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-create-icon svg {
    width: 28px;
    height: 28px;
    color: #242424;
}

.app-create-plus {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid #242424;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    color: #242424;
}

.app-launcher-more {
    opacity: 0.85;
}

.app-launcher-more .app-tile-icon svg {
    width: 28px;
    height: 28px;
    color: #616161;
}

/* ── Topbar User Menu ── */
.topbar-user {
    position: relative;
    margin-left: 4px;
}

.topbar-user-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 2px solid transparent;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: border-color 0.15s ease;
}

.topbar-user-btn:hover,
.topbar-user.open .topbar-user-btn {
    border-color: var(--primary);
}

.topbar-user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.15s ease;
    z-index: 200;
}

.topbar-user.open .topbar-user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.topbar-user-meta {
    padding: 8px 14px 10px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.topbar-user-meta strong {
    font-size: 0.867rem;
    color: var(--text);
}

.topbar-user-meta span {
    font-size: 0.733rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.topbar-user-link {
    display: block;
    width: 100%;
    padding: 9px 14px;
    border: none;
    background: none;
    text-align: left;
    font-size: 0.867rem;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
}

.topbar-user-link:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.topbar-user-logout {
    color: #dc2626;
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 12px;
}

.topbar-user-logout:hover {
    background: #fef2f2;
    color: #b91c1c;
}

/* ── Main ── */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: var(--topbar-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 clamp(20px, 3vw, 40px);
    flex-shrink: 0;
}

.sidebar-toggle { display: none; }

.search-box {
    flex: 1;
    max-width: 480px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 14px;
    height: 38px;
    cursor: pointer;
    transition: border-color var(--transition);
}

.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.search-box svg { color: var(--text-muted); flex-shrink: 0; }
.search-box input {
    flex: 1;
    border: none;
    background: none;
    font-size: 0.867rem;
    color: var(--text);
    outline: none;
    cursor: pointer;
}
.search-box kbd {
    font-size: 0.667rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    color: var(--text-muted);
    font-family: inherit;
}

.topbar-actions { margin-left: auto; display: flex; gap: 8px; }

.content {
    flex: 1;
    overflow-y: auto;
    padding: 28px clamp(20px, 3vw, 40px);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.867rem;
    font-weight: 500;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-outline { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--surface-hover); border-color: var(--text-muted); }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-icon:hover { background: var(--surface-hover); color: var(--text); }

/* ── Avatar ── */
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.733rem;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}
.avatar-sm { width: 24px; height: 24px; font-size: 0.6rem; }

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.733rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-todo { background: #f1f5f9; color: #475569; }
.badge-in_progress { background: var(--info-light); color: #2563eb; }
.badge-in_review { background: var(--accent-light); color: #4f46e5; }
.badge-done { background: var(--success-light); color: #059669; }

.badge-low { background: #f1f5f9; color: #64748b; }
.badge-medium { background: var(--warning-light); color: #d97706; }
.badge-high { background: #fff7ed; color: #ea580c; }
.badge-critical { background: var(--danger-light); color: #dc2626; }

.badge-task { background: var(--info-light); color: #2563eb; }
.badge-story { background: var(--success-light); color: #059669; }
.badge-bug { background: var(--danger-light); color: #dc2626; }
.badge-epic { background: var(--accent-light); color: #7c3aed; }

.badge-label {
    background: transparent;
    border: 1px solid currentColor;
    opacity: 0.85;
    font-size: 0.667rem;
    padding: 1px 7px;
}

/* ── Cards ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-title {
    font-size: 0.933rem;
    font-weight: 600;
    color: var(--text);
}

/* ── Page Header ── */
.page-header {
    margin-bottom: 28px;
}
.page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
}
.page-header p {
    color: var(--text-secondary);
    font-size: 0.933rem;
}

.page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
}

.stat-card.accent-teal .stat-value { color: var(--primary); }
.stat-card.accent-indigo .stat-value { color: var(--accent); }
.stat-card.accent-amber .stat-value { color: var(--warning); }
.stat-card.accent-green .stat-value { color: var(--success); }

/* ── Dashboard Grid ── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.dashboard-grid .span-full { grid-column: 1 / -1; }

/* ── Executive Dashboard ── */
.mgmt-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}
.dash-report-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.dash-report-meta {
    display: block;
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.dash-export-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.dash-export-scope {
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 4px 10px;
    background: var(--bg);
    border-radius: 20px;
    border: 1px solid var(--border);
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.dash-kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dash-kpi-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.dash-kpi-value { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.dash-kpi-sub { font-size: 0.75rem; color: var(--text-secondary); }
.dash-kpi--teal .dash-kpi-value { color: var(--primary); }
.dash-kpi--green .dash-kpi-value { color: var(--success); }
.dash-kpi--indigo .dash-kpi-value { color: var(--accent); }
.dash-kpi--amber .dash-kpi-value { color: var(--warning); }
.dash-kpi--red .dash-kpi-value { color: var(--danger); }
.dash-kpi--blue .dash-kpi-value { color: var(--info); }

.dash-section { margin-bottom: 24px; }
.dash-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.dash-section-hint { font-size: 0.8rem; color: var(--text-muted); }
.dash-section-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}
.dash-card { overflow: hidden; }
.dash-analytics-grid { margin-bottom: 20px; }
.dash-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg);
    color: var(--text-muted);
}
.dash-badge--risk { background: var(--danger-light); color: #dc2626; }
.dash-hint { padding: 16px; font-size: 0.867rem; color: var(--text-muted); margin: 0; }
.dash-hint--success { color: var(--success); }

.dash-table-wrap { overflow-x: auto; }
.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.867rem;
}
.dash-table th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 10px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.dash-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.dash-table tbody tr:last-child td { border-bottom: none; }
.dash-table-sub { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.dash-row-muted td { color: var(--text-muted); font-style: italic; }

.dash-progress-cell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.dash-progress {
    flex: 1;
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
    min-width: 60px;
}
.dash-progress-fill { height: 100%; background: var(--primary); border-radius: 3px; }
.dash-health {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    white-space: nowrap;
}
.dash-health--healthy { background: var(--success-light); color: #059669; }
.dash-health--watch { background: var(--warning-light); color: #d97706; }
.dash-health--risk { background: var(--danger-light); color: #dc2626; }

.dash-bar-chart { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.dash-bar-row { display: flex; align-items: center; gap: 10px; }
.dash-bar-label { width: 88px; font-size: 0.8rem; color: var(--text-secondary); flex-shrink: 0; }
.dash-bar-track { flex: 1; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.dash-bar-fill { height: 100%; border-radius: 4px; }
.dash-bar-value { width: 28px; text-align: right; font-size: 0.8rem; font-weight: 600; color: var(--text); }

.dash-trend-chart {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 140px;
    padding: 8px 0 0;
}
.dash-trend-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}
.dash-trend-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 100px;
    width: 100%;
    justify-content: center;
}
.dash-trend-bar { width: 14px; border-radius: 3px 3px 0 0; min-height: 4px; }
.dash-trend-bar--created { background: #3b82f6; }
.dash-trend-bar--done { background: var(--primary); }
.dash-trend-label { font-size: 0.68rem; color: var(--text-muted); text-align: center; }
.dash-trend-meta { font-size: 0.65rem; color: var(--text-muted); }
.dash-trend-legend {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.dash-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-right: 4px;
    vertical-align: middle;
}
.dash-legend-dot--created { background: #3b82f6; }
.dash-legend-dot--done { background: var(--primary); }

.dash-risk-list { display: flex; flex-direction: column; }
.dash-risk-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--transition);
}
.dash-risk-item:hover { background: var(--surface-hover); }
.dash-risk-item:last-child { border-bottom: none; }
.dash-risk-main { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.dash-risk-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-overdue-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--danger-light);
    color: #dc2626;
}

.dash-sprint-list { display: flex; flex-direction: column; gap: 12px; padding: 4px 0; }
.dash-sprint-card {
    padding: 12px 14px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}
.dash-sprint-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.dash-sprint-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.dash-sprint-pct { font-size: 0.75rem; color: var(--text-secondary); margin-top: 6px; display: block; }

.dash-activity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
    padding: 0 4px;
}

/* ── Portfolio Explorer ── */
.dash-portfolio { padding: 0; overflow: hidden; }
.portfolio-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 480px;
}
.portfolio-side {
    padding: 18px;
    border-right: 1px solid var(--border);
    background: var(--bg);
    overflow-y: auto;
}
.portfolio-main {
    padding: 18px 20px;
    overflow-y: auto;
    background: var(--surface);
}
.portfolio-side-head { margin-bottom: 14px; }
.dash-subtitle {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 4px;
}
.dash-subtitle-sm {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 16px 0 10px;
}
.dash-subtitle-hint { font-size: 0.78rem; color: var(--text-muted); margin: 0; }

.portfolio-scope-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.portfolio-scope-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
}
.portfolio-scope-tab:hover { border-color: var(--primary); color: var(--text); }
.portfolio-scope-tab.active {
    background: var(--primary-subtle);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.portfolio-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 12px;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.portfolio-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.portfolio-legend-item .portfolio-seg {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
}
.portfolio-legend--timeline {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-light);
}
.portfolio-legend-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-right: 4px;
}

.timeline-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.01em;
    line-height: 1.2;
}
.timeline-badge--sm {
    padding: 2px 7px;
    font-size: 0.62rem;
}
.timeline-badge--on_track { background: #ecfdf5; color: #047857; }
.timeline-badge--ongoing { background: #eff6ff; color: #1d4ed8; }
.timeline-badge--at_risk { background: #fffbeb; color: #b45309; }
.timeline-badge--overrun { background: #fef2f2; color: #b91c1c; }
.timeline-badge--completed { background: #f0fdfa; color: #0f766e; }
.timeline-badge--planned { background: #f1f5f9; color: #64748b; }

.portfolio-row-name-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 0;
    flex: 1;
}
.portfolio-timeline-line {
    margin: 0 0 14px;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--text-secondary);
    border-left: 3px solid var(--primary);
}
.portfolio-timeline-line--global { border-left-color: var(--info); }

.portfolio-overview { display: flex; flex-direction: column; gap: 8px; }
.portfolio-row {
    display: grid;
    grid-template-columns: minmax(120px, 150px) 1fr 72px;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: all var(--transition);
}
.portfolio-row:hover { border-color: var(--border); background: var(--surface-hover); }
.portfolio-row.active {
    border-color: var(--primary);
    background: var(--primary-subtle);
    box-shadow: inset 3px 0 0 var(--primary);
}
.portfolio-row-label {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.portfolio-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}
.portfolio-row-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.portfolio-row-key { font-size: 0.68rem; color: var(--text-muted); flex-shrink: 0; }
.portfolio-row-bar-wrap { min-width: 0; }
.portfolio-row-bar {
    display: flex;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--border-light);
    min-width: 24px;
}
.portfolio-seg { display: block; height: 100%; min-width: 2px; }
.portfolio-seg--todo { background: #94a3b8; }
.portfolio-seg--in_progress { background: #3b82f6; }
.portfolio-seg--in_review { background: #6366f1; }
.portfolio-seg--done { background: #10b981; }
.portfolio-seg--empty { flex: 1; background: var(--border); }
.portfolio-row-meta { text-align: right; }
.portfolio-row-stat { display: block; font-size: 0.82rem; font-weight: 700; color: var(--text); }
.portfolio-row-count { display: block; font-size: 0.68rem; color: var(--text-muted); }

.portfolio-share-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.portfolio-share { display: flex; align-items: center; gap: 16px; }
.portfolio-donut {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}
.portfolio-donut::after {
    content: '';
    position: absolute;
    inset: 18px;
    background: var(--bg);
    border-radius: 50%;
}
.portfolio-share-legend { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.portfolio-share-item {
    display: grid;
    grid-template-columns: 10px 1fr auto auto;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.portfolio-share-item-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
}
.portfolio-share-item strong { color: var(--text); }

.portfolio-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.portfolio-detail-eyebrow {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    margin-bottom: 4px;
}
.portfolio-detail-title { font-size: 1.25rem; font-weight: 700; margin: 0 0 4px; color: var(--text); }
.portfolio-detail-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.portfolio-detail-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}
.portfolio-mini-kpi {
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.portfolio-mini-kpi span { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.portfolio-mini-kpi strong { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.portfolio-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.portfolio-detail-chart {
    padding: 14px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
}
.portfolio-detail-chart h4 {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin: 0 0 12px;
}

.dash-print-footer {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.print-only { display: none; }

@media print {
    .sidebar, .topbar, .no-print, .toast-container, .modal-overlay, .app-launcher, .launcher-backdrop { display: none !important; }
    .main { margin-left: 0 !important; }
    .content { padding: 12px !important; }
    .mgmt-dashboard { max-width: none; }
    .dash-kpi-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .dash-kpi { break-inside: avoid; padding: 10px; }
    .dash-kpi-value { font-size: 1.2rem; }
    .dashboard-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .card { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
    .dash-card { margin-bottom: 12px; }
    .portfolio-layout { grid-template-columns: 1fr; }
    .portfolio-side { border-right: none; border-bottom: 1px solid #ddd; }
    .portfolio-detail-grid { grid-template-columns: 1fr 1fr; }
    .print-only { display: block !important; }
    @page { margin: 12mm; }
}

@media (max-width: 1100px) {
    .portfolio-layout { grid-template-columns: 1fr; }
    .portfolio-side { border-right: none; border-bottom: 1px solid var(--border); max-height: none; }
    .portfolio-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .portfolio-row { grid-template-columns: 1fr; gap: 6px; }
    .portfolio-row-meta { text-align: left; display: flex; gap: 8px; }
}

/* ── Issue List ── */
.issue-list { display: flex; flex-direction: column; }

.issue-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
    text-decoration: none;
    color: inherit;
}

.issue-row:hover { background: var(--surface-hover); }

.issue-key {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 80px;
    font-family: 'Inter', monospace;
}

.issue-title-text {
    flex: 1;
    font-size: 0.867rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.issue-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Project Grid ── */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.project-card-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-card-actions {
    display: flex;
    gap: 8px;
    padding: 0 4px;
}

.settings-danger-zone {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.settings-danger-zone h4 {
    color: #dc2626;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.settings-danger-zone .btn-outline {
    border-color: #dc2626;
    color: #dc2626;
}

.settings-danger-zone .btn-outline:hover {
    background: #fef2f2;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
    display: block;
}

.project-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.project-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.project-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.867rem;
}

.project-card h3 {
    font-size: 1rem;
    font-weight: 600;
}

.project-card-key {
    font-size: 0.733rem;
    color: var(--text-muted);
    font-weight: 500;
}

.project-card-desc {
    font-size: 0.867rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.project-stats {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.project-stats strong { color: var(--text); }

/* ── Kanban Board ── */
.board-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.board-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 3px;
}

.board-tab {
    padding: 7px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.867rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition);
}

.board-tab:hover { color: var(--text); }
.board-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    min-height: calc(100vh - 220px);
}

.kanban-column {
    flex: 0 0 300px;
    background: var(--bg);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 220px);
    border: 1px solid var(--border);
    overflow: hidden;
}

.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    flex-shrink: 0;
}

.column-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.867rem;
    font-weight: 600;
    color: var(--text);
}

.column-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.column-count {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid color-mix(in srgb, var(--col-accent, #94a3b8) 22%, var(--border));
    border-radius: 20px;
    padding: 1px 8px;
    font-size: 0.733rem;
    color: var(--text-muted);
    font-weight: 500;
}

.column-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Issue Card (Kanban) ── */
.issue-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.issue-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.btn-add-subtask-card {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--primary);
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition), background var(--transition);
    font-family: inherit;
    z-index: 2;
}

.issue-card:hover .btn-add-subtask-card,
.btn-add-subtask-card:focus {
    opacity: 1;
}

.btn-add-subtask-card:hover {
    background: var(--primary-subtle);
    border-color: var(--primary);
}

.detail-actions {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.create-modal-sm {
    max-width: 420px;
}

.issue-card:has(.btn-add-subtask-card) .issue-card-key-sm,
.issue-card:has(.btn-add-subtask-card) .issue-card-title {
    padding-right: 72px;
}

@media (hover: none) {
    .btn-add-subtask-card { opacity: 1; }
}

.issue-card-key-sm {
    font-size: 0.733rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.issue-card-title {
    font-size: 0.867rem;
    font-weight: 500;
    margin-bottom: 10px;
    line-height: 1.4;
}

.issue-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.issue-card-labels {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.issue-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.story-points {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.667rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ── Backlog ── */
.backlog-container { display: flex; flex-direction: column; gap: 20px; }

.sprint-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.sprint-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.sprint-header h3 {
    font-size: 0.933rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sprint-goal {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.sprint-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.sprint-issues { padding: 8px; }

.backlog-section .sprint-header { background: var(--surface); }

/* ── Activity Feed ── */
.activity-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-text {
    font-size: 0.867rem;
    color: var(--text-secondary);
}

.activity-text strong { color: var(--text); font-weight: 500; }
.activity-time { font-size: 0.733rem; color: var(--text-muted); margin-top: 2px; }

/* ── Status Bar Chart ── */
.status-chart { display: flex; flex-direction: column; gap: 10px; }

.status-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-bar-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 90px;
    font-weight: 500;
}

.status-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.status-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.status-bar-count {
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 24px;
    text-align: right;
}

/* ── Issue Detail Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    padding: 40px 20px;
    overflow-y: auto;
}

.modal-overlay.open { display: flex; }

.issue-modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 780px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.issue-detail-header {
    padding: 24px 28px 0;
}

.issue-detail-key {
    font-size: 0.867rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.issue-detail-title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    line-height: 1.3;
}

.issue-detail-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.issue-detail-body {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 0;
    border-top: 1px solid var(--border);
}

.issue-detail-main { padding: 24px 28px; }

.issue-detail-sidebar {
    padding: 20px 18px;
    background: linear-gradient(180deg, var(--bg) 0%, #eef2f7 100%);
    border-left: 1px solid var(--border);
    border-radius: 0 0 var(--radius-xl) 0;
}

.issue-detail-sidebar .detail-field {
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    margin-bottom: 10px;
}

.issue-detail-sidebar .detail-field label {
    color: var(--text-secondary);
}

.detail-section { margin-bottom: 28px; }
.detail-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.detail-description {
    font-size: 0.933rem;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-wrap;
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.detail-field label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-field select,
.detail-field input,
.detail-field textarea {
    min-height: var(--input-height-sm);
    padding: 8px 12px;
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius);
    font-size: 0.867rem;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.detail-field select {
    appearance: none;
    background-image: var(--select-chevron);
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
    cursor: pointer;
}

.detail-field select:hover:not(:disabled),
.detail-field input:hover:not(:disabled) {
    border-color: var(--input-border-hover);
    background: var(--surface);
}

.detail-field select:focus,
.detail-field input:focus,
.detail-field textarea:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--input-focus-ring);
}

/* ── Comments ── */
.comment-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }

.comment-item {
    display: flex;
    gap: 10px;
}

.comment-body {
    flex: 1;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 10px 14px;
}

.comment-author {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.comment-text { font-size: 0.867rem; color: var(--text-secondary); }
.comment-time { font-size: 0.667rem; color: var(--text-muted); margin-top: 4px; }

.comment-form {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    background: var(--input-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
}

.comment-form textarea {
    flex: 1;
    min-height: 72px;
    padding: 12px 14px;
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius);
    font-size: 0.867rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    resize: vertical;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    line-height: 1.5;
}

.comment-form textarea::placeholder { color: var(--text-muted); }

.comment-form textarea:hover {
    border-color: var(--input-border-hover);
}

.comment-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--input-focus-ring);
}

.comment-form-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

/* ── Create Modal ── */
.create-modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-body { padding: 24px 24px 8px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 0 8px;
    margin-top: 8px;
    border-top: 1px solid var(--border-light);
}

/* ── Form Design System ── */
.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 7px;
    letter-spacing: 0.01em;
}

.form-group input,
.form-group select,
.form-group textarea,
.inline-create-form input,
.inline-create-form select,
.inline-form-panel input,
.inline-form-panel select,
.inline-form-panel textarea,
.settings-form input,
.settings-form select,
.settings-form textarea,
.login-form input,
.login-form select,
.login-form textarea,
.filter-builder input,
.filter-builder select,
.bulk-bar select,
.board-selector select,
.workflow-row input,
.member-role-select,
#savedFilterSelect,
#bulkStatus {
    width: 100%;
    min-height: var(--input-height);
    padding: 10px 14px;
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    background: var(--input-bg);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    line-height: 1.4;
}

.form-group select,
.inline-create-form select,
.inline-form-panel select,
.settings-form select,
.filter-builder select,
.bulk-bar select,
.board-selector select,
.member-role-select,
#savedFilterSelect,
#bulkStatus {
    appearance: none;
    background-image: var(--select-chevron);
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 38px;
    cursor: pointer;
}

.form-group textarea,
.inline-form-panel textarea,
.settings-form textarea {
    min-height: 96px;
    resize: vertical;
    line-height: 1.55;
}

.form-group input[type="number"] { padding-right: 10px; }

.form-group input[type="color"],
.settings-form input[type="color"],
.inline-create-form input[type="color"] {
    padding: 4px 6px;
    height: var(--input-height);
    min-height: var(--input-height);
    cursor: pointer;
}

.form-group input::placeholder,
.form-group textarea::placeholder,
.inline-form-panel input::placeholder,
.inline-form-panel textarea::placeholder,
.login-form input::placeholder {
    color: var(--text-muted);
    opacity: 0.9;
}

.form-group input:hover:not(:disabled):not([type="color"]),
.form-group select:hover:not(:disabled),
.form-group textarea:hover:not(:disabled),
.inline-create-form input:hover:not(:disabled),
.inline-create-form select:hover:not(:disabled),
.inline-form-panel input:hover:not(:disabled),
.inline-form-panel select:hover:not(:disabled),
.settings-form input:hover:not(:disabled),
.settings-form select:hover:not(:disabled),
.login-form input:hover:not(:disabled),
.filter-builder input:hover:not(:disabled),
.filter-builder select:hover:not(:disabled),
.detail-field select:hover:not(:disabled),
.detail-field input:hover:not(:disabled) {
    border-color: var(--input-border-hover);
    background: var(--surface);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.inline-create-form input:focus,
.inline-create-form select:focus,
.inline-form-panel input:focus,
.inline-form-panel select:focus,
.inline-form-panel textarea:focus,
.settings-form input:focus,
.settings-form select:focus,
.settings-form textarea:focus,
.login-form input:focus,
.filter-builder input:focus,
.filter-builder select:focus,
.bulk-bar select:focus,
.board-selector select:focus,
.member-role-select:focus,
#savedFilterSelect:focus,
#bulkStatus:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px var(--input-focus-ring);
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled,
.settings-form input:disabled,
.settings-form select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--border-light);
}

.form-group-compact { margin-bottom: 0; }
.form-group-compact label {
    font-size: 0.75rem;
    margin-bottom: 5px;
    color: var(--text-muted);
}
.form-group-compact input,
.form-group-compact select {
    min-height: var(--input-height-sm);
    padding: 8px 12px;
    font-size: 0.867rem;
}

.form-group-compact .form-hint {
    margin-top: 4px;
    padding: 6px 10px;
    font-size: 0.72rem;
}

.form-hint,
.settings-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin: 6px 0 0;
    padding: 8px 12px;
    background: var(--primary-subtle);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
}

.settings-hint { margin: 8px 0 14px; }
.settings-hint code,
.form-hint code {
    background: rgba(255,255,255,0.7);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* Inline / compact action forms */
.inline-form-panel,
.inline-create-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
    padding: 16px 18px;
    background: linear-gradient(160deg, var(--surface) 0%, var(--input-bg) 100%);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.inline-form-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    align-items: end;
}

.inline-form-fields .form-group-compact[style*="grid-column"] {
    grid-column: 1 / -1;
}

.inline-form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.inline-form-panel.inline-form-row .inline-form-fields {
    grid-template-columns: 1fr minmax(140px, auto);
}

.inline-create-form:not(.inline-form-panel) {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
}

.inline-create-form:not(.inline-form-panel) input,
.inline-create-form:not(.inline-form-panel) select {
    flex: 1;
    min-width: 120px;
    width: auto;
}

.inline-create-form:not(.inline-form-panel) .btn {
    flex-shrink: 0;
}

.settings-form { padding-top: 4px; }
.settings-form .btn { margin-top: 4px; }

.filter-builder .form-row { align-items: flex-end; }
.filter-builder .form-group { margin-bottom: 0; }
.filter-builder #btnAddFilterCond { margin-bottom: 2px; }

.bulk-bar select,
#savedFilterSelect,
#bulkStatus {
    width: auto;
    min-width: 160px;
    min-height: var(--input-height-sm);
    padding: 7px 32px 7px 12px;
    font-size: 0.867rem;
}

/* ── Search Modal ── */
.search-modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 580px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
    overflow: hidden;
}

.search-modal-input {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.search-modal-input svg { color: var(--text-muted); }
.search-modal-input input {
    flex: 1;
    border: none;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    color: var(--text);
}

.search-modal-input kbd {
    font-size: 0.667rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    color: var(--text-muted);
}

.search-results { max-height: 400px; overflow-y: auto; padding: 8px; }

.search-result-group {
    padding: 8px 12px 4px;
    font-size: 0.733rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
}

.search-result-item:hover, .search-result-item.active { background: var(--primary-subtle); }

.search-empty {
    padding: 32px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.933rem;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state svg { margin-bottom: 12px; opacity: 0.4; }
.empty-state h3 { font-size: 1rem; color: var(--text-secondary); margin-bottom: 4px; }
.empty-state p { font-size: 0.867rem; }

/* ── Loading ── */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px;
    color: var(--text-muted);
    gap: 12px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--text);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 0.867rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
}

.toast.success { background: var(--success); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Filters ── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.filter-chip:hover { border-color: var(--text-muted); color: var(--text); }
.filter-chip.active { background: var(--primary-subtle); border-color: var(--primary); color: var(--primary-dark); }

a.filter-chip {
    text-decoration: none;
    display: inline-block;
}

.filter-bar-secondary {
    margin-top: -8px;
}

.filter-bar-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 4px;
}

.filter-chip-sm {
    padding: 3px 10px;
    font-size: 0.75rem;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .issue-detail-body { grid-template-columns: 1fr; }
    .issue-detail-sidebar { border-left: none; border-top: 1px solid var(--border); border-radius: 0; }
}

@media (max-width: 768px) {
    .app-launcher {
        left: 8px;
        right: 8px;
        width: auto;
        max-width: calc(100vw - 16px);
    }
    .app-launcher-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .content { padding: 20px 16px; }
    .kanban-column { flex: 0 0 260px; }
    .form-row { grid-template-columns: 1fr; }
    .topbar { padding: 0 16px; }
    .search-box kbd { display: none; }
}

/* ── Login Page ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0fdfa 0%, #f4f6f9 50%, #eef2ff 100%);
    overflow: auto;
}

.login-container { width: 100%; max-width: 420px; padding: 24px; }
.login-container-wide { max-width: 440px; }

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 16px;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.login-demo-intro {
    font-size: 0.833rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
    line-height: 1.45;
}

.login-demo-request .form-group:last-of-type { margin-bottom: 16px; }

.label-optional { font-weight: 400; color: var(--text-muted); font-size: 0.8rem; }

.demo-mode-banner {
    background: linear-gradient(90deg, #ecfdf5, #eff6ff);
    border-bottom: 1px solid #bbf7d0;
    color: #065f46;
    font-size: 0.833rem;
    padding: 8px 16px;
    text-align: center;
}
.demo-mode-banner strong { font-weight: 600; }

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px 32px;
    box-shadow: var(--shadow-lg);
}

.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand .brand-icon {
    width: 52px; height: 52px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.login-brand h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
.login-brand p { color: var(--text-secondary); font-size: 0.933rem; }

.login-btn { width: 100%; justify-content: center; padding: 12px; margin-top: 8px; font-size: 0.933rem; }
.login-form .form-group:last-of-type { margin-bottom: 20px; }
.login-error {
    background: var(--danger-light);
    color: #dc2626;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.867rem;
    margin-bottom: 12px;
}

.login-demo {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.login-demo p { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; }
.login-demo code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 0.8rem; }

.demo-users { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.demo-user-btn {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg);
    font-size: 0.733rem;
    font-family: inherit;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition);
}
.demo-user-btn:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-subtle); }

.demo-table {
    width: 100%;
    font-size: 0.8rem;
    border-collapse: collapse;
    margin-top: 8px;
}
.demo-table th, .demo-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}
.demo-table th { color: var(--text-muted); font-weight: 600; font-size: 0.733rem; }
.twofa-steps {
    margin: 0 0 14px 18px;
    font-size: 0.867rem;
    color: var(--text-secondary);
    line-height: 1.7;
}
.twofa-steps li { margin-bottom: 4px; }

/* ── Notifications ── */
.notif-wrapper { position: relative; }

.notif-btn { position: relative; }

.notif-badge {
    position: absolute;
    top: 2px; right: 2px;
    min-width: 16px; height: 16px;
    background: var(--danger);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 200;
    overflow: hidden;
}

.notif-dropdown.open { display: block; animation: modalIn 0.2s ease; }

.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.933rem;
}

.notif-list { max-height: 380px; overflow-y: auto; }

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid var(--border-light);
}

.notif-item:hover { background: var(--surface-hover); }
.notif-item.unread { background: var(--primary-subtle); }
.notif-item.unread:hover { background: #e6faf8; }

.notif-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }
.notif-title { font-size: 0.867rem; font-weight: 600; margin-bottom: 2px; }
.notif-message { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.4; }
.notif-time { font-size: 0.667rem; color: var(--text-muted); margin-top: 4px; }

/* ── Board Selector ── */
.board-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.board-selector label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.board-selector select {
    width: auto;
    min-height: var(--input-height-sm);
    padding: 7px 32px 7px 12px;
    font-size: 0.867rem;
}

.board-desc {
    font-size: 0.867rem;
    color: var(--text-secondary);
    margin: -12px 0 16px;
}

/* ── Gantt / Timeline ── */
.gantt-container { padding: 0; overflow: hidden; }

.gantt-legend {
    display: flex;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    align-items: center;
}

.gantt-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.gantt-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.gantt-legend-hint {
    font-size: 0.72rem !important;
    color: var(--text-muted) !important;
    font-style: italic;
    margin-left: auto;
}

.gantt-toggle,
.gantt-toggle-spacer {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gantt-toggle {
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    transition: background var(--transition), transform var(--transition);
}

.gantt-toggle:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text);
}

.gantt-toggle svg {
    transition: transform var(--transition);
}

.gantt-toggle.expanded svg {
    transform: rotate(0deg);
}

.gantt-toggle:not(.expanded) svg {
    transform: rotate(-90deg);
}

.gantt-phase-group.collapsed .gantt-phase-children {
    display: none;
}

.parent-rollup-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.parent-rollup-badge--done {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #6ee7b7;
}

.parent-rollup-badge--in_progress {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}

.gantt-phase-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    min-width: 0;
}

.gantt-phase-key {
    font-size: 0.72rem !important;
    font-weight: 600;
    color: var(--text-muted) !important;
}

.gantt-label-keyline--phase-meta {
    display: grid;
    grid-template-columns: 72px 86px 46px;
    align-items: center;
    gap: 4px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.gantt-label-keyline--phase-meta .issue-key {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.gantt-label-keyline--phase-meta .gantt-status-select,
.gantt-label-keyline--phase-meta .parent-rollup-badge {
    width: 86px;
    max-width: 86px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    justify-self: start;
    box-sizing: border-box;
}

.gantt-label-keyline--phase-meta .gantt-label-count {
    justify-self: end;
    max-width: 46px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.62rem;
    padding: 1px 5px;
}

.gantt-label-count--empty {
    visibility: hidden;
    width: 46px;
    height: 1px;
}

.gantt-chart {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

.gantt-header-row,
.gantt-row,
.gantt-sprint-row {
    display: flex;
    border-bottom: 1px solid var(--border-light);
    min-width: calc(var(--gantt-label-width, 320px) + var(--gantt-track-width, 800px));
}

.gantt-row-label {
    --gantt-label-width: 340px;
    position: sticky;
    left: 0;
    z-index: 3;
    width: var(--gantt-label-width);
    min-width: var(--gantt-label-width);
    max-width: var(--gantt-label-width);
    padding: 10px 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border-right: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.867rem;
    box-shadow: 4px 0 10px -6px rgba(16, 24, 40, 0.12);
    flex-shrink: 0;
    min-height: 52px;
    overflow: hidden;
    box-sizing: border-box;
}

.gantt-label-content {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}

.gantt-row-label > .gantt-toggle,
.gantt-row-label > .gantt-toggle-spacer,
.gantt-row-label > .gantt-tree-marker {
    margin-top: 2px;
    flex-shrink: 0;
}

.gantt-header-row .gantt-row-label {
    z-index: 5;
    background: var(--surface);
}

.gantt-sprint-label-spacer {
    min-height: 28px;
    background: var(--bg);
}

.gantt-header-label {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.gantt-label-keyline {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.gantt-label-keyline--task {
    display: grid;
    grid-template-columns: 68px 40px 86px 24px;
    align-items: center;
    gap: 4px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.gantt-label-keyline--task .issue-key {
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gantt-label-keyline--task .badge {
    justify-self: start;
    padding: 1px 5px;
    font-size: 0.58rem;
}

.gantt-label-keyline--task .gantt-status-select {
    width: 86px;
    max-width: 86px;
    min-width: 0;
    justify-self: start;
    box-sizing: border-box;
}

.gantt-label-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.gantt-label-avatar--empty {
    visibility: hidden;
    pointer-events: none;
}

.inline-status-select,
.gantt-status-select,
.status-select-colored[data-field="status"] {
    max-width: 110px;
    min-height: 26px;
    padding: 2px 24px 2px 8px;
    border: 1.5px solid var(--status-border, var(--input-border));
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-family: inherit;
    font-weight: 700;
    color: var(--status-color, var(--text));
    background-color: var(--status-bg, var(--surface));
    cursor: pointer;
    flex-shrink: 0;
    appearance: none;
    background-image: var(--select-chevron);
    background-repeat: no-repeat;
    background-position: right 6px center;
    transition: border-color var(--transition), background-color var(--transition), color var(--transition);
}

.gantt-status-select {
    max-width: 86px;
    width: 86px;
    font-size: 0.65rem;
    padding: 2px 20px 2px 6px;
    min-height: 24px;
}

.inline-status-select:hover,
.gantt-status-select:hover,
.status-select-colored[data-field="status"]:hover:not(:disabled) {
    border-color: var(--status-color, var(--primary));
    filter: brightness(0.98);
}

.inline-status-select:focus,
.gantt-status-select:focus,
.status-select-colored[data-field="status"]:focus {
    outline: none;
    border-color: var(--status-color, var(--primary));
    box-shadow: 0 0 0 3px var(--status-bg, var(--input-focus-ring));
}

.issue-meta .inline-status-select {
    max-width: 120px;
}

.detail-field select.status-select-colored {
    max-width: 100%;
    min-height: var(--input-height-sm);
    font-size: 0.8125rem;
    padding: 6px 32px 6px 12px;
}

.gantt-label-count {
    font-size: 0.68rem;
    color: var(--text-muted);
    background: var(--bg);
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid var(--border-light);
    white-space: nowrap;
    flex-shrink: 0;
}

.gantt-row-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    grid-column: 1 / -1;
}

.gantt-label-keyline--task + .gantt-row-title,
.gantt-label-content > .gantt-row-title {
    padding-top: 2px;
}

.gantt-tree-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.gantt-tree-marker--root {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.gantt-tree-marker--child {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.gantt-tree-marker--legend {
    width: 22px;
    height: 22px;
}

.gantt-timeline-header,
.gantt-row-track,
.gantt-sprint-track {
    flex: 1 0 var(--gantt-track-width, 800px);
    min-width: var(--gantt-track-width, 800px);
}

.gantt-timeline-header {
    display: flex;
    background: var(--bg);
}

.gantt-day {
    flex: 0 0 var(--gantt-day-width, 36px);
    width: var(--gantt-day-width, 36px);
    min-width: var(--gantt-day-width, 36px);
    text-align: center;
    padding: 6px 2px;
    border-right: 1px solid var(--border-light);
    font-size: 0.667rem;
    color: var(--text-muted);
    box-sizing: border-box;
}

.gantt-day.today { background: var(--primary-subtle); color: var(--primary-dark); font-weight: 600; }
.gantt-day.weekend { background: #fafbfc; }
.gantt-day-num { display: block; font-weight: 600; font-size: 0.733rem; }
.gantt-day-mon { display: block; font-size: 0.6rem; text-transform: uppercase; }

.gantt-row-track,
.gantt-sprint-track {
    position: relative;
    height: 40px;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent calc(var(--gantt-day-width, 36px) - 1px),
        var(--border-light) calc(var(--gantt-day-width, 36px) - 1px),
        var(--border-light) var(--gantt-day-width, 36px)
    );
}

.gantt-sprint-track { height: 28px; background: var(--bg); }

.gantt-sprint-band {
    position: absolute;
    top: 4px; height: 20px;
    background: var(--accent-light);
    border: 1px dashed var(--accent);
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 0.667rem;
    font-weight: 600;
    color: #4f46e5;
    overflow: hidden;
    white-space: nowrap;
}

.gantt-bar {
    position: absolute;
    top: 8px; height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    cursor: pointer;
    transition: opacity var(--transition), transform var(--transition);
    min-width: 4px;
    opacity: 0.9;
}

.gantt-bar:hover { opacity: 1; transform: scaleY(1.1); }

.gantt-bar-label {
    font-size: 0.667rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gantt-row { cursor: pointer; transition: background var(--transition); }
.gantt-row:hover { background: var(--surface-hover); }
.gantt-row:hover .gantt-row-label { background: var(--surface-hover); }

.gantt-row-phase {
    background: transparent;
}

.gantt-row-phase .gantt-row-label {
    background: var(--primary-subtle);
}

.gantt-row-phase:hover .gantt-row-label {
    background: #dff7f3;
}

.gantt-row-child .gantt-row-label {
    padding-left: 18px;
}

.gantt-row-child .gantt-tree-marker--child {
    margin-left: 4px;
}

.gantt-row-child .gantt-row-title {
    font-weight: 400;
    color: var(--text-secondary);
}

.gantt-bar-phase {
    opacity: 0.85;
    height: 22px;
    border: 1px dashed rgba(255,255,255,0.4);
}

.gantt-section-label {
    padding: 8px 12px 8px calc(var(--gantt-label-width, 320px) + 12px);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-hover);
    border-bottom: 1px solid var(--border);
    position: sticky;
    left: 0;
}

.badge-phase {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #7dd3fc;
}

@media (max-width: 768px) {
    .notif-dropdown { width: calc(100vw - 32px); right: -60px; }
    .gantt-row-label {
        --gantt-label-width: 240px;
        width: var(--gantt-label-width);
        min-width: var(--gantt-label-width);
        max-width: var(--gantt-label-width);
    }
}

/* ── Live Indicator ── */
.live-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background 0.3s;
}

.live-dot.live {
    background: var(--success);
    box-shadow: 0 0 0 3px var(--success-light);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.live-label {
    font-size: 0.733rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* ── Attachments ── */
.attachment-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.attachment-icon { font-size: 1.2rem; }
.attachment-info { flex: 1; min-width: 0; }
.attachment-name {
    display: block;
    font-size: 0.867rem;
    font-weight: 500;
    color: var(--primary-dark);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.attachment-name:hover { text-decoration: underline; }
.attachment-meta { font-size: 0.733rem; color: var(--text-muted); }

.attachment-upload {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding: 14px 16px;
    background: var(--input-bg);
    border: 1.5px dashed var(--input-border);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition), background var(--transition);
}

.attachment-upload:hover {
    border-color: var(--primary);
    background: var(--primary-subtle);
}

.attachment-upload input[type="file"] {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    max-width: 100%;
}

.attachment-upload input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 8px 14px;
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.attachment-upload input[type="file"]::file-selector-button:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
    background: var(--primary-subtle);
}

.upload-hint { font-size: 0.733rem; color: var(--text-muted); }

/* ── Settings ── */
.profile-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.867rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.checkbox-label:hover {
    background: var(--surface-hover);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}


.email-queue-stats {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.role-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.role-card {
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.role-card strong { display: block; font-size: 0.867rem; margin-bottom: 4px; }
.role-card p { font-size: 0.733rem; color: var(--text-secondary); margin: 0; }

.mention {
    background: var(--accent-light);
    color: #4f46e5;
    padding: 1px 4px;
    border-radius: 4px;
    font-weight: 600;
}

.audit-preview { max-height: 280px; overflow-y: auto; }

.audit-row {
    display: grid;
    grid-template-columns: 140px 120px 1fr;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8rem;
}

.audit-action { font-weight: 600; color: var(--primary-dark); }
.audit-time { color: var(--text-muted); font-size: 0.733rem; }
.audit-detail { color: var(--text-secondary); }

@media (max-width: 768px) {
    .audit-row { grid-template-columns: 1fr; }
}

/* ── v5 JIRA Parity ── */
.drag-handle { cursor: grab; color: var(--text-muted); margin-right: 8px; }
.backlog-item { cursor: grab; }
.backlog-drop-zone.drag-over { background: var(--primary-subtle); border-radius: 8px; min-height: 48px; }
.linked-issues-list { display: flex; flex-direction: column; gap: 6px; }

/* ── Issue Hierarchy ── */
.hierarchy-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--input-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 0.8rem;
}

.hierarchy-crumb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--primary-dark);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.hierarchy-crumb:hover { background: var(--primary-subtle); }

.hierarchy-crumb-type {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.hierarchy-crumb-current {
    padding: 2px 8px;
    font-weight: 700;
    color: var(--text);
    cursor: default;
}

.hierarchy-crumb-sep {
    color: var(--text-muted);
    font-size: 0.75rem;
    user-select: none;
}

.issue-detail-key-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.level-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.667rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1.5px solid transparent;
    flex-shrink: 0;
}

.level-pill--header {
    font-size: 0.72rem;
    padding: 3px 10px;
}

.level-pill--inline { margin-right: 4px; }
.level-pill--card {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}

.level-pill--0 { background: #ecfdf5; color: #047857; border-color: #6ee7b7; }
.level-pill--1 { background: #eff6ff; color: #1d4ed8; border-color: #93c5fd; }
.level-pill--2 { background: #f5f3ff; color: #6d28d9; border-color: #c4b5fd; }
.level-pill--3 { background: #fdf4ff; color: #a21caf; border-color: #f0abfc; }

.hierarchy-tree {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hierarchy-node--depth-1 { margin-left: 0; }
.hierarchy-node--depth-2 { margin-left: 16px; }
.hierarchy-node--depth-3 { margin-left: 32px; }

.hierarchy-children {
    margin-top: 6px;
    padding-left: 12px;
    border-left: 2px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hierarchy-node--depth-2 > .hierarchy-children { border-left-color: #c4b5fd; }
.hierarchy-node--depth-3 > .hierarchy-children { border-left-color: #f0abfc; }

.hierarchy-row {
    position: relative;
}

.hierarchy-gutter {
    width: 14px;
    color: var(--text-muted);
    font-size: 0.75rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.hierarchy-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hierarchy-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    background: var(--surface);
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border-light);
    flex-shrink: 0;
}

.hierarchy-legend .form-hint { margin-bottom: 0; }

.issue-row-indent {
    display: inline-block;
    width: calc(var(--depth, 1) * 14px);
    min-width: 14px;
    border-left: 2px solid var(--border);
    margin-right: 8px;
    align-self: stretch;
}

.issue-row--depth-1 { padding-left: 4px; border-left: 3px solid #93c5fd; }
.issue-row--depth-2 { padding-left: 8px; border-left: 3px solid #c4b5fd; }
.issue-row--depth-3 { padding-left: 12px; border-left: 3px solid #f0abfc; }

.issue-card--depth-1 { border-left: 3px solid #93c5fd; }
.issue-card--depth-2 { border-left: 3px solid #c4b5fd; }
.issue-card--depth-3 { border-left: 3px solid #f0abfc; }

.issue-card--depth-1,
.issue-card--depth-2,
.issue-card--depth-3 {
    position: relative;
}

.linked-issue-row {
    display: flex; align-items: center; gap: 8px; padding: 10px 14px;
    background: var(--input-bg); border: 1px solid var(--border-light);
    border-radius: var(--radius); cursor: pointer; font-size: 0.867rem;
    transition: background var(--transition), border-color var(--transition);
}
.linked-issue-row:hover { background: var(--primary-subtle); border-color: var(--primary-light); }
.link-type { font-size: 0.75rem; color: var(--text-muted); min-width: 80px; }
.workflow-row {
    display: flex; gap: 10px; margin-bottom: 10px; align-items: center;
    padding: 10px 12px; background: var(--input-bg);
    border: 1px solid var(--border-light); border-radius: var(--radius);
}
.workflow-row input { flex: 1; min-width: 0; min-height: var(--input-height-sm); padding: 8px 12px; font-size: 0.867rem; }
.workflow-row input[type="color"] { flex: 0 0 48px; width: 48px; padding: 4px; }
.issue-tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.issue-tab {
    padding: 8px 16px; border: none; background: none; cursor: pointer;
    font-size: 0.867rem; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.issue-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.issue-tab-panel { display: none; }
.issue-tab-panel.active { display: block; }
.rbac-role-tabs { display: flex; flex-direction: column; gap: 20px; }
.role-perm-section {
    margin-top: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}
.role-perm-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    padding: 14px 14px 0;
    color: var(--text);
}
.role-perm-section .perm-action-legend {
    margin: 10px 14px;
}
.role-perm-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
    display: flex;
    justify-content: flex-end;
}
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}
.data-table th,
.data-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table th {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: var(--bg-subtle);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-subtle); }
.perm-table-module {
    width: 120px;
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    vertical-align: top;
}
.perm-table-label {
    color: var(--text);
    min-width: 200px;
    vertical-align: middle;
}
.perm-table-label-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 24px;
}
.perm-table-label-inner > span { line-height: 1.3; }
.role-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.perm-action-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding: 10px 14px;
    margin: 0 0 10px;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.perm-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.perm-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--perm-icon-bg);
    color: var(--perm-icon-color);
    flex-shrink: 0;
}
.perm-action-icon svg { display: block; }
.perm-matrix-wrap {
    max-height: 520px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    isolation: isolate;
    scrollbar-gutter: stable;
    padding-right: 2px;
}
.perm-matrix-table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 100%;
}
.perm-matrix-table thead {
    position: relative;
    z-index: 30;
}
.perm-matrix-table thead th {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--surface);
    box-shadow: 0 2px 0 var(--border);
    padding-top: 12px;
    padding-bottom: 12px;
}
.perm-matrix-table thead th.perm-table-module {
    left: 0;
    z-index: 33;
    min-width: 120px;
    background: var(--surface);
    box-shadow: 1px 2px 0 var(--border);
}
.perm-matrix-table thead th.perm-matrix-label-col {
    left: 120px;
    z-index: 32;
    min-width: 200px;
    background: var(--surface);
    box-shadow: 0 2px 0 var(--border), 1px 0 0 var(--border);
}
.perm-matrix-table thead th.perm-matrix-role-col {
    z-index: 31;
    background: var(--surface);
}
.perm-matrix-table tbody td.perm-table-module {
    position: sticky;
    left: 0;
    z-index: 5;
    box-shadow: 1px 0 0 var(--border);
}
.perm-matrix-table tbody td.perm-table-label {
    position: sticky;
    left: 120px;
    z-index: 4;
    box-shadow: 1px 0 0 var(--border);
    vertical-align: middle;
}
/* Project=Blue | Work Item=Coral | Kolaborasi=Green | Perencanaan=Gold */
.perm-module-row.perm-module-row-start:not(:first-child) td {
    border-top: 2px solid var(--border);
}
.perm-module-row.perm-module--project td { background: rgba(37, 99, 235, 0.14); }
.perm-module-row.perm-module--project td.perm-table-module {
    background: rgba(37, 99, 235, 0.22);
    border-left: 3px solid #2563eb;
    color: #1e40af;
    font-weight: 700;
}
.perm-module-row.perm-module--project:hover td { background: rgba(37, 99, 235, 0.2); }
.perm-module-row.perm-module--project:hover td.perm-table-module { background: rgba(37, 99, 235, 0.28); }
.perm-module-row.perm-module--work td { background: rgba(234, 88, 12, 0.13); }
.perm-module-row.perm-module--work td.perm-table-module {
    background: rgba(234, 88, 12, 0.21);
    border-left: 3px solid #ea580c;
    color: #c2410c;
    font-weight: 700;
}
.perm-module-row.perm-module--work:hover td { background: rgba(234, 88, 12, 0.19); }
.perm-module-row.perm-module--work:hover td.perm-table-module { background: rgba(234, 88, 12, 0.27); }
.perm-module-row.perm-module--collab td { background: rgba(22, 163, 74, 0.13); }
.perm-module-row.perm-module--collab td.perm-table-module {
    background: rgba(22, 163, 74, 0.21);
    border-left: 3px solid #16a34a;
    color: #15803d;
    font-weight: 700;
}
.perm-module-row.perm-module--collab:hover td { background: rgba(22, 163, 74, 0.19); }
.perm-module-row.perm-module--collab:hover td.perm-table-module { background: rgba(22, 163, 74, 0.27); }
.perm-module-row.perm-module--plan td { background: rgba(202, 138, 4, 0.14); }
.perm-module-row.perm-module--plan td.perm-table-module {
    background: rgba(202, 138, 4, 0.22);
    border-left: 3px solid #ca8a04;
    color: #a16207;
    font-weight: 700;
}
.perm-module-row.perm-module--plan:hover td { background: rgba(202, 138, 4, 0.2); }
.perm-module-row.perm-module--plan:hover td.perm-table-module { background: rgba(202, 138, 4, 0.28); }
.perm-module-row.perm-module--default td { background: rgba(100, 116, 139, 0.08); }
.perm-matrix-role-col {
    width: 88px;
    min-width: 88px;
    text-align: center !important;
    vertical-align: middle;
}
.perm-matrix-table th.perm-matrix-role-col:last-child,
.perm-matrix-table td.perm-matrix-role-col:last-child {
    padding-right: 20px;
}
.perm-matrix-role-name {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.25;
}
.perm-matrix-role-count {
    display: block;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 2px;
    transition: color var(--transition);
}
.perm-matrix-table th.perm-matrix-saved .perm-matrix-role-count {
    color: var(--primary);
    font-weight: 700;
}
.perm-matrix-role-col input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}
.perm-table-check-col,
.perm-table-check {
    width: 72px;
    text-align: center !important;
}
.perm-table-check input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}
.user-table-wrap { padding: 0 16px 16px; }
.user-table .user-table-avatar-col { width: 48px; padding-right: 0; }
.user-table .user-table-action-col { width: 120px; text-align: right !important; }
.user-table-actions {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 2px;
}
.user-table-actions .btn-icon {
    width: 32px;
    height: 32px;
    color: var(--text-muted);
}
.user-table-actions .btn-icon:hover {
    color: var(--text);
    background: var(--surface-hover);
}
.user-table-actions .btn-icon-danger:hover {
    color: var(--danger);
    background: var(--danger-light);
}
.user-table-email { color: var(--text-muted); font-size: 0.84rem; }
.user-table td:last-child { text-align: right; }

/* ── Work Items Module ── */
.work-items-page .page-header { margin-bottom: 20px; }

.wi-toolbar { padding: 0; margin-bottom: 16px; overflow: hidden; }
.wi-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    flex-wrap: wrap;
}
.wi-type-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 3px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}
.wi-type-tabs::-webkit-scrollbar { display: none; }
.wi-type-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--transition);
}
.wi-type-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.65); }
.wi-type-tab.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}
.wi-tab-count {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg);
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.4;
}
.wi-type-tab.active .wi-tab-count {
    background: var(--primary-subtle);
    color: var(--primary-dark);
}
.wi-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.wi-btn-nav svg { flex-shrink: 0; }
.wi-toolbar-divider { height: 1px; background: var(--border); }
.wi-status-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    flex-wrap: wrap;
}
.wi-filter-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 48px;
}
.wi-status-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.wi-status-tab {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}
.wi-status-tab:hover { border-color: var(--text-muted); color: var(--text); }
.wi-status-tab.active {
    background: var(--primary-subtle);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.wi-list-card { padding: 0; overflow: hidden; }
.wi-list-meta {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg);
}
.wi-table-wrap { overflow-x: auto; }
.wi-table {
    width: 100%;
    border-collapse: collapse;
}
.wi-table thead th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 10px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.wi-table tbody tr {
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid var(--border-light);
}
.wi-table tbody tr:last-child { border-bottom: none; }
.wi-table tbody tr:hover { background: var(--surface-hover); }
.wi-table td {
    padding: 11px 16px;
    font-size: 0.867rem;
    vertical-align: middle;
}
.wi-table .issue-title-text {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.wi-col-key { width: 100px; }
.wi-col-type { width: 88px; }
.wi-col-status { width: 108px; }
.wi-col-priority { width: 88px; }
.wi-col-assignee { width: 56px; text-align: center; }
.wi-col-title { min-width: 220px; }
.wi-unassigned { color: var(--text-muted); font-size: 0.867rem; }
.wi-empty-row td { padding: 32px 16px; }
.wi-empty-row .empty-state { padding: 24px 0; }

/* ── Project View Toolbar ── */
.project-view-head {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
}
.project-view-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.project-view-tabs .board-tabs { background: transparent; padding: 0; }
.project-view-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.board-sprint-toggle { margin-left: 4px; white-space: nowrap; }

.settings-tabs { display: flex; gap: 4px; padding: 12px 20px 0; border-bottom: 1px solid var(--border); }
.settings-tab {
    padding: 8px 16px; border: none; background: none; cursor: pointer;
    font-size: 0.867rem; color: var(--text-muted); border-bottom: 2px solid transparent;
}
.settings-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.report-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.report-tabs-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.report-tab {
    padding: 8px 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}
.report-tab:hover { border-color: var(--primary); color: var(--text); }
.report-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
}

/* ── Enterprise Reports ── */
.reports-page { max-width: 1200px; }
.reports-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 20px 0 16px;
    flex-wrap: wrap;
}
.reports-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    margin: 0 0 4px;
}
.reports-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0;
}
.reports-methodology-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--primary-subtle);
    color: var(--primary-dark);
    border: 1px solid rgba(13, 148, 136, 0.2);
    white-space: nowrap;
}
.reports-panels { display: flex; flex-direction: column; gap: 16px; }
.report-panel--chart { overflow: hidden; }
.report-card-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px !important;
}
.report-card-desc {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
}
.report-chart-wrap { padding: 20px 24px 24px; }
.report-chart-svg {
    width: 100%;
    height: auto;
    display: block;
    margin: 8px 0 16px;
}
.chart-grid-line {
    stroke: #e2e8f0;
    stroke-width: 1;
}
.chart-axis-label {
    font-size: 11px;
    fill: #94a3b8;
    font-family: Inter, sans-serif;
}
.report-mini-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 8px;
}
.report-mini-kpi {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.report-mini-kpi span {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.report-mini-kpi strong {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}
.report-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}
.report-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}
.report-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}
.report-legend-dot--dashed {
    background: transparent;
    border: 2px dashed;
    width: 14px;
    height: 0;
    border-radius: 0;
}
.report-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
.report-status-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
}
.report-status-chip-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}
.report-status-chip-name {
    flex: 1;
    color: var(--text-secondary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.report-status-chip strong { font-weight: 700; color: var(--text); }
.report-status-chip-pct {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.report-dist-section {
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.report-dist-title {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin: 0 0 12px;
}
.report-dist-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 0.8125rem;
}
.report-dist-label {
    width: 100px;
    flex-shrink: 0;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.report-dist-track {
    flex: 1;
    height: 10px;
    background: var(--bg);
    border-radius: 5px;
    overflow: hidden;
}
.report-dist-fill {
    height: 100%;
    border-radius: 5px;
    min-width: 2px;
    transition: width 0.3s ease;
}
.report-dist-val {
    width: 32px;
    text-align: right;
    font-weight: 700;
    color: var(--text);
}
.report-velocity-chart {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    height: 220px;
    padding: 16px 8px 0;
    margin-bottom: 8px;
}
.report-velocity-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
    height: 100%;
}
.report-velocity-bar-wrap {
    flex: 1;
    width: 100%;
    max-width: 56px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.report-velocity-bar {
    width: 100%;
    background: linear-gradient(180deg, #14b8a6 0%, #0d9488 100%);
    border-radius: 6px 6px 0 0;
    min-height: 8px;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 6px;
}
.report-velocity-bar-val {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #fff;
}
.report-velocity-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.report-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}
.report-empty p { margin: 0; }

.bulk-bar {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    background: var(--primary-subtle); border-radius: var(--radius); margin-bottom: 12px;
    border: 1px solid var(--primary-light);
}

.chart-svg { width: 100%; max-width: 600px; height: auto; }
.bar-chart { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.bar-row { display: flex; align-items: center; gap: 12px; font-size: 0.867rem; }
.bar-label { min-width: 120px; overflow: hidden; white-space: nowrap; max-width: 140px; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 20px; background: var(--bg-subtle); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; }
.bar-value { min-width: 50px; text-align: right; font-weight: 600; }
.cflow-legend { display: flex; flex-wrap: wrap; gap: 16px; padding: 16px; font-size: 0.867rem; }

@media (max-width: 768px) {
    .report-mini-kpis { grid-template-columns: repeat(2, 1fr); }
    .report-status-grid { grid-template-columns: repeat(2, 1fr); }
}
.search-issue-row { cursor: pointer; }
.search-issue-row .bulk-check { margin-right: 8px; }
