/* Kron Design System: tokens globais + identidade dinamica por segmento. */
:root{
  --kron-sidebar:#07152f;--kron-sidebar-secondary:#101f46;
  --kron-background:#f6f8fc;--kron-background-secondary:#eef2f7;
  --kron-surface:#fff;--kron-surface-secondary:#f0f3f8;--kron-surface-hover:#f7f9fc;
  --kron-text-primary:#172033;--kron-text-secondary:#667085;--kron-text-muted:#98a2b3;
  --kron-border:#dce3ee;--kron-border-light:#e8edf4;
  --kron-success:#16a34a;--kron-warning:#d97706;--kron-danger:#dc2626;--kron-info:#2563eb;
  --theme-primary:#2563eb;--theme-primary-hover:#1d4ed8;--theme-primary-active:#1e40af;
  --theme-primary-dark:#1e3a8a;--theme-primary-light:#dbeafe;
  --theme-secondary:#0891b2;--theme-secondary-light:#cffafe;
  --theme-accent:#14b8a6;--theme-accent-light:#ccfbf1;
  --theme-on-primary:#fff;--theme-on-secondary:#fff;
  --kron-focus-ring:color-mix(in srgb,var(--theme-primary) 28%,transparent);
}

body.app-shell{background:var(--kron-background);color:var(--kron-text-primary)}
a{accent-color:var(--theme-primary)}
::selection{background:var(--theme-primary-light);color:var(--theme-primary-dark)}
:where(a,button,input,select,textarea,[tabindex]):focus-visible{outline:3px solid var(--kron-focus-ring);outline-offset:2px}

:where(.btn-primary,.primary-btn,button[type="submit"]:not(.btn-danger):not(.danger),input[type="submit"]){background:var(--theme-primary);border-color:var(--theme-primary);color:var(--theme-on-primary)}
:where(.btn-primary,.primary-btn,button[type="submit"]:not(.btn-danger):not(.danger),input[type="submit"]):hover{background:var(--theme-primary-hover);border-color:var(--theme-primary-hover)}
:where(.btn-primary,.primary-btn,button[type="submit"]:not(.btn-danger):not(.danger),input[type="submit"]):active{background:var(--theme-primary-active);border-color:var(--theme-primary-active)}
:where(.btn-outline,.ghost-btn){border-color:var(--theme-primary);color:var(--theme-primary)}
:where(.btn-outline,.ghost-btn):hover{background:var(--theme-primary-light);border-color:var(--theme-primary-hover);color:var(--theme-primary-dark)}
:where(input:not([type="checkbox"]):not([type="radio"]),select,textarea):focus{border-color:var(--theme-primary)!important;box-shadow:0 0 0 3px var(--kron-focus-ring)!important}
input[type="checkbox"],input[type="radio"]{accent-color:var(--theme-primary)}

:where(.tabs a.active,.tab.active,.tab-btn.active,[role="tab"][aria-selected="true"]){color:var(--theme-primary);border-color:var(--theme-primary)}
:where(.pagination .active,.page-item.active .page-link){background:var(--theme-primary);border-color:var(--theme-primary);color:var(--theme-on-primary)}
:where(.progress-bar,.ka-progress span){background:var(--theme-primary)}
:where(.icon-box,.ka-metric-icon){background:var(--theme-primary-light);color:var(--theme-primary)}
:where(.badge-primary,.chip-primary,.ka-chip){background:var(--theme-primary-light);color:var(--theme-primary-dark)}
:where(tr[aria-selected="true"],tr.is-selected,.table-row-selected){background:var(--theme-primary-light)}

.app-sidebar .sb-item.active{background:linear-gradient(100deg,var(--theme-primary-dark),var(--theme-primary));border-color:color-mix(in srgb,var(--theme-primary) 74%,white);box-shadow:inset 0 0 18px color-mix(in srgb,var(--theme-primary-dark) 70%,transparent),0 0 16px color-mix(in srgb,var(--theme-primary) 42%,transparent)}
.app-sidebar .sb-item.active .sb-item-icon{background:linear-gradient(145deg,var(--theme-primary),var(--theme-primary-dark));border-color:color-mix(in srgb,var(--theme-primary-light) 75%,white);box-shadow:inset 0 0 10px rgba(255,255,255,.15),0 0 12px color-mix(in srgb,var(--theme-primary) 48%,transparent)}
.app-sidebar .sb-item:not(.active):hover{background:color-mix(in srgb,var(--theme-primary) 12%,transparent)}

.ka-hero{background:linear-gradient(135deg,var(--theme-primary-dark),var(--theme-secondary) 55%,var(--theme-primary))!important;box-shadow:0 20px 46px color-mix(in srgb,var(--theme-primary) 20%,transparent)!important}
.ka-hero .btn-primary{color:var(--theme-primary-dark)!important}
.ka-metric-icon{background:var(--theme-primary-light)!important;color:var(--theme-primary)!important}
.ka-action-card:hover{border-color:var(--theme-primary)!important;box-shadow:0 12px 28px color-mix(in srgb,var(--theme-primary) 12%,transparent)!important}
.ka-chip{background:var(--theme-primary-light)!important;color:var(--theme-primary-dark)!important}
.ka-progress span{background:var(--theme-primary)!important}
.kr-fab{background:linear-gradient(135deg,var(--theme-secondary),var(--theme-primary))!important;box-shadow:0 10px 26px color-mix(in srgb,var(--theme-primary) 36%,transparent)!important}

/* Cores de estado sao semanticas e nunca mudam com o segmento. */
:where(.alert-success,.status-success,.badge-success){--status-color:var(--kron-success)}
:where(.alert-warning,.status-warning,.badge-warning){--status-color:var(--kron-warning)}
:where(.alert-danger,.status-danger,.badge-danger){--status-color:var(--kron-danger)}

@media (max-width:768px){
  :where(button,.btn,.btn-primary,.primary-btn,.ghost-btn){min-height:44px}
  :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){font-size:16px}
}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}

