﻿/* Base Styles */
.klqdsh-dashboard {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(180deg, #475569 20%, #f8fafc 80%);
    min-height: 100vh;
    padding: 5px;
    margin: 5px;
    border-radius:10px;
}

/* Header Section */
.klqdsh-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 5px 5px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.klqdsh-header-left {
    flex: 1;
}

.klqdsh-title {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.klqdsh-date {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
}

.klqdsh-header-right {
    text-align: right;
}

.klqdsh-last-updated {
    font-size: 14px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Icon Font (using emoji as fallback - replace with actual icon font in production) */
.klqdsh-icon {
    display: inline-block;
    width: 20px;
    text-align: center;
}

.klqdsh-icon-clock:before {
    content: "🕒";
}

.klqdsh-icon-refresh:before {
    content: "🔄";
}

.klqdsh-icon-users:before {
    content: "👥";
}

.klqdsh-icon-check:before {
    content: "✓";
}

.klqdsh-icon-warning:before {
    content: "⚠️";
}

.klqdsh-icon-cross:before {
    content: "✗";
}

.klqdsh-icon-arrow-up:before {
    content: "↑";
}

.klqdsh-icon-arrow-down:before {
    content: "↓";
}

.klqdsh-icon-minus:before {
    content: "−";
}

.klqdsh-icon-trend:before {
    content: "📊";
}

.klqdsh-icon-pie:before {
    content: "🥧";
}

.klqdsh-icon-department:before {
    content: "🏢";
}

.klqdsh-icon-active:before {
    content: "⚡";
}

.klqdsh-icon-clock-large:before {
    content: "🕐";
}

.klqdsh-icon-line-chart:before {
    content: "📈";
}

/* KPI Cards Grid */
.klqdsh-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.klqdsh-kpi-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

    .klqdsh-kpi-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    }

.klqdsh-kpi-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 48px;
    opacity: 0.2;
    transition: opacity 0.3s ease;
}

.klqdsh-kpi-card:hover .klqdsh-kpi-icon {
    opacity: 0.3;
}

.klqdsh-kpi-content {
    margin-bottom: 16px;
}

.klqdsh-kpi-label {
    font-size: 14px;
    color: #6c757d;
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.klqdsh-kpi-value {
    font-size: 42px;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
}

.klqdsh-kpi-trend {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 30px;
    background: #f8f9fa;
    width: fit-content;
}

.klqdsh-trend-up {
    color: #28a745;
}

.klqdsh-trend-down {
    color: #dc3545;
}

.klqdsh-trend-stable {
    color: #6c757d;
}

.klqdsh-trend-warning {
    color: #ffc107;
}

/* KPI Card Variants */
.klqdsh-kpi-total {
    border-left: 4px solid #4299e1;
}

.klqdsh-kpi-present {
    border-left: 4px solid #48bb78;
}

.klqdsh-kpi-late {
    border-left: 4px solid #ecc94b;
}

.klqdsh-kpi-absent {
    border-left: 4px solid #f56565;
}

/* Charts Row */
.klqdsh-charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.klqdsh-chart-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.klqdsh-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #edf2f7;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
    border-radius:10px;
}

    .klqdsh-card-header h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 600;
        color: #2d3748;
        display: flex;
        align-items: center;
        gap: 10px;
    }

.klqdsh-card-body {
    padding: 24px;
}

.klqdsh-no-padding {
    padding: 0;
}

.klqdsh-chart-container {
    height: 300px;
    position: relative;
}

.klqdsh-chart-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
}

.klqdsh-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4a5568;
}

.klqdsh-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 4px;
}

.klqdsh-color-present {
    background: #48bb78;
}

.klqdsh-color-late {
    background: #ecc94b;
}

.klqdsh-color-absent {
    background: #f56565;
}

/* Content Grid */
.klqdsh-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

/* Table Styles */
.klqdsh-table-responsive {
    overflow-x: auto;
}

.klqdsh-table {
    width: 100%;
    border-collapse: collapse;
}

    .klqdsh-table th {
        text-align: left;
        padding: 16px 24px;
        background: #f7fafc;
        font-weight: 600;
        font-size: 14px;
        color: #4a5568;
        border-bottom: 2px solid #e2e8f0;
    }

    .klqdsh-table td {
        padding: 16px 24px;
        border-bottom: 1px solid #edf2f7;
        color: #2d3748;
    }

.klqdsh-text-center {
    text-align: center;
}

.klqdsh-department-name {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.klqdsh-department-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

/* Status Badges */
.klqdsh-status-badge {
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 500;
}

.klqdsh-status-present {
    background: #c6f6d5;
    color: #22543d;
}

.klqdsh-badge {
    padding: 4px 12px;
    background: #e2e8f0;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 500;
    color: #4a5568;
}

.klqdsh-badge-success {
    background: #c6f6d5;
    color: #22543d;
}

/* Progress Bar */
.klqdsh-progress-container {
    background: #edf2f7;
    border-radius: 30px;
    height: 24px;
    position: relative;
    overflow: hidden;
}

.klqdsh-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    border-radius: 30px;
    transition: width 0.3s ease;
}

.klqdsh-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #2d3748;
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

/* Shifts List */
.klqdsh-shifts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.klqdsh-shift-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #f7fafc;
    border-radius: 16px;
    transition: background 0.3s ease;
}

    .klqdsh-shift-item:hover {
        background: #edf2f7;
    }

.klqdsh-shift-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

.klqdsh-shift-details {
    flex: 1;
}

.klqdsh-shift-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.klqdsh-shift-status {
    padding: 2px 8px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 500;
}

    .klqdsh-shift-status.bg-success {
        background: #c6f6d5;
        color: #22543d;
    }

    .klqdsh-shift-status.bg-warning {
        background: #feebc8;
        color: #744210;
    }

.klqdsh-shift-time, .klqdsh-shift-duration {
    font-size: 13px;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

/* Empty State */
.klqdsh-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #a0aec0;
}

    .klqdsh-empty-state i {
        font-size: 48px;
        margin-bottom: 16px;
        display: block;
    }

    .klqdsh-empty-state p {
        margin: 0;
        font-size: 16px;
    }

/* Show More Button */
.klqdsh-show-more {
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #edf2f7;
}

.klqdsh-btn-link {
    background: none;
    border: none;
    color: #4299e1;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    transition: color 0.3s ease;
}

    .klqdsh-btn-link:hover {
        color: #2b6cb0;
        text-decoration: underline;
    }

.klqdsh-btn-icon {
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .klqdsh-btn-icon:hover {
        background: #e2e8f0;
        color: #4a5568;
    }

/* Metrics */
.klqdsh-metric {
    display: flex;
    align-items: center;
    gap: 12px;
}

.klqdsh-metric-label {
    font-size: 14px;
    color: #718096;
}

.klqdsh-metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #48bb78;
}

.klqdsh-margin-top {
    margin-top: 32px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .klqdsh-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .klqdsh-charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .klqdsh-dashboard {
        padding: 16px;
    }

    .klqdsh-header {
        flex-direction: column;
        text-align: center;
        gap: 16px;
        padding: 20px;
    }

    .klqdsh-header-right {
        text-align: center;
    }

    .klqdsh-kpi-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .klqdsh-content-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .klqdsh-card-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .klqdsh-table {
        font-size: 14px;
    }

        .klqdsh-table th,
        .klqdsh-table td {
            padding: 12px;
        }

    .klqdsh-chart-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .klqdsh-title {
        font-size: 22px;
    }

    .klqdsh-kpi-value {
        font-size: 32px;
    }

    .klqdsh-shift-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .klqdsh-shift-name {
        justify-content: center;
    }

    .klqdsh-shift-time,
    .klqdsh-shift-duration {
        justify-content: center;
    }
}

/* Animations */
@keyframes klqdsh-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.klqdsh-kpi-card,
.klqdsh-chart-card,
.klqdsh-card {
    animation: klqdsh-fadeIn 0.5s ease-out forwards;
}

    .klqdsh-kpi-card:nth-child(1) {
        animation-delay: 0.1s;
    }

    .klqdsh-kpi-card:nth-child(2) {
        animation-delay: 0.2s;
    }

    .klqdsh-kpi-card:nth-child(3) {
        animation-delay: 0.3s;
    }

    .klqdsh-kpi-card:nth-child(4) {
        animation-delay: 0.4s;
    }
