/* ==========================================================================
   FU Training Portal — Dashboard Styles
   Brand: Teal #1c86c6 | Gold #e6a817 | Navy #0f172a
   ========================================================================== */

.fu-dashboard {
    --fu-primary: #1c86c6;
    --fu-gold: #e6a817;
    --fu-navy: #0f172a;
    --fu-text: #3a3a3a;
    --fu-light-bg: #f1f5f9;
    --fu-border: #e2e8f0;
    --fu-success: #10b981;
    --fu-warning: #f59e0b;
    --fu-danger: #ef4444;
    --fu-radius: 10px;

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--fu-text);
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* --- Header --- */
.fu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--fu-border);
}

.fu-header h1 {
    font-size: 28px;
    color: var(--fu-navy);
    margin: 0 0 4px;
}

.fu-welcome {
    color: #64748b;
    font-size: 15px;
    margin: 0;
}

.fu-location-badge {
    display: inline-block;
    background: var(--fu-light-bg);
    color: var(--fu-primary);
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    margin-left: 8px;
}

/* --- Buttons --- */
.fu-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--fu-radius);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.fu-btn-primary {
    background: var(--fu-primary);
    color: #fff;
}
.fu-btn-primary:hover {
    background: #1570a6;
    color: #fff;
}

.fu-btn-outline {
    background: transparent;
    color: var(--fu-text);
    border-color: var(--fu-border);
}
.fu-btn-outline:hover {
    border-color: var(--fu-primary);
    color: var(--fu-primary);
}

.fu-btn-gold {
    background: var(--fu-gold);
    color: #fff;
}
.fu-btn-gold:hover {
    background: #d49a14;
    color: #fff;
}

.fu-btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

/* --- Cards --- */
.fu-card {
    background: #fff;
    border: 1px solid var(--fu-border);
    border-radius: var(--fu-radius);
    padding: 24px;
    margin-bottom: 20px;
}

.fu-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.fu-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--fu-navy);
    margin: 0;
}

/* --- Stats Grid --- */
.fu-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.fu-stat {
    background: #fff;
    border: 1px solid var(--fu-border);
    border-radius: var(--fu-radius);
    padding: 20px;
    text-align: center;
}

.fu-stat-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--fu-navy);
    line-height: 1;
    margin-bottom: 4px;
}

.fu-stat-label {
    font-size: 13px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fu-stat--highlight .fu-stat-value {
    color: var(--fu-primary);
}

/* --- Progress Bar --- */
.fu-progress {
    height: 10px;
    background: var(--fu-light-bg);
    border-radius: 5px;
    overflow: hidden;
    margin: 8px 0;
}

.fu-progress-bar {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
    background: var(--fu-primary);
}

.fu-progress-bar[data-progress="100"] {
    background: var(--fu-success);
}

.fu-progress-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--fu-text);
}

/* --- Status Badges --- */
.fu-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.fu-badge-success  { background: #d1fae5; color: #065f46; }
.fu-badge-warning  { background: #fef3c7; color: #92400e; }
.fu-badge-info     { background: #dbeafe; color: #1e40af; }
.fu-badge-danger   { background: #fee2e2; color: #991b1b; }
.fu-badge-neutral  { background: var(--fu-light-bg); color: #64748b; }

/* --- Course Cards Grid --- */
.fu-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.fu-course-card {
    background: #fff;
    border: 1px solid var(--fu-border);
    border-radius: var(--fu-radius);
    padding: 20px;
    transition: box-shadow 0.2s;
}

.fu-course-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.fu-course-card h3 {
    font-size: 16px;
    color: var(--fu-navy);
    margin: 0 0 12px;
}

.fu-course-card a {
    color: var(--fu-primary);
    text-decoration: none;
    font-weight: 600;
}

.fu-course-card a:hover {
    text-decoration: underline;
}

/* --- Tables --- */
.fu-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.fu-table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--fu-border);
    background: var(--fu-light-bg);
}

.fu-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--fu-border);
    vertical-align: middle;
}

.fu-table tbody tr:hover {
    background: #f8fafc;
}

.fu-table .fu-clickable {
    cursor: pointer;
}

/* --- Location Tabs --- */
.fu-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.fu-tab {
    padding: 8px 18px;
    border-radius: 8px;
    border: 2px solid var(--fu-border);
    background: #fff;
    color: var(--fu-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.fu-tab:hover {
    border-color: var(--fu-primary);
    color: var(--fu-primary);
}

.fu-tab.active {
    background: var(--fu-primary);
    color: #fff;
    border-color: var(--fu-primary);
}

/* --- Certificate Card --- */
.fu-cert-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: var(--fu-radius);
    padding: 20px;
    margin-bottom: 12px;
    color: #fff;
}

.fu-cert-icon {
    font-size: 40px;
    line-height: 1;
}

.fu-cert-info h4 {
    margin: 0 0 4px;
    font-size: 16px;
    color: var(--fu-gold);
}

.fu-cert-info p {
    margin: 0;
    font-size: 13px;
    color: #94a3b8;
}

.fu-cert-download {
    margin-left: auto;
}

/* --- Modal --- */
.fu-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.fu-modal-overlay.active {
    display: flex;
}

.fu-modal {
    background: #fff;
    border-radius: var(--fu-radius);
    padding: 30px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    position: relative;
}

.fu-modal h2 {
    color: var(--fu-navy);
    font-size: 20px;
    margin: 0 0 20px;
}

.fu-modal-close {
    position: absolute;
    top: 12px; right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #94a3b8;
}

.fu-modal-close:hover { color: var(--fu-navy); }

/* --- Form Elements --- */
.fu-form-group {
    margin-bottom: 16px;
}

.fu-form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--fu-navy);
}

.fu-select,
.fu-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--fu-border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.fu-select:focus,
.fu-input:focus {
    outline: none;
    border-color: var(--fu-primary);
}

/* --- Empty State --- */
.fu-empty {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.fu-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.fu-empty p {
    font-size: 15px;
    margin: 0;
}

/* --- Loading Spinner --- */
.fu-loading {
    text-align: center;
    padding: 30px;
}

.fu-spinner {
    display: inline-block;
    width: 30px; height: 30px;
    border: 3px solid var(--fu-border);
    border-top-color: var(--fu-primary);
    border-radius: 50%;
    animation: fu-spin 0.7s linear infinite;
}

@keyframes fu-spin {
    to { transform: rotate(360deg); }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .fu-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .fu-header h1 {
        font-size: 22px;
    }
    .fu-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .fu-courses-grid {
        grid-template-columns: 1fr;
    }
    .fu-table {
        font-size: 13px;
    }
    .fu-table th,
    .fu-table td {
        padding: 8px 10px;
    }
    .fu-cert-card {
        flex-direction: column;
        text-align: center;
    }
    .fu-cert-download {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .fu-dashboard {
        padding: 12px;
    }
    .fu-stats {
        grid-template-columns: 1fr;
    }
    .fu-card {
        padding: 16px;
    }
}
