/* ── Módulo Plantões ─────────────────────────────────────────────────────── */

/* Botão de notificação ativo */
#pl-notif-btn.notif-on {
    background: #16a34a;
    color: white;
    border-color: transparent;
}
#pl-notif-btn.notif-on:hover { opacity: 0.85; }

/* Tabs de navegação do módulo */
.pl-tabs {
    display: flex;
    gap: 0.25rem;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 0.25rem;
    width: fit-content;
    margin-bottom: 1.5rem;
}
.pl-tab {
    padding: 0.5rem 1.25rem;
    border-radius: 9px;
    border: none;
    background: transparent;
    font-size: 0.88rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.pl-tab.active {
    background: white;
    color: var(--primary, #3b82f6);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.pl-tab:hover:not(.active) { background: #e8eef5; }

/* ── Agenda ────────────────────────────────────────────────────────────────── */

.pl-agenda-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.pl-today-label {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}
.pl-today-sub {
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 0.15rem;
}

/* Tabs de tipo (Plantões / Compromissos) */
.pl-type-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 1rem;
    gap: 0;
}
.pl-type-tab {
    padding: 0.6rem 1.25rem;
    border: none;
    background: transparent;
    font-size: 0.88rem;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.18s;
}
.pl-type-tab.active {
    color: var(--primary, #3b82f6);
    border-bottom-color: var(--primary, #3b82f6);
}

/* Cards de resumo do mês */
.pl-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.pl-summary-card {
    background: white;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    padding: 1rem 1.1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.pl-summary-card .s-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}
.pl-summary-card .s-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
}
.pl-summary-card .s-icon {
    font-size: 1.2rem;
    margin-bottom: 0.4rem;
}
.pl-summary-card.recebido .s-value  { color: #16a34a; }
.pl-summary-card.a-receber .s-value { color: #ea580c; }

/* Item de plantão/compromisso na lista */
.pl-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 0.6rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.15s;
}
.pl-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-1px); }
.pl-item-color {
    width: 5px;
    min-height: 48px;
    border-radius: 3px;
    flex-shrink: 0;
    align-self: stretch;
}
.pl-item-body { flex: 1; min-width: 0; }
.pl-item-title { font-size: 0.92rem; font-weight: 700; color: #1e293b; margin-bottom: 0.2rem; }
.pl-item-meta  { font-size: 0.78rem; color: #64748b; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pl-item-meta i { font-size: 0.72rem; }
.pl-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; flex-shrink: 0; }
.pl-item-valor { font-size: 0.9rem; font-weight: 700; color: #16a34a; white-space: nowrap; }
.pl-item-badge {
    font-size: 0.68rem; font-weight: 700; padding: 0.18rem 0.55rem;
    border-radius: 99px; white-space: nowrap;
}
.pl-item-badge.pago   { background: #dcfce7; color: #16a34a; }
.pl-item-badge.pendente { background: #fff7ed; color: #ea580c; }
.pl-item-badge.compromisso { background: #eff6ff; color: #3b82f6; }

/* Estado vazio */
.pl-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #94a3b8;
}
.pl-empty i { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.4; display: block; }
.pl-empty p { font-size: 0.88rem; margin: 0; }

/* Próximos 7 dias */
.pl-next-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1.5rem 0 0.75rem;
}
.pl-next-header h3 { font-size: 0.92rem; font-weight: 700; color: #1e293b; margin: 0; }
.pl-next-header a  { font-size: 0.8rem; color: var(--primary, #3b82f6); text-decoration: none; font-weight: 600; }

/* ── Calendário ──────────────────────────────────────────────────────────── */

.pl-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.pl-cal-nav h2 { font-size: 1.05rem; font-weight: 700; color: #1e293b; margin: 0; }
.pl-cal-nav button {
    background: white; border: 1.5px solid #e2e8f0; border-radius: 8px;
    width: 34px; height: 34px; cursor: pointer; font-size: 0.9rem;
    color: #475569; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.pl-cal-nav button:hover { background: #f1f5f9; }

.pl-cal-legend {
    display: flex; gap: 1rem; margin-bottom: 0.9rem; flex-wrap: wrap;
}
.pl-cal-legend span {
    display: flex; align-items: center; gap: 0.35rem;
    font-size: 0.78rem; color: #64748b; font-weight: 600;
}
.pl-cal-legend .dot {
    width: 9px; height: 9px; border-radius: 50%;
}
.pl-cal-legend .dot.plantao    { background: var(--primary, #3b82f6); }
.pl-cal-legend .dot.compromisso{ background: #94a3b8; border: 1px solid #94a3b8; }
.pl-cal-legend .dot.pendente   { background: #f59e0b; }

.pl-cal-grid {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.pl-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.pl-cal-weekday {
    text-align: center;
    padding: 0.6rem 0.2rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.pl-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}
.pl-cal-day {
    min-height: 72px;
    padding: 0.4rem;
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.12s;
    position: relative;
}
.pl-cal-day:nth-child(7n) { border-right: none; }
.pl-cal-day:hover { background: #f8fafc; }
.pl-cal-day.today .pl-cal-daynr {
    background: var(--primary, #3b82f6);
    color: white;
    border-radius: 50%;
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
}
.pl-cal-day.other-month { background: #fafbfd; }
.pl-cal-day.other-month .pl-cal-daynr { color: #cbd5e1; }
.pl-cal-daynr { font-size: 0.82rem; font-weight: 600; color: #475569; margin-bottom: 0.25rem; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.pl-cal-events { display: flex; flex-direction: column; gap: 2px; }
.pl-cal-event {
    font-size: 0.68rem; font-weight: 600; padding: 1px 5px;
    border-radius: 4px; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; color: white;
}
.pl-cal-more { font-size: 0.65rem; color: #94a3b8; padding-left: 2px; }

/* ── Relatórios ──────────────────────────────────────────────────────────── */

.pl-rel-month-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.5rem 1rem;
    width: fit-content;
}
.pl-rel-month-nav button {
    background: none; border: none; cursor: pointer;
    color: #64748b; font-size: 0.9rem; padding: 0.1rem 0.3rem;
    border-radius: 6px; transition: background 0.15s;
}
.pl-rel-month-nav button:hover { background: #f1f5f9; }
.pl-rel-month-nav span { font-size: 0.88rem; font-weight: 700; color: #1e293b; }

.pl-rel-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1.5rem; }

.pl-chart-card {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.pl-chart-card h3 { font-size: 0.9rem; font-weight: 700; color: #1e293b; margin: 0 0 1rem; }

/* Gráfico de barras simples */
.pl-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 120px;
}
.pl-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    height: 100%;
    justify-content: flex-end;
}
.pl-bar {
    width: 100%;
    background: var(--primary, #3b82f6);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.4s ease;
    opacity: 0.85;
}
.pl-bar:hover { opacity: 1; }
.pl-bar-label { font-size: 0.65rem; color: #94a3b8; font-weight: 600; }
.pl-bar-val { font-size: 0.62rem; color: #64748b; font-weight: 600; }

/* Tabela por local */
.pl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}
.pl-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #94a3b8;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.pl-table td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
}
.pl-table tr:last-child td { border-bottom: none; }
.pl-table td:first-child { font-weight: 600; color: #1e293b; }

/* ── Modais ──────────────────────────────────────────────────────────────── */

.pl-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(3px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.pl-modal-overlay.open { display: flex; }

.pl-modal {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: pl-slide-up 0.22s ease;
}
@keyframes pl-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.pl-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}
.pl-modal-header h2 { font-size: 1rem; font-weight: 700; color: #1e293b; margin: 0; }
.pl-modal-close {
    background: #f1f5f9; border: none; border-radius: 50%;
    width: 30px; height: 30px; cursor: pointer; font-size: 1rem;
    color: #64748b; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.pl-modal-close:hover { background: #e2e8f0; }

/* Modal tabs (Plantão / Compromisso) */
.pl-modal-tabs {
    display: flex;
    padding: 0.75rem 1.5rem 0;
    gap: 0;
    border-bottom: 2px solid #e2e8f0;
}
.pl-modal-tab {
    padding: 0.5rem 1.1rem;
    font-size: 0.88rem; font-weight: 600;
    color: #94a3b8; border: none; background: transparent;
    cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
    transition: all 0.15s;
}
.pl-modal-tab.active { color: var(--primary, #3b82f6); border-bottom-color: var(--primary, #3b82f6); }

.pl-modal-body { padding: 1.25rem 1.5rem; }

/* Campos do formulário */
.pl-field { margin-bottom: 1rem; }
.pl-field label { display: block; font-size: 0.78rem; font-weight: 700; color: #475569; margin-bottom: 0.35rem; }
.pl-field input, .pl-field select, .pl-field textarea {
    width: 100%; padding: 0.6rem 0.85rem;
    border: 1.5px solid #e2e8f0; border-radius: 10px;
    font-size: 0.88rem; color: #1e293b; background: white;
    outline: none; transition: border-color 0.18s;
    font-family: inherit; box-sizing: border-box;
}
.pl-field input:focus, .pl-field select:focus, .pl-field textarea:focus { border-color: var(--primary, #3b82f6); }
.pl-field textarea { resize: vertical; min-height: 70px; }

.pl-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

/* Radio tipo */
.pl-radio-group { display: flex; gap: 1.25rem; }
.pl-radio-group label {
    display: flex; align-items: center; gap: 0.4rem;
    font-size: 0.85rem; font-weight: 600; color: #475569;
    cursor: pointer; margin: 0;
}
.pl-radio-group input[type=radio] { accent-color: var(--primary, #3b82f6); width: 16px; height: 16px; }

/* Seletor de cores */
.pl-color-picker { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.pl-color-dot {
    width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
    border: 2.5px solid transparent; transition: transform 0.15s, border-color 0.15s;
}
.pl-color-dot:hover { transform: scale(1.15); }
.pl-color-dot.selected { border-color: #1e293b; transform: scale(1.15); }

/* Local input com botão */
.pl-local-wrap { position: relative; }
.pl-local-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: white; border: 1.5px solid #e2e8f0; border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 100;
    overflow: hidden; display: none;
    max-height: 200px; overflow-y: auto;
}
.pl-local-dropdown.open { display: block; }
.pl-local-opt {
    padding: 0.6rem 0.9rem; font-size: 0.85rem; color: #334155; cursor: pointer;
    border-bottom: 1px solid #f8fafc; transition: background 0.12s;
}
.pl-local-opt:hover { background: #eff6ff; color: #3b82f6; }
.pl-local-opt.add-new { color: #3b82f6; font-weight: 700; }
.pl-local-opt:last-child { border-bottom: none; }

/* Footer do modal */
.pl-modal-footer {
    display: flex; justify-content: flex-end; gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #f1f5f9;
}
.pl-btn-cancel {
    padding: 0.55rem 1.25rem; border-radius: 10px;
    border: 1.5px solid #e2e8f0; background: white;
    font-size: 0.88rem; font-weight: 600; color: #64748b;
    cursor: pointer; transition: background 0.15s;
}
.pl-btn-cancel:hover { background: #f1f5f9; }
.pl-btn-primary {
    padding: 0.55rem 1.5rem; border-radius: 10px;
    border: none; background: var(--primary, #3b82f6); color: white;
    font-size: 0.88rem; font-weight: 700; cursor: pointer;
    transition: opacity 0.15s;
}
.pl-btn-primary:hover { opacity: 0.88; }

/* ── Ações rápidas no item ───────────────────────────────────────────────── */
.pl-item-actions {
    display: flex; gap: 0.35rem; flex-shrink: 0; align-items: center;
}
.pl-btn-sm {
    padding: 0.25rem 0.6rem; border-radius: 8px; font-size: 0.72rem;
    font-weight: 700; border: 1.5px solid; cursor: pointer; transition: opacity 0.15s;
    white-space: nowrap;
}
.pl-btn-pagar  { background: #f0fdf4; color: #16a34a; border-color: #86efac; }
.pl-btn-edit   { background: #eff6ff; color: #3b82f6; border-color: #93c5fd; }
.pl-btn-delete { background: #fff1f2; color: #e11d48; border-color: #fca5a5; }

/* ── Botão Novo ──────────────────────────────────────────────────────────── */
.pl-btn-novo {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.55rem 1.25rem; border-radius: 10px;
    background: var(--primary, #3b82f6); color: white;
    border: none; font-size: 0.88rem; font-weight: 700;
    cursor: pointer; transition: opacity 0.15s;
    text-decoration: none;
}
.pl-btn-novo:hover { opacity: 0.88; }

/* ── Detalhe de plantão (slide drawer) ──────────────────────────────────── */
.pl-detail-row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid #f1f5f9; font-size: 0.85rem; }
.pl-detail-row:last-child { border-bottom: none; }
.pl-detail-row span:first-child { color: #94a3b8; font-weight: 600; }
.pl-detail-row span:last-child  { color: #1e293b; font-weight: 700; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .pl-field-row { grid-template-columns: 1fr; }
    .pl-cal-day { min-height: 52px; }
    .pl-cal-event { display: none; }
    .pl-cal-day.has-event::after {
        content: '';
        display: block;
        width: 6px; height: 6px;
        background: var(--primary, #3b82f6);
        border-radius: 50%;
        margin: 2px auto;
    }
    .pl-summary-grid { grid-template-columns: 1fr 1fr; }
    .pl-modal { border-radius: 16px 16px 0 0; max-height: 95vh; }
    .pl-modal-overlay { align-items: flex-end; padding: 0; }
    .pl-modal-sm-overlay { align-items: center !important; padding: 1rem !important; }
    .pl-tabs { width: 100%; }
    .pl-tab { flex: 1; justify-content: center; }
}

/* ── Modal pequeno (novo local) ──────────────────────────────────────────── */
.pl-modal-sm {
    max-width: 400px;
    border-radius: 20px !important;
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
#pl-toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}
.pl-toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
    min-width: 240px;
    max-width: 360px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    pointer-events: all;
    animation: toast-in 0.25s ease forwards;
}
.pl-toast.out { animation: toast-out 0.25s ease forwards; }
.pl-toast.success { background: #16a34a; }
.pl-toast.error   { background: #dc2626; }
.pl-toast.warning { background: #d97706; }
.pl-toast.info    { background: #2563eb; }
.pl-toast i { font-size: 1rem; flex-shrink: 0; }
@keyframes toast-in  { from { opacity:0; transform:translateX(40px); } to { opacity:1; transform:translateX(0); } }
@keyframes toast-out { from { opacity:1; transform:translateX(0); }    to { opacity:0; transform:translateX(40px); } }

/* ── Confirm modal ───────────────────────────────────────────────────────── */
.pl-confirm-box {
    text-align: center;
    padding: 0.5rem 0 0;
}
.pl-confirm-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: #fef3c7;
    color: #d97706;
    font-size: 1.4rem;
    display: flex; align-items: center; justify-content: center;
    margin: 1.25rem auto 0.75rem;
}
.pl-confirm-icon.danger { background: #fee2e2; color: #dc2626; }
.pl-confirm-box h3 { font-size: 0.95rem; font-weight: 700; color: #1e293b; margin: 0 0 0.3rem; padding: 0 1.5rem; }
.pl-confirm-box p  { font-size: 0.82rem; color: #64748b; margin: 0 0 1.25rem; padding: 0 1.5rem; }
.pl-btn-danger {
    padding: 0.55rem 1.25rem;
    border-radius: 10px;
    border: none;
    background: #dc2626;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.pl-btn-danger:hover { background: #b91c1c; }

/* ── Compartilhar ────────────────────────────────────────────────────────── */
.pl-share-mode-btn.active {
    background: var(--primary, #0a1a3a) !important;
    border-color: var(--primary, #0a1a3a) !important;
    color: white !important;
}
.pl-share-opts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.pl-share-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1rem 0.5rem;
    border-radius: 14px;
    border: 2px solid #f1f5f9;
    background: white;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
}
.pl-share-opt:hover { border-color: var(--primary, #3b82f6); background: #f8faff; }
.pl-share-opt i { font-size: 1.6rem; }
.pl-share-preview {
    background: #f8fafc;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    font-size: 0.78rem;
    color: #475569;
    white-space: pre-wrap;
    line-height: 1.6;
    font-family: monospace;
    max-height: 260px;
    overflow-y: auto;
}

/* ── Relatórios — topbar ─────────────────────────────────────────────────── */
.pl-rel-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.pl-rel-heading {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.pl-rel-heading i { color: var(--primary, #3b82f6); }
.pl-rel-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.pl-rel-action-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    background: white;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
}
.pl-rel-action-btn:hover { border-color: var(--primary,#3b82f6); color: var(--primary,#3b82f6); }
.pl-rel-action-btn.primary { background: var(--primary,#3b82f6); color: white; border-color: transparent; }
.pl-rel-action-btn.primary:hover { opacity: 0.88; }

/* ── Filtros avançados ───────────────────────────────────────────────────── */
.pl-filter-panel {
    background: white;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid #f1f5f9;
}
.pl-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: flex-end;
}
.pl-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 120px;
}
.pl-filter-group label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.pl-filter-group select,
.pl-filter-group input[type="date"] {
    padding: 0.42rem 0.7rem;
    border-radius: 9px;
    border: 1.5px solid #e2e8f0;
    font-size: 0.83rem;
    color: #334155;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.15s;
}
.pl-filter-group select:focus,
.pl-filter-group input[type="date"]:focus {
    border-color: var(--primary,#3b82f6);
    outline: none;
}
.pl-filter-apply {
    padding: 0.45rem 1rem;
    border-radius: 9px;
    border: none;
    background: var(--primary,#3b82f6);
    color: white;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    align-self: flex-end;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: opacity 0.15s;
}
.pl-filter-apply:hover { opacity: 0.85; }
.pl-filter-clear {
    padding: 0.45rem 0.7rem;
    border-radius: 9px;
    border: 1.5px solid #e2e8f0;
    background: white;
    color: #94a3b8;
    font-size: 0.9rem;
    cursor: pointer;
    align-self: flex-end;
    transition: all 0.15s;
}
.pl-filter-clear:hover { border-color: #dc2626; color: #dc2626; }
.pl-filter-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.6rem;
}
.pl-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.65rem;
    border-radius: 20px;
    background: #eff6ff;
    color: var(--primary,#3b82f6);
    font-size: 0.75rem;
    font-weight: 600;
}

/* ── Cards de resumo do relatório ────────────────────────────────────────── */
.pl-rel-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}
.pl-rel-card {
    border-radius: 16px;
    padding: 1.1rem 1.2rem;
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    background: white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid transparent;
}
.pl-rel-card.verde  { border-color: #bbf7d0; }
.pl-rel-card.laranja{ border-color: #fed7aa; }
.pl-rel-card.azul   { border-color: #bfdbfe; }
.pl-rel-card.roxo   { border-color: #ddd6fe; }
.pl-rel-card-icon {
    width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}
.pl-rel-card.verde  .pl-rel-card-icon { background:#dcfce7; color:#16a34a; }
.pl-rel-card.laranja .pl-rel-card-icon { background:#ffedd5; color:#ea580c; }
.pl-rel-card.azul   .pl-rel-card-icon { background:#dbeafe; color:#2563eb; }
.pl-rel-card.roxo   .pl-rel-card-icon { background:#ede9fe; color:#7c3aed; }
.pl-rel-card-label { font-size: 0.73rem; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 0.2rem; }
.pl-rel-card-value { font-size: 1.2rem; font-weight: 800; color: #1e293b; }
.pl-rel-card-sub   { font-size: 0.72rem; color: #94a3b8; margin-top: 0.15rem; }

/* ── Cabeçalho do chart card ─────────────────────────────────────────────── */
.pl-chart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.pl-chart-card-header h3 { margin: 0; font-size: 0.9rem; font-weight: 700; color: #1e293b; display: flex; align-items: center; gap: 0.4rem; }
.pl-chart-legend { display: flex; gap: 0.85rem; }
.pl-chart-legend span { font-size: 0.75rem; color: #64748b; display: flex; align-items: center; gap: 0.3rem; }
.leg-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ── Tabela melhorada ────────────────────────────────────────────────────── */
.pl-table tbody tr:hover { background: #f8fafc; }
.pl-table .pct-bar { height: 4px; border-radius: 4px; background: #e2e8f0; margin-top: 4px; }
.pl-table .pct-fill { height: 4px; border-radius: 4px; background: var(--primary,#3b82f6); }

/* ── Lista detalhada ─────────────────────────────────────────────────────── */
.pl-lista-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid #f1f5f9;
}
.pl-lista-item:last-child { border-bottom: none; }
.pl-lista-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pl-lista-info { flex: 1; min-width: 0; }
.pl-lista-titulo { font-size: 0.85rem; font-weight: 600; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-lista-meta { font-size: 0.75rem; color: #94a3b8; margin-top: 1px; }
.pl-lista-valor { font-size: 0.88rem; font-weight: 700; color: #1e293b; white-space: nowrap; }
.pl-lista-status { font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.55rem; border-radius: 20px; }
.pl-lista-status.pago    { background: #dcfce7; color: #16a34a; }
.pl-lista-status.pendente{ background: #ffedd5; color: #ea580c; }

/* ── Print / PDF ─────────────────────────────────────────────────────────── */
@media print {
    body * { visibility: hidden; }
    #pl-print-area, #pl-print-area * { visibility: visible; }
    #pl-print-area {
        position: fixed; inset: 0;
        padding: 2rem;
        background: white;
    }
}

/* ── Responsivo extra ────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .pl-rel-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .pl-rel-cards { grid-template-columns: 1fr 1fr; }
    .pl-rel-topbar { flex-direction: column; align-items: flex-start; }
    .pl-filter-group { min-width: 100%; }
}

/* ══════════════════════════════════════════════════════════════════════════
   DARK MODE — Módulo Plantões
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Tabs de navegação ───────────────────────────────────────────────────── */
[data-theme="dark"] .pl-tabs {
    background: #19273a;
}
[data-theme="dark"] .pl-tab {
    color: #94a3b8;
}
[data-theme="dark"] .pl-tab.active {
    background: #1f3145;
    color: #3b82f6;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
[data-theme="dark"] .pl-tab:hover:not(.active) {
    background: #1f3145;
}

/* ── Agenda — cabeçalho e labels ─────────────────────────────────────────── */
[data-theme="dark"] .pl-today-label {
    color: #e2e8f0;
}
[data-theme="dark"] .pl-today-sub {
    color: #64748b;
}

/* ── Tabs de tipo (Plantões / Compromissos) ──────────────────────────────── */
[data-theme="dark"] .pl-type-tabs {
    border-bottom-color: #1e3550;
}
[data-theme="dark"] .pl-type-tab {
    color: #64748b;
}
[data-theme="dark"] .pl-type-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* ── Cards de resumo do mês ──────────────────────────────────────────────── */
[data-theme="dark"] .pl-summary-card {
    background: #111d2e;
    border-color: #1e3550;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
[data-theme="dark"] .pl-summary-card .s-label {
    color: #64748b;
}
[data-theme="dark"] .pl-summary-card .s-value {
    color: #e2e8f0;
}
[data-theme="dark"] .pl-summary-card.recebido .s-value  { color: #22c55e; }
[data-theme="dark"] .pl-summary-card.a-receber .s-value { color: #fb923c; }

/* ── Item de plantão / compromisso ──────────────────────────────────────── */
[data-theme="dark"] .pl-item {
    background: #111d2e;
    border-color: #1e3550;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
[data-theme="dark"] .pl-item:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    background: #1f3145;
}
[data-theme="dark"] .pl-item-title {
    color: #e2e8f0;
}
[data-theme="dark"] .pl-item-meta {
    color: #64748b;
}
[data-theme="dark"] .pl-item-valor {
    color: #22c55e;
}

/* ── Badges de status ────────────────────────────────────────────────────── */
[data-theme="dark"] .pl-item-badge.pago {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}
[data-theme="dark"] .pl-item-badge.pendente {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
}
[data-theme="dark"] .pl-item-badge.compromisso {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

/* ── Estado vazio ────────────────────────────────────────────────────────── */
[data-theme="dark"] .pl-empty {
    color: #64748b;
}

/* ── Próximos 7 dias — header ────────────────────────────────────────────── */
[data-theme="dark"] .pl-next-header h3 {
    color: #e2e8f0;
}
[data-theme="dark"] .pl-next-header a {
    color: #3b82f6;
}

/* ── Calendário — navegação ──────────────────────────────────────────────── */
[data-theme="dark"] .pl-cal-nav h2 {
    color: #e2e8f0;
}
[data-theme="dark"] .pl-cal-nav button {
    background: #19273a;
    border-color: #1e3550;
    color: #94a3b8;
}
[data-theme="dark"] .pl-cal-nav button:hover {
    background: #1f3145;
}

/* ── Calendário — legenda ────────────────────────────────────────────────── */
[data-theme="dark"] .pl-cal-legend span {
    color: #64748b;
}

/* ── Calendário — grid ───────────────────────────────────────────────────── */
[data-theme="dark"] .pl-cal-grid {
    background: #111d2e;
    border-color: #1e3550;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
[data-theme="dark"] .pl-cal-weekdays {
    background: #19273a;
    border-bottom-color: #1e3550;
}
[data-theme="dark"] .pl-cal-weekday {
    color: #64748b;
}
[data-theme="dark"] .pl-cal-day {
    border-right-color: #1e3550;
    border-bottom-color: #1e3550;
}
[data-theme="dark"] .pl-cal-day:hover {
    background: #19273a;
}
[data-theme="dark"] .pl-cal-day.other-month {
    background: #0d1824;
}
[data-theme="dark"] .pl-cal-day.other-month .pl-cal-daynr {
    color: #334155;
}
[data-theme="dark"] .pl-cal-daynr {
    color: #94a3b8;
}
[data-theme="dark"] .pl-cal-more {
    color: #64748b;
}

/* ── Relatórios — navegação de mês ──────────────────────────────────────── */
[data-theme="dark"] .pl-rel-month-nav {
    background: #111d2e;
    border-color: #1e3550;
}
[data-theme="dark"] .pl-rel-month-nav button {
    color: #94a3b8;
}
[data-theme="dark"] .pl-rel-month-nav button:hover {
    background: #1f3145;
}
[data-theme="dark"] .pl-rel-month-nav span {
    color: #e2e8f0;
}

/* ── Chart card ──────────────────────────────────────────────────────────── */
[data-theme="dark"] .pl-chart-card {
    background: #111d2e;
    border-color: #1e3550;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
[data-theme="dark"] .pl-chart-card h3,
[data-theme="dark"] .pl-chart-card-header h3 {
    color: #e2e8f0;
}
[data-theme="dark"] .pl-chart-legend span {
    color: #94a3b8;
}
[data-theme="dark"] .pl-bar-label {
    color: #64748b;
}
[data-theme="dark"] .pl-bar-val {
    color: #94a3b8;
}

/* ── Tabela ──────────────────────────────────────────────────────────────── */
[data-theme="dark"] .pl-table th {
    background: #19273a;
    border-bottom-color: #1e3550;
    color: #64748b;
}
[data-theme="dark"] .pl-table td {
    border-bottom-color: #1e3550;
    color: #94a3b8;
}
[data-theme="dark"] .pl-table td:first-child {
    color: #e2e8f0;
}
[data-theme="dark"] .pl-table tbody tr:hover {
    background: #19273a;
}
[data-theme="dark"] .pl-table .pct-bar {
    background: #1e3550;
}

/* ── Modal overlay e caixa ───────────────────────────────────────────────── */
[data-theme="dark"] .pl-modal {
    background: #111d2e;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
[data-theme="dark"] .pl-modal-header {
    border-bottom-color: #1e3550;
}
[data-theme="dark"] .pl-modal-header h2 {
    color: #e2e8f0;
}
[data-theme="dark"] .pl-modal-close {
    background: #19273a;
    color: #94a3b8;
}
[data-theme="dark"] .pl-modal-close:hover {
    background: #1f3145;
}

/* ── Modal tabs ──────────────────────────────────────────────────────────── */
[data-theme="dark"] .pl-modal-tabs {
    border-bottom-color: #1e3550;
}
[data-theme="dark"] .pl-modal-tab {
    color: #64748b;
}
[data-theme="dark"] .pl-modal-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* ── Formulário — campos ─────────────────────────────────────────────────── */
[data-theme="dark"] .pl-field label {
    color: #94a3b8;
}
[data-theme="dark"] .pl-field input,
[data-theme="dark"] .pl-field select,
[data-theme="dark"] .pl-field textarea {
    background: #19273a;
    border-color: #1e3550;
    color: #e2e8f0;
}
[data-theme="dark"] .pl-field input:focus,
[data-theme="dark"] .pl-field select:focus,
[data-theme="dark"] .pl-field textarea:focus {
    border-color: #3b82f6;
}
[data-theme="dark"] .pl-field input::placeholder,
[data-theme="dark"] .pl-field textarea::placeholder {
    color: #64748b;
}

/* ── Radio group ─────────────────────────────────────────────────────────── */
[data-theme="dark"] .pl-radio-group label {
    color: #94a3b8;
}

/* ── Seletor de cores — dot selecionado ──────────────────────────────────── */
[data-theme="dark"] .pl-color-dot.selected {
    border-color: #e2e8f0;
}

/* ── Dropdown de local ───────────────────────────────────────────────────── */
[data-theme="dark"] .pl-local-dropdown {
    background: #111d2e;
    border-color: #1e3550;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
[data-theme="dark"] .pl-local-opt {
    color: #e2e8f0;
    border-bottom-color: #1e3550;
}
[data-theme="dark"] .pl-local-opt:hover {
    background: #1f3145;
    color: #3b82f6;
}
[data-theme="dark"] .pl-local-opt.add-new {
    color: #3b82f6;
}

/* ── Modal footer ────────────────────────────────────────────────────────── */
[data-theme="dark"] .pl-modal-footer {
    border-top-color: #1e3550;
}
[data-theme="dark"] .pl-btn-cancel {
    background: #19273a;
    border-color: #1e3550;
    color: #94a3b8;
}
[data-theme="dark"] .pl-btn-cancel:hover {
    background: #1f3145;
}

/* ── Botões de ação rápida no item ───────────────────────────────────────── */
[data-theme="dark"] .pl-btn-pagar {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}
[data-theme="dark"] .pl-btn-edit {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
}
[data-theme="dark"] .pl-btn-delete {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

/* ── Detalhe de plantão (drawer) ─────────────────────────────────────────── */
[data-theme="dark"] .pl-detail-row {
    border-bottom-color: #1e3550;
}
[data-theme="dark"] .pl-detail-row span:first-child {
    color: #64748b;
}
[data-theme="dark"] .pl-detail-row span:last-child {
    color: #e2e8f0;
}

/* ── Relatórios — topbar e botões ────────────────────────────────────────── */
[data-theme="dark"] .pl-rel-heading {
    color: #e2e8f0;
}
[data-theme="dark"] .pl-rel-action-btn {
    background: #19273a;
    border-color: #1e3550;
    color: #94a3b8;
}
[data-theme="dark"] .pl-rel-action-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}
[data-theme="dark"] .pl-rel-action-btn.primary {
    background: #3b82f6;
    color: white;
    border-color: transparent;
}

/* ── Painel de filtros ───────────────────────────────────────────────────── */
[data-theme="dark"] .pl-filter-panel {
    background: #111d2e;
    border-color: #1e3550;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
[data-theme="dark"] .pl-filter-group label {
    color: #64748b;
}
[data-theme="dark"] .pl-filter-group select,
[data-theme="dark"] .pl-filter-group input[type="date"] {
    background: #19273a;
    border-color: #1e3550;
    color: #e2e8f0;
}
[data-theme="dark"] .pl-filter-group select:focus,
[data-theme="dark"] .pl-filter-group input[type="date"]:focus {
    border-color: #3b82f6;
}
[data-theme="dark"] .pl-filter-clear {
    background: #19273a;
    border-color: #1e3550;
    color: #64748b;
}
[data-theme="dark"] .pl-filter-clear:hover {
    border-color: #ef4444;
    color: #ef4444;
}
[data-theme="dark"] .pl-filter-tag {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

/* ── Cards de resumo dos relatórios ──────────────────────────────────────── */
[data-theme="dark"] .pl-rel-card {
    background: #111d2e;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
[data-theme="dark"] .pl-rel-card.verde   { border-color: rgba(34, 197, 94, 0.25); }
[data-theme="dark"] .pl-rel-card.laranja { border-color: rgba(251, 146, 60, 0.25); }
[data-theme="dark"] .pl-rel-card.azul    { border-color: rgba(59, 130, 246, 0.25); }
[data-theme="dark"] .pl-rel-card.roxo    { border-color: rgba(124, 58, 237, 0.25); }
[data-theme="dark"] .pl-rel-card.verde   .pl-rel-card-icon { background: rgba(34, 197, 94, 0.15);  color: #22c55e; }
[data-theme="dark"] .pl-rel-card.laranja .pl-rel-card-icon { background: rgba(251, 146, 60, 0.15); color: #fb923c; }
[data-theme="dark"] .pl-rel-card.azul    .pl-rel-card-icon { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
[data-theme="dark"] .pl-rel-card.roxo    .pl-rel-card-icon { background: rgba(124, 58, 237, 0.15); color: #a78bfa; }
[data-theme="dark"] .pl-rel-card-label {
    color: #64748b;
}
[data-theme="dark"] .pl-rel-card-value {
    color: #e2e8f0;
}
[data-theme="dark"] .pl-rel-card-sub {
    color: #64748b;
}

/* ── Lista detalhada ─────────────────────────────────────────────────────── */
[data-theme="dark"] .pl-lista-item {
    border-bottom-color: #1e3550;
}
[data-theme="dark"] .pl-lista-titulo {
    color: #e2e8f0;
}
[data-theme="dark"] .pl-lista-meta {
    color: #64748b;
}
[data-theme="dark"] .pl-lista-valor {
    color: #e2e8f0;
}
[data-theme="dark"] .pl-lista-status.pago {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}
[data-theme="dark"] .pl-lista-status.pendente {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
}

/* ── Confirm modal ───────────────────────────────────────────────────────── */
[data-theme="dark"] .pl-confirm-icon {
    background: rgba(217, 119, 6, 0.2);
    color: #fbbf24;
}
[data-theme="dark"] .pl-confirm-icon.danger {
    background: rgba(220, 38, 38, 0.2);
    color: #ef4444;
}
[data-theme="dark"] .pl-confirm-box h3 {
    color: #e2e8f0;
}
[data-theme="dark"] .pl-confirm-box p {
    color: #94a3b8;
}

/* ── Share / compartilhar ────────────────────────────────────────────────── */
[data-theme="dark"] .pl-share-opt {
    background: #111d2e;
    border-color: #1e3550;
    color: #94a3b8;
}
[data-theme="dark"] .pl-share-opt:hover {
    border-color: #3b82f6;
    background: #19273a;
}
[data-theme="dark"] .pl-share-preview {
    background: #19273a;
    color: #94a3b8;
}

/* ── Botão de notificação ativo ──────────────────────────────────────────── */
[data-theme="dark"] #pl-notif-btn.notif-on {
    background: #16a34a;
    color: white;
    border-color: transparent;
}
