:root {
    color-scheme: dark;
    --ink: #ecf7ff;
    --muted: #91a8bc;
    --line: #203247;
    --panel: #101b29;
    --soft: #07111d;
    --primary: #5277ff;
    --primary-dark: #3e60df;
    --accent: #7190ff;
    --danger: #ff7d8b;
    --violet: #9b7bff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: #030509;
}

.login-page {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 20px;
    background: #030509;
}

.login-page::before { content: ''; position: absolute; z-index: -1; width: 360px; height: 1px; background: #4de8d3; opacity: .24; transform: rotate(-28deg); top: 18%; left: -120px; }
.login-page::after { content: ''; position: absolute; z-index: -1; width: 320px; height: 1px; background: #7190ff; opacity: .2; transform: rotate(-28deg); right: -100px; bottom: 22%; }

.mail-scene { position: absolute; z-index: -1; width: 410px; height: 300px; right: 9%; top: 50%; opacity: .56; transform: translateY(-50%); }
.mail-envelope { position: absolute; width: 220px; height: 142px; right: 34px; top: 70px; border: 1px solid rgba(113, 144, 255, .52); border-radius: 10px; background: rgba(8, 18, 32, .52); transform: rotate(-8deg); }
.mail-envelope::before, .mail-envelope::after { content: ''; position: absolute; width: 134px; height: 1px; top: 49px; background: rgba(77, 232, 211, .66); }
.mail-envelope::before { left: -4px; transform: rotate(33deg); transform-origin: left center; }
.mail-envelope::after { right: -4px; transform: rotate(-33deg); transform-origin: right center; }
.mail-envelope span { position: absolute; width: 82px; height: 1px; left: 68px; bottom: 30px; background: rgba(113, 144, 255, .55); }
.mail-message { position: absolute; width: 108px; height: 72px; border: 1px solid rgba(77, 232, 211, .48); border-radius: 8px; background: rgba(7, 16, 29, .65); }
.mail-message::after { content: ''; position: absolute; left: 16px; right: 16px; top: 22px; height: 2px; background: rgba(77, 232, 211, .46); box-shadow: 0 12px 0 rgba(113, 144, 255, .34); }
.message-one { top: 18px; right: 252px; }
.message-two { right: 8px; bottom: 28px; }
.mail-route { position: absolute; left: 30px; right: 0; bottom: 10px; height: 1px; background: rgba(113, 144, 255, .42); transform: rotate(-13deg); transform-origin: left; }
.mail-route i { position: absolute; top: -4px; width: 8px; height: 8px; border: 1px solid #4de8d3; border-radius: 50%; background: #030509; }
.mail-route i:nth-child(1) { left: 18%; }
.mail-route i:nth-child(2) { left: 52%; }
.mail-route i:nth-child(3) { left: 84%; }

.brand-mark {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    margin-bottom: 28px;
    color: var(--ink);
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 0 0 5px rgba(113, 144, 255, .08), 0 12px 30px rgba(113, 144, 255, .2);
    font-weight: 800;
    font-size: 24px;
}

.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 38px; }
.login-brand .eyebrow { margin-bottom: 4px; color: var(--ink); letter-spacing: 1px; }
.brand-subtitle { margin: 0; color: var(--muted); font-size: 13px; }
.accent-label { color: var(--accent); letter-spacing: 1px; }

.eyebrow {
    margin: 0 0 10px;
    color: inherit;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.topbar h1 {
    margin: 0;
}

.login-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: min(100%, 430px);
    padding: 34px;
    background: #080e17;
    border: 1px solid #24354a;
    border-top: 2px solid var(--violet);
    border-radius: 12px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .56), 0 0 0 1px rgba(77, 232, 211, .035);
}

.login-header h2 {
    margin: 0 0 28px;
    font-size: 30px;
}

.login-header h1 { margin: 0; color: #f5fbff; font-size: 31px; letter-spacing: 0; }
.login-intro { margin: 8px 0 24px; color: var(--muted); line-height: 1.45; font-size: 14px; }

.login-form {
    display: grid;
    gap: 12px;
}

.field-control { position: relative; }
.field-control input { padding-left: 44px; padding-right: 44px; }
.field-icon { position: absolute; z-index: 1; top: 50%; left: 14px; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; pointer-events: none; }
.field-control:focus-within .field-icon { stroke: var(--primary); }
.password-toggle { position: absolute; top: 50%; right: 10px; width: 34px; min-height: 34px; height: 34px; transform: translateY(-50%); padding: 7px; color: var(--muted); background: transparent; box-shadow: none; }
.password-toggle:hover { color: var(--primary); background: transparent; }
.password-toggle svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }

label {
    font-weight: 700;
    font-size: 14px;
}

input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    font-size: 16px;
    color: var(--ink);
    background: #071019;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .02);
}

input:focus {
    outline: 3px solid rgba(22, 217, 209, 0.14);
    border-color: var(--primary);
}

button {
    min-height: 48px;
    border: 0;
    border-radius: 8px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: var(--primary);
    box-shadow: 0 10px 26px rgba(82, 119, 255, .24);
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    user-select: none;
}

.login-submit { position: relative; }
.login-submit span:last-child { position: absolute; right: 19px; font-size: 19px; font-weight: 500; }

.login-footer { margin: 26px 0 0; color: var(--muted); text-align: center; font-size: 12px; }

button:hover {
    background: var(--primary-dark);
}

.alert {
    margin-bottom: 18px;
    border: 1px solid #f1b8b0;
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--danger);
    background: #291923;
}

.dashboard-shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 20px;
}

.admin-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 248px 1fr;
}

.admin-sidebar {
    padding: 24px 14px;
    border-right: 1px solid var(--line);
    background: #091521;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 10px 30px;
    font-size: 20px;
    font-weight: 800;
}

.brand-mark.small { width: 38px; height: 38px; margin: 0; font-size: 14px; }
.menu-link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--muted); text-decoration: none; }
.menu-link:hover, .menu-link.active { color: var(--ink); background: #132b3d; }
.menu-link.active { box-shadow: inset 3px 0 var(--primary); }
.menu-icon { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid currentColor; border-radius: 6px; font-size: 11px; font-weight: 800; }
.admin-content { min-width: 0; padding: 32px clamp(20px, 4vw, 56px); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.stat-panel { padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.stat-panel span { display: block; color: var(--muted); font-size: 13px; }
.stat-panel strong { display: block; margin-top: 10px; color: var(--accent); font-size: 30px; }

.topbar,
.welcome-panel {
    background: #101b29;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px;
}

.welcome-panel {
    margin-top: 20px;
    padding: 28px;
}

.welcome-panel h2 {
    margin: 0 0 12px;
}

.ghost-button {
    color: var(--primary-dark);
    background: #e6f5f4;
}

.ghost-button:hover {
    background: #d4eeee;
}

.action-link { display: inline-flex; align-items: center; text-decoration: none; }

@media (max-width: 520px) {
    .login-panel { padding: 28px 22px; }
    .login-brand { margin-bottom: 38px; }

    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
    .admin-sidebar nav { display: flex; gap: 6px; overflow-x: auto; }
    .menu-link { white-space: nowrap; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mail-scene { right: -210px; opacity: .45; }
}
