/* Dashboard Layout */
.dashboard-body {
    background-color: #F4F7F6;
    height: 100vh; /* Fallback */
    height: 100dvh;
    overflow: hidden;
    /* Prevent body scroll, handle inside main */
    display: flex;
    flex-direction: column;
}

.dashboard-container {
    display: flex;
    height: 100%;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    padding: 20px;
    transition: transform 0.3s ease;
    z-index: 100;
}

.sidebar-header {
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 12px;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover {
    background-color: #F4F7F6;
    color: var(--primary);
}

.nav-item.active {
    background-color: #E8F5E9;
    color: var(--primary);
    font-weight: 600;
}

.nav-item .icon {
    margin-right: 12px;
    font-size: 1.2rem;
}

.sidebar-footer {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.nav-item.logout {
    color: #FF5252;
}

.nav-item.logout:hover {
    background-color: #FFEBEE;
}

.close-sidebar {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.topbar {
    height: 80px;
    background: #F4F7F6;
    /* Blends with body */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    flex-shrink: 0;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    margin-right: 20px;
}

.page-title h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-dark);
}

.page-title p {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification-bell {
    position: relative;
    font-size: 1.2rem;
    cursor: pointer;
}

.badge-dot {
    position: absolute;
    top: 0;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: #FF5252;
    border-radius: 50%;
    border: 1px solid #F4F7F6;
}

.profile-img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 0 30px 30px;
    -webkit-overflow-scrolling: touch;
    /* iOS Scroll */
}

/* Dashboard Cards & Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.card-link {
    font-size: 0.9rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

/* Specific Component Styles */
.next-appointment {
    background: linear-gradient(135deg, var(--primary), #2D5C48);
    color: white;
}

.next-appointment h3 {
    color: white;
    font-size: 1.2rem;
}

.appointment-date {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 15px 0;
}

.appointment-meta {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: 10px;
    display: inline-block;
    font-size: 0.9rem;
}

.status-tracker {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-top: 30px;
}

.tracker-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
}

.step-dot {
    width: 25px;
    height: 25px;
    background: #eee;
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: transparent;
}

.tracker-step.completed .step-dot {
    background: var(--primary);
    color: white;
}

.tracker-step.active .step-dot {
    background: var(--accent);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.tracker-line {
    position: absolute;
    top: 12px;
    left: 0;
    width: 100%;
    font-weight: 500;
    cursor: pointer;
}

.tracker-line-fill {
    height: 100%;
    background: var(--primary);
    width: 50%;
    /* Dynamic */
}

/* Interactions */
.card:active, .list-item:active, .btn-sm:active {
    transform: scale(0.98);
}
.btn, .nav-item { cursor: pointer; transition: transform 0.2s, background 0.2s; }

/* Responsive */
@media (max-width: 900px) {
    .dashboard-body {
        padding-bottom: 0;
    }

    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        top: auto;
        width: 100%;
        height: 75px;
        flex-direction: row;
        padding: 0;
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.08);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        z-index: 2000;
        border-top: 1px solid rgba(0,0,0,0.05);
        border-right: none;
        transform: none !important;
    }

    .sidebar-header, .sidebar-footer {
        display: none;
    }

    .close-sidebar {
        display: none;
    }

    .sidebar-nav {
        flex-direction: row;
        justify-content: space-around;
        width: 100%;
        gap: 0;
    }

    .nav-item {
        flex: 1;
        flex-direction: column;
        justify-content: center;
        padding: 10px 0;
        font-size: 0.75rem;    
        border-radius: 0;
        white-space: nowrap;
        background: transparent !important;
    }

    .nav-item .icon {
        margin-right: 0;
        margin-bottom: 4px;
        font-size: 1.4rem;
    }

    .nav-item.active {
        color: var(--primary);
        font-weight: 700;
        border-top: 3px solid var(--primary);
        background: radial-gradient(circle at top, rgba(45,92,72,0.1) 0%, transparent 60%) !important;
    }

    .menu-toggle {
        display: none;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 0 20px;
    }

    .content-area {
        padding: 0 20px 95px !important;
    }

    /* Modal Mobile (Bottom Sheet) */
    .glass-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .glass-card-modal {
        width: 100%;
        max-width: 100%;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        padding: 30px 20px 40px;
        margin: 0;
        max-height: 90vh;
        transform: translateY(100%) scale(1);
    }
    .glass-overlay.active .glass-card-modal {
        transform: translateY(0) scale(1);
    }
    .glass-card-modal::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 50px;
        height: 5px;
        background: rgba(0,0,0,0.15);
        border-radius: 10px;
    }
}

/* List Items (History) */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.list-item:last-child {
    border-bottom: none;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
}

/* Timeline (Treatment) */
.timeline {
    position: relative;
    padding-left: 20px;
    border-left: 2px solid #eee;
    margin-left: 10px;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

.timeline-dot {
    position: absolute;
    left: -26px;
    top: 0;
    width: 14px;
    height: 14px;
    background: #ccc;
    border-radius: 50%;
    border: 2px solid white;
}

.timeline-dot.current {
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(45, 92, 72, 0.2);
}

.timeline-date {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 4px;
}

/* Order Table */
.order-table-responsive {
    overflow-x: auto;
}

.order-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.order-table th {
    text-align: left;
    padding: 15px;
    color: #888;
    font-weight: 500;
    font-size: 0.9rem;
}

.order-table td {
    padding: 15px;
    border-top: 1px solid #f5f5f5;
    font-size: 0.95rem;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.transit {
    background: #FFF3E0;
    color: #F57C00;
}

.status-badge.delivered {
    background: #E8F5E9;
    color: var(--primary);
}

.btn-sm {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-sm.text-only {
    border: none;
    color: var(--primary);
    background: none;
}

/* Chat Component */
.message {
    display: flex;
    flex-direction: column;
    max-width: 70%;
}

.message.received {
    align-self: flex-start;
}

.message.sent {
    align-self: flex-end;
    align-items: flex-end;
}

.message-bubble {
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
}

.message.received .message-bubble {
    background: white;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.message.sent .message-bubble {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 5px rgba(45, 92, 72, 0.2);
}

.message-time {
    font-size: 0.75rem;
    color: #999;
    margin-top: 5px;
}
/* Glass Modal System */
.glass-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 1000; display: none; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s ease; }
.glass-overlay.active { display: flex; opacity: 1; }
.glass-card-modal { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.6); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); width: 90%; max-width: 500px; border-radius: 24px; padding: 30px; transform: scale(0.9); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: relative; max-height: 85vh; overflow-y: auto; }
.glass-overlay.active .glass-card-modal { transform: scale(1); }
.glass-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid rgba(0,0,0,0.05); padding-bottom: 15px; }
.glass-header h3 { font-size: 1.3rem; color: var(--text-dark); margin: 0; }
.close-glass { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-light); width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: background 0.2s; }
.close-glass:hover { background: rgba(0,0,0,0.05); color: var(--text-dark); }
.info-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 0.95rem; }
.info-label { color: var(--text-light); }
.info-value { font-weight: 600; color: var(--text-dark); text-align: right; }
.tracking-timeline { margin-top: 20px; border-left: 2px solid #2d5c48; padding-left: 20px; margin-left: 10px; }
.tracking-item { position: relative; margin-bottom: 20px; }
.tracking-item::before { content: ''; position: absolute; left: -26px; top: 5px; width: 10px; height: 10px; background: white; border: 2px solid #2d5c48; border-radius: 50%; }
.tracking-item.active::before { background: #2d5c48; }
.video-placeholder { background: #000; border-radius: 15px; height: 250px; display: flex; align-items: center; justify-content: center; color: white; flex-direction: column; margin-bottom: 20px; position: relative; overflow: hidden; }
.pulsing-circle { width: 60px; height: 60px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.3); border-top-color: white; animation: spin 1s infinite linear; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Tracking Map */
.mock-map { background: #e6eef5; border-radius: 16px; height: 180px; position: relative; overflow: hidden; margin-bottom: 25px; border: 1px solid rgba(0,0,0,0.05); }
.map-background { width: 100%; height: 100%; opacity: 0.1; background-image: radial-gradient(#444 1px, transparent 1px); background-size: 20px 20px; }
.map-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.map-label { position: absolute; font-size: 0.75rem; font-weight: 600; color: #555; background: rgba(255,255,255,0.8); padding: 4px 8px; border-radius: 6px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.map-label.origin { top: 60px; left: 20px; }
.map-label.dest { top: 60px; right: 20px; }
.plane-icon { font-size: 1.5rem; position: absolute; offset-path: path('M 40 80 Q 250 10 460 80'); offset-distance: 60%; animation: movePlane 3s ease-in-out infinite alternate; filter: drop-shadow(0 4px 4px rgba(0,0,0,0.2)); }
@keyframes movePlane { from { offset-distance: 0%; } to { offset-distance: 100%; } }
