#dpems-plantao-unidades {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333333;
}
#dpems-plantao-unidades .content {
    margin: 0 auto;
    padding: 0 15px;
}
#dpems-plantao-unidades #searchOrgaosAtuacao {
    position: relative;
    margin-bottom: 15px;
}
#dpems-plantao-unidades .search {
    width: 100%;
    padding: 15px 20px 15px 45px;
    border: 1px solid #dddddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    height: 50px;
}
#dpems-plantao-unidades .search:focus {
    outline: none;
    border-color: #519c5e;
    box-shadow: 0 0 0 3px rgba(0, 90, 156, 0.2);
}
#dpems-plantao-unidades .iconSearch {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}
#dpems-plantao-unidades #itens {
    list-style: none;
    padding: 0;
    margin: 0;
}
#dpems-plantao-unidades .cidade {
    background-color: #ffffff;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#dpems-plantao-unidades .cidade:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}
#dpems-plantao-unidades .titulo {
    background-color: #519c5e;
    color: white;
    padding: 15px 20px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    position: relative;
}
#dpems-plantao-unidades .titulo::after {
    content: '+';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5em;
    font-weight: bold;
}
#dpems-plantao-unidades .cidade.aberto .titulo::after {
    content: '−';
}
#dpems-plantao-unidades .unidade {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
}
#dpems-plantao-unidades .dadosUnidade {
    border-bottom: 1px solid #dddddd;
    padding-bottom: 15px;
    margin-bottom: 15px;
}
#dpems-plantao-unidades .dadosUnidade p {
    margin: 0 0 8px 0;
    line-height: 1.5;
}
#dpems-plantao-unidades .item {
    border-radius: 10px;
    padding: 10px 20px;
    background-color: #519c5e11;
    margin-bottom: 20px;
}
#dpems-plantao-unidades .item p { margin: 0 0 5px 0; line-height: 1.5; }
#dpems-plantao-unidades .item p.defensor { font-size: 1.05em; }
#dpems-plantao-unidades .item p.email { font-size: 0.95em; color: #555; }
#dpems-plantao-unidades .item p.nome { font-size: 0.95em; color: #555; }
#dpems-plantao-unidades .item a { color: #519c5e; text-decoration: none; }
#dpems-plantao-unidades .item a:hover { text-decoration: underline; }
#dpems-plantao-unidades #msgBox {
    text-align: center;
    padding: 40px;
    font-size: 1.2em;
    color: #777;
    background-color: #f8f9fa;
    border-radius: 10px;
    border: 1px dashed #ddd;
}
#dpems-plantao-unidades .is-hidden,
#dpems-plantao-unidades .is-hidden-by-search {
    display: none;
}

#dpems-plantao-unidades .edit-toolbar, #dpems-plantao-unidades #filter-toolbar {
    margin: 0 auto 15px auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
#dpems-plantao-unidades #filter-toolbar select#regional-filter {
    height: 40px;
    box-shadow: none;
}
#dpems-plantao-unidades .edit-toolbar {
    background-color: #f8f9fa;
    border-radius: 8px;
    justify-content: flex-end;
}
#dpems-plantao-unidades #save-status {
    margin-left: 15px;
    font-style: italic;
    color: #555;
}

#dpems-plantao-unidades .edit-button, #dpems-plantao-unidades .save-button, #dpems-plantao-unidades .cancel-button {
    padding: 8px 15px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
}
#dpems-plantao-unidades .edit-button { background-color: #ffc107; color: #212529; }
#dpems-plantao-unidades .edit-button:hover { background-color: #e0a800; }
#dpems-plantao-unidades .save-button { background-color: #28a745; color: white; }
#dpems-plantao-unidades .save-button:hover { background-color: #218838; }
#dpems-plantao-unidades .cancel-button { background-color: #6c757d; color: white; }
#dpems-plantao-unidades .cancel-button:hover { background-color: #5a6268; }

#dpems-plantao-unidades .filter-btn {
    padding: 8px 15px;
    border: 1px solid #ccc;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    background-color: #fff;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}
#dpems-plantao-unidades .filter-btn:hover { background-color: #e9ecef; border-color: #adb5bd; }
#dpems-plantao-unidades .filter-btn.active { background-color: #519c5e; color: white; border-color: #519c5e; }
#dpems-plantao-unidades #regional-filter {
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

#dpems-plantao-unidades .regional-display-container {
    display: flex;
    align-items: center;
    background-color: #519c5e;
    color: white;
    padding: 8px 10px 8px 15px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    height: 40px; 
    box-sizing: border-box;
    cursor: default;
}

#dpems-plantao-unidades .regional-display-container span {
    margin-right: 10px;
    white-space: nowrap;
}

#dpems-plantao-unidades .clear-regional-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 16px;
    line-height: 20px;
    text-align: center;
    font-weight: bold;
    padding: 0;
    transition: background-color 0.2s;
}

#dpems-plantao-unidades .clear-regional-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}


#dpems-plantao-unidades .item-actions {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #eee;
}
#dpems-plantao-unidades.edit-mode-active .item-actions { display: flex; gap: 10px; flex-wrap: wrap; }
#dpems-plantao-unidades .action-btn { background: none; border: 1px solid #ccc; border-radius: 5px; padding: 5px 10px; cursor: pointer; font-size: 12px; }
#dpems-plantao-unidades .action-btn:hover { background-color: #f5f5f5; }
#dpems-plantao-unidades .action-btn.delete { color: #dc3545; border-color: #dc3545; }
#dpems-plantao-unidades .action-btn.delete:hover { background-color: #dc3545; color: white; }

#dpems-plantao-unidades .status-tag { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 0.8em; font-weight: bold; color: #fff; margin-left: 8px; }
#dpems-plantao-unidades .status-tag.ativo { background-color: #28a745; }
#dpems-plantao-unidades .status-tag.afastado { background-color: #f7e1af; color: #a98b4d; }
#dpems-plantao-unidades .status-tag.substituto { background-color: #17a2b8; }
#dpems-plantao-unidades .status-tag.auxiliar { background-color: #6f42c1; }
#dpems-plantao-unidades .vaga { background-color: #ffe4e3; color: #bb5b68; }

#dpems-plantao-unidades .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); display: flex; justify-content: center; align-items: center; z-index: 1000; }
#dpems-plantao-unidades .modal-content { background-color: white; padding: 25px; border-radius: 10px; width: 90%; max-width: 500px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
#dpems-plantao-unidades .modal-content h3 { margin-top: 0; border-bottom: 1px solid #eee; padding-bottom: 15px; }
#dpems-plantao-unidades #edit-form .form-group { margin-bottom: 15px; }
#dpems-plantao-unidades #edit-form label { display: block; margin-bottom: 5px; font-weight: 500; color: #555; }
#dpems-plantao-unidades #edit-form input, #dpems-plantao-unidades #edit-form select { width: 100%; border: 1px solid #ccc; border-radius: 5px; font-size: 16px; box-sizing: border-box; }
#dpems-plantao-unidades .modal-actions { margin-top: 20px; text-align: right; }

@media (max-width: 600px) {
    #dpems-plantao-unidades .titulo { font-size: 1.1em; }
    #dpems-plantao-unidades .search { padding: 12px 15px 12px 40px; font-size: 15px; }
}