:root {
    --primary-blue: #2563EB;
    --primary-hover: #1D4ED8;
    --danger-red: #DC2626;
    --danger-bg: #FEE2E2;
    --success-green: #10B981;
    --success-bg: #D1FAE5;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --bg-body: #F9FAFB;
    --bg-white: #FFFFFF;
    --border-color: #E5E7EB;
    --sidebar-width: 260px;
    --header-height: 64px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    font-size: 14px;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Icons (using text fallback or SVGs in HTML) */

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
}

.brand-logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-blue);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-new-task {
    background-color: var(--primary-blue);
    color: white;
    font-weight: 600;
    padding: 0.75rem;
    border-radius: 0.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
    display: block;
    border: none;
    width: 100%;
}

.btn-new-task:hover {
    background-color: var(--primary-hover);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-item:hover,
.nav-item.active {
    background-color: #EFF6FF;
    color: var(--primary-blue);
}

.nav-item svg {
    width: 20px;
    height: 20px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header Area in Main Content */
.main-header {
    background-color: var(--bg-white);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.btn-outline {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
}

.btn-outline:hover {
    background-color: #F3F4F6;
}

/* Dashboard Specifics */
.dashboard-content {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.filter-chip {
    padding: 0.4rem 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    font-size: 0.85rem;
    white-space: nowrap;
    cursor: pointer;
    color: var(--text-muted);
}

.filter-chip.active {
    background-color: var(--text-main);
    color: white;
    border-color: var(--text-main);
}

.filter-chip .count {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    padding: 0 0.4rem;
    margin-left: 0.4rem;
    font-size: 0.75rem;
}

.filter-chip:not(.active) .count {
    background: #E5E7EB;
    color: var(--text-muted);
}

.search-container {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

.search-container input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 0.95rem;
}

/* Task Cards */
.task-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border-left: 4px solid transparent;
    /* Potential priority indicator */
}

.task-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.task-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #E0E7FF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary-blue);
}

.task-info {
    flex: 1;
}

.task-meta-top {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.task-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.task-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    text-transform: uppercase;
}

.tag-danger {
    background: var(--danger-bg);
    color: var(--danger-red);
}

.tag-neutral {
    background: #F3F4F6;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.tag-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--danger-red);
    font-weight: 500;
}

.progress-section {
    margin-top: 1rem;
}

.progress-bar-bg {
    height: 6px;
    background: #F3F4F6;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--danger-red);
    border-radius: 3px;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Modal / Create Task Form */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
    /* Ensure it fits on screen vertically */
    overflow-y: auto;
    /* Scroll if too tall */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Form Elements */
.form-input,
.form-textarea,
.form-select {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-family: inherit;
    margin-bottom: 1rem;
}

.form-input:focus {
    outline: 2px solid var(--primary-blue);
    border-color: transparent;
}

/* Chat */
.chat-container {
    display: flex;
    height: 100%;
    background: white;
}

.chat-list {
    width: 300px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.chat-list-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.chat-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-item:hover,
.chat-item.active {
    background: #EFF6FF;
}

.chat-avatar-icon {
    width: 36px;
    height: 36px;
    background: #DBEAFE;
    color: var(--primary-blue);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.chat-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #FCFCFD;
}

.chat-box-header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    font-weight: 700;
    font-size: 1.1rem;
}

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

.chat-input-wrapper {
    background: white;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.chat-input-row {
    background: #F3F4F6;
    border-radius: 2rem;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-input-field {
    background: transparent;
    border: none;
    outline: none;
    flex: 1;
    padding: 0.5rem;
    font-size: 0.95rem;
}

.btn-send {
    background: var(--primary-blue);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-bubble {
    max-width: 60%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
}

.message-bubble.other {
    background: white;
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 0;
}

.message-bubble.mine {
    background: var(--primary-blue);
    color: white;
    border-bottom-right-radius: 0;
    align-self: flex-end;
}

/* Fix for Dropdown/Select Scroll Issues */
.dropdown-menu,
.dropdown-content,
.select-items,
.select-dropdown,
[class*="dropdown-list"],
.custom-select-options {
    max-height: 250px !important;
    overflow-y: auto !important;
    z-index: 99999 !important;
    position: absolute;
    /* Find-tuning position usually helps */
}

/* Ensure modal contents allow overflow if needed, or handle z-index properly */
.modal-card {
    overflow-y: auto;
    /* Ensure the modal itself scrolls */
}

/* If using a specific library class for the group selection, target it here */
.group-select-dropdown {
    max-height: 200px;
    overflow-y: auto;
}

/* Login Page Styles */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #F3F4F6;
    padding: 1rem;
}

.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.875rem;
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.alert-error {
    background-color: var(--danger-bg);
    color: var(--danger-red);
    border: 1px solid #FECACA;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .login-card {
        padding: 1.5rem;
        box-shadow: none;
        background: transparent;
    }

    .login-container {
        background: white;
        align-items: flex-start;
        padding-top: 3rem;
    }

    .login-header h1 {
        font-size: 1.75rem;
    }

    /* Dashboard Mobile Responsiveness - BOTTOM NAV LAYOUT */
    .sidebar,
    .btn-outline.mobile-only,
    #sidebarOverlay {
        display: none !important;
    }

    .main-content {
        width: 100% !important;
        margin-left: 0 !important;
    }

    /* Adjust main header for mobile */
    .main-header {
        padding: 0.75rem 1rem;
    }

    .page-title {
        font-size: 1.1rem;
    }

    /* Adjust dashboard content padding */
    .dashboard-content {
        padding: 1rem;
        padding-bottom: 80px;
        /* Space for bottom nav */
    }

    .mobile-only {
        display: block !important;
    }

    .desktop-only {
        display: none !important;
    }

    /* Bottom Navigation Styles */
    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: white;
        border-top: 1px solid #E5E7EB;
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding: 0.5rem 0;
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    }

    .bottom-nav .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: #6B7280;
        font-size: 0.7rem;
        gap: 0.2rem;
    }

    .bottom-nav .nav-item.active {
        color: var(--primary-blue);
    }

    .bottom-nav .nav-icon {
        width: 24px;
        height: 24px;
    }

    .bottom-nav .nav-item-fab {
        position: relative;
        top: -1.5rem;
    }


    .bottom-nav .fab-circle {
        width: 50px;
        height: 50px;
        background: var(--primary-blue);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4);
        border: 4px solid white;
    }

    /* Modal Mobile Adjustments */
    .modal-card {
        padding: 1.5rem;
        width: 95%;
    }
}