
/* A.A.M THEME UNIFY v21.5.26
   Hotfix visual: remove resquícios da paleta antiga e unifica todo o app
   no padrão roxo intenso + dourado luminoso premium. */
html.aam-refined{
  --aam-unify-violet:#a74dff;
  --aam-unify-violet-2:#7a2aec;
  --aam-unify-violet-3:#4b10c8;
  --aam-unify-surface:#16083c;
  --aam-unify-surface-2:#221058;
  --aam-unify-panel:#12072f;
  --aam-unify-line:rgba(164,97,255,.78);
  --aam-unify-line-soft:rgba(155,90,243,.34);
  --aam-unify-gold:#ffcf72;
  --aam-unify-gold-2:#ffb13c;
  --aam-unify-text:#fbf8ff;
  --aam-unify-muted:#cabde8;
}

/* Superfícies que ainda herdavam marrom/âmbar antigo */
html.aam-refined body :is(
  .client,.form-request,.timeline-event,.snapshot-item,.document-item,
  .info-grid div,.renegotiate-summary div,.renegotiate-result div,
  .upload-card,.authorization,.operation-item,.portfolio-row,.location-card,
  .payment-breakdown>div,.confirm-card,.dialog,.modal-card,dialog[open],
  .public-actions,.quick div,.document-grid>div,.admin-table-shell
){
  background:
    radial-gradient(circle at 100% 100%,rgba(147,53,255,.10),transparent 58%),
    linear-gradient(145deg,rgba(28,12,72,.98),rgba(10,7,33,.99)) !important;
  border-color:var(--aam-unify-line-soft) !important;
  color:var(--aam-unify-text) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 12px 30px rgba(10,0,36,.34) !important;
}

/* Campos e blocos internos escuros sem o marrom antigo */
html.aam-refined body :is(.form-request code,.form-request-link,code,kbd,pre){
  background:linear-gradient(145deg,#10082b,#0a061d) !important;
  border:1px solid rgba(150,88,245,.45) !important;
  color:#efe3ff !important;
}

html.aam-refined body :is(.location-result,.location-card){
  background:
    radial-gradient(circle at 0% 0%,rgba(175,106,255,.10),transparent 55%),
    linear-gradient(145deg,#180a42,#0d0827) !important;
  border:1px solid rgba(153,91,245,.62) !important;
}
html.aam-refined body .location-result strong{color:#fff !important}
html.aam-refined body .location-result p{color:var(--aam-unify-muted) !important}

/* Toasts, banners e avisos */
html.aam-refined body :is(.toast,.aam-toast,.action-feedback-toast,.connection-banner,.update-banner){
  background:
    radial-gradient(circle at 10% 10%,rgba(191,120,255,.12),transparent 46%),
    linear-gradient(145deg,rgba(30,11,79,.98),rgba(11,7,35,.99)) !important;
  border:1px solid rgba(162,92,255,.74) !important;
  color:#faf6ff !important;
  box-shadow:0 18px 40px rgba(9,0,31,.50),0 0 24px rgba(142,47,250,.22) !important;
  backdrop-filter:blur(12px);
}
html.aam-refined body :is(.toast.show,.aam-toast.show,.action-feedback-toast.show){opacity:1}
html.aam-refined body :is(.action-feedback-toast.success,.msg.ok,.status-pill.ok,.company-status.active,.company-signup-success,.connection-banner.online){
  color:#ffe6a9 !important;
  border-color:rgba(255,197,95,.72) !important;
}
html.aam-refined body :is(.action-feedback-toast.error,.msg.error,.connection-banner.offline,.status-danger,.badge-danger){
  color:#ffd4e0 !important;
  border-color:rgba(255,120,168,.64) !important;
}
html.aam-refined body .aam-toast{
  position:fixed;left:50%;bottom:92px;transform:translate(-50%,18px);opacity:0;
  min-width:210px;max-width:calc(100% - 28px);padding:11px 14px;border-radius:14px;
  z-index:10001;pointer-events:none;font-size:10px;font-weight:850;text-align:center;
  transition:.2s ease;
}
html.aam-refined body .aam-toast.show{transform:translate(-50%,0);opacity:1}
@media(min-width:900px){html.aam-refined body .aam-toast{bottom:28px}}

/* Botões: mantém identidade premium */
html.aam-refined body :is(.btn.danger,.danger,.confirm-actions .danger){
  background:linear-gradient(145deg,#2c115c,#160a39) !important;
  border:1px solid rgba(191,120,255,.54) !important;
  color:#fff1ff !important;
  box-shadow:inset 0 1px rgba(255,255,255,.08),0 8px 18px rgba(61,0,120,.18) !important;
}
html.aam-refined body .btn.delete-form,
html.aam-refined body .form-request .btn.delete-form{
  background:linear-gradient(145deg,#371371,#1a0d46) !important;
  border:1px solid rgba(168,93,255,.70) !important;
  color:#f3e6ff !important;
}
html.aam-refined body .form-request :is(.btn.primary,[data-apply-form]){
  background:linear-gradient(145deg,#351669,#1c0d49) !important;
  border:1px solid var(--aam-unify-gold) !important;
  color:#ffe3a2 !important;
  box-shadow:inset 0 1px rgba(255,255,255,.10),0 0 18px rgba(255,177,60,.18),0 10px 20px rgba(32,7,74,.32) !important;
}
html.aam-refined body .form-request :is(.btn.primary,[data-apply-form]):hover{
  box-shadow:inset 0 1px rgba(255,255,255,.12),0 0 22px rgba(255,188,73,.24),0 12px 24px rgba(32,7,74,.34) !important;
}
html.aam-refined body .form-request :is(.btn[data-reject-form],.btn.danger),
html.aam-refined body .form-request .btn.delete-form{
  min-height:48px;
}
html.aam-refined body .form-request .btn[data-reject-form]{
  background:linear-gradient(145deg,#271055,#150936) !important;
  border:1px solid rgba(170,98,255,.54) !important;
  color:#fbf7ff !important;
}
html.aam-refined body .form-request .btn:not(.primary):not(.danger):not(.delete-form){
  background:linear-gradient(145deg,#421794,#220d59) !important;
  border:1px solid rgba(173,104,255,.75) !important;
}

/* Badge NOVO e pílulas */
html.aam-refined body :is(.form-status-badge,.status-pill,.operation-badge,.risk-badge,.pill,.badge,.tag,.chip,.company-status){
  background:linear-gradient(145deg,#281356,#180b3f) !important;
  border:1px solid rgba(155,90,243,.52) !important;
  color:#ebd7ff !important;
}
html.aam-refined body :is(.form-status-badge,.form-request .form-status-badge){
  background:linear-gradient(145deg,#2a1238,#1a0b24) !important;
  border-color:rgba(255,201,97,.78) !important;
  color:#ffdb84 !important;
  box-shadow:0 0 14px rgba(255,184,64,.16) !important;
}
html.aam-refined body :is(.status-pill.up,.risk-badge.low,.risk-badge.medium){
  color:#ffe1a0 !important;border-color:rgba(255,196,91,.58) !important;
}
html.aam-refined body :is(.status-pill.over,.risk-badge.high,.risk-badge.critical){
  color:#ffd2df !important;border-color:rgba(255,122,169,.50) !important;
}

/* Form requests */
html.aam-refined body .form-request{
  border:1px solid rgba(150,89,246,.60) !important;
  background:
    radial-gradient(circle at 100% 0%,rgba(162,62,255,.10),transparent 40%),
    linear-gradient(145deg,#1a0b46,#0d0828) !important;
}
html.aam-refined body .form-request.pending,
html.aam-refined body .form-request.submitted,
html.aam-refined body .form-request.applied,
html.aam-refined body .form-request.rejected,
html.aam-refined body .form-request.expired{
  border-left:1px solid rgba(150,89,246,.60) !important;
}
html.aam-refined body .form-request .meta p,
html.aam-refined body .form-request p,
html.aam-refined body .form-request .actions,
html.aam-refined body .form-request small{color:var(--aam-unify-muted) !important}
html.aam-refined body .form-request .actions,
html.aam-refined body .form-request-actions{border-top-color:rgba(151,88,244,.22) !important}

/* Ajustes / Aparência */
html.aam-refined #settings .aam-settings-shell,
html.aam-refined #settings .aam-settings-section,
html.aam-refined #settings .aam-settings-content,
html.aam-refined #settings .aam-settings-toggle{
  border-color:rgba(154,87,245,.72) !important;
}
html.aam-refined #settings .aam-settings-toggle,
html.aam-refined #settings .aam-settings-content{
  background:
    radial-gradient(circle at 100% 0%,rgba(165,74,255,.10),transparent 46%),
    linear-gradient(145deg,#180a43,#0c0826) !important;
}
html.aam-refined #settings .aam-settings-icon{
  background:linear-gradient(145deg,#4c1fa6,#260d63) !important;
  border:1px solid rgba(170,98,255,.58) !important;
  color:#fff !important;
  box-shadow:inset 0 1px rgba(255,255,255,.09),0 0 18px rgba(136,43,241,.22) !important;
}
html.aam-refined #settings .aam-settings-chevron{color:#ffd87b !important}
html.aam-refined #settings .aam-settings-summary-value,
html.aam-refined #settings .aam-settings-content .row strong{color:#fff !important}
html.aam-refined #settings .aam-settings-content .row small,
html.aam-refined #settings .aam-settings-summary-sub,
html.aam-refined #settings .aam-settings-heading > span{color:var(--aam-unify-muted) !important}
html.aam-refined body :is(.visual-scale-control .scale-option.active,.interface-mode-control .mode-option.active){
  background:linear-gradient(145deg,#b657ff 0%,#7d2bef 50%,#5012d3 100%) !important;
  border-color:#d99cff !important;
  color:#fff !important;
  box-shadow:inset 0 1px rgba(255,255,255,.28),0 0 22px rgba(170,71,255,.38),0 9px 22px rgba(70,8,177,.28) !important;
}
html.aam-refined body :is(.visual-scale-control .scale-option,.interface-mode-control .mode-option){
  background:linear-gradient(145deg,#311267,#190d43) !important;
  border-color:rgba(146,85,237,.76) !important;
  color:#fff2ff !important;
}
html.aam-refined body :is(.visual-scale-control .scale-option:hover,.interface-mode-control .mode-option:hover){
  box-shadow:0 0 20px rgba(152,49,255,.24) !important;
}

/* Navegação inferior e abas */
html.aam-refined .nav-shell.basic-nav-shell,
html.aam-refined .admin-tabs{
  background:linear-gradient(145deg,rgba(21,10,48,.97),rgba(7,5,24,.98)) !important;
  border-color:rgba(136,72,236,.84) !important;
}
html.aam-refined .nav-shell.basic-nav-shell .basic-nav button.active,
html.aam-refined .admin-tab.active{
  background:linear-gradient(145deg,#b24eff 0%,#7927ee 46%,#4a0fc6 100%) !important;
  border-color:#d89cff !important;
  color:#fff !important;
  box-shadow:inset 0 1px rgba(255,255,255,.34),0 0 20px rgba(170,71,255,.42),0 10px 20px rgba(65,7,169,.32) !important;
}

/* Ações nativas / modais */
html.aam-refined body :is(.aam-ui-action,.aam-ui-action.primary,.aam-ui-action.danger){
  background:linear-gradient(145deg,#311267,#190d43) !important;
  border-color:rgba(147,86,236,.74) !important;
  color:#fff !important;
}
html.aam-refined body .aam-ui-action.primary{
  background:linear-gradient(145deg,#351669,#1c0d49) !important;
  border-color:var(--aam-unify-gold) !important;
  color:#ffe3a2 !important;
}
