/* Monitor Jurídico - Public Dashboard CSS */

.pjm-public-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #3c434a;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ── Abas de navegação ──────────────────────────────────────────────── */
.pjm-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #1a3a5c;
    margin-bottom: 28px;
}

.pjm-tab {
    display: inline-block;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    color: #1a3a5c;
    text-decoration: none;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    background: #f6f7f7;
    transition: background 0.15s;
}

.pjm-tab:hover {
    background: #e8eef5;
    color: #1a3a5c;
    text-decoration: none;
}

.pjm-tab-active {
    background: #1a3a5c;
    color: #fff !important;
    border-color: #1a3a5c;
}

.pjm-tab-active:hover {
    background: #1a3a5c;
    color: #fff;
}

/* ── Stats Grid ─────────────────────────────────────────────────────── */
.pjm-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.pjm-stat-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.pjm-stat-value {
    display: block;
    font-size: 32px;
    font-weight: 600;
    color: #2271b1;
    margin-bottom: 5px;
}

.pjm-stat-label {
    font-size: 14px;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pjm-stat-warning { border-top: 4px solid #f0b842; }
.pjm-stat-warning .pjm-stat-value { color: #d63638; }

.pjm-stat-danger { border-top: 4px solid #d63638; }
.pjm-stat-danger .pjm-stat-value { color: #d63638; }

/* ── Filters ────────────────────────────────────────────────────────── */
.pjm-filters-box {
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.pjm-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.pjm-filter-row:last-child {
    margin-bottom: 0;
}

.pjm-filter-row input[type="text"],
.pjm-filter-row input[type="date"],
.pjm-filter-row select {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.pjm-btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.pjm-btn-primary {
    background: #1a3a5c;
    color: #fff;
    border-color: #1a3a5c;
}

.pjm-btn-primary:hover {
    background: #0f2540;
    color: #fff;
    text-decoration: none;
}

.pjm-btn-secondary {
    background: #f6f7f7;
    color: #1a3a5c;
    border-color: #1a3a5c;
}

.pjm-btn-secondary:hover {
    background: #f0f0f1;
    text-decoration: none;
}

.pjm-btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

.pjm-btn-full {
    width: 100%;
    text-align: center;
    margin-top: 8px;
}

.pjm-btn-danger {
    background: #d63638;
    color: #fff;
    border-color: #d63638;
}

.pjm-btn-danger:hover {
    background: #b32d2e;
    color: #fff;
}

/* ── Table ──────────────────────────────────────────────────────────── */
.pjm-table-responsive {
    overflow-x: auto;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.pjm-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.pjm-table th,
.pjm-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #c3c4c7;
}

.pjm-table th {
    background: #f6f7f7;
    font-weight: 600;
    color: #3c434a;
}

.pjm-table tbody tr:hover {
    background: #f0f0f1;
}

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

/* ── Status & Deadlines ─────────────────────────────────────────────── */
.pjm-prazo-vencido { color: #d63638; }
.pjm-prazo-hoje { color: #f0b842; }
.pjm-prazo-urgente { color: #8a2424; }

.pjm-row-status-concluido td {
    opacity: 0.6;
    background-color: #f0f8f1;
}

.pjm-update-field {
    padding: 4px 8px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 13px;
    width: 100%;
    max-width: 150px;
}

/* ── Modal ──────────────────────────────────────────────────────────── */
.pjm-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.pjm-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.pjm-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.pjm-modal-close:hover,
.pjm-modal-close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

.pjm-modal-body {
    margin-top: 20px;
    white-space: pre-wrap;
    font-family: monospace;
    background: #f6f7f7;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #ddd;
    max-height: 60vh;
    overflow-y: auto;
}

/* ── Alerts ─────────────────────────────────────────────────────────── */
.pjm-alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.pjm-alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

.pjm-text-center {
    text-align: center;
}

/* ── Loading ────────────────────────────────────────────────────────── */
.pjm-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ── Alerta 15 dias ─────────────────────────────────────────────────── */
.pjm-alerta-15dias {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff8f7;
    border: 1px solid #c0392b;
    border-left: 5px solid #c0392b;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 24px;
    color: #7b1a1a;
}

.pjm-alerta-15dias .pjm-alerta-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.pjm-alerta-15dias strong {
    font-size: 15px;
    color: #c0392b;
    display: block;
    margin-bottom: 4px;
}

.pjm-stat-parada {
    border-top: 4px solid #c0392b;
    background: #fff8f7;
}

.pjm-stat-parada .pjm-stat-value { color: #c0392b; }
.pjm-stat-parada .pjm-stat-label { color: #c0392b; }

.pjm-row-parada {
    background: #fff8f0 !important;
    border-left: 3px solid #e67e22;
}

.pjm-row-parada:hover {
    background: #fef0e0 !important;
}

.pjm-badge-parada {
    display: inline-block;
    background: #fff0e0;
    color: #c0392b;
    border: 1px solid #e67e22;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.pjm-btn-view {
    background: #1a3a5c;
    color: #fff;
    border-color: #1a3a5c;
}

.pjm-btn-view:hover {
    background: #0f2540;
    color: #fff;
}

/* ══════════════════════════════════════════════════════════════════════ */
/* SEÇÃO DE EQUIPE                                                        */
/* ══════════════════════════════════════════════════════════════════════ */

.pjm-team-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.pjm-team-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.pjm-team-card h2 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 700;
    color: #1a3a5c;
    border-bottom: 2px solid #1a3a5c;
    padding-bottom: 10px;
}

/* Card de membros ocupa toda a largura */
#pjm-team-card-members {
    grid-column: 1 / -1;
}

/* Tabela de membros */
.pjm-team-table {
    width: 100%;
    border-collapse: collapse;
}

.pjm-team-table th,
.pjm-team-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    text-align: left;
}

.pjm-team-table th {
    background: #f6f7f7;
    font-weight: 600;
    color: #3c434a;
}

.pjm-team-table tbody tr:hover {
    background: #f9fafb;
}

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

.pjm-team-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 8px;
}

/* Formulários da equipe */
.pjm-form-group {
    margin-bottom: 16px;
}

.pjm-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #3c434a;
    margin-bottom: 5px;
}

.pjm-form-group input[type="text"],
.pjm-form-group input[type="email"],
.pjm-form-group input[type="password"],
.pjm-form-group select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.pjm-form-group input:focus,
.pjm-form-group select:focus {
    border-color: #1a3a5c;
    outline: none;
    box-shadow: 0 0 0 2px rgba(26,58,92,0.15);
}

.pjm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.pjm-field-hint {
    display: block;
    font-size: 12px;
    color: #646970;
    margin-top: 4px;
}

.pjm-required {
    color: #d63638;
}

/* Mensagem de feedback da equipe */
.pjm-team-msg {
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.pjm-team-msg.pjm-msg-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.pjm-team-msg.pjm-msg-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Info box */
.pjm-team-info-box {
    background: #e8f0fe;
    border-left: 4px solid #1a3a5c;
    padding: 14px 18px;
    border-radius: 4px;
    font-size: 13px;
    color: #1a3a5c;
    line-height: 1.6;
}

.pjm-empty-msg {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.pjm-loading-msg {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* ── Responsivo ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .pjm-team-layout {
        grid-template-columns: 1fr;
    }
    #pjm-team-card-members {
        grid-column: 1;
    }
    .pjm-form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .pjm-filter-row {
        flex-direction: column;
    }
    .pjm-filter-row input[type="text"],
    .pjm-filter-row input[type="date"],
    .pjm-filter-row select {
        width: 100%;
    }
    .pjm-tabs {
        flex-wrap: wrap;
    }
}
