/* ============================================================================
   WorkDash — Enterprise Premium Design System
   Dark theme with glassmorphism, smooth animations, IBM Plex Sans typography
   ============================================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
    /* Color palette */
    --wd-bg-primary: #161616;
    --wd-bg-secondary: #1e1e1e;
    --wd-bg-tertiary: #262626;
    --wd-bg-card: rgba(38, 38, 38, 0.7);
    --wd-bg-card-hover: rgba(57, 57, 57, 0.85);
    --wd-bg-sidebar: rgba(22, 22, 22, 0.95);
    --wd-bg-input: rgba(38, 38, 38, 0.6);

    --wd-border: rgba(255, 255, 255, 0.08);
    --wd-border-hover: rgba(255, 255, 255, 0.16);
    --wd-border-active: rgba(15, 98, 254, 0.5);

    --wd-text-primary: #f4f4f4;
    --wd-text-secondary: #c6c6c6;
    --wd-text-muted: #8d8d8d;
    --wd-text-accent: #78a9ff;

    --wd-accent: #0f62fe;
    --wd-accent-hover: #4589ff;
    --wd-accent-glow: rgba(15, 98, 254, 0.15);

    --wd-success: #42be65;
    --wd-warning: #f1c21b;
    --wd-danger: #da1e28;
    --wd-info: #4589ff;

    --wd-glass-blur: 16px;
    --wd-glass-bg: rgba(26, 26, 38, 0.6);
    --wd-glass-border: rgba(255, 255, 255, 0.08);

    --wd-sidebar-width: 260px;
    --wd-sidebar-collapsed: 64px;

    --wd-radius-sm: 6px;
    --wd-radius-md: 10px;
    --wd-radius-lg: 16px;

    --wd-shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --wd-shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --wd-shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --wd-shadow-glow: 0 0 20px var(--wd-accent-glow);

    --wd-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --wd-transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light mode overrides */
[data-theme="light"] {
    --wd-bg-primary: #f4f4f4;
    --wd-bg-secondary: #ffffff;
    --wd-bg-tertiary: #e0e0e0;
    --wd-bg-card: rgba(255, 255, 255, 0.85);
    --wd-bg-card-hover: rgba(255, 255, 255, 0.95);
    --wd-bg-sidebar: rgba(255, 255, 255, 0.95);
    --wd-bg-input: rgba(244, 244, 244, 0.8);

    --wd-border: rgba(0, 0, 0, 0.06);
    --wd-border-hover: rgba(0, 0, 0, 0.12);

    --wd-text-primary: #161616;
    --wd-text-secondary: #525252;
    --wd-text-muted: #8d8d8d;

    --wd-glass-bg: rgba(255, 255, 255, 0.7);
    --wd-glass-border: rgba(0, 0, 0, 0.06);

    --wd-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --wd-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --wd-shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--wd-bg-primary);
    color: var(--wd-text-primary);
    min-height: 100vh;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Subtle animated gradient background */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(15, 98, 254, 0.04), transparent),
        radial-gradient(ellipse 60% 40% at 80% 20%, rgba(69, 137, 255, 0.03), transparent);
    pointer-events: none;
    z-index: 0;
}

/* IBM Carbon top stripe */
body::after {
    content: '';
    display: block;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #0f62fe, #4589ff, #0f62fe);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
}

a { color: var(--wd-text-accent); text-decoration: none; transition: color var(--wd-transition); }
a:hover { color: var(--wd-accent-hover); }

::selection { background: var(--wd-accent); color: white; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ---------- Sidebar ---------- */
.wd-sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--wd-sidebar-width);
    height: 100vh;
    background: var(--wd-bg-sidebar);
    backdrop-filter: blur(var(--wd-glass-blur));
    border-right: 1px solid var(--wd-border);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: width var(--wd-transition-slow), transform var(--wd-transition-slow);
    overflow: hidden;
}

.wd-sidebar.collapsed {
    width: var(--wd-sidebar-collapsed);
}

.wd-sidebar .sidebar-brand {
    padding: 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--wd-border);
    flex-shrink: 0;
}

.wd-sidebar .sidebar-brand .brand-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--wd-accent), #4589ff);
    border-radius: var(--wd-radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(15, 98, 254, 0.3);
}

.wd-sidebar .sidebar-brand .brand-text {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--wd-text-primary);
    white-space: nowrap;
    opacity: 1;
    transition: opacity var(--wd-transition);
}

.wd-sidebar.collapsed .brand-text,
.wd-sidebar.collapsed .nav-text,
.wd-sidebar.collapsed .nav-section-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.wd-sidebar .sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.wd-sidebar .nav-section-label {
    padding: 1rem 1rem 0.25rem 1rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--wd-text-muted);
    white-space: nowrap;
    transition: opacity var(--wd-transition);
}

.wd-sidebar .nav-item {
    list-style: none;
}

.wd-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    margin: 2px 0.5rem;
    border-radius: var(--wd-radius-sm);
    color: var(--wd-text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--wd-transition);
    white-space: nowrap;
    position: relative;
}

.wd-sidebar .nav-link:hover {
    color: var(--wd-text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.wd-sidebar .nav-link.active {
    color: var(--wd-accent-hover);
    background: var(--wd-accent-glow);
}

.wd-sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--wd-accent);
    border-radius: 0 2px 2px 0;
}

.wd-sidebar .nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.wd-sidebar .nav-link .nav-text {
    transition: opacity var(--wd-transition);
}

.sidebar-toggle-btn {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--wd-border);
    flex-shrink: 0;
}

.sidebar-toggle-btn button {
    background: none; border: none;
    color: var(--wd-text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--wd-radius-sm);
    transition: all var(--wd-transition);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle-btn button:hover {
    color: var(--wd-text-primary);
    background: rgba(255,255,255,0.05);
}

/* ---------- Main Content ---------- */
.wd-main {
    margin-left: var(--wd-sidebar-width);
    padding: 1.5rem 2rem;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    transition: margin-left var(--wd-transition-slow);
}

.wd-sidebar.collapsed ~ .wd-main {
    margin-left: var(--wd-sidebar-collapsed);
}

/* ---------- Glass Card ---------- */
.wd-card {
    background: var(--wd-glass-bg);
    backdrop-filter: blur(var(--wd-glass-blur));
    border: 1px solid var(--wd-glass-border);
    border-radius: var(--wd-radius-lg);
    box-shadow: var(--wd-shadow-sm);
    transition: all var(--wd-transition);
    overflow: hidden;
}

.wd-card:hover {
    border-color: var(--wd-border-hover);
    box-shadow: var(--wd-shadow-md);
}

.wd-card .card-header {
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--wd-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--wd-text-primary);
}

.wd-card .card-body {
    padding: 1.25rem;
}

.wd-card .card-footer {
    background: rgba(255,255,255,0.02);
    border-top: 1px solid var(--wd-border);
    padding: 0.75rem 1.25rem;
}

/* ---------- Stat Cards ---------- */
.wd-stat-card {
    background: var(--wd-glass-bg);
    backdrop-filter: blur(var(--wd-glass-blur));
    border: 1px solid var(--wd-glass-border);
    border-left: 4px solid var(--stat-color, var(--wd-accent));
    border-radius: var(--wd-radius-lg);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: all var(--wd-transition);
}

.wd-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--stat-color, var(--wd-accent)), transparent);
}

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

.wd-stat-card .stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wd-text-muted);
    margin-bottom: 0.5rem;
}

.wd-stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--wd-text-primary);
    line-height: 1;
}

.wd-stat-card .stat-meta {
    font-size: 0.8rem;
    color: var(--wd-text-secondary);
    margin-top: 0.5rem;
}

.wd-stat-card.issues { --stat-color: var(--wd-info); }
.wd-stat-card.prs { --stat-color: var(--wd-success); }
.wd-stat-card.activity { --stat-color: var(--wd-warning); }
.wd-stat-card.attention { --stat-color: var(--wd-danger); }

/* ---------- List Items ---------- */
.wd-list-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--wd-border);
    transition: background var(--wd-transition), transform var(--wd-transition), box-shadow var(--wd-transition);
    color: var(--wd-text-primary);
    text-decoration: none;
}

.wd-list-item:hover {
    background: rgba(255, 255, 255, 0.03);
    transform: translateY(-1px) scale(1.01);
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
    color: var(--wd-text-primary);
}

.wd-list-item:last-child { border-bottom: none; }

.wd-list-item.needs-action {
    border-left: 3px solid var(--wd-danger);
}

.wd-list-item.waiting {
    border-left: 3px solid var(--wd-text-muted);
}

/* ---------- Action Badges ---------- */
.wd-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.08);
}

.wd-badge-respond { background: rgba(239,68,68,0.28); color: #fecaca; box-shadow: 0 0 10px rgba(239,68,68,0.35); border-color: rgba(239,68,68,0.4); }
.wd-badge-review { background: rgba(249,115,22,0.24); color: #fed7aa; border-color: rgba(249,115,22,0.35); }
.wd-badge-update { background: rgba(245,158,11,0.15); color: #fbbf24; }
.wd-badge-waiting { background: rgba(113,113,122,0.15); color: #a1a1aa; }
.wd-badge-blocked { background: rgba(239,68,68,0.28); color: #fecaca; box-shadow: 0 0 10px rgba(239,68,68,0.35); border-color: rgba(239,68,68,0.4); }
.wd-badge-ready_to_close { background: rgba(34,197,94,0.15); color: #4ade80; }
.wd-badge-ready_to_merge { background: rgba(34,197,94,0.15); color: #4ade80; }
.wd-badge-stale { background: rgba(113,113,122,0.1); color: #71717a; }

.wd-badge-open { background: rgba(34,197,94,0.15); color: #4ade80; }
.wd-badge-closed { background: rgba(113,113,122,0.15); color: #a1a1aa; }
.wd-badge-merged { background: rgba(8,189,186,0.15); color: #3ddbd9; }

/* ---------- Priority Indicators ---------- */
.wd-priority {
    width: 40px; height: 10px;
    border-radius: 999px;
    flex-shrink: 0;
    margin-top: 6px;
}

.wd-priority-lg {
    width: 54px;
    height: 12px;
    margin-top: 4px;
    box-shadow: 0 0 12px rgba(255,255,255,0.08);
}

.wd-priority-urgent { background: var(--wd-danger); box-shadow: 0 0 8px rgba(239,68,68,0.6); animation: wd-pulse 2s infinite; }
.wd-priority-high { background: #f97316; box-shadow: 0 0 6px rgba(249,115,22,0.45); }
.wd-priority-medium { background: var(--wd-warning); }
.wd-priority-low { background: var(--wd-text-muted); }

@keyframes wd-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(239,68,68,0.5); }
    50% { opacity: 0.6; box-shadow: 0 0 12px rgba(239,68,68,0.3); }
}

/* ---------- Buttons ---------- */
.wd-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--wd-radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--wd-border);
    background: var(--wd-glass-bg);
    color: var(--wd-text-primary);
    cursor: pointer;
    transition: all var(--wd-transition);
    white-space: nowrap;
    min-height: 34px;
    line-height: 1.1;
}

.wd-btn:hover {
    border-color: var(--wd-border-hover);
    background: var(--wd-bg-card-hover);
    transform: translateY(-1px);
}

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

.wd-btn-primary:hover {
    background: var(--wd-accent-hover);
    border-color: var(--wd-accent-hover);
    color: white;
    box-shadow: var(--wd-shadow-glow);
}

.wd-btn-sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.78rem;
    min-height: 30px;
}

.wd-btn-danger { border-color: rgba(239,68,68,0.3); color: #f87171; }
.wd-btn-danger:hover { background: rgba(239,68,68,0.1); border-color: #ef4444; color: #f87171; }

.wd-btn-success { border-color: rgba(34,197,94,0.3); color: #4ade80; }
.wd-btn-success:hover { background: rgba(34,197,94,0.1); border-color: #22c55e; color: #4ade80; }

/* ---------- Form Controls ---------- */
.wd-select, .wd-input {
    background: var(--wd-bg-input);
    border: 1px solid var(--wd-border);
    border-radius: var(--wd-radius-sm);
    color: var(--wd-text-primary);
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    transition: border-color var(--wd-transition);
}

.wd-select:focus, .wd-input:focus {
    outline: none;
    border-color: var(--wd-border-active);
    box-shadow: 0 0 0 3px var(--wd-accent-glow);
}

/* ---------- Filter Bar ---------- */
.wd-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 1.25rem;
    background: var(--wd-glass-bg);
    backdrop-filter: blur(var(--wd-glass-blur));
    border: 1px solid var(--wd-glass-border);
    border-radius: var(--wd-radius-lg);
    margin-bottom: 1rem;
}

.wd-filter-bar .filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wd-filter-bar .filter-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wd-text-muted);
}

.wd-pill-group {
    display: flex;
    gap: 2px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--wd-radius-sm);
    padding: 2px;
}

.wd-pill {
    padding: 0.3rem 0.65rem;
    border-radius: calc(var(--wd-radius-sm) - 2px);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--wd-text-secondary);
    transition: transform var(--wd-transition), background var(--wd-transition), color var(--wd-transition), box-shadow var(--wd-transition);
    cursor: pointer;
    text-decoration: none;
    border: none;
    background: none;
    will-change: transform;
}

.wd-pill:hover {
    color: var(--wd-text-primary);
    background: rgba(255,255,255,0.08);
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.wd-pill.active {
    background: var(--wd-accent);
    color: white;
    box-shadow: 0 1px 4px rgba(15, 98, 254, 0.3);
}
.wd-pill.active:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(15, 98, 254, 0.35);
}

/* ---------- Page Header ---------- */
.wd-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.wd-page-header h2 {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--wd-text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.wd-page-header h2 i {
    color: var(--wd-accent);
}

/* ---------- Report Content ---------- */
.wd-report-content {
    background: var(--wd-bg-tertiary);
    border-radius: var(--wd-radius-md);
    padding: 1.5rem;
}

/* ---------- Markdown Styles ---------- */
.markdown-content { line-height: 1.75; color: var(--wd-text-primary); }
.markdown-content h1, .markdown-content h2, .markdown-content h3,
.markdown-content h4, .markdown-content h5, .markdown-content h6 {
    margin-top: 1.25rem; margin-bottom: 0.5rem; font-weight: 600; color: var(--wd-text-primary);
}
.markdown-content h1 { font-size: 1.4rem; border-bottom: 1px solid var(--wd-border); padding-bottom: 0.3rem; }
.markdown-content h2 { font-size: 1.3rem; font-weight: 700; border-bottom: 1px solid var(--wd-border); padding-bottom: 0.3rem; }
.markdown-content h3 { font-size: 1.05rem; }
.markdown-content p { margin-bottom: 0.75rem; }
.markdown-content ul, .markdown-content ol { margin-bottom: 0.75rem; padding-left: 1.5rem; }
.markdown-content li { margin-bottom: 0.25rem; }
.markdown-content pre {
    background: var(--wd-bg-primary);
    color: #d4d4d4;
    padding: 1rem;
    border-radius: var(--wd-radius-sm);
    overflow-x: auto;
    margin-bottom: 0.75rem;
    border: 1px solid var(--wd-border);
}
.markdown-content code {
    background: rgba(255,255,255,0.06);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.85em;
    color: #e879f9;
}
.markdown-content pre code { background: transparent; padding: 0; color: #d4d4d4; }
.markdown-content blockquote {
    border-left: 3px solid var(--wd-accent);
    padding-left: 1rem;
    margin-left: 0;
    color: var(--wd-text-secondary);
}
.markdown-content table { width: 100%; margin-bottom: 0.75rem; border-collapse: collapse; }
.markdown-content th, .markdown-content td {
    border: 1px solid var(--wd-border);
    padding: 0.5rem 0.75rem;
}
.markdown-content th { background: var(--wd-bg-tertiary); font-weight: 600; }
.markdown-content a { color: var(--wd-text-accent); }
.markdown-content hr { border: none; border-top: 1px solid var(--wd-border); margin: 1rem 0; }

/* ---------- Toast Notifications ---------- */
.wd-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wd-toast {
    background: var(--wd-glass-bg);
    backdrop-filter: blur(var(--wd-glass-blur));
    border: 1px solid var(--wd-glass-border);
    border-radius: var(--wd-radius-md);
    padding: 0.75rem 1rem;
    box-shadow: var(--wd-shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    max-width: 440px;
    animation: wd-slideIn 0.3s ease;
    font-size: 0.85rem;
}

.wd-toast.success { border-left: 3px solid var(--wd-success); }
.wd-toast.error { border-left: 3px solid var(--wd-danger); }
.wd-toast.info { border-left: 3px solid var(--wd-info); }
.wd-toast.warning { border-left: 3px solid var(--wd-warning); }

.wd-toast.removing { animation: wd-slideOut 0.3s ease forwards; }

@keyframes wd-slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes wd-slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

/* ---------- Loading Skeleton ---------- */
.wd-skeleton {
    background: linear-gradient(90deg, var(--wd-bg-tertiary) 25%, rgba(255,255,255,0.05) 50%, var(--wd-bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: wd-shimmer 1.5s infinite;
    border-radius: var(--wd-radius-sm);
}

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

.wd-skeleton-line { height: 14px; margin-bottom: 0.5rem; }
.wd-skeleton-line:last-child { width: 60%; }
.wd-skeleton-card { height: 100px; }

/* ---------- Keyboard Shortcut Overlay ---------- */
.wd-shortcuts-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.wd-shortcuts-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.wd-shortcuts-panel {
    background: var(--wd-bg-secondary);
    border: 1px solid var(--wd-border);
    border-radius: var(--wd-radius-lg);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--wd-shadow-lg);
}

.wd-shortcuts-panel h3 {
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.wd-shortcut-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.wd-shortcut-key {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.wd-shortcut-key kbd {
    background: var(--wd-bg-tertiary);
    border: 1px solid var(--wd-border);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.8rem;
    font-family: inherit;
    color: var(--wd-text-secondary);
}

/* ---------- Chat Panel ---------- */
/* Chat panel styles removed — chat is now inline on dashboard */

.wd-chat-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--wd-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.wd-chat-header h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wd-chat-header h4 i { color: var(--wd-accent); }

.wd-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wd-chat-msg {
    max-width: 90%;
    padding: 0.75rem 1rem;
    border-radius: var(--wd-radius-md);
    font-size: 0.85rem;
    line-height: 1.6;
}

.wd-chat-msg.user {
    align-self: flex-end;
    background: var(--wd-accent);
    color: white;
    border-bottom-right-radius: 4px;
}

.wd-chat-msg.assistant {
    align-self: flex-start;
    background: var(--wd-bg-tertiary);
    border: 1px solid var(--wd-border);
    border-bottom-left-radius: 4px;
}

.wd-chat-msg.assistant .markdown-content { font-size: 0.85rem; }

.wd-chat-typing {
    display: flex;
    gap: 4px;
    padding: 0.75rem 1rem;
    align-self: flex-start;
}

.wd-chat-typing span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--wd-text-muted);
    animation: wd-typing 1.4s infinite;
}

.wd-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.wd-chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes wd-typing {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

.wd-chat-input-area {
    padding: 1rem;
    border-top: 1px solid var(--wd-border);
    flex-shrink: 0;
}

.wd-chat-input-wrap {
    display: flex;
    gap: 0.5rem;
}

.wd-chat-input {
    flex: 1;
    background: var(--wd-bg-input);
    border: 1px solid var(--wd-border);
    border-radius: var(--wd-radius-sm);
    color: var(--wd-text-primary);
    padding: 0.65rem 0.75rem;
    font-size: 0.85rem;
    resize: none;
    font-family: inherit;
}

.wd-chat-input:focus {
    outline: none;
    border-color: var(--wd-border-active);
}

.wd-chat-send {
    background: var(--wd-accent);
    border: none;
    border-radius: var(--wd-radius);
    color: white;
    padding: 0.5rem 1.25rem;
    cursor: pointer;
    transition: all var(--wd-transition);
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.wd-chat-send:hover { background: var(--wd-accent-hover); transform: translateY(-1px); }
.wd-chat-send:active { transform: translateY(0); }

/* ---------- Breadcrumb ---------- */
.wd-breadcrumb {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.wd-breadcrumb a {
    color: var(--wd-text-muted);
    transition: color var(--wd-transition);
}

.wd-breadcrumb a:hover { color: var(--wd-text-accent); }

.wd-breadcrumb .separator { color: var(--wd-text-muted); }

.wd-breadcrumb .current { color: var(--wd-text-secondary); }

/* ---------- Tabs ---------- */
.wd-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--wd-border);
    margin-bottom: 1.25rem;
}

.wd-tab {
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--wd-text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--wd-transition);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.wd-tab:hover { color: var(--wd-text-primary); }
.wd-tab.active { color: var(--wd-accent); border-bottom-color: var(--wd-accent); }

/* ---------- Empty State ---------- */
.wd-empty {
    text-align: center;
    padding: 3rem 2rem;
}

.wd-empty-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--wd-text-primary);
    margin-bottom: 0.35rem;
}

.wd-empty-icon {
    font-size: 3rem;
    color: var(--wd-text-muted);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.wd-empty-text {
    color: var(--wd-text-secondary);
    font-size: 0.9rem;
    max-width: 300px;
    margin: 0 auto;
}

.wd-empty-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.wd-empty-suggestions {
    margin-top: 1rem;
    display: grid;
    gap: 0.5rem;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.wd-empty-suggestion {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--wd-text-muted);
    font-size: 0.82rem;
}

.wd-empty-suggestion i {
    color: var(--wd-text-secondary);
}

.wd-btn-sync {
    position: relative;
    animation: wd-sync-pulse 3s ease-in-out infinite;
}

.wd-btn-sync:hover { animation-play-state: paused; }

@keyframes wd-sync-pulse {
    0%, 100% { box-shadow: 0 0 0 rgba(15, 98, 254, 0); }
    50% { box-shadow: 0 0 12px rgba(15, 98, 254, 0.25); }
}

@media (prefers-reduced-motion: reduce) {
    .wd-btn-sync { animation: none; }
    .wd-pill { transition: color var(--wd-transition), background var(--wd-transition); }
    .wd-pill:hover { transform: none; box-shadow: none; }
}

/* ---------- Details Layout ---------- */
.wd-detail-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.25rem;
}

.wd-detail-sidebar .wd-card + .wd-card {
    margin-top: 1rem;
}

.wd-detail-meta dt {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wd-text-muted);
    margin-bottom: 0.2rem;
}

.wd-detail-meta dd {
    margin-bottom: 0.75rem;
    color: var(--wd-text-secondary);
}

/* ---------- Action Summary ---------- */
.wd-action-summary {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--wd-text-secondary);
    margin-top: 0.35rem;
    background: rgba(255,255,255,0.06);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--wd-border);
}

/* ---------- Priority Badges ---------- */
.wd-badge-priority {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.28rem 0.6rem;
}

.wd-badge-priority-urgent { background: rgba(239,68,68,0.22); color: #fecaca; border-color: rgba(239,68,68,0.45); box-shadow: 0 0 10px rgba(239,68,68,0.25); }
.wd-badge-priority-high { background: rgba(249,115,22,0.2); color: #fed7aa; border-color: rgba(249,115,22,0.35); }
.wd-badge-priority-medium { background: rgba(245,158,11,0.14); color: #fde68a; border-color: rgba(245,158,11,0.25); }
.wd-badge-priority-low { background: rgba(113,113,122,0.14); color: #a1a1aa; border-color: rgba(113,113,122,0.25); }

/* ---------- Repo Text ---------- */
.wd-repo {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* ---------- CTA Buttons ---------- */
.wd-btn-cta {
    box-shadow: var(--wd-shadow-glow);
    border-width: 1px;
}

/* ---------- Kanban ---------- */
.wd-kanban {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.wd-kanban-lane {
    min-width: 280px;
    flex: 1;
    background: var(--wd-glass-bg);
    border: 1px solid var(--wd-glass-border);
    border-radius: var(--wd-radius-lg);
    display: flex;
    flex-direction: column;
}

.wd-kanban-lane-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--wd-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 0.85rem;
}

.wd-kanban-lane-count {
    font-size: 0.72rem;
    background: rgba(255,255,255,0.06);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    color: var(--wd-text-muted);
}

.wd-kanban-lane-body {
    flex: 1;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    max-height: 400px;
}

.wd-kanban-card {
    background: var(--wd-bg-card);
    border: 1px solid var(--wd-border);
    border-radius: var(--wd-radius-md);
    padding: 0.75rem;
    transition: all var(--wd-transition);
    cursor: pointer;
    text-decoration: none;
    color: var(--wd-text-primary);
    display: block;
}

.wd-kanban-card:hover {
    border-color: var(--wd-border-hover);
    background: var(--wd-bg-card-hover);
    transform: translateY(-1px);
    box-shadow: var(--wd-shadow-md);
    color: var(--wd-text-primary);
}

.wd-kanban-card-title {
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    line-height: 1.4;
}

.wd-kanban-card-meta {
    font-size: 0.72rem;
    color: var(--wd-text-muted);
}

/* ---------- Sparkline ---------- */
.wd-sparkline {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 24px;
}

.wd-sparkline-bar {
    width: 4px;
    background: var(--wd-accent);
    border-radius: 2px 2px 0 0;
    opacity: 0.6;
    transition: opacity var(--wd-transition);
}

.wd-sparkline-bar:hover { opacity: 1; }

/* ---------- Theme Toggle ---------- */
.wd-theme-toggle {
    background: none;
    border: none;
    color: var(--wd-text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--wd-radius-sm);
    transition: all var(--wd-transition);
    font-size: 1rem;
}

.wd-theme-toggle:hover {
    color: var(--wd-text-primary);
    background: rgba(255,255,255,0.05);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .wd-sidebar {
        transform: translateX(-100%);
        width: var(--wd-sidebar-width);
    }
    .wd-sidebar.mobile-open { transform: translateX(0); }
    .wd-main { margin-left: 0 !important; padding: 1rem; }
    .wd-detail-grid { grid-template-columns: 1fr; }
    .wd-chat-panel { width: 100%; }
}

/* ---------- Animations ---------- */
.wd-fade-in {
    animation: wd-fadeIn 0.4s ease;
}

@keyframes wd-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Bootstrap overrides for dark theme */
.btn-group .btn { font-size: 0.78rem; }
.badge { font-weight: 500; }
.form-select, .form-control {
    background-color: var(--wd-bg-input);
    border-color: var(--wd-border);
    color: var(--wd-text-primary);
}
.form-select:focus, .form-control:focus {
    background-color: var(--wd-bg-input);
    border-color: var(--wd-border-active);
    color: var(--wd-text-primary);
    box-shadow: 0 0 0 3px var(--wd-accent-glow);
}
.form-label { color: var(--wd-text-secondary); font-size: 0.8rem; }
.form-text { color: var(--wd-text-muted); }
.text-muted { color: var(--wd-text-muted) !important; }
.text-warning { color: var(--wd-warning) !important; }
.alert { background: var(--wd-glass-bg); border-color: var(--wd-border); color: var(--wd-text-primary); }
.modal-content {
    background: var(--wd-bg-secondary);
    border: 1px solid var(--wd-border);
    color: var(--wd-text-primary);
}
.modal-header { border-bottom-color: var(--wd-border); }
.dropdown-menu {
    background: var(--wd-bg-secondary);
    border-color: var(--wd-border);
}
.dropdown-item { color: var(--wd-text-primary); }
.dropdown-item:hover { background: rgba(255,255,255,0.05); color: var(--wd-text-primary); }
.card { background: var(--wd-glass-bg); border-color: var(--wd-glass-border); }
.card-header { background: rgba(255,255,255,0.02); border-bottom-color: var(--wd-border); color: var(--wd-text-primary); }
.card-footer { background: rgba(255,255,255,0.02); border-top-color: var(--wd-border); }
.list-group-item {
    background: transparent;
    border-color: var(--wd-border);
    color: var(--wd-text-primary);
    padding: 0.9rem 1.1rem;
    transition: background var(--wd-transition), transform var(--wd-transition);
}
.list-group-item:hover, .list-group-item-action:hover {
    background: rgba(255,255,255,0.03);
    color: var(--wd-text-primary);
    transform: translateY(-1px) scale(1.01);
}

/* ---------- GitHub External Links ---------- */
/* Clearly distinct from card navigation */
.wd-github-link {
    color: var(--wd-text-muted);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    font-size: 0.72rem;
    transition: color var(--wd-transition);
}
.wd-github-link:hover {
    color: var(--wd-accent);
    text-decoration-style: solid;
}

/* ---------- Conv Config Chat ---------- */
.wd-conv-config {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    max-width: 800px;
    margin: 0 auto;
}

.wd-conv-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0; /* important for flex overflow */
}

.wd-conv-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0f62fe, #4589ff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.wd-conv-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 0;
    flex-shrink: 0;
}

.wd-conv-chip {
    background: var(--wd-bg-tertiary);
    border: 1px solid var(--wd-border);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: var(--wd-text-secondary);
    cursor: pointer;
    transition: all var(--wd-transition);
}

.wd-conv-chip:hover {
    background: var(--wd-accent-glow);
    border-color: var(--wd-accent);
    color: var(--wd-text-primary);
}

.wd-conv-input-area {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 0;
    border-top: 1px solid var(--wd-border);
    flex-shrink: 0;
    align-items: flex-end;
}

.wd-conv-input {
    flex: 1;
    background: var(--wd-bg-input);
    border: 1px solid var(--wd-border);
    border-radius: var(--wd-radius-md);
    padding: 0.75rem 1rem;
    color: var(--wd-text-primary);
    font-size: 0.95rem;
    resize: none;
    font-family: 'IBM Plex Sans', sans-serif;
    min-height: 48px;
    max-height: 150px;
    line-height: 1.5;
}

.wd-conv-input::placeholder {
    color: var(--wd-text-muted);
}

.wd-conv-input:focus {
    outline: none;
    border-color: var(--wd-accent);
    box-shadow: var(--wd-shadow-glow);
}

.wd-conv-send {
    background: var(--wd-accent);
    border: none;
    border-radius: var(--wd-radius-md);
    min-width: 48px;
    height: 48px;
    padding: 0 1rem;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'IBM Plex Sans', sans-serif;
    transition: background var(--wd-transition);
    flex-shrink: 0;
}

.wd-conv-send:hover {
    background: var(--wd-accent-hover);
}

.wd-conv-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Action cards inline in chat */
.wd-conv-action-card {
    background: var(--wd-bg-tertiary);
    border: 1px solid var(--wd-border);
    border-left: 3px solid var(--wd-success);
    border-radius: var(--wd-radius-md);
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.wd-conv-action-card .action-title {
    font-weight: 600;
    color: var(--wd-text-primary);
    margin-bottom: 0.25rem;
}

.wd-conv-action-card .action-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.wd-conv-action-card .action-links a {
    color: var(--wd-accent);
    text-decoration: underline;
    font-size: 0.8rem;
}
