[hidden] { display: none !important; }
body:not(.auth-ready) [data-auth-protected] { visibility: hidden; }
[data-admin][hidden] { display: none !important; }
.auth-login-page {
    margin: 0; min-height: 100dvh; box-sizing: border-box; padding: 24px;
    display: grid; place-items: center; color: #28304c;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.auth-login-card { width: min(100%, 390px); box-sizing: border-box; padding: 32px; border-radius: 20px; background: #fff; box-shadow: 0 20px 60px #20204844; }
.auth-brand { width: 42px; height: 42px; border-radius: 12px; background: #eef0fc; color: #6671cf; display: grid; place-items: center; margin-bottom: 24px; }
.auth-login-card h1 { font-size: 26px; margin: 0 0 10px; }
.auth-muted { color: #69708a; font-size: 14px; line-height: 1.6; }
.auth-login-card .auth-muted { margin: 0 0 26px; }
.auth-form { display: grid; gap: 16px; }
.auth-form label { display: grid; gap: 8px; color: #464d66; font-size: 14px; font-weight: 500; }
.auth-form input, .auth-form select, .auth-user-actions select {
    width: 100%; box-sizing: border-box; min-width: 0; border: 1px solid #dce0ec;
    border-radius: 8px; padding: 11px 12px; color: #28304c; background: white; font: inherit;
}
.auth-form input:focus, .auth-form select:focus { outline: 2px solid #667eea; outline-offset: 1px; }
.auth-button { border: 0; border-radius: 8px; padding: 10px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; background: #eef0fc; color: #4e56a0; }
.auth-button:hover { background: #e3e7fc; }
.auth-button:disabled { opacity: .55; cursor: not-allowed; }
.auth-primary { background: #6671cf; color: white; }
.auth-primary:hover { background: #5561bf; }
.auth-danger { color: #a92e25; background: #fff0ef; }
.auth-status { margin: 0; color: #a92e25; font-size: 14px; min-height: 20px; line-height: 1.6; overflow-wrap: anywhere; }
.auth-status[data-success="true"] { color: #1d7752; }
.auth-login-note { margin: 22px 0 0; font-size: 12px; line-height: 1.7; color: #777d93; }
.page-header { flex-wrap: wrap; }
.auth-header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.auth-account-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; margin: -8px 0 24px; }
.auth-identity { color: #62677d; font-size: 13px; margin-right: auto; overflow-wrap: anywhere; }
.auth-account-bar .auth-button { padding: 8px 12px; font-size: 13px; }
.auth-dialog { margin: auto; width: min(620px, calc(100% - 24px)); max-height: calc(100dvh - 32px); box-sizing: border-box; overflow: auto; padding: 24px; border: 0; border-radius: 16px; color: #333; box-shadow: 0 20px 60px #0004; }
.auth-dialog::backdrop { background: #14182d88; }
body:has(.auth-dialog[open]) { overflow: hidden; }
.auth-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.auth-dialog-header h2 { margin: 0; font-size: 20px; }
.auth-dialog p.auth-muted { margin: 12px 0 20px; }
.auth-section + .auth-section { border-top: 1px solid #e0e0e0; margin-top: 24px; padding-top: 24px; }
.auth-section h3 { margin: 0 0 14px; font-size: 16px; }
.auth-user-list { display: grid; gap: 12px; margin: 14px 0; }
.auth-user-row { border: 1px solid #e0e0e0; border-radius: 10px; padding: 14px; }
.auth-user-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.auth-user-name { font-weight: 600; overflow-wrap: anywhere; }
.auth-role-tag { font-size: 12px; color: #626ba1; background: #f0f2fb; border-radius: 4px; padding: 3px 6px; }
.auth-user-date { color: #777; font-size: 12px; margin-bottom: 12px; }
.auth-user-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.auth-user-actions select { width: auto; padding: 8px; font-size: 13px; }
.auth-inline-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-load-error { margin-bottom: 18px; padding: 14px; border: 1px solid #e6ccd0; border-radius: 8px; background: #fff4f3; color: #a92e25; font-size: 14px; line-height: 1.6; }
.auth-load-error .auth-button { margin-left: 10px; }
@media (max-width: 600px) {
    .auth-login-page { padding: 16px; }
    .auth-login-card { padding: 26px; }
    .auth-dialog { padding: 20px; }
    .auth-header-actions { width: 100%; }
    .auth-header-actions .btn, .auth-header-actions .auth-button { flex: 1; text-align: center; }
    .auth-account-bar { justify-content: flex-start; margin-top: 0; }
    .auth-identity { flex-basis: 100%; }
    .auth-inline-fields { grid-template-columns: 1fr; }
}
