:root {
    --navy: #071d30;
    --navy2: #0e3452;
    --green: #147b65;
    --green-soft: #e5f5f0;
    --bg: #f4f7f9;
    --white: #fff;
    --text: #15232d;
    --muted: #687985;
    --line: #dce5ea;
    --danger: #a32f3d;
    --warning: #8b641d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    margin-top: 3px;
    color: var(--muted);
}

.logo {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--navy);
    color: white;
    font-weight: 900;
    font-size: 22px;
}

.logo.light {
    width: 40px;
    height: 40px;
    background: white;
    color: var(--navy);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 28px;
    padding: 24px;
    background:
        radial-gradient(
            circle at 15% 10%,
            rgba(20, 123, 101, .16),
            transparent 30%
        ),
        linear-gradient(145deg, #fafcfd, #edf3f6);
}

.auth-card {
    width: min(460px, 100%);
    padding: 36px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: white;
    box-shadow: 0 24px 70px rgba(7, 29, 48, .12);
}

.eyebrow {
    color: var(--green);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

h1 {
    margin: 8px 0;
    letter-spacing: -.04em;
}

h2,
h3 {
    margin: 6px 0;
}

.muted,
.heading p {
    color: var(--muted);
    line-height: 1.55;
}

form {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

label {
    display: grid;
    gap: 7px;
    font-size: 13px;
    font-weight: 750;
}

input {
    min-height: 48px;
    padding: 0 13px;
    border: 1px solid #cbd7de;
    border-radius: 10px;
    outline: none;
}

input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(20, 123, 101, .12);
}

.primary {
    min-height: 49px;
    border: 0;
    border-radius: 10px;
    background: var(--navy);
    color: white;
    font-weight: 800;
}

.primary:disabled,
.secondary:disabled {
    opacity: .55;
    cursor: wait;
}

.link-button {
    border: 0;
    background: transparent;
    color: var(--green);
    font-weight: 750;
}

.security-note {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 245px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 24px 17px;
    background: var(--navy);
    color: white;
}

.sidebar .brand small {
    color: rgba(255,255,255,.58);
}

.sidebar-brand {
    padding: 0 8px 28px;
}

nav {
    display: grid;
    gap: 7px;
}

.nav {
    border: 0;
    border-radius: 10px;
    padding: 13px;
    background: transparent;
    color: rgba(255,255,255,.68);
    text-align: left;
    font-weight: 750;
}

.nav.active,
.nav:hover {
    background: rgba(255,255,255,.1);
    color: white;
}

.sidebar-bottom {
    margin-top: auto;
    display: grid;
    gap: 14px;
}

.secure {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,.65);
    font-size: 12px;
}

.secure span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #43d7aa;
}

.logout {
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 9px;
    padding: 10px;
    background: transparent;
    color: white;
}

.workspace {
    min-width: 0;
}

.topbar {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 17px 32px;
    border-bottom: 1px solid var(--line);
    background: white;
}

.admin-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: right;
}

.admin-identity strong,
.admin-identity small {
    display: block;
}

.admin-identity small {
    margin-top: 3px;
    color: var(--muted);
}

.avatar {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--green-soft);
    color: var(--green);
    font-weight: 900;
}

.content {
    padding: 32px;
}

.view {
    max-width: 1300px;
    margin: 0 auto;
}

.heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 22px;
}

.heading p {
    margin: 0;
}

.secondary {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: white;
    font-weight: 750;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.metrics article {
    padding: 21px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: white;
}

.metrics span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.metrics strong {
    display: block;
    margin-top: 9px;
    font-size: 30px;
}

.panel {
    border: 1px solid var(--line);
    border-radius: 15px;
    overflow: hidden;
    background: white;
}

.panel-head {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.permissions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 20px;
}

.permission {
    padding: 7px 10px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green);
    font-family: monospace;
    font-size: 11px;
    font-weight: 750;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 18px;
    border-bottom: 1px solid #edf1f3;
    text-align: left;
}

th {
    background: #fafcfd;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.title {
    font-weight: 800;
}

.sub {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.badge {
    display: inline-block;
    padding: 6px 9px;
    border-radius: 999px;
    background: #eef3f6;
    font-size: 11px;
    font-weight: 750;
    text-transform: capitalize;
}

.badge.good {
    background: var(--green-soft);
    color: var(--green);
}

.badge.warn {
    background: #fff4d8;
    color: var(--warning);
}

.badge.bad {
    background: #fdebed;
    color: var(--danger);
}

.view-button {
    border: 0;
    border-radius: 8px;
    padding: 8px 10px;
    background: #e9f0f5;
    color: var(--navy);
    font-weight: 750;
}

.pagination {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 16px;
}

.pagination button {
    min-width: 36px;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    justify-content: flex-end;
    background: rgba(7,29,48,.42);
}

.drawer {
    width: min(500px, 100%);
    height: 100%;
    overflow-y: auto;
    background: white;
}

.drawer header {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    padding: 22px;
    border-bottom: 1px solid var(--line);
    background: white;
}

.close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    font-size: 22px;
}

.drawer-body {
    padding: 22px;
}

.detail {
    display: grid;
    grid-template-columns: 145px minmax(0,1fr);
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #edf1f3;
}

.detail span:first-child {
    color: var(--muted);
    font-size: 12px;
}

.detail span:last-child {
    overflow-wrap: anywhere;
    font-size: 13px;
    font-weight: 700;
}

.toast {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 999;
    max-width: 420px;
    padding: 13px 16px;
    border-radius: 10px;
    background: var(--navy);
    color: white;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: .18s;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    background: var(--danger);
}

.empty {
    padding: 30px;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 950px) {
    .metrics {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }
}

@media (max-width: 720px) {
    .app {
        display: block;
    }

    .sidebar {
        position: relative;
        height: auto;
    }

    nav {
        grid-template-columns: repeat(3,1fr);
    }

    .sidebar-bottom {
        display: none;
    }

    .topbar {
        padding: 15px 18px;
    }

    .content {
        padding: 22px 15px 40px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 26px 21px;
    }

    nav {
        grid-template-columns: 1fr;
    }

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

    .admin-identity > div:first-child {
        display: none;
    }

    .detail {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}
