/* C4U Stable 17.0 — acabamento e consistência geral */
:root{
  --v17-purple:#6f2dbd;--v17-purple-2:#5d239f;--v17-soft:#f6f1fc;--v17-border:#e6dff0;--v17-text:#2b2232;--v17-muted:#756b7c;
}
body.c4u-stable-v17{background:#f7f6fb;color:var(--v17-text)}
.c4u-v17-icon,.c4u-stable-v17 .c4u-icon{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}
.c4u-stable-v17 .btn,.c4u-stable-v17 button{transition:background .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease}
.c4u-stable-v17 .btn:not(:disabled):active,.c4u-stable-v17 button:not(:disabled):active{transform:translateY(1px)}
.c4u-stable-v17 .btn{display:inline-flex;align-items:center;justify-content:center;gap:8px}
.c4u-stable-v17 .btn-primary{background:linear-gradient(135deg,#7438ba,#6127a5);border-color:#692baa;box-shadow:0 8px 18px rgba(94,43,145,.17)}
.c4u-stable-v17 .btn-primary:hover{background:linear-gradient(135deg,#672eaa,#54208f);box-shadow:0 10px 24px rgba(94,43,145,.24)}
.c4u-stable-v17 .btn-light{border-color:#ddd5e7;background:#fff;color:#43364b}
.c4u-stable-v17 .btn-light:hover{border-color:#cdbbdf;background:#f8f3fd;color:#61259c}

/* Estrutura de páginas */
.c4u-stable-v17 .content>.page-head,.c4u-stable-v17 .content>.toolbar{margin-bottom:16px}
.c4u-stable-v17 .page-head{gap:16px;align-items:center}
.c4u-stable-v17 .page-head h2{letter-spacing:-.02em}
.c4u-stable-v17 .page-head p{color:var(--v17-muted);max-width:820px}
.c4u-stable-v17 .card,.c4u-stable-v17 .panel,.c4u-stable-v17 .page-card{border-color:var(--v17-border);box-shadow:0 10px 30px rgba(43,34,50,.045)}
.c4u-stable-v17 .table-wrap{border:1px solid var(--v17-border);border-radius:18px;background:#fff;overflow:auto;box-shadow:0 8px 24px rgba(43,34,50,.035)}
.c4u-stable-v17 table{min-width:760px}
.c4u-stable-v17 thead th{background:#faf8fc;color:#6a5e72;font-size:12px;text-transform:uppercase;letter-spacing:.04em}
.c4u-stable-v17 tbody tr:hover{background:#fbf8fe}
.c4u-stable-v17 .empty{border-radius:16px;color:#7a6f80}
.c4u-stable-v17 .actions{display:flex;flex-wrap:wrap;gap:7px}

/* Formulários */
.c4u-stable-v17 .form .field label,.c4u-stable-v17 .c4u-profile-form .field label{font-weight:700;color:#493e50}
.c4u-stable-v17 .field input,.c4u-stable-v17 .field select,.c4u-stable-v17 .field textarea,.c4u-stable-v17 .form input,.c4u-stable-v17 .form select,.c4u-stable-v17 .form textarea{border-color:#dcd4e5;background:#fff;transition:border-color .15s ease,box-shadow .15s ease}
.c4u-stable-v17 .field input:focus,.c4u-stable-v17 .field select:focus,.c4u-stable-v17 .field textarea:focus,.c4u-stable-v17 .form input:focus,.c4u-stable-v17 .form select:focus,.c4u-stable-v17 .form textarea:focus{border-color:#9665c8;box-shadow:0 0 0 3px rgba(111,45,189,.10);outline:none}
.c4u-v17-required{color:#c0263d;font-weight:800}
.c4u-v17-dirty{display:inline-flex;align-items:center;gap:6px;color:#9a6700;background:#fff8db;border:1px solid #efd98d;border-radius:999px;padding:7px 10px;margin-right:auto}
.c4u-v17-dirty.hidden{display:none}

/* Busca global */
.c4u-stable-v17 .global-search-results{width:min(620px,calc(100vw - 32px));max-height:min(650px,75vh);padding:9px;border:1px solid #dfd6e8;border-radius:18px;box-shadow:0 24px 70px rgba(51,33,64,.22);background:#fff;overflow:auto}
.c4u-v17-search-group+ .c4u-v17-search-group{border-top:1px solid #eee8f3;margin-top:8px;padding-top:8px}
.c4u-v17-search-group>header{display:flex;justify-content:space-between;align-items:center;padding:7px 10px;color:#7a6a83;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.06em}
.c4u-v17-search-group>header small{background:#f3edf9;color:#6f2dbd;border-radius:999px;padding:2px 7px}
.c4u-v17-search-group button{width:100%;display:grid;grid-template-columns:34px 1fr 22px;gap:10px;align-items:center;text-align:left;border:1px solid transparent;background:transparent;border-radius:12px;padding:10px;color:#342a3b}
.c4u-v17-search-group button:hover,.c4u-v17-search-group button.active{background:#f6effc;border-color:#e4d4f2;color:#5f239e}
.c4u-v17-search-icon{width:34px;height:34px;border-radius:10px;background:#f3edf9;display:grid;place-items:center;color:#6f2dbd}
.c4u-v17-search-icon svg{width:17px;height:17px}
.c4u-v17-search-group button span:nth-child(2){min-width:0}.c4u-v17-search-group button b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.c4u-v17-search-group button small{display:block;color:#807485;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}.c4u-v17-search-open{color:#9b88aa}.c4u-v17-search-loading{padding:22px;text-align:center;color:#7c7082}

/* Configurações */
.c4u-settings-v17 .c4u-settings-nav{min-width:230px}
.c4u-settings-v17 .c4u-settings-nav-links{gap:5px}
.c4u-settings-v17 .c4u-settings-nav-links button{min-height:44px}
.c4u-settings-v17 .c4u-settings-main{min-width:0}
.c4u-v17-option-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.c4u-v17-option-grid article{border:1px solid #e7dfed;border-radius:18px;padding:18px;background:#fff}.c4u-v17-option-grid article>b{display:block;font-size:16px}.c4u-v17-option-grid article>small{display:block;color:#7b7081;margin:5px 0 14px;min-height:34px}.c4u-segmented{display:flex;padding:4px;background:#f3eff7;border-radius:12px;gap:4px}.c4u-segmented button{flex:1;border:0;background:transparent;border-radius:9px;padding:9px 10px;color:#655b6b;font-weight:700}.c4u-segmented button.active{background:#6f2dbd;color:#fff;box-shadow:0 5px 14px rgba(111,45,189,.19)}
.c4u-v17-notify-summary{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin:10px 0 20px}.c4u-v17-notify-summary article{min-width:120px;border:1px solid #e7dfed;background:#fbf9fd;border-radius:16px;padding:13px 16px}.c4u-v17-notify-summary strong{font-size:24px;color:#5e239f;display:block}.c4u-v17-notify-summary span{color:#7a7080;font-size:12px}.c4u-v17-notify-list{display:grid;gap:9px}.c4u-v17-notify-list article{display:flex;gap:12px;padding:13px;border:1px solid #ebe4ef;border-radius:14px;background:#fff}.c4u-v17-notify-list article.unread{background:#f7f0fd;border-color:#dcc6ef}.c4u-v17-notify-list article>span{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:#f2e9fb;color:#6f2dbd}.c4u-v17-notify-list p{margin:3px 0;color:#5f5664}.c4u-v17-notify-list small{color:#8a7f90}
.c4u-v17-permission-head{display:flex;align-items:center;gap:12px;padding:16px;border:1px solid #e7dfed;border-radius:16px;background:#fbf9fd;margin-bottom:14px}.c4u-v17-avatar{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:#6f2dbd;color:#fff;font-weight:800}.c4u-v17-permission-head b,.c4u-v17-permission-head small{display:block}.c4u-v17-permission-head small{color:#7c7182;margin-top:2px}.c4u-v17-permission-list{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}.c4u-v17-permission-list span{display:inline-flex;align-items:center;gap:7px;border:1px solid #ded2e9;background:#f7f1fc;border-radius:999px;padding:8px 11px;color:#5f287d;font-size:12px;font-weight:700}.c4u-v17-permission-list svg{width:14px;height:14px}

/* Histórico / atividade */
.c4u-v17-audit-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:14px}.c4u-v17-audit-kpis article{background:#fff;border:1px solid #e6dff0;border-radius:16px;padding:16px}.c4u-v17-audit-kpis strong{display:block;font-size:25px;color:#55238a}.c4u-v17-audit-kpis span{display:block;color:#7c7282;font-size:12px;margin-top:2px}.c4u-v17-audit-filters{display:grid!important;grid-template-columns:minmax(260px,1fr) 220px 220px;gap:10px;margin-bottom:14px}.c4u-v17-audit-filters input,.c4u-v17-audit-filters select{min-width:0}.c4u-v17-action{display:inline-flex;border-radius:999px;padding:5px 8px;background:#f1edf4;color:#625868;font-size:11px;font-weight:800}.c4u-v17-action.success{background:#e9f8ee;color:#227342}.c4u-v17-action.danger{background:#fff0f1;color:#a42936}

/* Home: refinamento sem adicionar poluição */
.c4u-stable-v17 .c4u-home-v8{max-width:1500px;margin:0 auto}.c4u-stable-v17 .c4u-home-welcome{border:1px solid #e7dfed;background:linear-gradient(135deg,#fff,#faf6ff)}.c4u-stable-v17 .c4u-home-quick button:hover{border-color:#d4c2e6;box-shadow:0 10px 24px rgba(70,42,90,.07)}.c4u-stable-v17 .c4u-home-kpis article{border-color:#e8e1ed}.c4u-stable-v17 .c4u-home-panel{border-color:#e8e1ed}

/* Modal e páginas vazias */
.c4u-stable-v17 .modal-card{border:1px solid #e3dbe9;box-shadow:0 28px 85px rgba(34,24,40,.28)}
.c4u-stable-v17 .modal-overlay{backdrop-filter:blur(2px)}

/* Densidade */
html[data-density="compact"] .content{padding-top:14px!important}
html[data-density="compact"] .card,html[data-density="compact"] .panel{padding-top:14px;padding-bottom:14px}
html[data-density="compact"] table td,html[data-density="compact"] table th{padding-top:8px!important;padding-bottom:8px!important}
html[data-density="compact"] .field{gap:4px}
html[data-motion="reduced"] *,html[data-motion="reduced"] *::before,html[data-motion="reduced"] *::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}

/* Responsividade */
@media (max-width:1180px){
  .c4u-v17-option-grid{grid-template-columns:1fr 1fr}
  .c4u-v17-audit-kpis{grid-template-columns:1fr 1fr}
  .c4u-v17-audit-filters{grid-template-columns:1fr 1fr}.c4u-v17-audit-filters .search{grid-column:1/-1}
  .c4u-stable-v17 .c4u-home-kpis{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:900px){
  .c4u-settings-v17{grid-template-columns:1fr!important}.c4u-settings-v17 .c4u-settings-nav{position:static!important;min-width:0}.c4u-settings-v17 .c4u-settings-nav-links{display:flex;overflow:auto;padding-bottom:6px}.c4u-settings-v17 .c4u-settings-nav-links button{min-width:170px}
  .c4u-v17-option-grid{grid-template-columns:1fr}
  .c4u-stable-v17 .c4u-home-grid{grid-template-columns:1fr!important}
}
@media (max-width:680px){
  .c4u-v17-audit-kpis{grid-template-columns:1fr 1fr}.c4u-v17-audit-filters{grid-template-columns:1fr}.c4u-v17-audit-filters .search{grid-column:auto}
  .c4u-stable-v17 .c4u-home-kpis{grid-template-columns:1fr 1fr}.c4u-stable-v17 .c4u-home-quick{grid-template-columns:1fr!important}
  .c4u-stable-v17 .page-head{align-items:flex-start;flex-direction:column}.c4u-stable-v17 .page-head>.btn{width:100%}
  .c4u-stable-v17 .form-grid{grid-template-columns:1fr!important}.c4u-stable-v17 .field.span2,.c4u-stable-v17 .field.span3{grid-column:auto!important}
  .c4u-stable-v17 .actions{min-width:190px}
}

/* Dark */
html[data-theme="dark"] body.c4u-stable-v17{--v17-text:#f2edf5;--v17-muted:#b4a9bb;--v17-border:#493b51;background:#18151b}
html[data-theme="dark"] .c4u-stable-v17 .table-wrap,html[data-theme="dark"] .c4u-stable-v17 .card,html[data-theme="dark"] .c4u-stable-v17 .panel,html[data-theme="dark"] .c4u-stable-v17 .page-card,html[data-theme="dark"] .c4u-v17-option-grid article{background:#231e27;border-color:#493e51}
html[data-theme="dark"] .c4u-stable-v17 thead th{background:#2c2631;color:#cabed1}
html[data-theme="dark"] .c4u-stable-v17 tbody tr:hover{background:#2b2430}
html[data-theme="dark"] .c4u-stable-v17 .field input,html[data-theme="dark"] .c4u-stable-v17 .field select,html[data-theme="dark"] .c4u-stable-v17 .field textarea,html[data-theme="dark"] .global-search-results{background:#211c25;border-color:#504457;color:#eee8f1}
html[data-theme="dark"] .c4u-v17-search-group button{color:#eee8f1}html[data-theme="dark"] .c4u-v17-search-group button:hover,html[data-theme="dark"] .c4u-v17-search-group button.active{background:#382b44;border-color:#5a436b}
