/* ==========================================================================
   Tema scuro — Richieste di collaborazione, Calendario, Recensioni ricevute
   Pagine: richieste_collaborazione.php (+ ?id=N), calendario_collaborazioni.php,
   recensioni_ricevute.php. Markup in partner_collabrations/{richieste,calendario,
   recensioni}_inner.php e js/collaborazioni.js; stili chiari .req-* .cal-* .rv-*
   e .pg-* in css/custom.css.
   ========================================================================== */

/* ==========================================================================
   Layout .pg condiviso (anche con campaign_list.php / dashboard)
   Ripiego a specificità minima con :where(): se 40-campaigns o 20-dashboard
   tematizzano gli stessi componenti, vincono loro; qui si copre solo il caso
   in cui nessuno lo abbia fatto. Batte comunque custom.css (caricato prima).
   Su p/strong il tag resta fuori dal :where() per superare il "color: inherit"
   di dark-theme.css (0,1,2).
   ========================================================================== */
html[data-theme="dark"] :where(.pg-head) p {
    color: var(--cu-text-3);
}

html[data-theme="dark"] :where(.pg-back) {
    color: var(--cu-primary-hi) !important;
}

html[data-theme="dark"] :where(.pg-back:hover) {
    color: var(--cu-text) !important;
}

html[data-theme="dark"] :where(.pg-btn-ghost) {
    background: var(--cu-surface);
    border-color: var(--cu-border-2);
    color: var(--cu-text) !important;
}

html[data-theme="dark"] :where(.pg-btn-ghost:hover) {
    background: var(--cu-surface-2);
    border-color: var(--cu-primary);
    color: var(--cu-primary-hi) !important;
}

html[data-theme="dark"] :where(.pg-btn-primary) {
    box-shadow: 0 4px 14px -4px rgba(39, 163, 140, .45);
}

html[data-theme="dark"] :where(.pg-surface) {
    background: var(--cu-surface);
    border-color: var(--cu-border);
    box-shadow: var(--cu-shadow-sm);
}

html[data-theme="dark"] :where(.pg-section-title small) {
    color: var(--cu-text-3);
}

html[data-theme="dark"] :where(.pg-empty) {
    background: var(--cu-surface);
    border-color: var(--cu-border);
}

html[data-theme="dark"] :where(.pg-empty-icon) {
    background: var(--cu-primary-soft);
    color: var(--cu-primary-hi);
}

html[data-theme="dark"] :where(.pg-empty) p {
    color: var(--cu-text-3);
}

/* Contatori in testa (riusano .dash-stat-* della dashboard) */
html[data-theme="dark"] :where(.dash-stat-card) {
    background: var(--cu-surface);
    box-shadow: inset 0 0 0 1px var(--cu-border), var(--cu-shadow-sm);
}

html[data-theme="dark"] :where(.dash-stat-info) strong {
    color: var(--cu-text);
}

html[data-theme="dark"] :where(.dash-stat-info small) {
    color: var(--cu-text-3);
}

html[data-theme="dark"] :where(.dash-stat-green) {
    background: var(--cu-primary-soft);
    color: var(--cu-primary-hi);
}

html[data-theme="dark"] :where(.dash-stat-blue) {
    background: var(--cu-info-soft);
    color: var(--cu-info);
}

html[data-theme="dark"] :where(.dash-stat-gray) {
    background: rgba(167, 180, 177, .12);
    color: var(--cu-text-2);
}

html[data-theme="dark"] :where(.dash-stat-yellow) {
    background: var(--cu-warning-soft);
    color: var(--cu-warning);
}

/* quarta tinta, aggiunta per le richieste rifiutate */
html[data-theme="dark"] .dash-stat-red {
    background: var(--cu-danger-soft);
    color: var(--cu-danger);
}

/* Card campagna della panoramica richieste (stessa .camp-card dell'elenco) */
html[data-theme="dark"] :where(.camp-card) {
    background: var(--cu-surface);
    box-shadow: 0 0 0 1px var(--cu-border), var(--cu-shadow-sm);
}

html[data-theme="dark"] :where(.camp-card:hover) {
    box-shadow: 0 0 0 1px var(--cu-border-2), var(--cu-shadow);
}

html[data-theme="dark"] :where(.camp-card-img, .camp-detail-hero) {
    background: var(--cu-surface-3);
}

html[data-theme="dark"] :where(.camp-card-stats) {
    border-top-color: var(--cu-border);
    border-bottom-color: var(--cu-border);
}

html[data-theme="dark"] :where(.camp-stat small) {
    color: var(--cu-text-3);
}

html[data-theme="dark"] :where(.camp-stat) strong {
    color: var(--cu-primary-hi);
}

/* Intestazione della vista singola campagna (.camp-detail-*) */
html[data-theme="dark"] :where(.camp-detail-subtitle > span) {
    color: var(--cu-text-2);
}

html[data-theme="dark"] :where(.camp-detail-subtitle > span i, .camp-detail-stat > i) {
    color: var(--cu-primary-hi);
}

html[data-theme="dark"] :where(.camp-detail-stats) {
    background: var(--cu-surface-2);
    box-shadow: inset 0 0 0 1px var(--cu-border);
}

html[data-theme="dark"] :where(.camp-detail-stat small) {
    color: var(--cu-text-3);
}

html[data-theme="dark"] :where(.camp-detail-stat) strong {
    color: var(--cu-text);
}

/* Badge "N in attesa" sopra la foto della campagna: pieno, leggibile sulla foto */
html[data-theme="dark"] .camp-badge.req-badge-waiting {
    background: rgba(13, 19, 18, .86);
    color: var(--cu-warning);
    box-shadow: inset 0 0 0 1px rgba(242, 181, 74, .45);
}

/* ==========================================================================
   Richieste — vista singola campagna (?id=N)
   ========================================================================== */

/* Tab a pillola */
html[data-theme="dark"] .pg .req-tabs.nav-tabs {
    background: var(--cu-surface-2);
    box-shadow: inset 0 0 0 1px var(--cu-border);
}

html[data-theme="dark"] .pg .req-tabs.nav-tabs .nav-link {
    background: transparent;
    color: var(--cu-text-3);
}

html[data-theme="dark"] .pg .req-tabs.nav-tabs .nav-link:hover {
    background: transparent;
    color: var(--cu-text);
}

html[data-theme="dark"] .pg .req-tabs.nav-tabs .nav-link.active {
    background: var(--cu-surface-4);
    color: var(--cu-primary-hi);
    box-shadow: var(--cu-shadow-sm);
}

html[data-theme="dark"] .pg .req-tabs .req-tab-count {
    background: var(--cu-surface-4);
    color: var(--cu-text-2);
}

html[data-theme="dark"] .pg .req-tabs .nav-link.active .req-tab-count {
    background: var(--cu-primary-soft-2);
    color: var(--cu-primary-hi);
}

html[data-theme="dark"] .req-section-label {
    color: var(--cu-text-3);
}

html[data-theme="dark"] .req-section-label .fa {
    color: var(--cu-warning);
}

/* Card richiesta */
html[data-theme="dark"] .req-card {
    background: var(--cu-surface-2);
    border-color: var(--cu-border);
}

html[data-theme="dark"] .req-card:hover {
    border-color: var(--cu-border-2);
    box-shadow: var(--cu-shadow);
}

html[data-theme="dark"] .req-card-gold {
    border-color: rgba(242, 181, 74, .38);
    background: linear-gradient(0deg, rgba(242, 181, 74, .07), rgba(242, 181, 74, 0) 70%), var(--cu-surface-2);
}

html[data-theme="dark"] .req-avatar img,
html[data-theme="dark"] .req-modal-head img,
html[data-theme="dark"] .req-cmp-head img {
    border-color: var(--cu-border-2);
    background: var(--cu-surface-3);
}

html[data-theme="dark"] .req-name {
    color: var(--cu-text);
}

html[data-theme="dark"] .req-meta {
    color: var(--cu-text-3);
}

html[data-theme="dark"] .req-meta .fa {
    color: var(--cu-primary-hi);
}

/* Chip requisiti / trattativa / pagamento */
html[data-theme="dark"] .req-flag-ok {
    background: var(--cu-primary-soft);
    color: var(--cu-primary-hi);
}

html[data-theme="dark"] .req-flag-warn {
    background: var(--cu-warning-soft);
    color: #f6d08f;
}

html[data-theme="dark"] .req-flag-tratt {
    background: var(--cu-info-soft);
    color: #a9d1f8;
}

html[data-theme="dark"] .req-flag-pay {
    background: var(--cu-danger-soft);
    color: #f6a8a8;
}

html[data-theme="dark"] .req-flag-btn:hover {
    filter: brightness(1.18);
}

/* Recensione già data dal business + nota "in attesa dell'influencer" */
html[data-theme="dark"] .req-review-text {
    color: var(--cu-text-3);
}

html[data-theme="dark"] .req-waiting-note {
    background: var(--cu-warning-soft);
    border-color: rgba(242, 181, 74, .3);
    color: #f2c46d;
}

/* Badge di stato */
html[data-theme="dark"] .req-badge-waiting {
    background: var(--cu-warning-soft);
    color: #f6d08f;
}

html[data-theme="dark"] .req-badge-rejected {
    background: var(--cu-danger-soft);
    color: #f6a8a8;
}

html[data-theme="dark"] .req-badge-completed {
    background: rgba(167, 180, 177, .14);
    color: var(--cu-text-2);
}

html[data-theme="dark"] .req-badge-reviewed {
    background: var(--cu-info-soft);
    color: #a9d1f8;
}

/* Bottoni */
html[data-theme="dark"] .req-btn-light {
    background: var(--cu-surface-3);
    border-color: var(--cu-border-2);
    color: var(--cu-text) !important;
}

html[data-theme="dark"] .req-btn-light:hover {
    background: var(--cu-surface-4);
    border-color: var(--cu-border-3);
}

html[data-theme="dark"] .req-btn-danger {
    background: transparent;
    border-color: rgba(240, 108, 108, .4);
    color: var(--cu-danger) !important;
}

html[data-theme="dark"] .req-btn-danger:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff !important;
}

html[data-theme="dark"] .req-btn-outline {
    border-color: rgba(60, 196, 166, .4);
    color: var(--cu-primary-hi) !important;
}

html[data-theme="dark"] .req-btn-outline:hover {
    background: var(--cu-primary);
    border-color: var(--cu-primary);
    color: #fff !important;
}

/* Vuoto / caricamento */
html[data-theme="dark"] .req-empty,
html[data-theme="dark"] .req-loading {
    color: var(--cu-text-3);
}

html[data-theme="dark"] .req-empty .fa {
    color: var(--cu-text-4);
}

/* p: theme.css lo forza a #777 */
html[data-theme="dark"] .req-empty p {
    color: var(--cu-text-3);
}

/* ==========================================================================
   Richieste — modali (profilo influencer, recensione, confronto, report)
   ========================================================================== */
html[data-theme="dark"] .req-info-list {
    border-top-color: var(--cu-border);
}

html[data-theme="dark"] .req-info-row {
    border-bottom-color: var(--cu-border);
}

html[data-theme="dark"] .req-info-row span,
html[data-theme="dark"] .req-review-label {
    color: var(--cu-text-3);
}

html[data-theme="dark"] .req-info-row strong {
    color: var(--cu-text);
}

/* Commento recensione: theme.css forza .form-control bianco con !important */
html[data-theme="dark"] #cuReviewModal .form-control {
    background-color: var(--cu-surface-2) !important;
}

html[data-theme="dark"] #cuReviewModal .form-control:focus {
    background-color: var(--cu-surface-3) !important;
}

/* Confronto requisiti */
html[data-theme="dark"] .req-cmp-result.ok {
    background: var(--cu-primary-soft);
    color: var(--cu-primary-hi);
}

html[data-theme="dark"] .req-cmp-result.warn {
    background: var(--cu-warning-soft);
    color: #f6d08f;
}

html[data-theme="dark"] .req-cmp-table {
    border-color: var(--cu-border-2);
}

html[data-theme="dark"] .req-cmp-row {
    border-bottom-color: var(--cu-border);
}

html[data-theme="dark"] .req-cmp-row-header {
    background: var(--cu-surface-2);
    color: var(--cu-text-3);
}

html[data-theme="dark"] .req-cmp-c-req,
html[data-theme="dark"] .req-cmp-c-inf {
    color: var(--cu-text);
}

html[data-theme="dark"] .req-cmp-c-req i {
    color: var(--cu-text-3);
}

html[data-theme="dark"] .req-cmp-c-camp {
    color: var(--cu-text-2);
}

html[data-theme="dark"] .req-cmp-ok .req-cmp-c-state {
    color: var(--cu-primary-hi);
}

html[data-theme="dark"] .req-cmp-warn {
    background: rgba(240, 108, 108, .07);
}

html[data-theme="dark"] .req-cmp-warn .req-cmp-c-state,
html[data-theme="dark"] .req-cmp-warn .req-cmp-c-inf {
    color: var(--cu-danger);
}

html[data-theme="dark"] .req-cmp-neutral .req-cmp-c-state {
    color: var(--cu-text-4);
}

html[data-theme="dark"] .req-cmp-neutral .req-cmp-c-camp,
html[data-theme="dark"] .req-cmp-neutral .req-cmp-c-inf {
    color: var(--cu-text-3);
}

html[data-theme="dark"] .req-cmp-detail {
    background: var(--cu-warning-soft);
    color: #f6d08f;
}

html[data-theme="dark"] .req-cmp-legend {
    color: var(--cu-text-3);
}

html[data-theme="dark"] .req-cmp-legend span:nth-child(1) i {
    color: var(--cu-primary-hi);
}

html[data-theme="dark"] .req-cmp-legend span:nth-child(2) i {
    color: var(--cu-danger);
}

html[data-theme="dark"] .req-cmp-legend span:nth-child(3) i {
    color: var(--cu-text-4);
}

/* Report completo (stato D) */
html[data-theme="dark"] .req-report-title p {
    color: var(--cu-text-3);
}

html[data-theme="dark"] .req-report-title strong {
    color: var(--cu-text);
}

html[data-theme="dark"] .req-report-ig {
    border-color: var(--cu-border-2);
    background: var(--cu-surface);
}

html[data-theme="dark"] .req-report-item {
    background: var(--cu-surface-2);
    border-color: var(--cu-border);
}

html[data-theme="dark"] .req-report-item small {
    color: var(--cu-text-3);
}

html[data-theme="dark"] .req-report-item strong,
html[data-theme="dark"] .req-report-engagement span,
html[data-theme="dark"] .req-report-engagement strong {
    color: var(--cu-primary-hi);
}

html[data-theme="dark"] .req-report-engagement {
    background: var(--cu-primary-soft);
}

html[data-theme="dark"] .req-report-caption {
    background: var(--cu-surface-2);
    color: var(--cu-text-2);
}

html[data-theme="dark"] .req-report-hashtags {
    color: #8fa0ff;
}

html[data-theme="dark"] .req-ig-cooldown {
    background: var(--cu-surface-2);
    color: var(--cu-text-3);
}

html[data-theme="dark"] .req-report-section-label {
    color: var(--cu-text-2);
}

html[data-theme="dark"] .req-rev-card {
    border-color: var(--cu-border-2);
    background: var(--cu-surface-2);
}

/* le due righe laterali colorate (influencer teal, azienda blu) restano */
html[data-theme="dark"] .req-rev-influencer {
    border-left-color: var(--cu-primary);
}

html[data-theme="dark"] .req-rev-business {
    border-left-color: #6d83f2;
}

html[data-theme="dark"] .req-rev-head img {
    border-color: var(--cu-border-2);
}

html[data-theme="dark"] .req-rev-who strong {
    color: var(--cu-text);
}

html[data-theme="dark"] .req-rev-stars b {
    color: var(--cu-text-3);
}

html[data-theme="dark"] .req-rev-text {
    color: var(--cu-text-2);
}

html[data-theme="dark"] .req-rev-empty {
    background: var(--cu-surface-3);
    color: var(--cu-text-3);
}

/* Dialog "Pagamento compenso" (SweetAlert, HTML con style="" da
   js/collaborazioni.js): solo i filetti #eee, il resto lo fa 10-widgets */
html[data-theme="dark"] .swal2-html-container div[style*="solid #eee"] {
    border-top-color: var(--cu-border-2) !important;
}

/* ==========================================================================
   Calendario collaborazioni (FullCalendar v2.2.5)
   ========================================================================== */

/* Legenda: pillole sullo sfondo pagina */
html[data-theme="dark"] .pg-cal .cal-leg {
    background: var(--cu-surface);
    box-shadow: inset 0 0 0 1px var(--cu-border);
    color: var(--cu-text-2);
}

/* "Accettata" è nero (#1a1a2e) in style="" e negli eventi: sul fondo scuro
   sparirebbe, si inverte in chiaro (stesso colore in legenda ed eventi) */
html[data-theme="dark"] .pg-cal .cal-dot[style*="#1a1a2e"] {
    background: var(--cu-text) !important;
}

/* nelle viste orarie jQuery riscrive lo style="" e i colori diventano rgb() */
html[data-theme="dark"] .pg-cal .cal-wrap .fc-event[style*="#1a1a2e"],
html[data-theme="dark"] .pg-cal .cal-wrap .fc-event[style*="rgb(26, 26, 46)"] {
    background-color: var(--cu-text) !important;
    border-color: var(--cu-text) !important;
    color: var(--cu-bg) !important;
}

/* "In attesa": theme.css forza testo bianco su giallo (illeggibile) */
html[data-theme="dark"] .pg-cal .cal-wrap .fc-event[style*="#f6c343"],
html[data-theme="dark"] .pg-cal .cal-wrap .fc-event[style*="rgb(246, 195, 67)"] {
    color: #3d2f00 !important;
}

/* Barra strumenti */
html[data-theme="dark"] .pg-cal .cal-wrap.fc .fc-toolbar h2 {
    color: var(--cu-text);
}

html[data-theme="dark"] .pg-cal .cal-wrap.fc .fc-toolbar .fc-button {
    background: var(--cu-surface-2);
    border-color: var(--cu-border-2);
    color: var(--cu-text-2);
}

html[data-theme="dark"] .pg-cal .cal-wrap.fc .fc-toolbar .fc-button:hover {
    background: var(--cu-surface-3);
    color: var(--cu-text);
}

html[data-theme="dark"] .pg-cal .cal-wrap.fc .fc-toolbar .fc-button.fc-state-active,
html[data-theme="dark"] .pg-cal .cal-wrap.fc .fc-toolbar .fc-button.fc-state-down {
    background: var(--cu-primary);
    border-color: var(--cu-primary);
    color: #fff;
}

html[data-theme="dark"] .pg-cal .cal-wrap.fc .fc-toolbar .fc-button.fc-state-disabled {
    background: var(--cu-surface-2);
    color: var(--cu-text-3);
    opacity: .6;
}

html[data-theme="dark"] .pg-cal .cal-wrap.fc .fc-toolbar .fc-button:focus {
    box-shadow: var(--cu-focus);
}

/* Griglia */
html[data-theme="dark"] .pg-cal .cal-wrap .fc-view-container {
    border-color: var(--cu-border-2);
}

html[data-theme="dark"] .pg-cal .cal-wrap td,
html[data-theme="dark"] .pg-cal .cal-wrap th,
html[data-theme="dark"] .pg-cal .cal-wrap thead,
html[data-theme="dark"] .pg-cal .cal-wrap tbody,
html[data-theme="dark"] .pg-cal .cal-wrap .fc-row,
html[data-theme="dark"] .pg-cal .cal-wrap .fc-widget-content,
html[data-theme="dark"] .pg-cal .cal-wrap .fc-widget-header {
    border-color: var(--cu-border);
}

/* le celle dello skeleton eventi restano trasparenti come in FullCalendar */
html[data-theme="dark"] .pg-cal .cal-wrap .fc-row .fc-content-skeleton td,
html[data-theme="dark"] .pg-cal .cal-wrap .fc-row .fc-helper-skeleton td {
    border-color: transparent;
}

html[data-theme="dark"] .pg-cal .cal-wrap th.fc-day-header {
    background: var(--cu-surface-2);
    color: var(--cu-text-3);
}

html[data-theme="dark"] .pg-cal .cal-wrap .fc-day-number {
    color: var(--cu-text-2);
}

html[data-theme="dark"] .pg-cal .cal-wrap .fc-day-number.fc-other-month {
    color: var(--cu-text-4);
}

html[data-theme="dark"] .pg-cal .cal-wrap .fc-day-number.fc-today {
    color: var(--cu-primary-hi);
}

/* Oggi: tinta teal opaca (la cella sfondo e quella del numero si sovrappongono) */
html[data-theme="dark"] .pg-cal .cal-wrap .fc-today {
    background: #17302b !important;
}

/* Viste Settimana/Giorno: asse orari, riga "Giorno", divisore */
html[data-theme="dark"] .pg-cal .cal-wrap .fc-axis {
    color: var(--cu-text-3);
}

html[data-theme="dark"] .pg-cal .cal-wrap hr,
html[data-theme="dark"] .pg-cal .cal-wrap .fc-divider {
    background: var(--cu-surface-2);
    border-color: var(--cu-border);
}

html[data-theme="dark"] .pg-cal .cal-wrap .fc-time-grid .fc-slats .fc-minor td {
    border-top-color: rgba(255, 255, 255, .04);
}

html[data-theme="dark"] .pg-cal .cal-wrap .fc-highlight {
    background: var(--cu-primary);
    opacity: .18;
}

/* Popover "+N altri" */
html[data-theme="dark"] .pg-cal .cal-wrap .fc-popover {
    background: var(--cu-surface-3);
    border-color: var(--cu-border-2);
    box-shadow: var(--cu-shadow);
}

html[data-theme="dark"] .pg-cal .cal-wrap .fc-popover .fc-header {
    background: var(--cu-surface-4);
    color: var(--cu-text);
}

html[data-theme="dark"] .pg-cal .cal-wrap .fc-popover .fc-header .fc-close {
    color: var(--cu-text-2);
}

html[data-theme="dark"] .pg-cal .cal-wrap .fc-more {
    color: var(--cu-primary-hi);
}

/* ==========================================================================
   Recensioni ricevute
   ========================================================================== */
html[data-theme="dark"] .rv-score {
    border-right-color: var(--cu-border);
}

html[data-theme="dark"] .rv-score-num {
    color: var(--cu-text);
}

html[data-theme="dark"] .rv-score small,
html[data-theme="dark"] .rv-bar-count {
    color: var(--cu-text-3);
}

html[data-theme="dark"] .rv-bar {
    color: var(--cu-text-2);
}

html[data-theme="dark"] .rv-bar-track {
    background: var(--cu-surface-3);
}

html[data-theme="dark"] .rv-card {
    background: var(--cu-surface);
    border-color: var(--cu-border);
}

html[data-theme="dark"] .rv-card:hover {
    border-color: var(--cu-border-2);
    box-shadow: var(--cu-shadow);
}

html[data-theme="dark"] .rv-card-head img {
    background: var(--cu-surface-3);
    box-shadow: 0 0 0 1px var(--cu-border-2);
}

html[data-theme="dark"] .rv-card-who strong {
    color: var(--cu-text);
}

html[data-theme="dark"] .rv-card-score {
    background: var(--cu-warning-soft);
    color: #f2c46d;
}

html[data-theme="dark"] .rv-card-text {
    color: var(--cu-text-2);
}

@media (max-width: 767px) {
    html[data-theme="dark"] .rv-score {
        border-bottom-color: var(--cu-border);
    }
}
