* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: #182235;
    background: #f4f8fd;
}

.login-page {
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(180deg, #eaf3ff 0%, #f8fbff 42%, #f4f8fd 100%);
}

.login-shell {
    width: min(420px, 100%);
}

.login-panel {
    background: #ffffff;
    border: 1px solid #d8e3f0;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 18px 44px rgba(15, 54, 100, .14);
}

.brand-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #ffffff;
    font-weight: 900;
    background: #1565c0;
}

h1 {
    margin: 18px 0 8px;
    font-size: 28px;
    line-height: 1.15;
}

.muted {
    color: #64748b;
    line-height: 1.45;
}

.alert {
    margin: 18px 0;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
}

.alert.error {
    color: #be123c;
    background: #fff1f2;
    border: 1px solid #fecdd3;
}

.alert.ok {
    color: #166534;
    background: #ecfdf3;
    border: 1px solid #bbf7d0;
}

form {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

label span {
    display: block;
    margin-bottom: 7px;
    color: #26364d;
    font-size: 13px;
    font-weight: 800;
}

input {
    width: 100%;
    border: 1px solid #cfdced;
    border-radius: 12px;
    padding: 12px;
    font: inherit;
    outline: none;
}

select {
    width: 100%;
    border: 1px solid #cfdced;
    border-radius: 12px;
    padding: 12px;
    font: inherit;
    background: #ffffff;
    outline: none;
}

input:focus {
    border-color: #1e88e5;
    box-shadow: 0 0 0 4px rgba(30, 136, 229, .13);
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 92px;
}

.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    min-height: 36px;
    transform: translateY(-50%);
    border-radius: 10px;
    padding: 8px 12px;
    color: #0d47a1;
    background: #eaf3ff;
    font-size: 13px;
}

button,
.logout-link {
    border: 0;
    border-radius: 12px;
    padding: 12px 16px;
    font: inherit;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

button {
    color: #ffffff;
    background: #1565c0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 24px;
    color: #ffffff;
    background: #0d47a1;
}

.topbar h1 {
    margin: 4px 0;
}

.topbar .muted {
    margin: 0;
    color: #eaf6ff;
}

.eyebrow {
    margin: 0;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #bfe7ff;
}

.logout-link {
    color: #0d47a1;
    background: #ffffff;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.user-box {
    flex: 0 0 auto;
    min-width: 340px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    text-align: right;
}

.dashboard-user-box {
    align-self: center;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .12);
}

.user-info {
    min-width: 0;
}

.user-name {
    font-weight: 900;
    line-height: 1.25;
}

.user-meta {
    color: #eaf6ff;
    font-size: 13px;
    line-height: 1.35;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-grid {
    width: min(1100px, 94vw);
    margin: 28px auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.menu-card {
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 22px;
    padding: 20px;
    color: #182235;
    text-decoration: none;
    background: #ffffff;
    border: 1px solid #d8e3f0;
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(15, 54, 100, .08);
}

.menu-card strong {
    color: #0d47a1;
    font-size: 20px;
}

.menu-card span {
    color: #64748b;
    line-height: 1.45;
}

.menu-card.accent {
    border-color: #90caf9;
    background: #f8fbff;
}

.admin-layout {
    width: min(1100px, 94vw);
    margin: 28px auto;
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 16px;
}

.admin-panel {
    background: #ffffff;
    border: 1px solid #d8e3f0;
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 10px 26px rgba(15, 54, 100, .08);
}

.admin-panel h2 {
    margin: 0 0 16px;
    color: #0d47a1;
}

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    padding: 10px 12px;
    border-bottom: 1px solid #d8e3f0;
    text-align: left;
}

th {
    color: #0d47a1;
    background: #f8fbff;
}

@media (max-width: 850px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .user-box {
        width: 100%;
        min-width: 0;
        justify-content: space-between;
        text-align: left;
    }

    .user-meta {
        max-width: 58vw;
    }

    .menu-grid {
        grid-template-columns: 1fr;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }
}
