:root {
    --bg-color: #0f1015;
    --sidebar-bg: #16171d;
    --content-bg: #1c1e26;
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --text-color: #e2e8f0;
    --text-muted: #94a3b8;
    --border-color: #2d3748;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    font-family: inherit;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    transition: width 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 40px;
}

.logo i {
    width: 24px;
    height: 24px;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: var(--text-muted);
    transition: all 0.2s ease;
    cursor: pointer;
    font-weight: 500;
}

.sidebar nav li:hover {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--text-color);
}

.sidebar nav li.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sidebar nav li i {
    width: 18px;
    height: 18px;
}

.user-profile {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #1e293b;
    font-size: 0.9rem;
}

.user-profile .info {
    display: flex;
    flex-direction: column;
}

.user-profile .name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-profile .role {
    font-size: 0.75rem;
    color: var(--text-muted);
}


/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
    padding: 0;
    overflow: hidden;
    position: relative;
}

.top-bar {
    height: 80px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(15, 16, 21, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--content-bg);
    padding: 8px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    width: 300px;
    transition: border-color 0.2s;
}

.search-bar:focus-within {
    border-color: var(--primary-color);
}

.search-bar input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-family: inherit;
    width: 100%;
}

.search-bar i {
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-primary:active {
    transform: scale(0.98);
}

.task-board {
    padding: 32px;
    flex: 1;
    overflow-y: auto;
}

.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.board-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

.view-options {
    display: flex;
    gap: 8px;
}

.view-options button {
    padding: 8px;
    border-radius: 8px;
    color: var(--text-muted);
    transition: 0.2s;
}

.view-options button.active,
.view-options button:hover {
    background-color: var(--content-bg);
    color: var(--text-color);
}

.view-options i {
    width: 20px;
    height: 20px;
}

/* Task List */
.task-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding-bottom: 40px;
}

.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-muted);
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.task-card {
    background-color: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.task-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--primary-color);
}

.task-card[data-priority="high"]::before {
    background-color: #ef4444;
}

.task-card[data-priority="medium"]::before {
    background-color: #f59e0b;
}

.task-card[data-priority="low"]::before {
    background-color: #10b981;
}

.task-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.3);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.task-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 4px;
}

.task-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    /* Fixed lint error */
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* Auth Styles */
.auth-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: grid;
    place-items: center;
    visibility: hidden;
    opacity: 0;
    transition: all 0.4s ease;
    background:
        radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.2), transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(16, 185, 129, 0.16), transparent 42%),
        linear-gradient(160deg, #0d111b 0%, #141a2a 55%, #1a1d2e 100%);
}

.auth-wrapper.active {
    visibility: visible;
    opacity: 1;
}

.auth-container {
    width: 100%;
    max-width: 980px;
    padding: 24px;
}

.auth-card {
    display: grid;
    grid-template-columns: 1fr 420px;
    min-height: 560px;
    background: rgba(28, 30, 38, 0.86);
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 24px;
    overflow: hidden;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-lg);
}

.auth-visual {
    padding: 56px;
    border-right: 1px solid rgba(148, 163, 184, 0.2);
    background:
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.32), transparent 35%),
        radial-gradient(circle at 80% 80%, rgba(34, 197, 94, 0.2), transparent 38%);
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: #f8fafc;
}

.logo-icon {
    width: 42px;
    height: 42px;
    color: var(--primary-color);
}

.auth-visual h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1.12;
    margin-bottom: 18px;
}

.auth-visual p {
    max-width: 470px;
    color: #cbd5e1;
    margin-bottom: 26px;
}

.auth-highlights {
    list-style: none;
    display: grid;
    gap: 12px;
    color: #e2e8f0;
}

.auth-highlights li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-highlights i {
    color: #22c55e;
}

.auth-panel {
    padding: 38px 34px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-header {
    margin-bottom: 16px;
    text-align: center;
}

.auth-header .logo-icon {
    width: 46px;
    height: 46px;
    margin-bottom: 10px;
}

.auth-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 6px;
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.15);
    margin-bottom: 18px;
}

.auth-tabs .tab {
    text-align: center;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 8px 0;
    border-radius: 8px;
    color: #cbd5e1;
    transition: all 0.2s ease;
}

.auth-tabs .tab.active {
    color: #ffffff;
    background: rgba(99, 102, 241, 0.38);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.password-input-wrap {
    position: relative;
}

.password-input-wrap input {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    transition: 0.2s;
}

.password-toggle:hover {
    color: #fff;
    background: rgba(148, 163, 184, 0.2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.w-full {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
    min-height: 44px;
}

.auth-footer {
    margin-top: 18px;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}

.auth-footer a {
    color: var(--primary-color);
    font-weight: 600;
    transition: 0.2s;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-trust-note {
    margin-top: 14px;
    font-size: 0.8rem;
    text-align: center;
    color: #94a3b8;
}

.auth-trust-note i {
    color: #22c55e;
    margin-right: 6px;
}

/* Profile Dropdown Improvements */
.user-profile.dropdown {
    position: relative;
    cursor: pointer;
    padding: 12px;
    border: 1px solid transparent;
}

.user-profile.dropdown:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
}

.dropdown-arrow {
    margin-left: auto;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.user-profile.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    bottom: 100%;
    left: 10px;
    right: 10px;
    margin-bottom: 10px;
    background: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
    display: none;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.dropdown-menu.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    padding: 10px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
    font-size: 0.9rem;
    transition: 0.2s;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.dropdown-item i {
    width: 16px;
    height: 16px;
}

.dropdown-item.logout {
    color: #ef4444;
}

.dropdown-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px;
}

/* View Sections */
.view-section {
    padding: 32px;
    flex: 1;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.profile-card {
    background: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    margin: 0 auto;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--content-bg);
    width: 500px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    position: relative;
    padding: 24px;
    transform: scale(0.95);
    transition: transform 0.3s;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.close-modal {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-muted);
    transition: 0.2s;
}

.close-modal:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea,
.form-group select {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    color: white;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 10px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    min-width: 100px;
}

.btn-secondary:hover {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 16px;
        flex-direction: row;
        justify-content: space-between;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .sidebar nav {
        display: none;
    }

    /* Hide heavy nav on mobile for simplicity in this demo */
    .user-profile {
        display: none;
    }

    .main-content {
        height: calc(100vh - 70px);
    }

    .task-list {
        grid-template-columns: 1fr;
    }

    .auth-container {
        padding: 12px;
    }

    .auth-card {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .auth-visual {
        padding: 24px 22px;
        border-right: none;
        border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    }

    .auth-visual h1 {
        font-size: 1.7rem;
    }

    .auth-panel {
        padding: 24px 20px 20px;
    }
}

/* User Search Dropdown */
.search-input-wrapper {
    position: relative;
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    z-index: 1002;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.search-results-dropdown.active {
    display: flex;
}

.search-result-item {
    padding: 10px 12px;
    cursor: pointer;
    transition: 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.search-result-item .user-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
}

.search-result-item .user-email {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Task Card Enhancements */
.task-card.completed {
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.1);
}

.strikethrough {
    text-decoration: line-through;
    color: var(--text-muted);
}

.complete-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-muted);
    transition: 0.2s;
    margin-top: 4px;
}

.complete-toggle:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.complete-toggle.active {
    color: #10b981;
}

/* Status Select Badge Style */
.status-badge-select {
    appearance: none;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
    text-transform: uppercase;
    outline: none;
    background-color: transparent;
    border: 1px solid transparent;
}

.status-badge-select option {
    background-color: #1e1e2d;
    color: white;
    text-transform: capitalize;
}

.status-badge-select.pending {
    background: rgba(239, 68, 68, 0.15);
    /* Red background */
    color: #ef4444;
    /* Red text */
    border-color: rgba(239, 68, 68, 0.2);
}

.status-badge-select.in_progress {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
    border-color: rgba(99, 102, 241, 0.2);
}

.status-badge-select.completed {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.2);
}

.status-badge-select:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.action-btn {
    opacity: 0.8 !important;
    color: var(--text-muted);
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.action-btn.delete {
    color: #ef4444;
    /* Force red for delete icons */
}

.action-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.action-btn.clone:hover {
    color: #10b981;
    /* Green for clone */
}

/* Priority Badges */
.priority-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.priority-badge.high {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.priority-badge.medium {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.priority-badge.low {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}