:root {
    --primary-color: #6C5DD3;
    /* The bright purple from the image */
    --secondary-color: #F8F9FA;
    --text-color: #1b1b28;
    --light-text: #8A8A9E;
    --sidebar-width: 250px;
    --header-height: 70px;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    --border-radius: 12px;
    --success-color: #10B981;
    /* green from the image */
    --bg-color: #F4F5FA;
    /* light body bg */
    --sidebar-bg: #1E1E2D;
    /* dark sidebar bg */
    --sidebar-text: #8A8A9E;
    --sidebar-active-bg: #6C5DD3;
    --sidebar-active-text: #FFFFFF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-right: none;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 40px;
}

.nav-links {
    list-style: none;
    flex: 1;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--sidebar-text);
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
}

.nav-link i {
    font-size: 1.2rem;
}

.settings {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
}

/* Sidebar Dropdown */
.nav-dropdown {
    position: relative;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.dropdown-toggle {
    cursor: pointer;
    justify-content: space-between !important;
}

.dropdown-toggle i:last-child {
    font-size: 0.75rem;
    color: #94a3b8;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-dropdown.active .dropdown-toggle {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
}

.nav-dropdown.active .dropdown-toggle i:last-child {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.dropdown-menu {
    list-style: none inside !important;
    padding: 0 0 10px 48px !important;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin: 0;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    left: 28px;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, #e2e8f0 0%, #cbd5e0 100%);
    border-radius: 1px;
}

.nav-dropdown.active .dropdown-menu {
    max-height: 300px;
    opacity: 1;
    visibility: visible;
    padding-top: 5px !important;
}

.dropdown-menu li {
    list-style: none !important;
    margin: 0;
    padding: 0;
}

.dropdown-link {
    display: flex !important;
    align-items: center;
    padding: 10px 0 !important;
    text-decoration: none;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    background: transparent !important;
}

.dropdown-link:hover {
    color: var(--primary-color);
    padding-left: 5px !important;
}

.dropdown-link.active {
    color: var(--sidebar-active-text);
    font-weight: 600;
}

.dropdown-link.active::before {
    content: '';
    position: absolute;
    left: -21px;
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(77, 124, 254, 0.5);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    height: var(--header-height);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    /* border-bottom: 1px solid #eee; */
}

.search-bar {
    display: flex;
    align-items: center;
    background: #F8F9FA;
    padding: 10px 15px;
    border-radius: 8px;
    width: 300px;
}

.search-bar input {
    border: none;
    background: transparent;
    margin-left: 10px;
    outline: none;
    width: 100%;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification-icon {
    position: relative;
    font-size: 1.2rem;
    cursor: pointer;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 8px;
    height: 8px;
    background: red;
    border-radius: 50%;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: right;
}

.user-info h4 {
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.user-info span {
    font-size: 0.75rem;
    color: var(--light-text);
}

.profile-pic {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Dashboard Content */
.dashboard-container {
    padding: 30px;
}

.welcome-section {
    margin-bottom: 30px;
}

.welcome-section h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.welcome-section p {
    color: var(--light-text);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border: 1px solid #f1f5f9;
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 20px;
}

/* Status Badges */
.status-badge { padding: 6px 14px; border-radius: 10px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; display: inline-flex; align-items: center; justify-content: center; }
.status-scheduled { background: #eff6ff; color: #3b82f6; }
.status-confirmed { background: #e0f2fe; color: #0ea5e9; }
.status-completed { background: #dcfce7; color: #166534; }
.status-no_show, .status-missed { background: #fef2f2; color: #dc2626; }
.status-cancelled { background: #f1f5f9; color: #64748b; }
.status-late { background: #fffbeb; color: #d97706; border: 1px solid #fef3c7; }

/* Plan View Task Statuses */
.status-wait { background: #f1f5f9 !important; color: #64748b !important; }
.status-done { background: #dcfce7 !important; color: #166534 !important; }

.stat-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.stat-icon.blue {
    background: #EAF0FF;
    color: #4D7CFE;
}

.stat-icon.purple {
    background: #F0EDFF;
    color: #6C5DD3;
}

.stat-icon.green {
    background: #E6F8F3;
    color: #10B981;
}

.stat-icon.orange {
    background: #FFF4E6;
    color: #FE9F4D;
}

.stat-info {
    flex: 1;
}

.stat-info h3 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.stat-info p {
    color: var(--light-text);
    font-size: 0.85rem;
}

.stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: #dc3545;
}

/* Charts & Lists Row */
.content-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.card {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 1.1rem;
}

.card-header a {
    text-decoration: none;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.appointment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.appointment-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.patient-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 35px;
    height: 35px;
    background: #eee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #555;
}

.details h5 {
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.details span {
    font-size: 0.75rem;
    color: var(--light-text);
}

.status {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.status.confirmed {
    background: #E6FFF0;
    color: #28A745;
}

@media (max-width: 900px) {
    .content-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 250px;
        transition: transform 0.3s ease;
        padding: 20px;
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.3);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar .logo span,
    .sidebar .nav-link span {
        display: block;
    }

    .sidebar .logo {
        justify-content: flex-start;
        margin-bottom: 40px;
    }

    .sidebar .nav-link {
        justify-content: flex-start;
        padding: 12px 15px;
    }

    .search-bar {
        display: none;
    }

    .menu-toggle {
        display: block !important;
    }

    .topbar {
        padding: 0 15px;
    }

    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Alert Boxes */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 500;
    animation: slideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert i {
    font-size: 1.2rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Appointment Plan & Calendar Premium Styles */
.plan-card {
    background: white;
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.badge-interval {
    background: #eff6ff;
    color: #3b82f6;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: capitalize;
}

.task-item {
    border-left: 4px solid #e2e8f0;
    padding-left: 20px;
    margin-bottom: 25px;
    position: relative;
    transition: all 0.3s ease;
}

.task-item.completed {
    border-left-color: #10b981;
}

.task-item.pending {
    border-left-color: #f59e0b;
}

.task-status {
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 10px;
    margin-left: 10px;
}

.status-wait {
    background: #fffbeb;
    color: #f59e0b;
}

/* Modal Animations */
@keyframes modSlide {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cal-modal-content {
    animation: modSlide 0.3s ease;
}

/* FullCalendar Customizations */
.fc .fc-toolbar-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    font-family: 'Outfit', sans-serif !important;
}

.fc .fc-button-primary {
    background-color: #4D7CFE;
    border-color: #4D7CFE;
    border-radius: 10px;
    font-weight: 600;
    padding: 8px 16px;
    transition: all 0.2s;
}

.fc .fc-button-primary:hover {
    background-color: #3b65e6;
    border-color: #3b65e6;
}

.fc .fc-daygrid-day-number {
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
}

.event-badge {
    background-color: #eff6ff !important;
    color: #3b82f6 !important;
    border: none !important;
    font-weight: 700 !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
}

.card-met { border-left-color: #10b981 !important; background: #f0fdf4 !important; }
.card-missed { border-left-color: #ef4444 !important; background: #fef2f2 !important; }
.card-late { border-left-color: #f59e0b !important; background: #fffbeb !important; }
.card-reached { border-left-color: #64748b !important; background: #f8fafc !important; }

.event-one-time { background-color: #3b82f6 !important; color: white !important; border-left: 5px solid #2563eb !important; }
.event-plan { background-color: #8b5cf6 !important; color: white !important; border-left: 5px solid #7c3aed !important; }
.event-late { background-color: #f59e0b !important; color: white !important; border-left: 5px solid #d97706 !important; }
.event-no-show { background-color: #ef4444 !important; color: white !important; border-left: 5px solid #dc2626 !important; }