body {
    background: #f4f7fb;
    font-family: 'Poppins', sans-serif;
    margin: 0;
}

.sidebar {
    width: 260px;
    background: #0f172a;
    min-height: 100vh;
    color: #cbd5f5;
    display: flex;
    flex-direction: column;
}

.sidebar .brand {
    color: #fff;
    font-weight: 700;
    letter-spacing: .3px;
    font-size: 1.05rem;
}

.sidebar .brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar .brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 0;
    object-fit: contain;
    flex-shrink: 0;
    background: transparent;
}

.sidebar .brand-sub {
    color: #64748b;
    font-size: 12px;
}

.nav-stack a {
    color: #94a3b8;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 12px;
    margin-bottom: 4px;
    font-size: 0.92rem;
    font-weight: 500;
}

.nav-stack a i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
}

.nav-stack a:hover,
.nav-stack a.active {
    background: #1e293b;
    color: #fff;
}

.nav-stack a.active {
    background: linear-gradient(90deg, #1d4ed8, #2563eb);
}

.nav-stack a.nav-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.main-shell {
    min-width: 0;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.profile-chip {
    display: flex;
    align-items: center;
}

.content-pad {
    padding: 24px;
}

.card {
    border-radius: 16px;
    border: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    background: #fff;
}

.card-head {
    border-bottom: 1px solid #eef2f7;
}

.metric-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.metric-icon {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.metric-blue .metric-icon { background: #dbeafe; color: #2563eb; }
.metric-green .metric-icon { background: #dcfce7; color: #16a34a; }
.metric-amber .metric-icon { background: #fef3c7; color: #d97706; }
.metric-indigo .metric-icon { background: #e0e7ff; color: #4f46e5; }

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.avatar-lg {
    width: 40px;
    height: 40px;
}

.dash-table thead th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    font-weight: 600;
    border-bottom-width: 1px;
    background: #f8fafc;
    padding: 12px 16px;
}

.dash-table tbody td {
    padding: 14px 16px;
    border-color: #f1f5f9;
}

.badge-soft {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-muted { background: #f1f5f9; color: #475569; }

.badge-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    vertical-align: middle;
}
.badge-dot.online { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.badge-dot.offline { background: #94a3b8; }

.soft-progress {
    height: 8px;
    background: #eef2f7;
    border-radius: 999px;
    overflow: hidden;
}

.soft-progress .progress-bar {
    background: #2563eb;
}

.bg-indigo {
    background: #4f46e5 !important;
}

.code-box {
    font-weight: 700;
    letter-spacing: .2em;
    font-size: 20px;
    min-width: 180px;
}

.login-body {
    --login-ink: #07111f;
    --login-panel: #f7f4ef;
    --login-text: #102033;
    --login-muted: #5b6b7c;
    --login-accent: #0e7490;
    --login-accent-deep: #0f4c81;
    --login-warm: #d97706;
    min-height: 100vh;
    margin: 0;
    position: relative;
    overflow-x: hidden;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: #050b14;
    font-family: "Sora", sans-serif;
    color: #e8eef6;
}

.login-atmosphere {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 70% 55% at 12% 20%, rgba(14, 165, 180, 0.28), transparent 55%),
        radial-gradient(ellipse 55% 45% at 88% 12%, rgba(217, 119, 6, 0.18), transparent 50%),
        radial-gradient(ellipse 50% 40% at 70% 85%, rgba(37, 99, 235, 0.22), transparent 55%),
        linear-gradient(160deg, #050b14 0%, #0a1628 45%, #07111f 100%);
    animation: loginAtmosphere 18s ease-in-out infinite alternate;
}

.login-grid-overlay {
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.22;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
    pointer-events: none;
}

@keyframes loginAtmosphere {
    from { filter: hue-rotate(0deg) saturate(1); transform: scale(1); }
    to { filter: hue-rotate(8deg) saturate(1.08); transform: scale(1.03); }
}

.login-shell {
    position: relative;
    z-index: 1;
    width: min(1120px, calc(100% - 48px));
    margin: 40px auto;
    display: grid;
    grid-template-columns: 1.15fr 0.95fr;
    min-height: min(640px, calc(100vh - 80px));
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(8, 16, 28, 0.55);
    backdrop-filter: blur(18px);
    animation: loginRise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes loginRise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-hero {
    position: relative;
    padding: 56px 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #f4f8fc;
}

.login-hero-glow {
    position: absolute;
    width: 280px;
    height: 280px;
    left: 36px;
    top: 48px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 165, 180, 0.35), transparent 70%);
    filter: blur(8px);
    animation: loginPulse 5.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes loginPulse {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.08); }
}

.login-logo {
    position: relative;
    width: 112px;
    height: 112px;
    border-radius: 0;
    object-fit: contain;
    margin-bottom: 28px;
    background: transparent;
    border: 0;
    animation: loginLogoIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

@keyframes loginLogoIn {
    from { opacity: 0; transform: translateY(10px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-kicker {
    position: relative;
    margin: 0 0 10px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #7dd3c7;
}

.login-brand-name {
    position: relative;
    margin: 0 0 16px;
    font-family: "Fraunces", Georgia, serif;
    font-weight: 650;
    font-size: clamp(2.2rem, 3.4vw, 3.15rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: #fff;
}

.login-tagline {
    position: relative;
    margin: 0 0 28px;
    max-width: 34ch;
    font-size: 1rem;
    line-height: 1.65;
    color: rgba(226, 236, 247, 0.78);
}

.login-points {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.login-points li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
    color: rgba(226, 236, 247, 0.88);
}

.login-points li::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: linear-gradient(135deg, #22d3c5, #f59e0b);
    flex-shrink: 0;
}

.login-panel {
    background: var(--login-panel);
    color: var(--login-text);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 36px;
}

.login-panel-inner {
    width: 100%;
    max-width: 360px;
    animation: loginRise 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.login-panel-eyebrow {
    margin: 0 0 8px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--login-accent);
}

.login-panel-title {
    margin: 0 0 8px;
    font-family: "Fraunces", Georgia, serif;
    font-weight: 650;
    font-size: 2rem;
    letter-spacing: -0.02em;
    color: var(--login-text);
}

.login-panel-sub {
    margin: 0 0 28px;
    font-size: 0.92rem;
    color: var(--login-muted);
    line-height: 1.5;
}

.login-form-fields {
    display: grid;
    gap: 16px;
}

.login-field label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
}

.login-field input {
    width: 100%;
    border: 1px solid #d7dde6;
    background: #fff;
    border-radius: 12px;
    padding: 13px 14px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--login-text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-field input::placeholder {
    color: #94a3b8;
}

.login-field input:focus {
    border-color: #0e7490;
    box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.15);
}

.login-error {
    margin: 0;
    padding: 11px 13px;
    border-radius: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.86rem;
}

.login-submit {
    margin-top: 6px;
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 14px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #0f4c81 0%, #0e7490 100%);
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.18s ease, filter 0.18s ease;
}

.login-submit:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.login-submit:active {
    transform: translateY(0);
}

.login-footnote {
    margin: 22px 0 0;
    text-align: center;
    font-size: 0.75rem;
    color: #8a97a8;
    letter-spacing: 0.02em;
}

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr;
        width: min(480px, calc(100% - 28px));
        margin: 24px auto;
        min-height: auto;
    }

    .login-hero {
        padding: 36px 28px 24px;
    }

    .login-logo {
        width: 88px;
        height: 88px;
        margin-bottom: 18px;
    }

    .login-brand-name {
        font-size: 2rem;
    }

    .login-points {
        display: none;
    }

    .login-panel {
        padding: 28px 24px 36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-atmosphere,
    .login-hero-glow,
    .login-shell,
    .login-logo,
    .login-panel-inner {
        animation: none !important;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 210px;
    }
}
