:root {
    --bg: #f4f7fb;
    --card: rgba(255, 255, 255, 0.88);
    --text: #111827;
    --muted: #6b7280;
    --line: #d9e0ea;
    --brand: #2563eb;
    --brand-2: #0f766e;
    --danger: #dc2626;
    --shadow: 0 20px 50px rgba(15, 23, 42, 0.10);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    margin: 0;
}

body {
    margin: 0;
    min-height: 100dvh;
    background: radial-gradient(circle at top left, #dbeafe, transparent 35%), var(--bg);
    color: var(--text);
    font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

a {
    color: var(--brand);
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

main,
.container {
    flex: 1 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 26px;
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
}

.brand-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 0 18px rgba(37, 99, 235, 0.6);
    flex: 0 0 auto;
}

.brand-text {
    display: inline-block;
}

.navlinks {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.navlinks a,
.theme-toggle {
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 999px;
    line-height: 1;
}

.navlinks a.is-active {
    border-color: rgba(37, 99, 235, 0.45);
    background: rgba(37, 99, 235, 0.12);
    color: var(--brand);
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    color: var(--text);
    padding: 0;
    box-shadow: none;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 99px;
    background: currentColor;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.topbar.is-open .nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.topbar.is-open .nav-toggle span:nth-child(2) {
    opacity: 0;
}

.topbar.is-open .nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.logout {
    color: var(--danger) !important;
}

.container {
    width: min(1380px, calc(100% - 32px));
    margin: 28px auto 18px;
}

.panel,
.card,
.login-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.panel {
    padding: 22px;
    margin-bottom: 20px;
}

.hero {
    padding: 34px;
    border-radius: 30px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(15, 118, 110, 0.9));
    color: white;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.hero h1 {
    margin: 4px 0;
    font-size: clamp(30px, 5vw, 52px);
}

.eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.85;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.card {
    padding: 24px;
    color: var(--text);
}

.card strong {
    display: block;
    font-size: 42px;
}

.card span {
    color: var(--muted);
}

.grid-two {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 20px;
    align-items: start;
}

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

.form label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 11px 12px;
    background: white;
    color: var(--text);
}

textarea {
    min-height: 88px;
    resize: vertical;
}

button,
.form button,
.search button {
    border: 0;
    border-radius: 14px;
    padding: 11px 16px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: white;
    font-weight: 800;
    cursor: pointer;
}

.check {
    display: flex !important;
    grid-template-columns: none !important;
    flex-direction: row;
    align-items: center;
}

.check input {
    width: auto;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

code {
    background: rgba(37, 99, 235, 0.10);
    padding: 4px 8px;
    border-radius: 8px;
}

.danger {
    color: var(--danger);
}

.search {
    display: flex;
    gap: 10px;
    align-items: center;
}

.alert,
.notice {
    padding: 12px;
    border-radius: 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
}

.footer {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0;
    padding: 0 12px 10px;
    box-sizing: border-box;
    pointer-events: none;
}

.footer-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: calc(100vw - 24px);
    padding: 6px 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-sizing: border-box;
}

.footer-title,
.footer-brand {
    white-space: nowrap;
}

.footer-brand {
    color: var(--text);
}

.footer-dot {
    width: 5px;
    height: 5px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.65);
}

@media (prefers-color-scheme: dark) {
    .footer-pill {
        border-color: rgba(34, 211, 238, 0.24);
        background: rgba(15, 23, 42, 0.68);
        color: rgba(226, 232, 240, 0.76);
        box-shadow: 0 0 24px rgba(34, 211, 238, 0.12), 0 14px 30px rgba(0, 0, 0, 0.36);
    }

    .footer-brand {
        color: #e0faff;
    }
}

@media (max-width: 900px) {
    body.nav-open {
        overflow: hidden;
    }

    .topbar {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
    }

    .brand {
        min-width: 0;
    }

    .brand-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .navlinks {
        display: none;
        grid-column: 1 / -1;
        width: 100%;
        max-height: calc(100dvh - 82px);
        overflow-y: auto;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 8px;
        padding: 10px 0 2px;
    }

    .topbar.is-open .navlinks {
        display: flex;
    }

    .navlinks a,
    .theme-toggle {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-radius: 14px;
        padding: 13px 14px;
        line-height: 1.2;
    }

    .theme-toggle {
        justify-content: center;
    }

    .grid-two,
    .cards {
        grid-template-columns: 1fr;
    }

    .search {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 520px) {
    .footer {
        padding: 0 8px 8px;
    }

    .footer-pill {
        gap: 6px;
        padding: 5px 9px;
        font-size: 9px;
    }
}

@media (max-width: 460px) {
    .topbar {
        padding: 10px 12px;
    }

    .brand-text {
        max-width: 230px;
    }

    .container {
        width: min(100% - 20px, 1380px);
        margin: 18px auto 12px;
    }
}