:root {
    --shell-bg: #f3f3f3;
    --shell-dark: #0b0b0b;
    --shell-accent: #e8b800;
    --shell-brand: #003018;
    --shell-white: #ffffff;
    --shell-gray: #8a8a8a;
    --shell-font: "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    font-family: var(--shell-font);
    color: var(--shell-dark);
    background: var(--shell-bg);
}

button, input, select, textarea { font: inherit; }

a { color: var(--shell-brand); }

.shell-frame {
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr;
}

.shell-topbar {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 12px 20px;
    background: var(--shell-dark);
    color: var(--shell-white);
}

.shell-brand {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--shell-white);
    text-decoration: none;
}

.shell-brand-name {
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1;
}

.shell-brand-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--shell-accent);
    margin-top: 2px;
}

.shell-nav {
    display: flex;
    gap: 0.35rem;
    flex: 1;
}

.shell-nav a {
    color: #ddd;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: 4px;
}

.shell-nav a.active,
.shell-nav a:hover {
    color: var(--shell-accent);
    background: rgba(255, 255, 255, 0.06);
}

.shell-logout { margin-left: auto; }

.shell-topbar .btn {
    height: auto;
    border-width: 1px;
}

.shell-main {
    min-height: 0;
    overflow: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.home-panel { padding: 24px 20px; max-width: 880px; }

.home-head { margin: 0 0 20px; }

.home-panel h1 {
    margin: 0 0 8px;
    font-size: 1.6rem;
    width: max-content;
}

.home-panel h1:focus { outline: none; }
.home-panel h1:focus-visible {
    outline: 2px solid var(--shell-accent);
    outline-offset: 4px;
}

.home-lead { margin: 0; color: var(--shell-gray); }
.home-muted { color: var(--shell-gray); }

.health-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.health-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    background: var(--shell-white);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid var(--shell-gray);
}

.health-card:hover { border-color: #ccc; }
.health-card:focus-visible {
    outline: 2px solid var(--shell-accent);
    outline-offset: 2px;
}

.health-card.ok { border-left-color: #39FF14; }
.health-card.bad { border-left-color: #C62828; }
.health-card.pending { border-left-color: #f5a623; }

.health-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.health-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--shell-gray);
    flex-shrink: 0;
}

.health-card.ok .health-dot { background: #39FF14; }
.health-card.bad .health-dot { background: #C62828; }
.health-card.pending .health-dot { background: #f5a623; }

.health-card-title { font-weight: 700; font-size: 1.1rem; }

.health-pill {
    display: inline-block;
    margin-top: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #eceff1;
    color: #455a64;
}

.health-card.ok .health-pill { background: #eaf7ee; color: #155724; }
.health-card.bad .health-pill { background: #ffebee; color: #b71c1c; }
.health-card.pending .health-pill { background: #fff3cd; color: #856404; }

.health-card-detail { margin-top: 8px; font-size: 0.85rem; color: var(--shell-gray); }

.product-stub {
    background: var(--shell-white);
    border-radius: 8px;
    padding: 24px;
    border: 1px solid #ddd;
    max-width: 640px;
}

.product-stub h1 { margin-top: 0; }

.btn-logout {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.35);
    color: var(--shell-white);
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
}

.btn-logout:hover { border-color: var(--shell-accent); color: var(--shell-accent); }

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(280px, 42%) 1fr;
    background: var(--shell-bg);
}

.login-aside {
    background-color: var(--shell-dark);
    background-image:
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 11px,
            rgba(255, 255, 255, 0.028) 11px,
            rgba(255, 255, 255, 0.028) 12px
        );
    color: var(--shell-white);
    display: flex;
    align-items: center;
    padding: 48px 40px;
    border-right: 3px solid var(--shell-brand);
}

.login-aside-inner {
    max-width: 320px;
    animation: login-aside-in 420ms ease-out both;
}

.login-brand {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
}

.login-aside .brand-name {
    color: var(--shell-white);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.login-aside .brand-admin {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--shell-accent);
    margin-top: 6px;
}

.login-aside-lead {
    margin: 0 0 28px;
    font-size: 1rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.72);
    max-width: 18ch;
}

.login-aside-points {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.login-aside-points li {
    position: relative;
    padding-left: 14px;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.55);
}

.login-aside-points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 6px;
    height: 2px;
    background: var(--shell-accent);
}

.login-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.login-form {
    width: min(380px, 100%);
    animation: login-form-in 480ms ease-out both;
}

.login-form-title {
    margin: 0 0 6px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--shell-dark);
    letter-spacing: -0.02em;
}

.login-form-sub {
    margin: 0 0 24px;
    color: var(--shell-gray);
    font-size: 0.9rem;
}

.login-form .field { margin-bottom: 16px; }

.login-form .field label {
    display: block;
    font-size: 0.78rem;
    color: var(--shell-gray);
    font-weight: 600;
    margin-bottom: 4px;
}

.login-form .field input {
    width: 100%;
    height: 44px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0 12px;
    background: var(--shell-white);
    color: var(--shell-dark);
}

.login-form .field input:focus,
.login-form .field input:focus-visible {
    outline: 2px solid var(--shell-accent);
    outline-offset: 0;
    border-color: var(--shell-accent);
    box-shadow: none;
}

.login-form .field input:-webkit-autofill,
.login-form .field input:-webkit-autofill:hover,
.login-form .field input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--shell-dark);
    box-shadow: 0 0 0 1000px var(--shell-white) inset;
    border-color: var(--shell-accent);
    caret-color: var(--shell-dark);
}

.login-submit {
    width: 100%;
    margin-top: 8px;
    height: 44px;
    font-weight: 600;
    background: var(--shell-brand);
    color: var(--shell-white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

@keyframes login-aside-in {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes login-form-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msg {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.88rem;
}

.msg-error { background: #ffebee; color: #b71c1c; }

#blazor-error-ui {
    background: #ffebee;
    bottom: 0;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

@media (max-width: 860px) {
    .login-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .login-aside {
        padding: 28px 24px;
        border-right: none;
        border-bottom: 3px solid var(--shell-brand);
        align-items: flex-start;
    }

    .login-aside-inner { max-width: none; }
    .login-aside .brand-name { font-size: 1.55rem; }
    .login-aside-lead {
        margin-bottom: 0;
        max-width: none;
    }
    .login-aside-points { display: none; }
    .login-main {
        align-items: flex-start;
        padding-top: 32px;
    }
}

@media (max-width: 800px) {
    .shell-topbar { flex-wrap: wrap; }
    .health-grid { grid-template-columns: 1fr; }
}
