/* Alignment Fixes for Purple Dashboard Theme */

/* Fix Page Header Alignment */
.breadcrumb-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title-section {
    flex: 1;
    min-width: 0;
}

.page-title-section h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.2;
}

.page-subtitle {
    margin: 0;
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.4;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Fix Statistics Cards Grid Alignment */
.dashboard-container .row {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.dashboard-container .row > [class*="col-"] {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Enhanced Statistics Cards */
.stats-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.15s ease-out;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    height: 100%;
    min-height: 120px;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stats-card-primary {
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-purple-light) 100%);
    color: white;
}

.stats-card-info {
    background: linear-gradient(135deg, var(--info) 0%, #60A5FA 100%);
    color: white;
}

.stats-card-success {
    background: linear-gradient(135deg, var(--success) 0%, #34D399 100%);
    color: white;
}

.stats-card-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #FBBF24 100%);
    color: white;
}

.stats-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.stats-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

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

.stats-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1;
    word-break: break-all;
}

.stats-label {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
    line-height: 1.3;
}

.stats-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    flex-wrap: wrap;
}

.stats-count {
    white-space: nowrap;
}

.stats-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}

/* Fix Main Content Layout */
.main-content {
    padding: 0 1.5rem;
    min-height: calc(100vh - 140px);
}

.dashboard-container {
    max-width: 100%;
    margin: 0 auto;
}

/* Fix Card Layouts */
.modern-card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: all 0.15s ease-out;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.modern-card .card-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.card-title-section {
    flex: 1;
    min-width: 0;
}

.card-title-section .card-title {
    color: var(--gray-800);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    line-height: 1.3;
}

.card-subtitle {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 0;
    line-height: 1.4;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

/* Fix Quick Stats Sidebar */
.quick-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quick-stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    transition: all 0.15s ease-out;
}

.quick-stat-item:hover {
    background: var(--purple-tint);
    transform: translateX(2px);
}

.quick-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

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

.quick-stat-info h5 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--gray-800);
    line-height: 1.2;
}

.quick-stat-info p {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0;
    line-height: 1.3;
}

/* Fix Activity Timeline */
.activity-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-text {
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--gray-500);
    line-height: 1.3;
}

/* Fix Responsive Grid Issues */
@media (max-width: 1199px) {
    .stats-card {
        min-height: 100px;
        padding: 1.25rem;
    }
    
    .stats-icon {
        width: 52px;
        height: 52px;
        font-size: 1.375rem;
    }
    
    .stats-number {
        font-size: 1.75rem;
    }
}

@media (max-width: 991px) {
    .breadcrumb-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .page-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
    
    .main-content {
        padding: 0 1rem;
    }
}

@media (max-width: 767px) {
    .stats-card {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
        padding: 1rem;
        min-height: auto;
    }
    
    .stats-content {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .stats-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
        margin: 0 auto;
    }
    
    .stats-number {
        font-size: 1.5rem;
    }
    
    .stats-meta {
        justify-content: center;
    }
    
    .page-title-section h1 {
        font-size: 1.5rem;
    }
    
    .main-content {
        padding: 0 0.75rem;
    }
    
    .dashboard-container .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .dashboard-container .row > [class*="col-"] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Fix Container Spacing */
.container-fluid {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

@media (max-width: 767px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Fix Equal Height Cards */
.row.equal-height {
    display: flex;
    flex-wrap: wrap;
}

.row.equal-height > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

.row.equal-height .stats-card,
.row.equal-height .modern-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.row.equal-height .card-body {
    flex: 1;
}

/* Fix Text Alignment for RTL */
.text-right {
    text-align: right !important;
}

.text-left {
    text-align: left !important;
}

.text-center {
    text-align: center !important;
}

/* Fix Flexbox Alignment */
.d-flex {
    display: flex !important;
}

.align-items-center {
    align-items: center !important;
}

.align-items-start {
    align-items: flex-start !important;
}

.align-items-end {
    align-items: flex-end !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.justify-content-center {
    justify-content: center !important;
}

.justify-content-end {
    justify-content: flex-end !important;
}

/* Fix Margin and Padding Utilities */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.mr-0 { margin-right: 0 !important; }
.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.mr-3 { margin-right: 1rem !important; }
.mr-4 { margin-right: 1.5rem !important; }
.mr-5 { margin-right: 3rem !important; }

.ml-0 { margin-left: 0 !important; }
.ml-1 { margin-left: 0.25rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.ml-3 { margin-left: 1rem !important; }
.ml-4 { margin-left: 1.5rem !important; }
.ml-5 { margin-left: 3rem !important; }

/* Fix Width and Height Utilities */
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }

/* Fix Display Utilities */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }

@media (max-width: 575px) {
    .d-sm-none { display: none !important; }
    .d-sm-block { display: block !important; }
}

@media (max-width: 767px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
}

@media (max-width: 991px) {
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
}

@media (max-width: 1199px) {
    .d-xl-none { display: none !important; }
    .d-xl-block { display: block !important; }
}

