/* United Reports Dashboard — login */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f7f7f7;
    color: #374151;
    min-height: 100vh;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    padding: 40px;
}

.login-card__header {
    text-align: center;
    margin-bottom: 28px;
}

.united-lockup {
    display: flex;
    justify-content: center;
    align-items: center;
}

.united-lockup__logo {
    display: block;
    max-width: 100%;
    height: auto;
}

.login-card__subtitle {
    margin-top: 12px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #6b7280;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-family: inherit;
    color: #111827;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-input:hover {
    border-color: #9ca3af;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.sign-in-btn {
    margin-top: 4px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background: #3b82f6;
    cursor: pointer;
    transition: background 0.15s ease;
}

.sign-in-btn:hover {
    background: #2563eb;
}

.sign-in-btn:active {
    background: #1d4ed8;
}

.sign-in-btn:focus-visible {
    outline: 2px solid #1d4ed8;
    outline-offset: 2px;
}

.login-error {
    padding: 10px 12px;
    border-radius: 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Dashboard — full-viewport app shell */

html.dashboard-root {
    height: 100%;
}

html.dashboard-root body.page-dashboard {
    margin: 0;
    min-height: 100%;
    height: 100%;
    overflow: hidden;
    background: #e8ecf1;
}

.app-shell {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #e8ecf1;
}

.app-header {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 56px;
    padding: 10px 20px 10px 20px;
    padding-left: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border-bottom: 1px solid #d8dee6;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 2px 8px rgba(15, 23, 42, 0.06);
    z-index: 10;
}

.app-header::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #005da1 0%, #003d78 100%);
    border-radius: 0 2px 2px 0;
}

.app-header__brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    flex: 1;
}

.app-header__logo {
    display: block;
    height: 32px;
    width: auto;
    max-width: min(200px, 38vw);
    object-fit: contain;
    object-position: left center;
}

.app-header__titles {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    border-left: 1px solid #e2e8f0;
    padding-left: 16px;
}

.app-header__product {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #64748b;
}

.app-header__report {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.app-header__fullscreen {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    color: #334155;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.app-header__fullscreen:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.app-header__fullscreen:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.app-header__signout {
    flex-shrink: 0;
    padding: 8px 18px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    color: #334155;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.app-header__signout:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.app-header__signout:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.app-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

/* ── Report sidebar nav ── */
.report-nav {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-right: 1px solid #d8dee6;
    overflow-y: auto;
    padding: 12px 0;
}

.report-nav__heading {
    padding: 4px 16px 10px;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #94a3b8;
}

.report-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.report-nav__item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 16px;
    border: none;
    background: none;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    color: #374151;
    text-align: left;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.report-nav__item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.report-nav__item.is-active {
    background: #eff6ff;
    color: #1d4ed8;
    border-left-color: #3b82f6;
    font-weight: 600;
}

.report-nav__item svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.report-nav__item.is-active svg {
    opacity: 1;
}

.app-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
}

.app-main__stage {
    flex: 1;
    min-height: 0;
    position: relative;
    background: #1e293b;
}

#embedContainer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: none;
}

#embedContainer iframe {
    width: 100% !important;
    height: 100% !important;
    border: 0;
}

.app-main__iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #0f172a;
}

.app-empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(160deg, #f1f5f9 0%, #e2e8f0 45%, #cbd5e1 100%);
    overflow: auto;
}

.app-empty-state__card {
    max-width: 28rem;
    padding: 32px 28px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    text-align: center;
}

.app-empty-state__icon {
    margin-bottom: 16px;
    opacity: 0.9;
}

.app-empty-state__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.app-empty-state__text,
.app-empty-state__hint {
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 10px;
}

.app-empty-state__hint {
    margin-bottom: 0;
    font-size: 0.8125rem;
    color: #64748b;
}

.app-empty-state__text code,
.app-empty-state__hint code {
    font-size: 0.8125rem;
    padding: 2px 7px;
    border-radius: 4px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
}

.app-footer {
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 16px;
    background: #ffffff;
    border-top: 1px solid #d8dee6;
}

.app-footer__label {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #94a3b8;
}

.app-footer__logo {
    height: 28px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    display: block;
    opacity: 0.95;
}

@media (max-width: 480px) {
    .app-header {
        padding: 10px 12px 10px 16px;
        gap: 10px;
    }

    .app-header__logo {
        height: 28px;
        max-width: 160px;
    }

    .app-header__titles {
        padding-left: 12px;
    }

    .app-header__signout {
        padding: 7px 14px;
        font-size: 0.75rem;
    }

    .app-footer {
        flex-wrap: wrap;
        gap: 8px;
    }
}

.site-footer {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 16px 20px 28px;
    text-align: center;
}

.site-footer__powered {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 10px;
}

.site-footer__logo {
    width: auto;
    max-width: 180px;
    height: auto;
    display: block;
}

@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px;
    }

    .site-footer__logo {
        max-width: 160px;
    }
}

/* ── Change Password Modal ── */
.pwd-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
}

.pwd-modal {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pwd-modal__icon {
    display: flex;
    justify-content: center;
    margin-bottom: 4px;
}

.pwd-modal__title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
    margin: 0;
}

.pwd-modal__sub {
    font-size: 0.8125rem;
    color: #64748b;
    text-align: center;
    margin: 0;
}

.pwd-modal__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pwd-modal__label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
}

.pwd-modal__input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-family: inherit;
    color: #111827;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pwd-modal__input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.pwd-modal__error {
    font-size: 0.8125rem;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 0;
}

.pwd-modal__btn {
    width: 100%;
    padding: 11px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background: #3b82f6;
    cursor: pointer;
    transition: background 0.15s ease;
    margin-top: 4px;
}

.pwd-modal__btn:hover  { background: #2563eb; }
.pwd-modal__btn:active { background: #1d4ed8; }

/* ── Reset Password Page ── */
.report-nav__divider {
    height: 1px;
    background: #e2e8f0;
    margin: 10px 16px;
}

.reset-pwd-page {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 24px;
    background: linear-gradient(160deg, #f1f5f9 0%, #e2e8f0 45%, #cbd5e1 100%);
    overflow-y: auto;
    height: 100%;
}

.reset-pwd-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.reset-pwd-card__title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.reset-pwd-card__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reset-pwd-card__label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
}

.reset-pwd-card__select,
.reset-pwd-card__input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-family: inherit;
    color: #111827;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.reset-pwd-card__select:focus,
.reset-pwd-card__input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.reset-pwd-card__btn {
    width: 100%;
    padding: 11px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background: #3b82f6;
    cursor: pointer;
    transition: background 0.15s ease;
    margin-top: 4px;
}

.reset-pwd-card__btn:hover  { background: #2563eb; }
.reset-pwd-card__btn:active { background: #1d4ed8; }

.reset-pwd-card__success {
    font-size: 0.875rem;
    color: #15803d;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 0;
}

.reset-pwd-card__error {
    font-size: 0.875rem;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 0;
}

/* ── Manage Users Page ── */
.admin-page {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 24px;
    background: linear-gradient(160deg, #f1f5f9 0%, #e2e8f0 45%, #cbd5e1 100%);
    overflow-y: auto;
    height: 100%;
}

.admin-card {
    width: 100%;
    max-width: 700px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
    padding: 36px 32px;
}

.admin-card__title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 24px;
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.user-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
}

.user-table td {
    padding: 11px 12px;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.user-table tbody tr:last-child td {
    border-bottom: none;
}

.user-table tbody tr:hover td {
    background: #f8fafc;
}

.user-table__username {
    color: #64748b;
    font-size: 0.8125rem;
}

.user-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.user-badge--active {
    background: #dcfce7;
    color: #15803d;
}

.user-badge--inactive {
    background: #fee2e2;
    color: #b91c1c;
}

.user-table__btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease;
}

.user-table__btn--deactivate {
    background: #fee2e2;
    color: #b91c1c;
}

.user-table__btn--deactivate:hover {
    background: #fecaca;
}

.user-table__btn--activate {
    background: #dcfce7;
    color: #15803d;
}

.user-table__btn--activate:hover {
    background: #bbf7d0;
}

/* Small square icon button used in the user table (e.g. Delete) */
.user-table__icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    transition: background 0.12s ease;
    color: #ef4444; /* default dangerous color */
}

.user-table__icon-btn:hover {
    background: rgba(239, 68, 68, 0.06);
}

.user-table__icon-btn svg {
    width: 16px;
    height: 16px;
    display: block;
}

.user-table__icon-btn--danger {
    color: #ef4444;
}

/* ── Admin card header (title + Add User button) ── */
.admin-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.admin-card__header .admin-card__title {
    margin: 0;
}

.admin-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background: #3b82f6;
    cursor: pointer;
    transition: background 0.15s ease;
}

.admin-add-btn:hover  { background: #2563eb; }
.admin-add-btn:active { background: #1d4ed8; }

/* ── Shared modal backdrop ── */
.mu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
}

.mu-backdrop.is-open {
    display: flex;
}

.mu-modal {
    width: 100%;
    max-width: 380px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mu-modal--wide {
    max-width: 460px;
}

.mu-modal__icon {
    display: flex;
    justify-content: center;
    margin-bottom: 4px;
}

.mu-modal__title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
    margin: 0;
}

.mu-modal__sub {
    font-size: 0.875rem;
    color: #64748b;
    text-align: center;
    margin: 0;
}

.mu-modal__fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 4px;
}

.mu-modal__field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mu-modal__label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
}

.mu-modal__input {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-family: inherit;
    color: #111827;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mu-modal__input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.mu-modal__actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.mu-modal__btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease;
}

.mu-modal__btn--cancel {
    background: #f1f5f9;
    color: #475569;
}

.mu-modal__btn--cancel:hover { background: #e2e8f0; }

.mu-modal__btn--confirm {
    background: #3b82f6;
    color: #ffffff;
}

.mu-modal__btn--confirm:hover { background: #2563eb; }

.mu-modal__btn--danger {
    background: #ef4444;
    color: #ffffff;
}

.mu-modal__btn--danger:hover { background: #dc2626; }

/* ── Modal field inline error ── */
.mu-field-error {
    font-size: 0.8rem;
    color: #b91c1c;
    margin-top: 2px;
}

.mu-input--error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}
