/* ========================================
   Dashboard Styles - Modern Design
   ======================================== */

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Dashboard Header
   ======================================== */

.dashboard-header {
    margin-bottom: 1.5rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.header-title-section {
    flex: 1;
}

.dashboard-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

.dashboard-title:focus,
.dashboard-title:focus-visible,
.dashboard-title:active,
h1.dashboard-title:focus,
h1.dashboard-title:focus-visible,
h1.dashboard-title:active {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.dashboard-title i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.dashboard-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin: 0;
}

/* ========================================
   Stats Grid - Modern Cards
   ======================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    position: relative;
    background: white;
    border-radius: 0.875rem;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.stat-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.stat-card-content {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.stat-card-decoration {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    opacity: 0.06;
    pointer-events: none;
}

.stat-primary .stat-card-decoration {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
}

.stat-success .stat-card-decoration {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
}

.stat-warning .stat-card-decoration {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
}

.stat-info .stat-card-decoration {
    background: linear-gradient(135deg, #0dcaf0 0%, #31d2f2 100%);
}

.stat-icon-wrapper {
    flex-shrink: 0;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(-5deg);
}

.stat-primary .stat-icon {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.15) 0%, rgba(13, 110, 253, 0.08) 100%);
    color: var(--primary-color);
}

.stat-success .stat-icon {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.15) 0%, rgba(25, 135, 84, 0.08) 100%);
    color: var(--success-color);
}

.stat-warning .stat-icon {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 193, 7, 0.08) 100%);
    color: var(--warning-color);
}

.stat-info .stat-icon {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.15) 0%, rgba(13, 202, 240, 0.08) 100%);
    color: var(--info-color);
}

.stat-details {
    flex: 1;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.375rem 0;
    line-height: 1;
}

.stat-change {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--danger-color);
}

/* ========================================
   Dashboard Grid - Modern Layout
   ======================================== */

.dashboard-layout-wrapper {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-direction: row; /* keep consistent ordering for RTL/LTR */
}

.dashboard-sidebar {
    order: 2;
    flex: 0 0 var(--dashboard-compact-width, 200px);
    position: sticky;
    top: 0.75rem;
}

.dashboard-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1.5rem;
    order: 1;
}

.dashboard-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out backwards;
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.dashboard-card:nth-child(1) { animation-delay: 0.1s; }
.dashboard-card:nth-child(2) { animation-delay: 0.2s; }
.dashboard-card:nth-child(3) { animation-delay: 0.3s; }
.dashboard-card:nth-child(4) { animation-delay: 0.4s; }

.dashboard-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.dashboard-card--compact {
    max-width: var(--dashboard-compact-width, 200px);
}

.dashboard-card--compact .card-header {
    padding: 0.875rem 1rem;
}

.dashboard-card--compact .card-header h2 {
    font-size: 0.9375rem;
    gap: 0.5rem;
}

.dashboard-card--compact .card-header h2 i {
    font-size: 0.875rem;
}

.dashboard-card--compact .card-body {
    padding: 1rem;
}

.card-header {
    padding: 1.125rem 1.375rem;
    background: linear-gradient(to bottom, rgba(13, 110, 253, 0.02) 0%, transparent 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin: 0;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

.card-header h2 i {
    color: var(--primary-color);
    font-size: 1.125rem;
}

.dashboard-title:focus,
.dashboard-title:focus-visible,
.card-header h2:focus,
.card-header h2:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.btn-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
}

.btn-link:hover {
    background: rgba(13, 110, 253, 0.08);
    color: var(--primary-color);
    text-decoration: none;
}

.card-body {
    padding: 1.375rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ========================================
   Appointments - Modern Design
   ======================================== */

.appointment-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.appointment-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 0.625rem;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.03) 0%, rgba(13, 110, 253, 0.01) 100%);
    border: 1px solid rgba(13, 110, 253, 0.1);
    transition: all 0.25s ease;
}

.appointment-item:hover {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.08) 0%, rgba(13, 110, 253, 0.03) 100%);
    border-color: rgba(13, 110, 253, 0.2);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.1);
}

.appointment-time {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.9375rem;
    min-width: 90px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.appointment-time i {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.appointment-details {
    flex: 1;
}

.appointment-details h4 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.appointment-details p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.appointment-details i {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.appointment-item.past-appointment {
    opacity: 0.5;
    filter: grayscale(0.5);
}

.appointment-reason {
    font-style: italic;
    color: var(--text-tertiary);
}

.badge {
    padding: 0.4rem 0.875rem;
    border-radius: 2rem;
    font-size: 0.8125rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: fit-content;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.badge-upcoming {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3);
}

.badge-success {
    background: linear-gradient(135deg, #d1e7dd 0%, #badbcc 100%);
    color: #0a3622;
    font-weight: 600;
}

.badge-completed {
    background: linear-gradient(135deg, #c9dcff 0%, #b3ceff 100%);
    color: #073984;
    font-weight: 600;
}

.badge-cancelled {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c2c7 100%);
    color: #58151c;
    font-weight: 600;
}

.badge-pending {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    color: #664d03;
    font-weight: 600;
}

.badge-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
    color: #000000;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(255, 193, 7, 0.3);
}

.view-more-link {
    text-align: center;
    padding: 1rem 0 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: 0.75rem;
}

.view-more-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    display: inline-block;
}

.view-more-link a:hover {
    background: rgba(13, 110, 253, 0.08);
    color: var(--primary-hover);
}

/* ========================================
   Patients - Modern Design
   ======================================== */

.patient-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
}

.patient-list::-webkit-scrollbar {
    width: 6px;
}

.patient-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 3px;
}

.patient-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
    transition: background 0.2s ease;
}

.patient-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.patient-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 0.625rem;
    background: linear-gradient(135deg, rgba(103, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
    border: 1px solid rgba(103, 126, 234, 0.1);
    transition: all 0.25s ease;
}

.patient-item:hover {
    background: linear-gradient(135deg, rgba(103, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-color: rgba(103, 126, 234, 0.2);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(103, 126, 234, 0.15);
}

.patient-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease;
}

.patient-item:hover .patient-avatar {
    transform: scale(1.1) rotate(-5deg);
}

.patient-details {
    flex: 1;
}

.patient-details h4 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.patient-details p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.patient-details i {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.patient-age {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%);
    color: white;
    padding: 0.3rem 0.65rem;
    border-radius: 2rem;
    font-size: 0.8125rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3);
}

.patient-email {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.separator {
    color: var(--text-tertiary);
    margin: 0 0.25rem;
    font-weight: 700;
}

/* ========================================
   Tasks
   ======================================== */

.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background-color: var(--bg-secondary);
}

.task-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.task-item label {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    margin: 0;
}

.task-item input[type="checkbox"]:checked + label {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* ========================================
   Responsive Design
   ======================================== */

@media (min-width: 1400px) {
    .dashboard-container {
        max-width: 1600px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-layout-wrapper {
        flex-direction: column;
    }
    .dashboard-sidebar {
        order: 1;
        position: static;
        flex: 1 1 auto;
        max-width: 100%;
    }
    .dashboard-grid {
        order: 2;
    }
}

/* ========================================
   Assistant Dashboard Specific Styles
   ======================================== */


/* ========================================
   Quick Actions - Vertical List Aligned Right
   ======================================== */

.quick-actions-card {
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.quick-actions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.quick-actions-list .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    font-size: 0.8125rem;
    line-height: 1.2;
    border-radius: 0.6rem;
    transition: all 0.2s ease;
    text-align: left;
    justify-content: flex-start;
}

.quick-actions-list .btn i {
    font-size: 0.95rem;
    margin: 0;
    flex-shrink: 0;
}

.quick-actions-list .btn span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================
   Pending Actions - Modern Design
   ======================================== */

.pending-actions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.pending-action-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.03) 0%, rgba(255, 193, 7, 0.01) 100%);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid rgba(255, 193, 7, 0.1);
}

.pending-action-item:hover {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.08) 0%, rgba(255, 193, 7, 0.03) 100%);
    border-color: rgba(255, 193, 7, 0.2);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.15);
    transform: translateX(6px);
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.pending-action-item:hover .action-icon {
    transform: scale(1.1) rotate(-5deg);
}

.action-icon.pending {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 193, 7, 0.08) 100%);
    color: var(--warning-color);
}

.action-icon.warning {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.15) 0%, rgba(220, 53, 69, 0.08) 100%);
    color: var(--danger-color);
}

.action-icon.info {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.15) 0%, rgba(13, 202, 240, 0.08) 100%);
    color: var(--info-color);
}

.action-details {
    flex: 1;
}

.action-details h4 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.375rem 0;
}

.action-details p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.action-arrow {
    color: var(--text-tertiary);
    font-size: 1rem;
    transition: transform 0.25s ease;
}

.pending-action-item:hover .action-arrow {
    transform: translateX(4px);
}

/* ========================================
   Header Actions
   ======================================== */

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-actions .btn {
    transition: all 0.25s ease;
}

.header-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* ========================================
   Responsive Design - Modern
   ======================================== */

@media (min-width: 1400px) {
    .dashboard-container {
        max-width: 1600px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-title {
        font-size: 1.75rem;
    }
    
    .dashboard-title i {
        font-size: 1.5rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }
    
    .stat-icon {
        width: 56px;
        height: 56px;
        font-size: 1.625rem;
    }
    
    .dashboard-header {
        margin-bottom: 1.75rem;
    }
    
    .card-header h2 {
        font-size: 1.125rem;
    }
    
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .patient-age {
        position: static;
        display: inline-block;
        margin-left: 0.75rem;
    }
    
    .dashboard-grid {
        gap: 1.5rem;
    }
}

@media (max-width: 576px) {
    .page-content {
        padding: 1rem;
    }
    
    .stat-card {
        padding: 1.25rem;
    }
    
    .stat-card-content {
        gap: 1rem;
    }
    
    .stat-icon {
        width: 52px;
        height: 52px;
        font-size: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.875rem;
    }
    
    .appointment-item,
    .patient-item,
    .pending-action-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .quick-action-btn {
        padding: 1.25rem 1rem;
    }
    
    .card-header,
    .card-body {
        padding: 1.25rem;
    }
    
    .dashboard-title {
        font-size: 1.5rem;
    }
    
    .dashboard-subtitle {
        font-size: 1rem;
    }
}

/* ========================================
   Dark Mode Support (if needed)
   ======================================== */

@media (prefers-color-scheme: dark) {
    .stat-card,
    .dashboard-card {
        background: var(--bg-secondary);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .card-header {
        background: linear-gradient(to bottom, rgba(13, 110, 253, 0.05) 0%, transparent 100%);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .appointment-item,
    .patient-item,
    .pending-action-item {
        background: rgba(255, 255, 255, 0.03);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .appointment-item:hover,
    .patient-item:hover,
    .pending-action-item:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.2);
    }

    /* Quick Actions Dark Mode */
    .quick-actions-card {
        background: var(--bg-secondary);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .quick-actions-list .btn-primary {
        background: #0b5ed7;
        border-color: #0b5ed7;
    }

    .quick-actions-list .btn-primary:hover {
        background: #0a53be;
        border-color: #0a53be;
    }

    .quick-actions-list .btn-success {
        background: #157347;
        border-color: #157347;
    }

    .quick-actions-list .btn-success:hover {
        background: #13653f;
        border-color: #13653f;
    }

    .quick-actions-list .btn-secondary {
        background: #5a6268;
        border-color: #5a6268;
    }

    .quick-actions-list .btn-secondary:hover {
        background: #545b62;
        border-color: #545b62;
    }

    .quick-actions-list .btn-info {
        background: #0c5460;
        border-color: #0c5460;
    }

    .quick-actions-list .btn-info:hover {
        background: #0b4b57;
        border-color: #0b4b57;
    }
}

