/* License & Update Center: sign-in page and dashboard.
   Colours follow the DevExpress "blazing-berry" theme through --bs-primary. */

:root {
    --portal-ink: #1f1d2b;
    --portal-muted: #6b6880;
    --portal-line: #e7e4ef;
    --portal-surface: #ffffff;
    --portal-canvas: #f6f5fa;
    --portal-ok: #1f8a5b;
    --portal-ok-soft: #e3f4ec;
    --portal-warn: #a86400;
    --portal-warn-soft: #fff1d9;
    --portal-danger: #c23a3a;
    --portal-danger-soft: #fbe5e5;
    --portal-info: #3b5bcc;
    --portal-info-soft: #e6ebfb;
    --portal-none: #b9b5c8;
    --portal-radius: 14px;
    --portal-shadow: 0 1px 2px rgba(31, 29, 43, .06), 0 8px 24px rgba(31, 29, 43, .06);
}

/* ============================== Sign-in ============================== */

.auth-page {
    display: grid;
    grid-template-columns: minmax(360px, 46%) 1fr;
    height: 100vh;
    background: var(--portal-canvas);
    color: var(--portal-ink);
}

.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.75rem 3.25rem;
    color: #fff;
    background:
        radial-gradient(1200px 500px at -10% 110%, rgba(255, 255, 255, .14), transparent 60%),
        radial-gradient(600px 400px at 110% -10%, rgba(255, 255, 255, .10), transparent 60%),
        linear-gradient(160deg, var(--bs-primary) 0%, #2a1840 100%);
    overflow: hidden;
}

    .auth-brand::after {
        /* faint grid pattern */
        content: "";
        position: absolute;
        inset: 0;
        background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
                          linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
        background-size: 44px 44px;
        mask-image: linear-gradient(180deg, transparent, #000 40%, #000 70%, transparent);
        pointer-events: none;
    }

.auth-brand > * { position: relative; z-index: 1; }

.auth-brand-top { display: flex; align-items: center; gap: .75rem; }
.auth-brand-mark { width: 44px; height: 44px; }
.auth-brand-name { font-size: 1.15rem; font-weight: 600; letter-spacing: .02em; }

.auth-brand-body { max-width: 30rem; }
    .auth-brand-body h1 {
        font-size: 2.4rem;
        line-height: 1.15;
        font-weight: 700;
        margin: 0 0 1rem;
        text-wrap: balance;
    }
    .auth-brand-body p { font-size: 1.05rem; line-height: 1.6; opacity: .85; margin: 0 0 1.75rem; }

.auth-brand-points { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
    .auth-brand-points li { display: flex; align-items: center; gap: .75rem; font-size: .98rem; opacity: .92; }

.auth-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .18); flex: none;
}

.auth-brand-foot { font-size: .85rem; opacity: .65; }

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    overflow-y: auto;
}

.auth-card { width: 100%; max-width: 400px; }

.auth-heading { margin-bottom: 1.75rem; }
    .auth-heading h2 { font-size: 1.85rem; font-weight: 700; margin: 0 0 .35rem; }
    .auth-heading p { color: var(--portal-muted); margin: 0; }

.auth-heading-mark {
    display: none; width: 44px; height: 44px; margin-bottom: 1.25rem;
    border-radius: 12px; background: var(--bs-primary);
}

.auth-form { display: grid; gap: 1.1rem; }

.auth-field { display: grid; gap: .4rem; }
    .auth-field label { font-weight: 600; font-size: .9rem; }

.auth-input {
    width: 100%;
    height: 46px;
    padding: 0 .9rem;
    border: 1px solid var(--portal-line);
    border-radius: 10px;
    background: var(--portal-surface);
    color: var(--portal-ink);
    font-size: 1rem;
    transition: border-color .15s, box-shadow .15s;
}
    .auth-input::placeholder { color: #a9a5ba; }
    .auth-input:focus {
        outline: none;
        border-color: var(--bs-primary);
        box-shadow: 0 0 0 4px color-mix(in srgb, var(--bs-primary) 18%, transparent);
    }
    .auth-input.invalid { outline: none; border-color: var(--portal-danger); }
    .auth-input.valid.modified { outline: none; }

.auth-password { position: relative; }
    .auth-password .auth-input { padding-right: 4.5rem; }

.auth-reveal {
    position: absolute; right: .4rem; top: 50%; transform: translateY(-50%);
    border: 0; background: transparent; color: var(--bs-primary);
    font-weight: 600; font-size: .85rem; padding: .35rem .6rem; border-radius: 8px; cursor: pointer;
}
    .auth-reveal:hover { background: color-mix(in srgb, var(--bs-primary) 10%, transparent); }

.auth-error { color: var(--portal-danger); font-size: .85rem; }

.auth-remember { display: flex; align-items: center; gap: .55rem; font-size: .95rem; cursor: pointer; user-select: none; }
    .auth-remember input { width: 18px; height: 18px; accent-color: var(--bs-primary); }

.auth-submit {
    height: 48px;
    margin-top: .35rem;
    border: 0;
    border-radius: 10px;
    background: var(--bs-primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter .15s, transform .05s;
}
    .auth-submit:hover { filter: brightness(1.08); }
    .auth-submit:active { transform: translateY(1px); }
    .auth-submit:focus-visible { outline: 3px solid color-mix(in srgb, var(--bs-primary) 40%, transparent); outline-offset: 2px; }

.auth-note { margin: 1.75rem 0 0; font-size: .85rem; color: var(--portal-muted); line-height: 1.5; }

.auth-card .alert { border-radius: 10px; font-size: .92rem; }

@media (max-width: 900px) {
    .auth-page { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-heading-mark { display: block; }
}

/* ============================== Dashboard ============================== */

.dash {
    height: calc(100dvh - 4.75rem);
    overflow-y: auto;
    padding: .25rem .25rem 2rem;
    color: var(--portal-ink);
}

.dash-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 2rem;
    margin-bottom: 1.5rem;
}
    .dash-header h1 { font-size: 1.75rem; font-weight: 700; margin: 0 0 .25rem; }
    .dash-header p { color: var(--portal-muted); margin: 0; }

.dash-actions { display: flex; flex-wrap: wrap; gap: .6rem; }

.dash-btn {
    display: inline-flex; align-items: center; height: 40px; padding: 0 1rem;
    border: 1px solid var(--portal-line); border-radius: 10px; background: var(--portal-surface);
    color: var(--portal-ink); font-weight: 600; font-size: .92rem; text-decoration: none;
    transition: border-color .15s, background .15s;
}
    .dash-btn:hover { border-color: var(--bs-primary); color: var(--bs-primary); }

.dash-btn-primary { background: var(--bs-primary); border-color: var(--bs-primary); color: #fff; }
    .dash-btn-primary:hover { color: #fff; filter: brightness(1.08); }

.dash-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.kpi {
    display: flex; flex-direction: column; gap: .3rem;
    padding: 1.1rem 1.25rem; border-radius: var(--portal-radius);
    background: var(--portal-surface); border: 1px solid var(--portal-line); box-shadow: var(--portal-shadow);
    color: inherit; text-decoration: none; transition: transform .12s, border-color .12s;
    border-top: 3px solid var(--bs-primary);
}
    .kpi:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--bs-primary) 45%, var(--portal-line)); color: inherit; }

.kpi-warn { border-top-color: var(--portal-warn); }
.kpi-label { font-size: .82rem; font-weight: 600; color: var(--portal-muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-size: 2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-value-text { font-size: 1.45rem; padding: .3rem 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.kpi-sub { font-size: .85rem; color: var(--portal-muted); }

.dash-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.panel {
    background: var(--portal-surface); border: 1px solid var(--portal-line);
    border-radius: var(--portal-radius); box-shadow: var(--portal-shadow);
    padding: 1.1rem 1.25rem 1.25rem; min-width: 0;
}

.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
    .panel-head h2 { font-size: 1.05rem; font-weight: 700; margin: 0; }
    .panel-head a { font-size: .88rem; font-weight: 600; color: var(--bs-primary); text-decoration: none; }
    .panel-head a:hover { text-decoration: underline; }

.panel-empty { color: var(--portal-muted); margin: .5rem 0 0; }

.rows { list-style: none; margin: 0; padding: 0; }

.row-item {
    display: flex; align-items: center; gap: .85rem;
    padding: .7rem 0; border-top: 1px solid var(--portal-line);
}
    .row-item:first-child { border-top: 0; }

.row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.row-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: .85rem; color: var(--portal-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-time { font-size: .82rem; color: var(--portal-muted); white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

.chip {
    flex: none; font-size: .78rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; white-space: nowrap;
}
.chip-ok { background: var(--portal-ok-soft); color: var(--portal-ok); }
.chip-warn { background: var(--portal-warn-soft); color: var(--portal-warn); }
.chip-danger { background: var(--portal-danger-soft); color: var(--portal-danger); }
.chip-info { background: var(--portal-info-soft); color: var(--portal-info); }
.chip-muted { background: #efedf4; color: var(--portal-muted); }

.event-icon { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.event-ok { background: var(--portal-ok); }
.event-warn { background: var(--portal-warn); }
.event-danger { background: var(--portal-danger); }
.event-info { background: var(--portal-info); }

.stack-bar {
    display: flex; height: 14px; border-radius: 999px; overflow: hidden;
    background: #efedf4; margin: .5rem 0 1.1rem; gap: 2px;
}
.stack-seg { min-width: 6px; }

.seg-ok { background: var(--portal-ok); }
.seg-warn { background: #e39b2d; }
.seg-danger { background: var(--portal-danger); }
.seg-muted { background: #8e8aa3; }
.seg-none { background: var(--portal-none); }

.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
    .legend li { display: flex; align-items: center; gap: .6rem; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-label { flex: 1; color: var(--portal-ink); }
.legend-value { font-weight: 700; font-variant-numeric: tabular-nums; }

@media (max-width: 1100px) {
    .dash-grid { grid-template-columns: 1fr; }
}

/* ============================== Sidebar brand ============================== */

.brand-lockup { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; min-width: 0; }
    .brand-lockup:hover { color: #fff; }
.brand-lockup img { width: 34px; height: 34px; flex: none; }
.brand-lockup-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-lockup-name { font-weight: 700; font-size: 1rem; }
.brand-lockup-sub { font-size: .72rem; opacity: .75; white-space: nowrap; }
.drawer-user { width: 100%; display: grid; gap: .6rem; padding: 0 .75rem; }

.drawer-user-link {
    display: flex; align-items: center; gap: .6rem; min-width: 0;
    padding: .5rem; border-radius: 10px; color: #fff; text-decoration: none;
    background: rgba(255, 255, 255, .08);
}
    .drawer-user-link:hover { color: #fff; background: rgba(255, 255, 255, .14); }

.drawer-avatar {
    flex: none; width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center; font-weight: 700; font-size: .85rem;
    background: #fff; color: var(--bs-primary);
}

.drawer-user-name { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.drawer-signout {
    width: 100%; height: 34px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 8px;
    background: transparent; color: #fff; font-size: .85rem; font-weight: 600; cursor: pointer;
}
    .drawer-signout:hover { background: rgba(255, 255, 255, .12); }

.drawer-version { color: rgba(255, 255, 255, .6); font-size: .75rem; text-align: center; }

/* Sidebar scrolling (short windows): thin, light scrollbar instead of the default white bar. */
.navigation-drawer .dxbl-drawer-body {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .28) transparent;
}
    .navigation-drawer .dxbl-drawer-body::-webkit-scrollbar { width: 6px; }
    .navigation-drawer .dxbl-drawer-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .28); border-radius: 3px; }
    .navigation-drawer .dxbl-drawer-body::-webkit-scrollbar-track { background: transparent; }
