:root {
    --sidebar-width: 280px;
    --dashboard-bg: #f8fafc;
}

body.dashboard-page {
    background-color: var(--dashboard-bg);
}

.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid #e2e8f0;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-logo {
    margin-bottom: 3rem;
}

.sidebar-nav {
    list-style: none;
    flex: 1;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-footer {
    padding-top: 2rem;
    border-top: 1px solid #f1f5f9;
}

/* Main Content */
.dashboard-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem 3rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.stat-card .label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

.stat-card .value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
}

/* Data Table / List */
.dashboard-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
}

.data-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.status-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.status-badge.upcoming {
    background: #e0f2fe;
    color: #0369a1;
}

.status-badge.completed {
    background: #dcfce7;
    color: #15803d;
}

.status-badge.pending {
    background: #fef9c3;
    color: #854d0e;
}

/* CHAT STYLES */
.chat-container {
    display: flex;
    height: 70vh;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.chat-sidebar {
    width: 300px;
    border-right: 1px solid #f1f5f9;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
}

.chat-search {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.chat-search input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: var(--white);
}

.chat-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    margin: 0;
    padding: 0;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f1f5f9;
    border-left: 4px solid transparent;
}

.chat-item:hover,
.chat-item.active {
    background: var(--white);
    border-left: 4px solid var(--primary);
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
    flex-shrink: 0;
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-info h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.chat-info p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: auto;
    flex-shrink: 0;
}

.chat-window {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    background: var(--white);
}

.chat-header-info {
    margin-left: 10px;
}

.chat-header-info h3 {
    margin: 0;
    font-size: 1rem;
}

.status-indicator {
    font-size: 0.8rem;
    color: #10b981;
}

.status-indicator.online::before {
    content: '\25cf';
    margin-right: 4px;
}

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

.message {
    max-width: 70%;
    padding: 1rem;
    border-radius: 12px;
    position: relative;
    font-size: 0.9rem;
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message p {
    margin: 0;
}

.message.received {
    align-self: flex-start;
    background: var(--white);
    color: var(--text-dark);
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.message.sent {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 2px;
}

.message .time {
    display: block;
    font-size: 0.7rem;
    margin-top: 0.5rem;
    opacity: 0.7;
}

.chat-input-area {
    padding: 1rem;
    background: var(--white);
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 1rem;
}

.chat-input-area input {
    flex: 1;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.chat-input-area input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-icon {
    padding: 0 1.5rem;
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .chat-container {
        height: 75vh;
    }

    .chat-sidebar {
        width: 100px;
    }

    .chat-info p {
        display: none;
    }

    .chat-time {
        font-size: 0.6rem;
    }
}

/* Dashboard Sections */
.dashboard-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.dashboard-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Styles */
.modal {
    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: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.active .modal-content {
    transform: scale(1);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-dark);
}

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

.modal-close:hover {
    color: var(--text-dark);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

/* Revenue Chart */
.revenue-chart {
    display: flex;
    align-items: flex-end;
    gap: 2rem;
    height: 250px;
    padding: 2rem 1rem 1rem;
    border-radius: 12px;
    background: linear-gradient(to top, #f9fafb 0%, transparent 100%);
}

.chart-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.bar-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.bar-fill {
    width: 100%;
    max-width: 60px;
    height: var(--value);
    background: var(--color);
    border-radius: 8px 8px 0 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: barGrow 1s ease-out;
}

@keyframes barGrow {
    from {
        height: 0;
        opacity: 0;
    }

    to {
        height: var(--value);
        opacity: 1;
    }
}

.bar-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-top: 0.5rem;
}

.chart-bar:hover .bar-fill {
    filter: brightness(1.1);
    transform: scaleY(1.05);
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .dashboard-main {
        margin-left: 0;
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .revenue-chart {
        gap: 1rem;
        padding: 1rem 0.5rem 0.5rem;
    }

    .bar-fill {
        max-width: 40px;
    }

    .bar-value {
        font-size: 0.8rem;
    }
}