/* ═══════════════════════════════════════════
   WF Dashboard — Frontend CPanel
   ═══════════════════════════════════════════ */

.wf-dashboard {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1e293b;
}

.wf-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.wf-dashboard-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
}

.wf-dashboard-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.wf-dashboard-user-name {
    font-weight: 500;
    color: #475569;
}

.wf-dashboard-logout {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #ef4444;
    text-decoration: none;
    transition: all 0.15s;
}

.wf-dashboard-logout:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

/* ── Tabs ──────────────────────────────── */

.wf-dashboard-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0;
}

.wf-dashboard-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
}

.wf-dashboard-tab:hover {
    color: #1e293b;
    background: #f8fafc;
}

.wf-dashboard-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.wf-dashboard-panel {
    display: none;
}

.wf-dashboard-panel.active {
    display: block;
}

/* ── Sections ──────────────────────────── */

.wf-dashboard-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
}

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

.wf-section-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

/* ── Buttons ───────────────────────────── */

.wf-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.wf-btn-primary {
    background: #3b82f6;
    color: #fff;
}

.wf-btn-primary:hover {
    background: #2563eb;
}

.wf-btn-full {
    width: 100%;
    justify-content: center;
    padding: 12px;
}

.wf-btn-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    color: #64748b;
    transition: all 0.15s;
}

.wf-btn-icon:hover {
    background: #f1f5f9;
    color: #1e293b;
}

/* ── Employee Cards ────────────────────── */

.wf-employees-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.wf-employee-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    transition: border-color 0.15s;
}

.wf-employee-card:hover {
    border-color: #cbd5e1;
}

.wf-employee-avatar {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3b82f6;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    border-radius: 10px;
    flex-shrink: 0;
}

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

.wf-employee-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.wf-employee-email {
    font-size: 12px;
    color: #64748b;
}

.wf-employee-meta {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.wf-employee-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* ── Badges ────────────────────────────── */

.wf-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.wf-badge-owner {
    background: #fef08a;
    color: #854d0e;
}

.wf-badge-employee {
    background: #dbeafe;
    color: #1e40af;
}

.wf-badge-pin {
    background: #dcfce7;
    color: #166534;
}

.wf-badge-warning {
    background: #fff3cd;
    color: #856404;
}

.wf-badge-success {
    background: #dcfce7;
    color: #166534;
}

.wf-badge-danger {
    background: #fef2f2;
    color: #991b1b;
}

/* ── Modal ─────────────────────────────── */

.wf-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.wf-modal {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    max-width: 440px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.wf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.wf-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.wf-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: #f1f5f9;
    cursor: pointer;
    color: #64748b;
}

.wf-modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* ── Forms ─────────────────────────────── */

.wf-form-group {
    margin-bottom: 16px;
}

.wf-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.wf-form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #1e293b;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.wf-form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.wf-form-hint {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

.wf-input-prefix {
    display: flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.wf-input-prefix span {
    padding: 10px 12px;
    font-size: 13px;
    background: #f8fafc;
    color: #64748b;
    border-right: 1px solid #e2e8f0;
    white-space: nowrap;
}

.wf-input-prefix input {
    border: none;
    border-radius: 0;
}

/* ── Features Grid ─────────────────────── */

.wf-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.wf-feature-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s;
    font-size: 13px;
    font-weight: 500;
}

.wf-feature-toggle:hover {
    border-color: #3b82f6;
}

.wf-feature-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
}

/* ── Table ─────────────────────────────── */

.wf-table-wrap {
    overflow-x: auto;
}

.wf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.wf-table th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.wf-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
}

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

/* ── Empty state ───────────────────────── */

.wf-dashboard-empty {
    text-align: center;
    padding: 48px 20px;
    color: #94a3b8;
    font-size: 14px;
}

/* ── Config form ───────────────────────── */

.wf-config-form {
    max-width: 600px;
}

/* ── Responsive ────────────────────────── */

@media (max-width: 640px) {
    .wf-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .wf-employees-grid {
        grid-template-columns: 1fr;
    }
    .wf-dashboard-tabs {
        overflow-x: auto;
    }
    .wf-dashboard-tab {
        white-space: nowrap;
        padding: 10px 12px;
        font-size: 13px;
    }
}
