/* PrestigeiaPro — Facturation Complète — Admin CSS */

.pfc-wrap { max-width: 1400px; padding: 0 10px; }
.pfc-wrap h1 { font-size: 22px; margin-bottom: 15px; }

/* ── Layout ─────────────────────────────────────────────────── */
.pfc-row { display: flex; gap: 15px; flex-wrap: wrap; }
.pfc-col-2 { flex: 2; min-width: 0; }
.pfc-col-1 { flex: 1; min-width: 280px; }

.pfc-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 15px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.pfc-card h3 {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* ── KPIs ───────────────────────────────────────────────────── */
.pfc-kpis { display: flex; gap: 12px; flex-wrap: wrap; margin: 15px 0; }
.pfc-kpi {
    flex: 1; min-width: 140px;
    background: #fff;
    border-radius: 10px;
    padding: 16px 18px;
    border-left: 5px solid #ccc;
    box-shadow: 0 2px 6px rgba(0,0,0,.07);
}
.kpi-val { font-size: 22px; font-weight: 800; line-height: 1.2; }
.kpi-label { font-size: 11px; color: #777; margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }

.pfc-kpi.green  { border-color: #27ae60; }
.pfc-kpi.green .kpi-val  { color: #27ae60; }
.pfc-kpi.blue   { border-color: #3498db; }
.pfc-kpi.blue .kpi-val   { color: #3498db; }
.pfc-kpi.red    { border-color: #e74c3c; }
.pfc-kpi.red .kpi-val    { color: #e74c3c; }
.pfc-kpi.orange { border-color: #e67e22; }
.pfc-kpi.orange .kpi-val { color: #e67e22; }
.pfc-kpi.purple { border-color: #9b59b6; }
.pfc-kpi.purple .kpi-val { color: #9b59b6; }
.pfc-kpi.teal   { border-color: #1abc9c; }
.pfc-kpi.teal .kpi-val   { color: #1abc9c; }

/* ── Forms ──────────────────────────────────────────────────── */
.pfc-field {
    display: flex; flex-direction: column;
    flex: 1; min-width: 0;
    gap: 4px;
}
.pfc-field label {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.pfc-field input[type="text"],
.pfc-field input[type="number"],
.pfc-field input[type="email"],
.pfc-field input[type="url"],
.pfc-field input[type="date"],
.pfc-field input[type="color"],
.pfc-field select,
.pfc-field textarea {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 7px 9px;
    font-size: 13px;
    width: 100%;
    background: #fff;
    transition: border-color .15s;
}
.pfc-field input:focus,
.pfc-field select:focus,
.pfc-field textarea:focus {
    border-color: #0A2463;
    outline: none;
    box-shadow: 0 0 0 2px rgba(10,36,99,.1);
}

/* ── Tables ─────────────────────────────────────────────────── */
.pfc-table th { font-size: 12px !important; }
.pfc-table td { vertical-align: middle !important; font-size: 13px; padding: 9px 10px !important; }
.pfc-actions { white-space: nowrap; }
.pfc-actions .button { margin-right: 3px; margin-bottom: 3px; font-size: 12px !important; }

/* ── Badges ─────────────────────────────────────────────────── */
.pfc-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.pfc-badge-green  { background: #d4edda; color: #155724; }
.pfc-badge-blue   { background: #cce5ff; color: #004085; }
.pfc-badge-red    { background: #f8d7da; color: #721c24; }
.pfc-badge-orange { background: #fff3cd; color: #856404; }
.pfc-badge-purple { background: #e2d9f3; color: #432874; }
.pfc-badge-gray   { background: #e2e3e5; color: #383d41; }
.pfc-badge-teal   { background: #d1ecf1; color: #0c5460; }

/* ── Buttons ─────────────────────────────────────────────────── */
.pfc-btn {
    display: inline-block;
    padding: 9px 16px;
    background: #0A2463;
    color: white !important;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    margin: 4px 4px 4px 0;
    border: none;
    cursor: pointer;
    transition: background .15s;
}
.pfc-btn:hover { background: #0d2e7a; }
.pfc-btn-outline { background: transparent; color: #0A2463 !important; border: 2px solid #0A2463; }
.pfc-btn-orange { background: #e67e22; }
.pfc-btn-orange:hover { background: #cf6d17; }
.pfc-btn-blue { background: #3498db; }
.pfc-btn-blue:hover { background: #2980b9; }

/* ── Filters ─────────────────────────────────────────────────── */
.pfc-filters { margin: 12px 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pfc-filters input[type="search"],
.pfc-filters select { padding: 6px 10px; border: 1px solid #ddd; border-radius: 5px; font-size: 13px; }

/* ── Year switcher ──────────────────────────────────────────── */
.pfc-year-switcher { display: flex; gap: 6px; margin: 8px 0 15px; flex-wrap: wrap; }
.pfc-year-switcher a {
    padding: 5px 14px;
    background: #f0f0f0;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    color: #555;
    font-weight: 600;
    transition: all .15s;
}
.pfc-year-switcher a:hover { background: #0A2463; color: white; }
.pfc-year-switcher a.active { background: #0A2463; color: white; }

/* ── Lignes devis/facture ────────────────────────────────────── */
.pfc-ligne {
    padding: 5px 0;
    position: relative;
}

/* ── Totaux ──────────────────────────────────────────────────── */
.pfc-totaux { float: right; width: 340px; margin: 15px 0; }
.pfc-totaux table { width: 100%; border-collapse: collapse; }
.pfc-totaux td { padding: 7px 10px; font-size: 13px; }
.pfc-totaux td:last-child { text-align: right; font-weight: 600; }
.pfc-totaux .pfc-total-ttc td { background: #0A2463; color: white; font-size: 16px !important; border-radius: 6px; }
.clearfix::after { content:""; display:block; clear:both; }

/* ── Actions save ────────────────────────────────────────────── */
.pfc-actions-save { position: sticky; bottom: 0; background: #fff; border-top: 2px solid #f0f0f0; padding: 12px 0; z-index: 100; margin-top: 15px; }
.pfc-actions-save .button { margin-right: 8px; }

/* ── Mini table ──────────────────────────────────────────────── */
.pfc-mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pfc-mini-table td { padding: 6px 0; border-bottom: 1px solid #f0f0f0; }
.pfc-mini-table td:last-child { text-align: right; font-weight: 600; }
.pfc-mini-table tr.total td { padding-top: 10px; font-size: 15px; border-top: 2px solid #333; border-bottom: none; }

/* ── Fiscal table ────────────────────────────────────────────── */
.pfc-fiscal-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pfc-fiscal-table td { padding: 7px 10px; border-bottom: 1px solid #f5f5f5; }
.pfc-fiscal-table td.val { text-align: right; font-weight: 600; }
.pfc-fiscal-table .section-header { background: #f0f4ff; }
.pfc-fiscal-table .section-header td { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #0A2463; font-weight: 700; padding: 8px 10px; }
.pfc-fiscal-table .total-line { color: #0A2463; font-size: 14px; }
.pfc-fiscal-table .total-section td { background: #e8f0ff; font-size: 14px; padding: 12px 10px; }

/* ── Toast ───────────────────────────────────────────────────── */
#pfc-toast {
    position: fixed;
    bottom: 30px; right: 30px;
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    display: none;
    z-index: 99999;
    box-shadow: 0 4px 15px rgba(0,0,0,.3);
    max-width: 400px;
}
#pfc-toast.error { background: #e74c3c; }

/* ── Modal impression ────────────────────────────────────────── */
.pfc-modal-overlay {
    position: fixed; top:0; left:0; right:0; bottom:0;
    background: rgba(0,0,0,.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 99998;
}
.pfc-modal {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,.3);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 960px) {
    .pfc-row { flex-direction: column; }
    .pfc-kpi { min-width: 45%; }
    .pfc-totaux { float: none; width: 100%; }
}

@media print {
    #adminmenumain, #wpadminbar, #wpfooter, .pfc-actions-save { display: none !important; }
}
