/* ==========================================================================
   DEVTRACK MODERN DARK THEME (Linear / Vercel / GitHub inspired)
   ========================================================================== */

:root {
    --bg-base: #090d16;
    --bg-surface: #0f172a;
    --bg-card: #141e33;
    --bg-card-hover: #1a2742;
    --bg-input: #0b1120;
    --bg-overlay: rgba(5, 8, 15, 0.75);

    --border-subtle: #1e293b;
    --border-strong: #334155;
    --border-focus: #3b82f6;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #090d16;

    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-indigo: #6366f1;
    --accent-purple: #8b5cf6;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-cyan: #06b6d4;

    --badge-bg-assigned: rgba(100, 116, 139, 0.18);
    --badge-text-assigned: #cbd5e1;
    --badge-border-assigned: rgba(148, 163, 184, 0.3);

    --badge-bg-progress: rgba(245, 158, 11, 0.15);
    --badge-text-progress: #fbbf24;
    --badge-border-progress: rgba(245, 158, 11, 0.35);

    --badge-bg-verify: rgba(139, 92, 246, 0.15);
    --badge-text-verify: #c084fc;
    --badge-border-verify: rgba(139, 92, 246, 0.35);

    --badge-bg-done: rgba(16, 185, 129, 0.15);
    --badge-text-done: #34d399;
    --badge-border-done: rgba(16, 185, 129, 0.35);

    --badge-bg-blocker: rgba(244, 63, 94, 0.18);
    --badge-text-blocker: #fb7185;
    --badge-border-blocker: rgba(244, 63, 94, 0.35);

    --badge-bg-urgent: rgba(249, 115, 22, 0.18);
    --badge-text-urgent: #fb923c;
    --badge-border-urgent: rgba(249, 115, 22, 0.35);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.15);

    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', "Fira Code", monospace;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* -------------------------------------------------------------
   AUTH LAYOUT (Login & Register)
   ------------------------------------------------------------- */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at 50% 20%, #152238 0%, #090d16 65%);
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    animation: fadeIn 0.4s ease-out;
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
    margin-bottom: 12px;
}

.brand-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg-base);
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border: 1px solid var(--border-subtle);
}

.auth-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

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

.auth-footer {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.auth-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border-subtle);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

/* -------------------------------------------------------------
   FORM CONTROLS & BUTTONS
   ------------------------------------------------------------- */
.form-group {
    margin-bottom: 16px;
}

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

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.form-label span.required {
    color: var(--accent-rose);
}

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

.input-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.form-control {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
}

.input-wrapper .form-control {
    padding-left: 38px;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background-color: #0d1527;
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
    font-family: var(--font-mono);
    line-height: 1.5;
}

select.form-control {
    appearance: none;
    background-image: 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' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-primary {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-strong);
}

.btn-danger {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
    border-color: rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
    background: var(--accent-rose);
    color: #ffffff;
}

.btn-block {
    width: 100%;
}

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

/* -------------------------------------------------------------
   ALERT BOX & TOASTS
   ------------------------------------------------------------- */
.alert-box {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.4;
}

.alert-danger {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

#toastContainer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-msg {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    animation: slideInRight 0.3s ease-out;
}

.toast-msg.toast-success {
    border-left: 4px solid var(--accent-emerald);
}

.toast-msg.toast-error {
    border-left: 4px solid var(--accent-rose);
}

.toast-msg.toast-info {
    border-left: 4px solid var(--accent-blue);
}

/* -------------------------------------------------------------
   MAIN WORKSPACE LAYOUT
   ------------------------------------------------------------- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Left Sidebar */
.app-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: all 0.3s ease;
}

.sidebar-brand {
    padding: 20px 20px 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.sidebar-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.sidebar-badge {
    font-size: 10px;
    font-weight: 700;
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 2px 6px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.sidebar-section {
    padding: 16px 14px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px 10px 8px;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}

.sidebar-icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sidebar-icon-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.project-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.project-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.project-nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.project-nav-item.active {
    background: var(--bg-card);
    border-color: var(--border-strong);
    color: #ffffff;
    font-weight: 600;
}

.project-nav-item.active .project-icon {
    color: var(--accent-blue);
}

.project-info-group {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.project-icon {
    flex-shrink: 0;
    color: var(--text-muted);
}

.project-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}

.project-count {
    font-family: var(--font-mono);
    font-size: 11px;
    background: rgba(30, 41, 59, 0.7);
    color: var(--text-secondary);
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

/* Sidebar User Footer */
.sidebar-user {
    padding: 14px 16px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-base);
}

.user-profile-group {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #3b82f6, #10b981);
    color: #fff;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.user-meta {
    overflow: hidden;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* Main Content Area */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-x: hidden;
}

/* Header */
.app-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.project-title-large {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.tab-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-base);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--bg-card);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

/* Workspace Views Container */
.workspace-content {
    padding: 28px;
    flex: 1;
    overflow-y: auto;
}

/* -------------------------------------------------------------
   TAB A: PANNELLO STATISTICHE (DASHBOARD)
   ------------------------------------------------------------- */
.stats-grid-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: transform 0.2s, border-color 0.2s;
}

.kpi-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.kpi-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
    margin-top: 4px;
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.kpi-icon.amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.kpi-icon.emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.kpi-icon.purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }

.stats-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 20px;
}

.chart-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.chart-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-canvas-container {
    position: relative;
    width: 100%;
    min-height: 240px;
    max-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* -------------------------------------------------------------
   TAB B: VISTA ELENCO (LIST VIEW)
   ------------------------------------------------------------- */
.list-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.search-filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.search-input-wrapper {
    position: relative;
    min-width: 260px;
}

.table-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}

.data-table th {
    background: var(--bg-card);
    padding: 12px 16px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    vertical-align: middle;
}

.data-table tbody tr {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
    background-color: var(--bg-card-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.task-title-cell {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
}

/* Stati */
.badge-assigned { background: var(--badge-bg-assigned); color: var(--badge-text-assigned); border-color: var(--badge-border-assigned); }
.badge-assigned .badge-dot { background: var(--badge-text-assigned); }

.badge-progress { background: var(--badge-bg-progress); color: var(--badge-text-progress); border-color: var(--badge-border-progress); }
.badge-progress .badge-dot { background: var(--badge-text-progress); }

.badge-verify { background: var(--badge-bg-verify); color: var(--badge-text-verify); border-color: var(--badge-border-verify); }
.badge-verify .badge-dot { background: var(--badge-text-verify); }

.badge-done { background: var(--badge-bg-done); color: var(--badge-text-done); border-color: var(--badge-border-done); }
.badge-done .badge-dot { background: var(--badge-text-done); }

/* Gravità */
.badge-blocker { background: var(--badge-bg-blocker); color: var(--badge-text-blocker); border-color: var(--badge-border-blocker); }
.badge-urgent { background: var(--badge-bg-urgent); color: var(--badge-text-urgent); border-color: var(--badge-border-urgent); }
.badge-media { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border-color: rgba(59, 130, 246, 0.3); }
.badge-bassa { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border-color: rgba(148, 163, 184, 0.3); }

/* Tipo */
.badge-feature { background: rgba(99, 102, 241, 0.15); color: #818cf8; border-color: rgba(99, 102, 241, 0.35); }
.badge-bug { background: rgba(239, 68, 68, 0.15); color: #f87171; border-color: rgba(239, 68, 68, 0.35); }

/* -------------------------------------------------------------
   TAB C: VISTA KANBAN (KANBAN BOARD)
   ------------------------------------------------------------- */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: flex-start;
}

.kanban-column {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    min-height: 520px;
    transition: border-color 0.2s, background-color 0.2s;
}

.kanban-column.drag-over {
    border-color: var(--accent-blue);
    background: #111a2e;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.kanban-header {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
}

.kanban-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kanban-column-title {
    font-size: 14px;
    font-weight: 700;
}

.kanban-counter {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    color: var(--text-secondary);
}

.kanban-cards-container {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 440px;
    flex: 1;
}

.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: grab;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

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

.kanban-card.dragging {
    opacity: 0.4;
    cursor: grabbing;
    transform: scale(0.98);
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.card-id {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.4;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.card-assignee {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.card-attachments-count {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

/* -------------------------------------------------------------
   MODALS & DIALOGS
   ------------------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-overlay);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

.modal-dialog {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: slideUp 0.25s ease-out;
}

.modal-dialog-large {
    max-width: 860px;
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    background: var(--bg-card);
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

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

/* -------------------------------------------------------------
   DRAG & DROP FILE UPLOAD AREA
   ------------------------------------------------------------- */
.dropzone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-md);
    padding: 24px 16px;
    text-align: center;
    background: var(--bg-input);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent-blue);
    background: #0e172a;
}

.dropzone-icon {
    color: var(--accent-blue);
    margin-bottom: 8px;
}

.dropzone-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.dropzone-subtext {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.attachment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.attachment-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

/* -------------------------------------------------------------
   MARKDOWN PREVIEW & CODE SNIPPETS
   ------------------------------------------------------------- */
.markdown-body {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 13.5px;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    margin-top: 16px;
    margin-bottom: 8px;
    color: #ffffff;
    font-weight: 700;
}

.markdown-body h1 { font-size: 18px; border-bottom: 1px solid var(--border-subtle); padding-bottom: 4px; }
.markdown-body h2 { font-size: 15px; }
.markdown-body h3 { font-size: 14px; }

.markdown-body p {
    margin-bottom: 10px;
}

.markdown-body ul, .markdown-body ol {
    padding-left: 20px;
    margin-bottom: 10px;
}

.markdown-body li {
    margin-bottom: 4px;
}

.markdown-body code {
    font-family: var(--font-mono);
    font-size: 12px;
    background: rgba(30, 41, 59, 0.8);
    color: #e2e8f0;
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

.markdown-body pre {
    background: #080c14;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    overflow-x: auto;
    margin-bottom: 12px;
    position: relative;
}

.markdown-body pre code {
    background: transparent;
    padding: 0;
    border: none;
    font-size: 12.5px;
    color: #f1f5f9;
}

.markdown-body blockquote {
    border-left: 3px solid var(--accent-blue);
    padding-left: 12px;
    color: var(--text-secondary);
    margin: 10px 0;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .kanban-board {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }
    .app-sidebar {
        width: 100%;
        min-width: 100%;
    }
    .stats-charts-grid {
        grid-template-columns: 1fr;
    }
}
