html[data-theme=dark]{color-scheme:dark;background:#0b1220;color:#e5edf8}
html[data-theme=dark] body{background:#0b1220;color:#e5edf8}
[data-theme=dark] .bg-white,[data-theme=dark] .bg-white\/95,[data-theme=dark] .bg-white\/90{background-color:#121d30!important}
[data-theme=dark] .bg-slate-50,[data-theme=dark] .bg-slate-50\/70,[data-theme=dark] .bg-slate-100{background-color:#0f192a!important}
[data-theme=dark] .bg-slate-200{background-color:#28384e!important}
[data-theme=dark] .bg-slate-900{background-color:#253b61!important}
[data-theme=dark] .text-slate-900,[data-theme=dark] .text-slate-800{color:#edf3fd!important}
[data-theme=dark] .text-slate-700,[data-theme=dark] .text-slate-600{color:#c8d5e8!important}
[data-theme=dark] .text-slate-500,[data-theme=dark] .text-slate-400{color:#99acc7!important}
[data-theme=dark] .border-slate-200,[data-theme=dark] .border-slate-100,[data-theme=dark] .border-slate-300{border-color:#2a3b55!important}
[data-theme=dark] .divide-slate-100>:not(:last-child),[data-theme=dark] .divide-slate-200>:not(:last-child){border-color:#2a3b55!important}
[data-theme=dark] .hover\:bg-slate-50:hover,[data-theme=dark] .hover\:bg-slate-100:hover,[data-theme=dark] [class*="hover:bg-slate-50"]:hover,[data-theme=dark] [class*="hover:bg-slate-100"]:hover{background-color:#1c2d47!important}
[data-theme=dark] [class*="hover:bg-blue-50"]:hover,[data-theme=dark] [class*="hover:bg-blue-100"]:hover{background-color:#1b3863!important}
[data-theme=dark] [class*="hover:bg-red-50"]:hover{background-color:#492032!important}
[data-theme=dark] [class*="hover:bg-amber-100"]:hover{background-color:#45381f!important}
[data-theme=dark] .hover\:text-slate-900:hover{color:#fff!important}
[data-theme=dark] .bg-red-50,[data-theme=dark] .bg-red-50\/50{background-color:#381b29!important}
[data-theme=dark] .bg-emerald-50,[data-theme=dark] .bg-emerald-50\/70{background-color:#12332f!important}
[data-theme=dark] .bg-blue-50,[data-theme=dark] .bg-blue-50\/50{background-color:#142b4d!important}
[data-theme=dark] .bg-amber-50{background-color:#352c19!important}
[data-theme=dark] .text-red-700,[data-theme=dark] .text-red-800{color:#ff9aaa!important}
[data-theme=dark] .text-emerald-700,[data-theme=dark] .text-emerald-800,[data-theme=dark] .text-emerald-900{color:#76e3ba!important}
[data-theme=dark] .text-blue-700,[data-theme=dark] .text-blue-800,[data-theme=dark] .text-blue-900{color:#91baff!important}
[data-theme=dark] .text-amber-700,[data-theme=dark] .text-amber-800{color:#f5cd7a!important}
[data-theme=dark] [class*="bg-red-50/"]{background-color:#381b29!important;color:#ffadbb!important}
[data-theme=dark] [class*="bg-red-50/"] *{color:inherit!important}
[data-theme=dark] [class*="bg-emerald-50/"]{background-color:#12332f!important}
[data-theme=dark] [class*="bg-blue-50/"]{background-color:#142b4d!important}
[data-theme=dark] [class*="bg-amber-50/"]{background-color:#352c19!important}
[data-theme=dark] .text-emerald-600{color:#76e3ba!important}
[data-theme=dark] .border-red-200{border-color:#703344!important}
[data-theme=dark] .border-emerald-200{border-color:#295c50!important}
[data-theme=dark] .border-blue-200{border-color:#2b4a76!important}
[data-theme=dark] .auth-page{background:#0b1220}
[data-theme=dark] .auth-card{background:#121d30;border-color:#2a3b55;box-shadow:0 16px 60px #0004}
[data-theme=dark] .auth-lead,[data-theme=dark] .auth-help,[data-theme=dark] .pwa-note,[data-theme=dark] .gps-help,[data-theme=dark] .gps-fields label{color:#a9bad2}
[data-theme=dark] .auth-field label{color:#d1def1}
[data-theme=dark] input,[data-theme=dark] select,[data-theme=dark] textarea{background-color:#0e182a;color:#e5edf8;border-color:#334762}
[data-theme=dark] input::placeholder,[data-theme=dark] textarea::placeholder{color:#7d93b0}
[data-theme=dark] .auth-error{background:#381b29;border-color:#793145;color:#ffb0ba}
[data-theme=dark] .auth-invitation{background:#1c2c45}
[data-theme=dark] .account-button{background:#1b2c45;border-color:#364a67;color:#dbe8fa}
[data-theme=dark] .account-button:hover{background:#2c4162}
[data-theme=dark] .pwa-warning{background:#392f1b;color:#f5d28d}
.theme-toggle{position:fixed;right:14px;bottom:14px;z-index:40;border:1px solid #334762;border-radius:999px;background:#192d4b;color:#e8f1ff;box-shadow:0 4px 20px #0003;padding:10px 15px;font:600 12px var(--font-sans);cursor:pointer}
.session-notice{position:fixed;left:14px;bottom:14px;right:160px;max-width:560px;z-index:39;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;border-radius:12px;border:1px solid #cbd5e1;background:#ffffffeb;backdrop-filter:blur(8px);color:#334155;font-size:12px;line-height:1.45;box-shadow:0 8px 28px rgba(15,23,42,.12);animation:kpFadeSlideUp .28s ease both}
[data-theme=dark] .session-notice{background:#121d30eb;border-color:#2a3b55;color:#c8d5e8;box-shadow:0 10px 30px rgba(0,0,0,.45)}
.session-notice-btn{flex-shrink:0;border-radius:8px;background:#1d4ed8;color:#fff;padding:7px 12px;font-size:12px;font-weight:600;cursor:pointer}
.session-notice-btn:hover{background:#1e40af}
@media(max-width:640px){.session-notice{right:14px;bottom:62px;flex-direction:column;align-items:flex-start}}
body:has([aria-modal=true]) .theme-toggle{display:none}
[data-theme=light] .theme-toggle{background:white;color:#334155;border-color:#cbd5e1}
.notification-panel,.live-panel{border:1px solid #cbd5e1;border-radius:12px;background:#fff;padding:16px;font-size:13px;line-height:1.6}
[data-theme=dark] .notification-panel,[data-theme=dark] .live-panel{background:#121d30;border-color:#2a3b55;color:#c8d5e8}
.test-banner{padding:8px 16px;background:#854d0e;color:#fff;font-size:12px;text-align:center}.sms-code{font:700 25px var(--font-mono);letter-spacing:5px}.panel-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.panel-status{margin-top:10px;white-space:pre-wrap}.role-tabs{display:flex;gap:8px;margin-bottom:18px}.role-tabs button[aria-pressed=true]{background:#1d4ed8;color:#fff;border-color:#1d4ed8}
.sidebar-account{display:flex;align-items:center;gap:10px;min-width:0;width:100%}.sidebar-avatar{display:flex;align-items:center;justify-content:center;width:34px;height:34px;flex-shrink:0;border-radius:50%;background:#dbeafe;color:#1d4ed8;font-size:12px;font-weight:700}.sidebar-account-text{min-width:0}.sidebar-account-name{font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sidebar-account-phone{font-size:11px;color:#64748b;margin-top:2px}.sidebar-settings{padding:16px;border-top:1px solid #e2e8f0}.sidebar-settings-button{display:flex;align-items:center;gap:10px;width:100%;padding:12px;border-radius:10px;color:#475569;font-size:14px;font-weight:600;text-align:left}.sidebar-settings-button:hover,.sidebar-settings-button[aria-current=page]{background:#eff6ff;color:#1d4ed8}.settings-page{display:grid;gap:20px;max-width:720px}.settings-card{display:grid;gap:12px;padding:24px;border:1px solid #e2e8f0;border-radius:12px;background:#fff}.settings-card .account-button{justify-self:start}html[data-theme=dark] .sidebar-avatar{background:#1e3a5f;color:#93c5fd}html[data-theme=dark] .sidebar-account-name{color:#e2e8f0}html[data-theme=dark] .sidebar-account-phone{color:#94a3b8}html[data-theme=dark] .sidebar-settings,html[data-theme=dark] .settings-card{border-color:#2b3e57}html[data-theme=dark] .settings-card{background:#131e30}html[data-theme=dark] .sidebar-settings-button{color:#cbd5e1}html[data-theme=dark] .sidebar-settings-button:hover,html[data-theme=dark] .sidebar-settings-button[aria-current=page]{background:#1e3a5f;color:#93c5fd}

/* --- Effects & Animations --- */
@keyframes kpFadeIn{from{opacity:0}to{opacity:1}}
@keyframes kpFadeSlideUp{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
@keyframes kpScaleIn{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes kpPulseGlow{0%,100%{box-shadow:0 0 0 0 rgba(239,68,68,.28)}50%{box-shadow:0 0 0 6px rgba(239,68,68,0)}}

html{scroll-behavior:smooth}
button,a,input,select,textarea{transition:background-color .18s ease,border-color .18s ease,color .18s ease,box-shadow .18s ease,transform .15s cubic-bezier(.22,1,.36,1)}
button:not(:disabled):active,.account-button:not(:disabled):active{transform:scale(.97)}

.auth-card{animation:kpScaleIn .34s cubic-bezier(.22,1,.36,1) both}
.auth-primary{box-shadow:0 6px 18px rgba(29,78,216,.24)}
.auth-primary:not(:disabled):hover{transform:translateY(-1px);box-shadow:0 10px 24px rgba(29,78,216,.34)}
.auth-error{animation:kpFadeSlideUp .22s ease both}

.theme-toggle{backdrop-filter:blur(8px)}
.theme-toggle:hover{transform:translateY(-2px);box-shadow:0 8px 24px rgba(0,0,0,.28)}

.settings-card,.notification-panel,.live-panel{animation:kpFadeSlideUp .28s cubic-bezier(.22,1,.36,1) both;transition:border-color .2s ease,box-shadow .2s ease,transform .2s ease}
.rounded-xl,.rounded-2xl{transition:border-color .2s ease,box-shadow .2s ease,transform .2s ease}
.grid>.rounded-xl:hover{transform:translateY(-2px);box-shadow:0 10px 24px -8px rgba(15,23,42,.12)}
[data-theme=dark] .grid>.rounded-xl:hover{box-shadow:0 12px 28px -8px rgba(0,0,0,.45);border-color:#3b5275!important}

aside nav button,.sidebar-settings-button{transition:background-color .18s ease,color .18s ease,transform .18s cubic-bezier(.22,1,.36,1)}
aside nav button:hover,.sidebar-settings-button:hover{transform:translateX(3px)}

tbody tr{transition:background-color .15s ease}
[role="dialog"],[aria-modal="true"]{animation:kpScaleIn .24s cubic-bezier(.22,1,.36,1) both}
.border-red-200.rounded-xl{animation:kpFadeSlideUp .28s ease both,kpPulseGlow 2.6s ease-in-out 2}
img{transition:transform .25s cubic-bezier(.22,1,.36,1),opacity .2s ease}
button:hover img{transform:scale(1.03)}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
  button:not(:disabled):active,.auth-primary:not(:disabled):hover,.theme-toggle:hover,.grid>.rounded-xl:hover,aside nav button:hover,.sidebar-settings-button:hover,button:hover img{transform:none!important}
}
