:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background: var(--bg-dark);
    background-image:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
}

/* Auth Page */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.auth-card {
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.auth-card p {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: white;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Dashboard Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    padding: 2rem;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.main-content {
    padding: 2rem;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

.nav-link.active,
.nav-link:hover {
    color: white;
    background: rgba(99, 102, 241, 0.1);
}

.nav-link.active {
    color: var(--primary);
}

/* Kanban Board */
.kanban-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
    min-width: 1100px;
    /* Ensure 4 columns stay side-by-side on desktop */
}

.kanban-column {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 260px;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.column-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.task-list {
    flex: 1;
    min-height: 100px;
}

.task-card {
    padding: 1.25rem;
    margin-bottom: 1rem;
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.task-card:active {
    cursor: grabbing;
}

.task-card:hover {
    transform: scale(1.02);
}

.task-priority {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 100px;
    margin-bottom: 0.75rem;
    display: inline-block;
}

.status-todo {
    border-left: 4px solid var(--text-muted);
}

.status-in_progress {
    border-left: 4px solid var(--primary);
}

.status-done {
    border-left: 4px solid var(--success);
}

.status-failed {
    border-left: 4px solid var(--danger);
}

/* Project Management */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.project-card {
    padding: 1.5rem;
}

.asset-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.asset-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.875rem;
    gap: 1rem;
}

.asset-item span {
    flex: 1;
    word-break: break-all;
    line-height: 1.4;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
}

/* Header */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Mobile Navigation & Responsive Adjustments */
.mobile-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
}

@media (max-width: 1360px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 1000;
        background: var(--bg-dark);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-right: 1px solid var(--border);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .mobile-toggle {
        display: flex;
    }

    .kanban-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        min-width: auto;
    }

    .kanban-column {
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .header-top>div:first-child h1 {
        font-size: 1.5rem;
    }

    .user-profile {
        width: 100%;
        justify-content: space-between;
    }

    .main-content {
        padding: 1rem;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        width: 95%;
        padding: 1.5rem;
        margin: 10px;
    }

    .auth-card {
        max-width: 90%;
        padding: 2rem 1.5rem;
    }

    /* Table Responsiveness: Card View */
    .responsive-table table thead {
        display: none;
    }

    .responsive-table table,
    .responsive-table table tbody,
    .responsive-table table tr {
        display: block;
        width: 100%;
        height: auto !important;
    }

    .responsive-table table tr {
        display: flex;
        flex-wrap: wrap;
        margin-bottom: 1.5rem;
        border: 1px solid var(--border) !important;
        border-radius: 16px;
        padding: 0.5rem;
        background: rgba(255, 255, 255, 0.03);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        transition: transform 0.2s ease, background 0.2s ease;
        animation: fadeIn 0.4s ease-out forwards;
    }

    .responsive-table table tr:hover {
        background: rgba(255, 255, 255, 0.05);
        transform: translateY(-2px);
    }

    .responsive-table table td {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        justify-content: flex-end;
        flex: 1 1 50%;
        min-height: 5rem;
        padding: 1.25rem 1rem 0.75rem !important;
        position: relative;
        text-align: right;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    /* Important rows get full width */
    .responsive-table table td[data-label="Task"],
    .responsive-table table td[data-label="Action"],
    .responsive-table table td[data-label="Payment"] {
        flex: 1 1 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        align-items: flex-start;
        text-align: left;
        padding-top: 2.25rem !important;
    }

    .responsive-table table td[data-label="Action"] select {
        width: 100%;
        margin-top: 0.5rem;
    }

    .responsive-table table td:nth-last-child(-n+2) {
        border-bottom: none;
    }

    .responsive-table table td::before {
        content: attr(data-label);
        position: absolute;
        top: 0.85rem;
        left: 1rem;
        font-weight: 700;
        color: var(--primary);
        font-size: 0.6rem;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        opacity: 0.8;
    }

    /* Spacing for Task Title and Date */
    .responsive-table table td[data-label="Task"] div:first-child {
        font-size: 1.125rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
        color: var(--primary);
    }

    .responsive-table table td[data-label="Task"] div:last-child {
        font-size: 0.75rem;
        color: var(--text-muted);
    }

    /* Global Animations */
    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Filter Form Enhancements */
    .filter-form {
        flex-direction: column;
        align-items: stretch !important;
    }

    .filter-form>div {
        width: 100% !important;
        margin-bottom: 0.5rem;
    }

    .filter-form-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        width: 100%;
        margin-top: 1rem;
    }

    .filter-form-buttons .btn {
        width: 100% !important;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    /* Fix status indicators in card view */
    .status-todo,
    .status-in_progress,
    .status-done,
    .status-failed {
        border-left: none;
        border-top: 4px solid;
    }
}

/* Mobile Quick Move Control */
.mobile-move-control {
    display: none;
}

@media (max-width: 1360px) {
    .mobile-move-control {
        display: block;
    }
}

@media (max-width: 480px) {
    .auth-card h1 {
        font-size: 1.75rem;
    }

    .btn {
        padding: 0.65rem;
        font-size: 0.875rem;
    }

    .sidebar {
        width: 100%;
        left: -100%;
    }
}