/* V11.36.9.6 - campos por módulo, permissões claras e Configurações protegidas */

/* Fundo gelo mais confortável */
body,#appView,.page-wrap,.content{background:#f3f7fb}
.card,.form-section,.table-wrap,.settings-panel .card,.dialog-card{background:#fff}

/* Configurações - abas modernas */
.settings-tabs{display:flex;flex-wrap:wrap;gap:8px;padding:8px;background:#eaf2f8;border:1px solid #d8e6ef;border-radius:18px;margin:14px 0 18px}
.settings-tab{appearance:none;border:1px solid transparent!important;border-radius:999px!important;background:transparent!important;color:#38546b!important;padding:10px 15px!important;font-weight:750!important;line-height:1!important;box-shadow:none!important;transition:.16s ease}
.settings-tab:hover{background:#fff!important;border-color:#d6e6ef!important;color:#087f90!important}
.settings-tab.active{color:#fff!important;background:linear-gradient(135deg,#087f90,#20bfd0)!important;border-color:transparent!important;box-shadow:0 7px 16px rgba(8,127,144,.2)!important}

/* Campos por módulo - acordeão arejado */
.field-modules{display:grid;gap:12px;margin-top:16px}
.field-module-card{border:1px solid #dbe6ee;border-radius:16px;background:#fff;overflow:hidden;box-shadow:0 3px 12px rgba(15,23,42,.025)}
.field-module-card[open]{border-color:#acd7df;box-shadow:0 8px 22px rgba(15,23,42,.055)}
.field-module-card>summary{cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:space-between;padding:17px 18px;background:#f9fbfd;min-height:66px}
.field-module-card>summary::-webkit-details-marker{display:none}
.field-module-card>summary span:first-child{display:grid;gap:3px}
.field-module-card>summary b{font-size:15px;color:#10263a}
.field-module-card>summary small{color:#71869a;font-size:11px}
.field-module-card[open]>summary{background:#eef8fa;border-bottom:1px solid #dbe6ee}
.field-module-card>summary .material-symbols-outlined{transition:.18s;color:#0a8192}
.field-module-card[open]>summary .material-symbols-outlined{transform:rotate(180deg)}
.field-module-body{padding:16px 18px 20px}
.field-module-actions{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 14px}
.field-policy-table-wrap{overflow:auto;border:1px solid #e1e9ef;border-radius:14px}
.field-policy-table{width:100%;border-collapse:separate;border-spacing:0;min-width:700px;background:#fff}
.field-policy-table th{position:sticky;top:0;z-index:2;background:#edf5fa;color:#38536a;font-size:11px;text-transform:uppercase;letter-spacing:.04em;padding:12px 14px;border-bottom:1px solid #dbe6ee;text-align:center}
.field-policy-table th:first-child{text-align:left;min-width:300px}
.field-policy-table td{padding:13px 14px;border-bottom:1px solid #edf1f4;text-align:center;vertical-align:middle}
.field-policy-table tbody tr:last-child td{border-bottom:0}
.field-policy-table tbody tr:nth-child(even){background:#fbfdff}
.field-policy-table tbody tr:hover{background:#f1f9fb}
.field-name-cell{text-align:left!important}
.field-name-cell b{display:block;font-size:13px;color:#11283d;margin-bottom:3px}
.field-tech-name{display:block;color:#8797a8;font-size:10px}
.field-policy-choice{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:112px;padding:8px 10px;border:1px solid transparent;border-radius:999px;cursor:pointer;color:#51677b;font-size:12px;white-space:nowrap}
.field-policy-choice:hover{background:#f1f7fa;border-color:#d8e6ed}
.field-policy-choice input{width:17px;height:17px;accent-color:#07889a}
.field-policy-choice:has(input:checked){background:#eaf9fb;border-color:#8dd4de;color:#08798a;font-weight:750}

/* Permissões - tabela real, simples e sempre legível */
.permission-table-wrap{max-height:460px;overflow:auto;border:1px solid #d8e3eb;border-radius:15px;background:#fff;margin-top:12px}
.permission-table{width:100%;min-width:900px;border-collapse:separate;border-spacing:0;table-layout:fixed}
.permission-table th,.permission-table td{border-right:1px solid #e7edf2;border-bottom:1px solid #e7edf2;text-align:center;padding:0}
.permission-table thead th{position:sticky;top:0;z-index:7;background:#eaf3f8;height:58px;color:#2c485f;font-size:11px;font-weight:800}
.permission-table thead th:first-child{left:0;z-index:9;width:220px;text-align:left;padding-left:16px;background:#e3eff5}
.permission-table tbody th{position:sticky;left:0;z-index:5;background:#fff;width:220px}
.permission-table tbody tr:nth-child(even) th,.permission-table tbody tr:nth-child(even) td{background:#fbfdff}
.permission-table tbody tr:hover th,.permission-table tbody tr:hover td{background:#f0f8fb}
.perm-col-table{border:0;background:transparent;width:100%;height:58px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;cursor:pointer;color:#2d5068;font-weight:750}
.perm-col-table:hover{background:#dff0f5;color:#087f90}
.perm-col-table .material-symbols-outlined{font-size:19px;color:#087f90}
.perm-module-table{width:100%;min-height:58px;border:0;background:transparent;text-align:left;padding:10px 16px;cursor:pointer;color:#142b3f}
.perm-module-table b{display:block;font-size:13px}
.perm-module-table small{display:block;margin-top:2px;color:#8a9aab;font-size:9px;font-weight:500}
.perm-module-table:hover{background:#eaf6f9}
.permission-table td{height:58px;background:#fff}
.perm-table-check{width:100%;height:58px;display:grid;place-items:center;cursor:pointer}
.perm-table-check input{position:absolute;opacity:0;pointer-events:none}
.perm-table-box{width:28px;height:28px;border:2px solid #c8d5df;border-radius:8px;background:#fff;display:grid;place-items:center;transition:.14s}
.perm-table-box .material-symbols-outlined{font-size:18px;color:transparent}
.perm-table-check input:checked+.perm-table-box{background:linear-gradient(135deg,#087f90,#20bfd0);border-color:#087f90;box-shadow:0 4px 10px rgba(8,127,144,.18)}
.perm-table-check input:checked+.perm-table-box .material-symbols-outlined{color:#fff}
.perm-table-na{color:#9aa9b6;background:#f6f8fa!important;font-weight:800}
.permission-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:12px}
.permission-toolbar-help{color:#73879a;font-size:11px;margin-left:4px}

/* Senha administrativa para Configurações */
.security-unlock-backdrop{position:fixed;inset:0;z-index:99999;background:rgba(8,21,36,.58);backdrop-filter:blur(4px);display:grid;place-items:center;padding:20px}
.security-unlock-card{width:min(460px,100%);background:#fff;border-radius:22px;padding:28px;box-shadow:0 30px 90px rgba(3,15,29,.35);border:1px solid #dce7ee}
.security-unlock-icon{width:52px;height:52px;border-radius:16px;display:grid;place-items:center;background:linear-gradient(135deg,#e5f7fa,#edf3ff);color:#087f90;margin-bottom:14px}
.security-unlock-card h2{margin:5px 0 7px;font-size:24px;color:#10263a}.security-unlock-card>p{margin:0 0 20px;color:#667d91;line-height:1.5}
.security-user{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border:1px solid #dce7ee;border-radius:12px;background:#f8fbfd;margin-bottom:14px;font-weight:750}.security-user small{font-weight:500;color:#788a9a}
.security-unlock-msg{min-height:22px;margin-top:8px;font-size:12px;color:#668096}.security-unlock-msg.error{color:#c23b3b}

@media(max-width:760px){.settings-tabs{flex-wrap:nowrap;overflow-x:auto;border-radius:14px}.settings-tab{flex:0 0 auto}.field-module-body{padding:12px}.field-policy-table{min-width:650px}.permission-table{min-width:760px}.permission-table thead th:first-child,.permission-table tbody th{width:170px}.permission-toolbar-help{width:100%;margin-left:0}}
