/**
 * ============================================================================
 * PD Pisa Newsletter Manager — Foglio di stile principale
 * ============================================================================
 * Progettato dal consulente informatico
 * Mario Velucchi — Pisa, marzo 2026 per pdpisa.it
 * (c) 2026 mario.velucchi.EU
 *
 * Palette colori coordinata con https://www.pdpisa.it/
 * Partito Democratico — colori istituzionali:
 *   Rosso PD:        #D50000 (primario)
 *   Rosso scuro:     #9B0000
 *   Bianco:          #FFFFFF
 *   Grigio chiaro:   #F5F5F5
 *   Blu navy scuro:  #1A1A2E (footer/header)
 *   Grigio testo:    #333333
 *   Grigio secondario: #6C757D
 *
 * Framework: Bootstrap 5 (personalizzato)
 * Rif.: https://getbootstrap.com/docs/5.3/
 * ============================================================================
 */

/* ==========================================================================
 * CSS CUSTOM PROPERTIES — Variabili di design
 * ========================================================================== */
:root {
    /* Colori primari PD Pisa */
    --pd-red:            #D50000;
    --pd-red-dark:       #9B0000;
    --pd-red-light:      #FF1744;
    --pd-red-bg:         #FFEBEE;
    --pd-navy:           #1A1A2E;
    --pd-navy-light:     #2D2D44;
    --pd-navy-lighter:   #3A3A55;

    /* Neutri */
    --pd-white:          #FFFFFF;
    --pd-light:          #F5F5F5;
    --pd-light-alt:      #EEEEEE;
    --pd-gray:           #9E9E9E;
    --pd-gray-dark:      #6C757D;
    --pd-text:           #333333;
    --pd-text-muted:     #757575;

    /* Funzionali */
    --pd-success:        #2E7D32;
    --pd-success-bg:     #E8F5E9;
    --pd-warning:        #F57F17;
    --pd-warning-bg:     #FFF8E1;
    --pd-info:           #0277BD;
    --pd-info-bg:        #E1F5FE;
    --pd-danger:         #C62828;
    --pd-danger-bg:      #FFEBEE;

    /* Tipografia */
    --font-primary:      'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-heading:      'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-mono:         'Cascadia Code', 'Fira Code', 'Consolas', monospace;

    /* Ombre e bordi */
    --shadow-sm:         0 1px 3px rgba(0,0,0,0.08);
    --shadow-md:         0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg:         0 8px 30px rgba(0,0,0,0.12);
    --radius-sm:         6px;
    --radius-md:         10px;
    --radius-lg:         16px;

    /* Transizioni */
    --transition:        all 0.25s ease;
}

/* ==========================================================================
 * RESET E BASE
 * ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    color: var(--pd-text);
    background-color: var(--pd-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
 * HEADER FISSO
 * ========================================================================== */
.pdnl-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: linear-gradient(135deg, var(--pd-navy) 0%, var(--pd-navy-light) 100%);
    box-shadow: var(--shadow-md);
    padding: 0;
}

.pdnl-header .navbar {
    padding: 0.5rem 1rem;
    min-height: 60px;
}

.pdnl-header .navbar-brand {
    color: var(--pd-white) !important;
    font-weight: 700;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    letter-spacing: 0.3px;
}

.pdnl-header .navbar-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: var(--pd-red);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.pdnl-header .nav-link {
    color: rgba(255,255,255,0.82) !important;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.6rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    white-space: nowrap;
}

.pdnl-header .nav-link:hover,
.pdnl-header .nav-link.active {
    color: var(--pd-white) !important;
    background: rgba(255,255,255,0.1);
}

.pdnl-header .nav-link.active {
    background: var(--pd-red);
}

.pdnl-header .nav-link i {
    margin-right: 5px;
    font-size: 0.85rem;
}

/* ==========================================================================
 * CONTENUTO PRINCIPALE
 * ========================================================================== */
.pdnl-main {
    flex: 1;
    margin-top: 74px;
    margin-bottom: 60px;
    padding: 1.5rem 0;
}

/* ==========================================================================
 * FOOTER FISSO
 * ========================================================================== */
.pdnl-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1020;
    background: var(--pd-navy);
    color: rgba(255,255,255,0.6);
    font-size: 0.78rem;
    padding: 0.55rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.pdnl-footer a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: var(--transition);
}

.pdnl-footer a:hover {
    color: var(--pd-white);
}

.pdnl-footer .footer-version {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    opacity: 0.7;
}

/* ==========================================================================
 * CARD E PANNELLI
 * ========================================================================== */
.pdnl-card {
    background: var(--pd-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.06);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: var(--transition);
}

.pdnl-card:hover {
    box-shadow: var(--shadow-md);
}

.pdnl-card-header {
    background: linear-gradient(135deg, var(--pd-light) 0%, var(--pd-white) 100%);
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--pd-red);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pdnl-card-header h5,
.pdnl-card-header h4 {
    margin: 0;
    font-weight: 700;
    color: var(--pd-navy);
    font-size: 1.05rem;
}

.pdnl-card-header h5 i,
.pdnl-card-header h4 i {
    color: var(--pd-red);
    margin-right: 8px;
}

.pdnl-card-body {
    padding: 1.5rem;
}

/* ==========================================================================
 * DASHBOARD — Statistiche
 * ========================================================================== */
.stat-card {
    background: var(--pd-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.06);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--pd-red);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
    font-size: 2rem;
    color: var(--pd-red);
    margin-bottom: 0.5rem;
}

.stat-card .stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--pd-navy);
    line-height: 1.1;
}

.stat-card .stat-label {
    color: var(--pd-text-muted);
    font-size: 0.85rem;
    margin-top: 0.3rem;
    font-weight: 500;
}

/* Varianti colore per le stat card */
.stat-card.stat-success::before { background: var(--pd-success); }
.stat-card.stat-success .stat-icon { color: var(--pd-success); }

.stat-card.stat-warning::before { background: var(--pd-warning); }
.stat-card.stat-warning .stat-icon { color: var(--pd-warning); }

.stat-card.stat-info::before { background: var(--pd-info); }
.stat-card.stat-info .stat-icon { color: var(--pd-info); }

/* ==========================================================================
 * BOTTONI
 * ========================================================================== */
.btn-pd-primary {
    background: var(--pd-red);
    color: var(--pd-white);
    border: none;
    font-weight: 600;
    padding: 0.55rem 1.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    letter-spacing: 0.3px;
}

.btn-pd-primary:hover {
    background: var(--pd-red-dark);
    color: var(--pd-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(213,0,0,0.3);
}

.btn-pd-secondary {
    background: var(--pd-navy);
    color: var(--pd-white);
    border: none;
    font-weight: 600;
    padding: 0.55rem 1.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-pd-secondary:hover {
    background: var(--pd-navy-light);
    color: var(--pd-white);
    transform: translateY(-1px);
}

.btn-pd-outline {
    background: transparent;
    color: var(--pd-red);
    border: 2px solid var(--pd-red);
    font-weight: 600;
    padding: 0.45rem 1.3rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-pd-outline:hover {
    background: var(--pd-red);
    color: var(--pd-white);
}

/* ==========================================================================
 * TABELLE
 * ========================================================================== */
.pdnl-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

.pdnl-table thead th {
    background: var(--pd-navy);
    color: var(--pd-white);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border: none;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pdnl-table thead th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.pdnl-table thead th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.pdnl-table tbody td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--pd-light-alt);
    vertical-align: middle;
}

.pdnl-table tbody tr:hover {
    background-color: var(--pd-red-bg);
}

.pdnl-table tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
 * FORM
 * ========================================================================== */
.form-control:focus,
.form-select:focus {
    border-color: var(--pd-red);
    box-shadow: 0 0 0 3px rgba(213,0,0,0.12);
}

.form-label {
    font-weight: 600;
    color: var(--pd-navy);
    font-size: 0.88rem;
    margin-bottom: 0.35rem;
}

/* ==========================================================================
 * EDITOR NEWSLETTER
 * ========================================================================== */
.pdnl-editor-toolbar {
    background: var(--pd-light);
    border: 1px solid var(--pd-light-alt);
    border-bottom: 2px solid var(--pd-red);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    padding: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.pdnl-editor-toolbar .toolbar-btn {
    width: 34px;
    height: 34px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pd-navy);
    transition: var(--transition);
    font-size: 0.85rem;
}

.pdnl-editor-toolbar .toolbar-btn:hover {
    background: var(--pd-red-bg);
    border-color: var(--pd-red);
    color: var(--pd-red);
}

.pdnl-editor-toolbar .toolbar-btn.active {
    background: var(--pd-red);
    color: var(--pd-white);
    border-color: var(--pd-red);
}

.pdnl-editor-toolbar .toolbar-sep {
    width: 1px;
    height: 28px;
    background: var(--pd-light-alt);
    margin: 3px 4px;
    align-self: center;
}

.pdnl-editor-content {
    border: 1px solid var(--pd-light-alt);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    min-height: 360px;
    padding: 1.2rem;
    outline: none;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--pd-text);
    background: var(--pd-white);
    overflow-y: auto;
    max-height: 600px;
}

.pdnl-editor-content:focus {
    border-color: var(--pd-red);
    box-shadow: 0 0 0 3px rgba(213,0,0,0.08);
}

.pdnl-editor-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 0.5rem 0;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.pdnl-editor-content img:hover {
    border-color: var(--pd-red);
}

.pdnl-editor-content img.selected {
    border-color: var(--pd-red);
    box-shadow: 0 0 0 3px rgba(213,0,0,0.2);
}

/* ==========================================================================
 * DRAG AND DROP ZONE
 * ========================================================================== */
.pdnl-dropzone {
    border: 2px dashed var(--pd-gray);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: var(--pd-light);
}

.pdnl-dropzone:hover,
.pdnl-dropzone.dragover {
    border-color: var(--pd-red);
    background: var(--pd-red-bg);
}

.pdnl-dropzone .dropzone-icon {
    font-size: 2.5rem;
    color: var(--pd-gray);
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

.pdnl-dropzone:hover .dropzone-icon,
.pdnl-dropzone.dragover .dropzone-icon {
    color: var(--pd-red);
    transform: scale(1.1);
}

.pdnl-dropzone .dropzone-text {
    color: var(--pd-text-muted);
    font-size: 0.9rem;
}

.pdnl-dropzone .dropzone-text strong {
    color: var(--pd-red);
}

/* ==========================================================================
 * BADGE E TAG
 * ========================================================================== */
.badge-pd {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.3rem 0.7rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-active {
    background: var(--pd-success-bg);
    color: var(--pd-success);
}

.badge-inactive {
    background: var(--pd-light-alt);
    color: var(--pd-gray-dark);
}

.badge-bounced {
    background: var(--pd-danger-bg);
    color: var(--pd-danger);
}

.badge-pending {
    background: var(--pd-warning-bg);
    color: var(--pd-warning);
}

.badge-sending {
    background: var(--pd-info-bg);
    color: var(--pd-info);
}

.badge-completed {
    background: var(--pd-success-bg);
    color: var(--pd-success);
}

/* ==========================================================================
 * ALLEGATI
 * ========================================================================== */
.attachment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 0.8rem;
    background: var(--pd-light);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    transition: var(--transition);
}

.attachment-item:hover {
    background: var(--pd-light-alt);
}

.attachment-item .att-icon {
    color: var(--pd-red);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.attachment-item .att-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.attachment-item .att-size {
    color: var(--pd-text-muted);
    font-size: 0.78rem;
    flex-shrink: 0;
}

.attachment-item .att-remove {
    color: var(--pd-danger);
    cursor: pointer;
    border: none;
    background: none;
    padding: 2px 6px;
    border-radius: 4px;
    transition: var(--transition);
}

.attachment-item .att-remove:hover {
    background: var(--pd-danger-bg);
}

/* ==========================================================================
 * ALERT E MESSAGGI FLASH
 * ========================================================================== */
.pdnl-alert {
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.2rem;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-left: 4px solid;
}

.pdnl-alert-success {
    background: var(--pd-success-bg);
    border-left-color: var(--pd-success);
    color: var(--pd-success);
}

.pdnl-alert-error {
    background: var(--pd-danger-bg);
    border-left-color: var(--pd-danger);
    color: var(--pd-danger);
}

.pdnl-alert-warning {
    background: var(--pd-warning-bg);
    border-left-color: var(--pd-warning);
    color: #795000;
}

.pdnl-alert-info {
    background: var(--pd-info-bg);
    border-left-color: var(--pd-info);
    color: var(--pd-info);
}

/* ==========================================================================
 * PAGINA LOGIN
 * ========================================================================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--pd-navy) 0%, var(--pd-navy-light) 50%, var(--pd-red-dark) 100%);
    padding: 1.5rem;
}

.login-card {
    background: var(--pd-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.login-card .login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-card .login-logo .logo-circle {
    width: 72px;
    height: 72px;
    background: var(--pd-red);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 4px 20px rgba(213,0,0,0.3);
}

.login-card .login-logo .logo-circle i {
    font-size: 2rem;
    color: var(--pd-white);
}

.login-card .login-logo h4 {
    margin: 0;
    font-weight: 700;
    color: var(--pd-navy);
}

.login-card .login-logo p {
    color: var(--pd-text-muted);
    font-size: 0.85rem;
    margin: 0.3rem 0 0;
}

/* ==========================================================================
 * PROGRESSBAR INVIO
 * ========================================================================== */
.pdnl-progress {
    height: 8px;
    border-radius: 50px;
    background: var(--pd-light-alt);
    overflow: hidden;
}

.pdnl-progress-bar {
    height: 100%;
    border-radius: 50px;
    background: linear-gradient(90deg, var(--pd-red) 0%, var(--pd-red-light) 100%);
    transition: width 0.5s ease;
}

/* ==========================================================================
 * RATE CALCULATOR
 * ========================================================================== */
.rate-result {
    background: linear-gradient(135deg, var(--pd-navy) 0%, var(--pd-navy-light) 100%);
    color: var(--pd-white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 1rem;
}

.rate-result .rate-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--pd-red-light);
}

.rate-result .rate-label {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 0.2rem;
}

/* ==========================================================================
 * SPINNER / LOADING
 * ========================================================================== */
.pdnl-spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid var(--pd-light-alt);
    border-top-color: var(--pd-red);
    border-radius: 50%;
    animation: pdnl-spin 0.7s linear infinite;
}

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

/* ==========================================================================
 * RESPONSIVE
 * ========================================================================== */
@media (max-width: 991.98px) {
    .pdnl-header .navbar-brand {
        font-size: 1rem;
    }

    .pdnl-footer {
        flex-direction: column;
        gap: 4px;
        padding: 0.5rem 1rem;
        text-align: center;
    }

    .stat-card .stat-value {
        font-size: 1.8rem;
    }
}

@media (max-width: 767.98px) {
    .pdnl-main {
        padding: 1rem 0;
        margin-top: 64px;
        margin-bottom: 55px;
    }

    .pdnl-card-body {
        padding: 1rem;
    }

    .pdnl-editor-content {
        min-height: 250px;
    }

    .pdnl-table {
        font-size: 0.8rem;
    }

    .pdnl-table thead th,
    .pdnl-table tbody td {
        padding: 0.5rem 0.6rem;
    }
}

@media (max-width: 575.98px) {
    .pdnl-editor-toolbar .toolbar-btn {
        width: 30px;
        height: 30px;
        font-size: 0.78rem;
    }

    .login-card {
        padding: 1.8rem;
    }
}

/* ==========================================================================
 * UTILITY CLASSES
 * ========================================================================== */
.text-pd-red { color: var(--pd-red) !important; }
.text-pd-navy { color: var(--pd-navy) !important; }
.bg-pd-red { background-color: var(--pd-red) !important; }
.bg-pd-navy { background-color: var(--pd-navy) !important; }
.border-pd-red { border-color: var(--pd-red) !important; }

/* Scrollbar personalizzata */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--pd-light);
}

::-webkit-scrollbar-thumb {
    background: var(--pd-gray);
    border-radius: 50px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--pd-red);
}

/* Animazione fade-in per contenuti */
.pdnl-fade-in {
    animation: pdnlFadeIn 0.4s ease forwards;
}

@keyframes pdnlFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
 * v1.1.0 — DARK MODE (P3.3)
 * Rif.: prefers-color-scheme — https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme
 * ========================================================================== */
[data-bs-theme="dark"] {
    --pd-white:          #1e1e2e;
    --pd-light:          #151520;
    --pd-light-alt:      #252535;
    --pd-text:           #e0e0e0;
    --pd-text-muted:     #a0a0a0;
    --pd-red-bg:         #2a1a1a;
    --pd-success-bg:     #1a2a1a;
    --pd-warning-bg:     #2a2a1a;
    --pd-info-bg:        #1a1a2a;
    --pd-danger-bg:      #2a1a1a;
    --shadow-sm:         0 1px 3px rgba(0,0,0,0.3);
    --shadow-md:         0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg:         0 8px 30px rgba(0,0,0,0.5);
}

[data-bs-theme="dark"] body {
    background-color: var(--pd-light);
    color: var(--pd-text);
}

[data-bs-theme="dark"] .pdnl-card {
    background: var(--pd-white);
    border-color: var(--pd-light-alt);
}

[data-bs-theme="dark"] .pdnl-card-header {
    background: linear-gradient(135deg, var(--pd-light-alt) 0%, var(--pd-white) 100%);
}

[data-bs-theme="dark"] .pdnl-card-header h5,
[data-bs-theme="dark"] .pdnl-card-header h4 {
    color: #e0e0e0;
}

[data-bs-theme="dark"] .stat-card {
    background: var(--pd-white);
    border-color: var(--pd-light-alt);
}

[data-bs-theme="dark"] .stat-card .stat-value {
    color: #e0e0e0;
}

[data-bs-theme="dark"] .pdnl-table thead th {
    background: var(--pd-navy-lighter);
}

[data-bs-theme="dark"] .pdnl-table tbody td {
    border-bottom-color: var(--pd-light-alt);
}

[data-bs-theme="dark"] .pdnl-table tbody tr:hover {
    background-color: var(--pd-light-alt);
}

[data-bs-theme="dark"] .pdnl-editor-toolbar {
    background: var(--pd-light-alt);
    border-color: var(--pd-light-alt);
}

[data-bs-theme="dark"] .pdnl-editor-toolbar .toolbar-btn {
    color: #ccc;
}

[data-bs-theme="dark"] .pdnl-editor-content {
    background: #1a1a28;
    color: #e0e0e0;
    border-color: var(--pd-light-alt);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background: #1a1a28;
    border-color: var(--pd-light-alt);
    color: #e0e0e0;
}

[data-bs-theme="dark"] .pdnl-dropzone {
    background: var(--pd-light-alt);
    border-color: #555;
}

[data-bs-theme="dark"] .table { color: var(--pd-text); }
[data-bs-theme="dark"] .modal-content { background: var(--pd-white); color: var(--pd-text); }
[data-bs-theme="dark"] .nav-tabs .nav-link { color: var(--pd-text-muted); }
[data-bs-theme="dark"] .nav-tabs .nav-link.active { background: var(--pd-white); color: var(--pd-text); border-color: var(--pd-light-alt); }
[data-bs-theme="dark"] .pdnl-alert { color: var(--pd-text); }
[data-bs-theme="dark"] .login-wrapper { background: linear-gradient(145deg, #0a0a15 0%, #1a1a2e 50%, #3a0000 100%); }

/* ==========================================================================
 * v1.1.0 — CONTATORE PAROLE / CARATTERI (P3.6)
 * ========================================================================== */
.pdnl-word-counter {
    display: flex;
    gap: 1rem;
    padding: 0.4rem 1rem;
    background: var(--pd-light);
    border: 1px solid var(--pd-light-alt);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    font-size: 0.75rem;
    color: var(--pd-text-muted);
}

[data-bs-theme="dark"] .pdnl-word-counter {
    background: var(--pd-light-alt);
    border-color: var(--pd-light-alt);
}

/* ==========================================================================
 * v1.1.0 — ANTEPRIMA RESPONSIVE (P3.2)
 * ========================================================================== */
.pdnl-preview-frame {
    border: 2px solid var(--pd-light-alt);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    margin: 0 auto;
    background: #fff;
}

.pdnl-preview-frame.preview-desktop { width: 100%; max-width: 600px; }
.pdnl-preview-frame.preview-mobile { width: 375px; max-width: 100%; }

/* ==========================================================================
 * v1.1.0 — KEYBOARD SHORTCUT HINT (P3.4)
 * ========================================================================== */
.pdnl-shortcut-hint {
    position: fixed;
    bottom: 70px;
    right: 20px;
    background: var(--pd-navy);
    color: #ccc;
    font-size: 0.72rem;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.pdnl-shortcut-hint.visible { opacity: 1; pointer-events: auto; }
.pdnl-shortcut-hint kbd { background: rgba(255,255,255,0.15); padding: 1px 5px; border-radius: 3px; font-size: 0.7rem; }
