/**
 * SKYBOOK GLOBAL - Modern Reporting & Analytics Center Stylesheet
 * Version 6.0.0 (High Contrast Solid White Theme, Flex-Wrapping Nav, Skeleton UX)
 */

/* =========================================================================
   1. REPORTING VIEWPORT & SOLID THEME TOKENS
   ========================================================================= */

#view-reports {
    background: #F7F9FC;
    color: #111827;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    padding-bottom: 40px;
}

[data-theme="dark"] #view-reports {
    background: #0f172a;
    color: #f9fafb;
}

/* =========================================================================
   2. HEADER & GLOBAL FILTER CARD
   ========================================================================= */

.report-header-card {
    background: #FFFFFF;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .report-header-card {
    background: #1e293b;
    border-color: #334155;
}

.report-header-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #111827;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

[data-theme="dark"] .report-header-title {
    color: #f9fafb;
}

.report-header-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 4px;
    margin-bottom: 0;
}

[data-theme="dark"] .report-header-subtitle {
    color: #9ca3af;
}

.report-filter-panel {
    background: #FFFFFF;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px 20px;
    margin-top: 16px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .report-filter-panel {
    background: #1e293b;
    border-color: #334155;
}

.report-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    align-items: end;
}

@media (max-width: 768px) {
    .report-filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .report-filter-grid {
        grid-template-columns: 1fr;
    }
}

.report-field-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 4px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

[data-theme="dark"] .report-field-label {
    color: #cbd5e1;
}

.report-field-input,
.report-field-select {
    font-size: 0.83rem;
    height: 38px;
    width: 100%;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #FFFFFF;
    color: #111827;
    padding: 0 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

[data-theme="dark"] .report-field-input,
[data-theme="dark"] .report-field-select {
    background: #0f172a;
    border-color: #334155;
    color: #f9fafb;
}

.report-field-input:focus,
.report-field-select:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* =========================================================================
   3. HIGH-CONTRAST SOLID KPI CARDS GRID
   ========================================================================= */

.report-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.report-kpi-card {
    background: #FFFFFF;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    box-sizing: border-box;
}

[data-theme="dark"] .report-kpi-card {
    background: #1e293b;
    border-color: #334155;
}

.report-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.report-kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.report-kpi-value {
    font-size: 28px;
    font-weight: 800;
    color: #111827;
    line-height: 1.2;
    font-family: inherit;
}

[data-theme="dark"] .report-kpi-value {
    color: #f9fafb;
}

.report-kpi-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-top: 4px;
}

[data-theme="dark"] .report-kpi-label {
    color: #cbd5e1;
}

.report-kpi-subtext {
    font-size: 0.72rem;
    color: #6b7280;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

[data-theme="dark"] .report-kpi-subtext {
    color: #9ca3af;
}

/* =========================================================================
   4. FLEX-WRAPPING REPORT NAVIGATION BAR
   ========================================================================= */

.report-nav-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.report-nav-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #FFFFFF;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

[data-theme="dark"] .report-nav-strip {
    background: #1e293b;
    border-color: #334155;
}

.report-nav-btn {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.83rem;
    font-weight: 600;
    color: #4b5563;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

[data-theme="dark"] .report-nav-btn {
    color: #9ca3af;
}

.report-nav-btn:hover {
    color: #111827;
    background: #f3f4f6;
}

[data-theme="dark"] .report-nav-btn:hover {
    color: #f9fafb;
    background: #334155;
}

.report-nav-btn.active {
    background: #6366f1;
    color: #FFFFFF;
    font-weight: 800;
    border-color: #6366f1;
    box-shadow: 0 1px 2px 0 rgba(99, 102, 241, 0.3);
}

.report-nav-mobile-select {
    display: none;
    width: 100%;
    height: 40px;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #FFFFFF;
    color: #111827;
    padding: 0 12px;
}

@media (max-width: 640px) {
    .report-nav-strip {
        display: none;
    }
    .report-nav-mobile-select {
        display: block;
    }
}

/* =========================================================================
   5. REUSABLE REPORT CARDS & TABLES
   ========================================================================= */

.report-table-card {
    background: #FFFFFF;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 20px;
}

[data-theme="dark"] .report-table-card {
    background: #1e293b;
    border-color: #334155;
}

.report-table-toolbar {
    padding: 14px 18px;
    background: #FFFFFF;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

[data-theme="dark"] .report-table-toolbar {
    background: #1e293b;
    border-color: #334155;
}

.report-table-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: #111827;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

[data-theme="dark"] .report-table-title {
    color: #f9fafb;
}

.report-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.report-table-responsive table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.report-table-responsive thead th {
    background: #f9fafb;
    color: #4b5563;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

[data-theme="dark"] .report-table-responsive thead th {
    background: #0f172a;
    color: #9ca3af;
    border-color: #334155;
}

.report-table-responsive tbody td {
    padding: 12px 16px;
    font-size: 0.83rem;
    color: #111827;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

[data-theme="dark"] .report-table-responsive tbody td {
    color: #f9fafb;
    border-color: #334155;
}

.report-table-responsive tbody tr:hover {
    background: #f9fafb;
}

[data-theme="dark"] .report-table-responsive tbody tr:hover {
    background: #334155;
}

/* =========================================================================
   6. LOCAL SKELETON LOADERS
   ========================================================================= */

@keyframes reportShimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.skeleton-box {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 37%, #f3f4f6 63%);
    background-size: 800px 100%;
    animation: reportShimmer 1.4s ease infinite;
    border-radius: 6px;
    display: inline-block;
}

[data-theme="dark"] .skeleton-box {
    background: linear-gradient(90deg, #1e293b 25%, #334155 37%, #1e293b 63%);
    background-size: 800px 100%;
}

.skeleton-card {
    background: #FFFFFF;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

[data-theme="dark"] .skeleton-card {
    background: #1e293b;
    border-color: #334155;
}

/* =========================================================================
   7. PAGINATION CONTROL UI
   ========================================================================= */

.report-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #FFFFFF;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.83rem;
}

[data-theme="dark"] .report-pagination {
    background: #1e293b;
    border-color: #334155;
}

.report-pagination-info {
    color: #6b7280;
}

.report-pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #FFFFFF;
    color: #374151;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-btn:not(:disabled):hover {
    background: #f3f4f6;
    color: #111827;
}

/* =========================================================================
   8. COMPONENT CARDS & TIMELINE STYLES
   ========================================================================= */

.staff-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.movement-timeline-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    width: 100%;
}

.movement-card {
    background: #FFFFFF;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

[data-theme="dark"] .movement-card {
    background: #1e293b;
    border-color: #334155;
}

.movement-flow {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 10px 16px;
    border-radius: 8px;
}

[data-theme="dark"] .movement-flow {
    background: #0f172a;
    border-color: #334155;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-success { background: #d1fae5; color: #065f46; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-primary { background: #e0e7ff; color: #3730a3; border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-danger  { background: #fee2e2; color: #991b1b; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-info    { background: #e0f2fe; color: #075985; border: 1px solid rgba(56, 189, 248, 0.3); }
.badge-warning { background: #fef3c7; color: #92400e; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-secondary { background: #f1f5f9; color: #475569; border: 1px solid #e5e7eb; }
