:root {
    --mp-primary: #6366f1;
    --mp-primary-hover: #4f46e5;
    --mp-secondary: #64748b;
    --mp-bg: #0f172a;
    --mp-sidebar-bg: #1e293b;
    --mp-card-bg: #1e293b;
    --mp-text: #f1f5f9;
    --mp-text-muted: #94a3b8;
    --mp-border: #334155;
    --mp-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.2);
    --mp-radius: 0.75rem;
}

.mp-dashboard {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--mp-text);
    background: var(--mp-bg);
    border-radius: var(--mp-radius);
    overflow: hidden;
    height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--mp-shadow);
    margin: 2rem 0;
}

/* Header */
.mp-header {
    background: var(--mp-sidebar-bg);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--mp-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mp-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mp-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.mp-header-right {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

#mp-search {
    padding: 0.5rem 1rem;
    border: 1px solid var(--mp-border);
    border-radius: 9999px;
    outline: none;
    font-size: 0.875rem;
    width: 250px;
    background: var(--mp-bg);
    color: var(--mp-text);
}

/* Layout */
.mp-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.mp-sidebar {
    width: 260px;
    background: var(--mp-sidebar-bg);
    border-right: 1px solid var(--mp-border);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: width 0.3s ease;
}

.mp-sidebar.collapsed {
    width: 0;
    overflow: hidden;
    border-right: none;
}

.mp-sidebar-content {
    padding: 1.5rem;
}

.mp-sidebar-section {
    margin-bottom: 2rem;
}

.mp-sidebar-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mp-text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mp-sidebar-section h3 button {
    background: none;
    border: none;
    color: var(--mp-primary);
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
}

.mp-sidebar-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mp-sidebar-section li {
    margin-bottom: 0.25rem;
}

.mp-sidebar-section a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    color: var(--mp-text);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.mp-sidebar-section a:hover,
.mp-sidebar-section li.active a {
    background: #f1f5f9;
    color: var(--mp-primary);
}

.mp-sidebar-toggle {
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: #fff;
    border: 1px solid var(--mp-border);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

/* Main Area */
.mp-main {
    flex: 1;
    overflow-x: auto;
    background: var(--mp-bg);
}

.mp-kanban-container {
    padding: 1.5rem;
    height: 100%;
    display: flex;
    gap: 1.5rem;
    min-width: min-content;
}

.mp-no-project-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    color: var(--mp-text-muted);
}

/* Kanban Board */
.mp-kanban-column {
    width: 300px;
    background: #1a2332;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.mp-column-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mp-column-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.mp-task-list {
    flex: 1;
    padding: 0.75rem;
    overflow-y: auto;
    min-height: 50px;
}

/* Task Card */
.mp-task-card {
    background: var(--mp-card-bg);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    cursor: grab;
    border: 1px solid var(--mp-border);
    transition: transform 0.1s, box-shadow 0.1s;
    position: relative;
    color: var(--mp-text);
}

.mp-task-card:hover {
    box-shadow: var(--mp-shadow);
}

.mp-task-card.dragging {
    opacity: 0.5;
}

.mp-task-priority {
    width: 4px;
    position: absolute;
    left: 0;
    top: 1rem;
    bottom: 1rem;
    border-radius: 0 2px 2px 0;
}

.mp-priority-low {
    background: #10b981;
}

.mp-priority-medium {
    background: #f59e0b;
}

.mp-priority-high {
    background: #ef4444;
}

.mp-task-card h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--mp-text);
}

.mp-task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--mp-text-muted);
}

/* Buttons */
.mp-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    background: var(--mp-primary);
    color: #fff;
    white-space: nowrap;
}

.mp-btn:hover:not(:disabled) {
    background: var(--mp-primary-hover);
}

.mp-btn-primary {
    background: var(--mp-primary);
    color: #fff;
}

.mp-btn-primary:hover:not(:disabled) {
    background: var(--mp-primary-hover);
}

.mp-btn-secondary {
    background: var(--mp-primary);
    color: #fff;
}

.mp-btn-secondary:hover {
    background: var(--mp-primary-hover);
}

.mp-btn-danger {
    background: #ef4444;
    color: #fff;
}

.mp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modals */
.mp-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    overflow-y: auto;
    padding: 1rem 0;
}

.mp-modal-content {
    background-color: var(--mp-sidebar-bg);
    margin: 2rem auto;
    padding: 1.5rem;
    border-radius: var(--mp-radius);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.3);
    color: var(--mp-text);
}

.mp-modal-content h2 {
    margin-top: 0;
    color: var(--mp-text);
}

@media (max-width: 640px) {
    .mp-modal-content {
        margin: 1rem;
        padding: 1rem;
        width: calc(100% - 2rem);
        max-width: 100%;
        max-height: 95vh;
    }
}

.mp-modal-close {
    color: var(--mp-text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.mp-modal-close:hover {
    color: var(--mp-text);
}

/* Forms */
.mp-form-group {
    margin-bottom: 1.25rem;
}

.mp-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.mp-form-group input[type="text"],
.mp-form-group textarea,
.mp-form-group select {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--mp-border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    outline: none;
    background: var(--mp-bg);
    color: var(--mp-text);
}

.mp-form-group input[type="text"]:focus,
.mp-form-group textarea:focus,
.mp-form-group select:focus {
    border-color: var(--mp-primary);
}

.mp-form-group input[type="date"] {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--mp-border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    outline: none;
    background: var(--mp-bg);
    color: var(--mp-text);
}

.mp-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .mp-form-row {
        grid-template-columns: 1fr;
    }
}

.mp-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
}

.mp-column-config-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mp-column-config-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.mp-column-config-item input {
    flex: 1;
}

.mp-remove-col {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
}

.mp-btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.mp-subtasks-container {
    margin-top: 0.5rem;
    border-top: 1px dashed var(--mp-border);
    padding-top: 0.5rem;
}

.mp-attachments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0.5rem 0;
}

.mp-attachment-item {
    width: 60px;
    position: relative;
    border: 1px solid var(--mp-border);
    border-radius: 0.25rem;
    padding: 2px;
}

.mp-attachment-item img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 0.125rem;
}

.mp-attachment-item span {
    display: none;
}

.mp-remove-attachment {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hamburger button (hidden on desktop) */
.mp-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    margin-right: 0.5rem;
}

@media (max-width: 768px) {
    /* Dashboard - remove fixed height */
    .mp-dashboard {
        height: auto;
        min-height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    /* Header adjustments */
    .mp-header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .mp-header-right {
        order: 3;
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    /* Hide search on mobile header - it's shown below */
    #mp-search {
        width: 100%;
        order: 2;
        margin: 0.5rem 0;
        grid-column: 1 / -1;
    }

    /* Make buttons smaller and touch-friendly on mobile */
    .mp-btn {
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Export link as button */
    #mp-export-csv {
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
    }

    /* Show hamburger button */
    .mp-menu-toggle {
        display: flex;
    }

    /* Sidebar becomes off-canvas drawer */
    .mp-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 80%;
        max-width: 300px;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        border-right: 1px solid var(--mp-border);
    }

    .mp-sidebar.open {
        transform: translateX(0);
    }

    /* Backdrop overlay */
    .mp-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .mp-backdrop.visible {
        display: block;
    }

    /* Hide desktop toggle button */
    .mp-sidebar-toggle {
        display: none;
    }

    /* Sidebar close button */
    .mp-sidebar-close {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 1rem;
        background: #0f172a;
        border-bottom: 1px solid var(--mp-border);
        font-size: 0.875rem;
        color: var(--mp-text);
    }

    .mp-sidebar-content {
        padding-top: 0;
    }

    /* Kanban container - horizontal scroll */
    .mp-kanban-container {
        padding: 1rem;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .mp-kanban-column {
        min-width: 280px;
        scroll-snap-align: start;
    }

    /* Hide scrollbar */
    .mp-kanban-container::-webkit-scrollbar {
        display: none;
    }
    .mp-kanban-container {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

@media (min-width: 769px) {
    .mp-sidebar-close {
        display: none;
    }
}