@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@400;500;600;700;800&display=swap');

:root {
    --blue: #174ea6;
    --blue-dark: #123c80;
    --cyan: #2f80ed;
    --gold: #f5c542;
    --ink: #101828;
    --muted: #667085;
    --line: #d8e3f1;
    --bg: #f4f8fc;
    --ok: #0e9384;
    --danger: #c0352b;
    --card: rgba(255, 255, 255, 0.92);
    --shadow: 0 22px 58px rgba(15, 23, 42, 0.11);
}

@media (min-width: 1024px) {
    .admin-dashboard-page #admin-users .row-actions {
        display: flex;
        gap: 8px;
        min-width: 176px;
        width: 176px;
    }

    .admin-dashboard-page #admin-users .desktop-secondary-action {
        display: none;
    }

    .admin-dashboard-page #admin-users .row-action-menu {
        display: block;
    }

    .admin-dashboard-page #admin-users .row-action-menu-panel {
        right: 0;
        left: auto;
        min-width: 178px;
    }

    .admin-dashboard-page #admin-users .row-action-menu-panel .btn {
        justify-content: flex-start;
        min-width: 154px;
        white-space: nowrap;
    }

    .admin-dashboard-page #admin-logs .section-head .row-actions {
        display: flex;
        min-width: 0;
        width: auto;
    }

    .admin-dashboard-page #admin-logs .section-head .row-actions form {
        display: block;
    }
}

@media (min-width: 1024px) {
    .admin-dashboard-page .desktop-secondary-action {
        display: none;
    }

    .admin-dashboard-page .admin-shell {
        width: min(1480px, calc(100% - 44px));
        padding-top: 18px;
    }

    .admin-dashboard-page .admin-topbar {
        align-items: center;
        background: rgba(255, 255, 255, 0.94);
        border-radius: 14px;
        box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
        margin-bottom: 14px;
        padding: 12px 16px;
        position: sticky;
        top: 12px;
        z-index: 120;
    }

    .admin-dashboard-page .admin-topbar .brand strong {
        font-size: 1.18rem;
    }

    .admin-dashboard-page .admin-topbar .brand span {
        font-size: 0.88rem;
    }

    .admin-dashboard-page .topbar-actions {
        gap: 8px;
    }

    .admin-dashboard-page .topbar-actions .btn,
    .admin-dashboard-page .nav-menu > summary.btn {
        min-height: 38px;
        padding: 9px 12px;
    }

    .admin-dashboard-page .admin-summary {
        border: 1px solid rgba(216, 227, 241, 0.95);
        border-radius: 14px;
        grid-template-columns: 0.82fr 1.18fr;
        margin-bottom: 16px;
        min-height: 0;
    }

    .admin-dashboard-page .admin-summary .hero-copy,
    .admin-dashboard-page .admin-summary .hero-side {
        padding: 26px;
    }

    .admin-dashboard-page .admin-summary h1 {
        font-size: 1.86rem;
        line-height: 1.18;
    }

    .admin-dashboard-page .quick-actions {
        margin-top: 16px;
    }

    .admin-dashboard-page .connection-card {
        margin-bottom: 16px;
    }

    .admin-dashboard-page .status-grid {
        gap: 10px;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .admin-dashboard-page .status {
        background: rgba(255, 255, 255, 0.96);
        border: 1px solid rgba(216, 227, 241, 0.9);
        border-radius: 12px;
        box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
        min-height: 86px;
        padding: 14px;
    }

    .admin-dashboard-page .status span {
        font-size: 0.82rem;
    }

    .admin-dashboard-page .status strong {
        font-size: 1.66rem;
    }

    .admin-dashboard-page .dashboard-section {
        border-radius: 14px;
        box-shadow: 0 16px 36px rgba(15, 23, 42, 0.07);
        margin-bottom: 16px;
    }

    .admin-dashboard-page .section-head {
        align-items: center;
        background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
        border-bottom: 1px solid rgba(216, 227, 241, 0.9);
        gap: 18px;
        padding: 18px 22px;
    }

    .admin-dashboard-page .section-head h2 {
        font-size: 1.28rem;
        margin-bottom: 0;
    }

    .admin-dashboard-page .section-kicker {
        color: var(--blue);
        font-size: 0.78rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .admin-dashboard-page .search-form {
        align-items: center;
        display: grid;
        gap: 8px;
        grid-template-columns: minmax(320px, 1fr) 150px 140px auto auto auto;
        width: 100%;
    }

    .admin-dashboard-page .search-form input,
    .admin-dashboard-page .search-form select {
        min-height: 40px;
    }

    .admin-dashboard-page .table-wrap {
        max-height: 560px;
        overflow: auto;
    }

    .admin-dashboard-page #admin-users .table-wrap {
        max-height: none;
    }

    .admin-dashboard-page table {
        border-collapse: separate;
        border-spacing: 0;
        font-size: 0.94rem;
    }

    .admin-dashboard-page th {
        background: #f8fbff;
        border-bottom: 1px solid rgba(188, 204, 225, 0.9);
        color: #344054;
        font-size: 0.78rem;
        letter-spacing: 0.03em;
        position: sticky;
        top: 0;
        z-index: 3;
    }

    .admin-dashboard-page td {
        background: #fff;
        border-bottom: 1px solid rgba(216, 227, 241, 0.85);
        padding: 12px 14px;
    }

    .admin-dashboard-page tbody tr:nth-child(even) td {
        background: #fbfdff;
    }

    .admin-dashboard-page tbody tr:hover td {
        background: #eef6ff;
    }

    .admin-dashboard-page .user-cell {
        min-width: 420px;
    }

    .admin-dashboard-page .user-cell strong {
        color: #182230;
        font-size: 1rem;
    }

    .admin-dashboard-page .badge {
        border-radius: 8px;
        padding: 5px 9px;
    }

    .admin-dashboard-page .status-detail {
        display: block;
        margin: 7px 0 0;
    }

    .admin-dashboard-page #admin-users .row-actions {
        display: flex;
        min-width: 174px;
        width: 174px;
    }

    .admin-dashboard-page #admin-users .row-actions > form,
    .admin-dashboard-page #admin-users .row-actions > form:last-child {
        display: none;
    }

    .admin-dashboard-page #admin-users .row-action-menu {
        display: block;
    }

    .admin-dashboard-page #admin-users .row-actions .btn {
        min-height: 34px;
        min-width: 82px;
    }

    .admin-dashboard-page #admin-users .row-action-menu-panel .btn {
        justify-content: flex-start;
        min-width: 150px;
        white-space: nowrap;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Kanit', Tahoma, Arial, sans-serif;
    background:
        radial-gradient(circle at 8% 6%, rgba(245, 197, 66, 0.16), transparent 24%),
        radial-gradient(circle at 92% 12%, rgba(47, 128, 237, 0.14), transparent 28%),
        linear-gradient(180deg, #eef5ff 0%, #f8fafc 100%);
    color: var(--ink);
}

.admin-dashboard-page {
    background:
        radial-gradient(circle at 8% 0%, rgba(23, 78, 166, 0.12), transparent 28%),
        radial-gradient(circle at 92% 8%, rgba(14, 147, 132, 0.1), transparent 26%),
        linear-gradient(180deg, #eef5ff 0%, #f7fafc 44%, #ffffff 100%);
}

.auth-page {
    background:
        radial-gradient(circle at 18% 8%, rgba(245, 197, 66, 0.18), transparent 28%),
        radial-gradient(circle at 86% 20%, rgba(47, 128, 237, 0.18), transparent 30%),
        linear-gradient(135deg, #eef5ff 0%, #f8fbff 46%, #eef6ff 100%);
}

.auth-page.apple-captive-page {
    background: #f5f8fc;
}

.apple-captive-page .page > .topbar:not(.admin-topbar),
.apple-captive-page .panel,
.apple-captive-page .admin-topbar {
    backdrop-filter: none;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.apple-captive-page .hero {
    box-shadow: 0 12px 28px rgba(23, 78, 166, 0.12);
}

.page {
    width: min(1080px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 36px;
}

.admin-shell {
    width: min(1240px, calc(100% - 28px));
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    overflow: visible;
    padding: 16px 0;
    position: relative;
    z-index: 50;
}

.topbar .brand {
    min-width: 0;
}

.page > .topbar:not(.admin-topbar) {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(216, 227, 241, 0.78);
    border-radius: 18px;
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.08);
    margin-bottom: 18px;
    padding: 14px 16px;
}

.admin-topbar {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(217, 226, 239, 0.82);
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    margin-bottom: 18px;
    overflow: visible;
    padding: 14px;
    backdrop-filter: blur(16px);
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auth-page .brand {
    display: grid;
    gap: 2px 10px;
    grid-template-columns: auto 1fr;
}

.admin-dashboard-page .brand {
    display: grid;
    gap: 2px 10px;
    grid-template-columns: auto 1fr;
}

.brand-mark,
.brand-logo {
    align-items: center;
    background: var(--blue);
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    font-weight: 800;
    grid-row: span 2;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.brand-logo {
    background: #fff;
    border: 1px solid var(--line);
    object-fit: contain;
    padding: 4px;
    box-shadow: 0 10px 22px rgba(23, 78, 166, 0.12);
}

.brand strong {
    font-size: 1.35rem;
    letter-spacing: 0;
}

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

.panel {
    background: var(--card);
    border: 1px solid rgba(216, 227, 241, 0.9);
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(12px);
}

.hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 0;
}

.auth-page .hero {
    border: 0;
    box-shadow: 0 26px 78px rgba(23, 78, 166, 0.17);
}

.admin-login-hero {
    grid-template-columns: 1fr 0.8fr;
}

.admin-summary {
    border: 0;
    margin-bottom: 18px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.admin-mobile-jump {
    display: none;
}

.hero-copy {
    padding: 34px;
}

.auth-page .hero-copy {
    padding: 46px;
}

.admin-summary .hero-copy {
    padding: 34px;
}

.hero-side {
    background: #174ea6;
    color: #fff;
    overflow: hidden;
    padding: 34px;
    position: relative;
}

.auth-page .hero-side {
    background:
        radial-gradient(circle at 18% 16%, rgba(245, 197, 66, 0.25), transparent 30%),
        linear-gradient(160deg, rgba(8, 31, 68, 0.28), transparent 42%),
        linear-gradient(180deg, #174ea6 0%, #0b3a82 100%);
    position: relative;
}

.admin-summary .hero-side {
    background:
        linear-gradient(160deg, rgba(8, 31, 68, 0.22), transparent 42%),
        linear-gradient(180deg, #174ea6 0%, #123c80 100%);
}

.admin-summary h1 {
    font-size: 2.15rem;
    margin-bottom: 8px;
}

h1,
h2,
h3 {
    margin: 0 0 12px;
}

h1 {
    font-size: 2rem;
    line-height: 1.2;
    letter-spacing: 0;
}

.auth-page h1 {
    font-size: 2.4rem;
    margin-bottom: 10px;
}

.eyebrow {
    color: var(--blue);
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 800;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.auth-page .eyebrow,
.admin-dashboard-page .eyebrow {
    background: #eef6ff;
    border: 1px solid #bfd8ff;
    border-radius: 7px;
    padding: 6px 10px;
    text-transform: none;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.admin-summary .status-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.status {
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    padding: 12px;
}

.auth-page .status {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.24);
}

.admin-summary .status {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.24);
}

.status span {
    display: block;
    font-size: 0.8rem;
    opacity: 0.82;
}

.status strong {
    display: block;
    font-size: 1.05rem;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.admin-summary .status strong {
    font-size: 1.28rem;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--line);
}

.auth-page .tabs {
    background: #f2f6fb;
    border: 1px solid var(--line);
    border-radius: 14px;
    margin-top: 26px;
    padding: 5px;
}

.tab {
    flex: 1;
    border: 0;
    background: #f8fafc;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    padding: 14px;
}

.auth-page .tab {
    background: transparent;
    border-radius: 10px;
    padding: 12px;
}

.tab.active {
    background: #fff;
    color: var(--blue);
    font-weight: 700;
}

.auth-page .tab.active {
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.form-wrap {
    padding: 24px;
}

.auth-page .form-wrap {
    padding: 24px 0 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.filter-bar {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(240px, 1fr) 150px 150px 150px auto auto;
}

.registry-head {
    align-items: center;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 22px 24px 18px;
}

.registry-total {
    background: #1f4f9a;
    border-radius: 8px;
    color: #ffffff;
    min-width: 150px;
    padding: 13px 18px;
    text-align: right;
}

.registry-total span,
.registry-total small {
    color: rgba(255, 255, 255, 0.72);
    display: block;
    font-size: 0.82rem;
}

.registry-total strong {
    display: block;
    font-size: 1.9rem;
    line-height: 1;
    margin: 6px 0;
}

.registry-stat-grid {
    background: linear-gradient(180deg, #f8fbff, #ffffff);
    border-top: 1px solid #e4ecf7;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 0 24px 22px;
}

.registry-stat {
    background: #ffffff;
    border: 1px solid #dce8f7;
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(20, 51, 92, 0.06);
    overflow: hidden;
    padding: 18px;
    position: relative;
}

.registry-stat::before {
    background: var(--accent, #2f6fd6);
    content: "";
    height: 4px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.registry-stat span,
.registry-stat small {
    color: var(--muted);
    display: block;
    font-size: 0.84rem;
    line-height: 1.35;
}

.registry-stat strong {
    color: var(--ink);
    display: block;
    font-size: 1.85rem;
    line-height: 1.1;
    margin: 6px 0 4px;
}

.accent-student {
    --accent: #2f6fd6;
}

.accent-diploma {
    --accent: #16a085;
}

.accent-bachelor {
    --accent: #7c3aed;
}

.accent-registered {
    --accent: #f59e0b;
}

.accent-active {
    --accent: #22c55e;
}

.type-dot {
    background: #94a3b8;
    border-radius: 999px;
    display: inline-block;
    flex: 0 0 auto;
    height: 8px;
    margin-right: 7px;
    vertical-align: 1px;
    width: 8px;
}

.type-dot.student {
    background: #2f6fd6;
}

.type-dot.diploma {
    background: #16a085;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field.full {
    grid-column: 1 / -1;
}

.password-pair-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.identity-field {
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    border: 1px solid #dbe7f5;
    border-radius: 16px;
    gap: 10px;
    padding: 12px;
}

.identity-switch {
    background: #eef4ff;
    border: 1px solid #d6e4ff;
    border-radius: 13px;
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 4px;
}

.identity-option {
    background: transparent;
    border: 0;
    border-radius: 10px;
    color: #475467;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    min-height: 42px;
    padding: 8px 10px;
    transition: background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.identity-option.active {
    background: #fff;
    box-shadow: 0 8px 18px rgba(23, 78, 166, 0.1);
    color: var(--blue);
}

.identity-input input {
    border-color: #c8d8ec;
}

.check-field {
    justify-content: center;
}

.check-field label {
    align-items: center;
    display: flex;
    gap: 8px;
}

.check-field input {
    min-height: 0;
    width: auto;
}

label {
    color: #344054;
    font-size: 0.96rem;
    font-weight: 700;
}

.field-hint {
    color: var(--muted);
    font-size: 0.86rem;
}

input,
select,
textarea {
    background: #fff;
    border: 1px solid #d7e1ee;
    border-radius: 12px;
    font: inherit;
    font-size: 1rem;
    min-height: 50px;
    padding: 12px 14px;
    width: 100%;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #6ea8fe;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.12);
    outline: none;
}

.password-reveal {
    position: relative;
}

.password-reveal input {
    padding-right: 70px;
}

.password-reveal-btn {
    align-items: center;
    background: #eef6ff;
    border: 1px solid #bfd8ff;
    border-radius: 10px;
    color: var(--blue);
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    height: 38px;
    justify-content: center;
    min-height: 0;
    padding: 0;
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
}

.password-reveal-btn:hover,
.password-reveal-btn[aria-pressed="true"] {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #475467 50%),
        linear-gradient(135deg, #475467 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 13px) 50%;
    background-repeat: no-repeat;
    background-size: 5px 5px, 5px 5px;
    padding-right: 42px;
}

.btn {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    justify-content: center;
    min-height: 42px;
    padding: 9px 14px;
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.auth-page .btn-primary {
    border-radius: 14px;
    font-size: 1.05rem;
    min-height: 54px;
    padding: 14px 22px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #174ea6, #2f80ed);
    box-shadow: 0 14px 24px rgba(23, 78, 166, 0.22);
    color: #fff;
}

.btn-primary:hover {
    background: var(--blue-dark);
}

.btn-light {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(216, 227, 241, 0.96);
    color: var(--blue);
}

.btn-light:hover {
    background: #eef6ff;
    border-color: #bfd3ee;
}

.admin-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-menu {
    position: relative;
    z-index: 80;
}

.nav-menu summary {
    list-style: none;
}

.nav-menu summary::-webkit-details-marker {
    display: none;
}

.nav-menu summary::after {
    content: "▾";
    font-size: 0.78rem;
    margin-left: 8px;
}

.nav-menu[open] summary::after {
    content: "▴";
}

.nav-menu-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.14);
    display: grid;
    min-width: 190px;
    padding: 6px;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 100;
}

.nav-menu-panel a {
    border-radius: 6px;
    color: var(--ink);
    font-weight: 700;
    padding: 10px 11px;
    text-decoration: none;
    white-space: nowrap;
}

.nav-menu-panel a:hover {
    background: #f8fafc;
    color: var(--blue);
}

.mobile-public-menu {
    display: none;
    position: relative;
    z-index: 90;
}

.topbar-actions {
    display: flex;
    flex: 0 0 auto;
    margin-left: auto;
}

.topbar-mobile-menu {
    display: none;
}

.mobile-menu-button {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    height: 42px;
    justify-content: center;
    list-style: none;
    width: 42px;
}

.mobile-menu-button::-webkit-details-marker {
    display: none;
}

.mobile-menu-button span {
    background: var(--blue);
    border-radius: 999px;
    display: block;
    height: 2px;
    width: 20px;
}

.mobile-menu-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.14);
    display: grid;
    min-width: 180px;
    padding: 6px;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 110;
}

.mobile-menu-panel a {
    border-radius: 6px;
    color: var(--ink);
    font-weight: 700;
    padding: 11px 12px;
    text-decoration: none;
    white-space: nowrap;
}

.mobile-menu-section {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    padding: 9px 12px 4px;
    text-transform: uppercase;
}

.mobile-menu-panel a:hover {
    background: #f8fafc;
    color: var(--blue);
}

.btn-danger {
    background: #fff1f0;
    border-color: #ffd1cc;
    color: var(--danger);
}

.btn-sm {
    border-radius: 6px;
    font-size: 0.86rem;
    min-height: 34px;
    padding: 5px 9px;
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.inline-actions {
    align-items: center;
    margin-top: 0;
}

.login-help-strip {
    background: #f8fbff;
    border: 1px solid var(--line);
    border-radius: 14px;
    margin-top: 12px;
    padding: 12px;
}

.register-prompt {
    color: var(--muted);
    font-size: 0.94rem;
    margin: 12px 0 0;
    text-align: center;
}

.register-prompt button {
    background: transparent;
    border: 0;
    color: var(--blue);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.login-help-strip details {
    min-width: 0;
}

.login-help-strip summary {
    color: var(--blue);
    cursor: pointer;
    font-weight: 800;
}

.login-help-strip p {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
    margin: 8px 0 0;
}

.login-help-strip button {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--blue);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 800;
    justify-content: center;
    padding: 0;
    text-align: center;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.dashboard-section {
    margin-top: 18px;
}

.overview-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 18px;
}

.overview-card {
    min-height: 100%;
}

.overview-metrics {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 0 24px 24px;
}

.overview-metrics div {
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
}

.overview-metrics span {
    color: var(--muted);
    display: block;
    font-size: 0.82rem;
}

.overview-metrics strong {
    display: block;
    font-size: 1.35rem;
    margin-top: 6px;
}

.bar-chart {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    min-height: 260px;
    padding: 0 24px 24px;
}

.bar-item {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.bar-item span,
.bar-item small {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.bar-track {
    align-items: end;
    background: #eef4ff;
    border: 1px solid #d6e4ff;
    border-radius: 999px;
    display: flex;
    height: 180px;
    overflow: hidden;
    width: 100%;
}

.bar-track i {
    background: linear-gradient(180deg, var(--blue), #2f80ed);
    border-radius: 999px;
    display: block;
    width: 100%;
}

.rank-list {
    display: grid;
    gap: 14px;
    padding: 0 24px 24px;
}

.rank-item {
    display: grid;
    gap: 8px;
}

.rank-item div {
    align-items: baseline;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.rank-item span {
    color: var(--muted);
    font-size: 0.84rem;
}

.rank-item b {
    background: #eef4ff;
    border-radius: 999px;
    display: block;
    height: 10px;
    overflow: hidden;
}

.rank-item i {
    background: linear-gradient(90deg, var(--blue), #2f80ed);
    border-radius: inherit;
    display: block;
    height: 100%;
}

.section-head {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding-bottom: 18px;
}

.section-head h2 {
    margin-bottom: 0;
}

.section-head-stack {
    align-items: stretch;
    flex-direction: column;
}

.section-kicker {
    color: var(--blue);
    display: block;
    font-size: 0.76rem;
    font-weight: 800;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.search-form {
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    border: 1px solid var(--line);
    border-radius: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    padding: 12px;
}

.search-form input,
.search-form select {
    max-width: 360px;
}

.list-summary {
    margin: 12px 0 0;
}

.alert {
    border-radius: 14px;
    margin-bottom: 14px;
    padding: 12px;
}

.alert-danger {
    background: #fff1f0;
    border: 1px solid #ffd1cc;
    color: var(--danger);
}

.alert-ok {
    background: #ecfdf3;
    border: 1px solid #b8efd1;
    color: #067647;
}

.alert-info {
    background: #eef6ff;
    border: 1px solid #bfd8ff;
    color: #174ea6;
}

.table-wrap {
    overflow: auto;
}

.admin-dashboard-page .table-wrap {
    border-top: 1px solid var(--line);
}

.panel > .table-wrap:first-child,
.dashboard-section > .table-wrap {
    border-top: 1px solid var(--line);
}

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

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

.admin-dashboard-page th,
.admin-dashboard-page td {
    padding: 11px 14px;
    vertical-align: middle;
}

th {
    background: #f3f7fc;
    color: #344054;
}

.admin-dashboard-page th {
    color: #475467;
    font-size: 0.82rem;
    text-transform: uppercase;
}

.admin-dashboard-page tbody tr:hover {
    background: #f8fbff;
}

.user-cell {
    min-width: 360px;
    white-space: normal;
}

.compact-cell {
    min-width: 180px;
}

.user-cell strong,
.user-cell span {
    display: block;
}

.user-cell strong {
    margin-bottom: 4px;
}

.user-cell span {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.user-cell .registry-meta {
    align-items: center;
    display: flex;
    gap: 0;
}

.badge {
    background: #eef4ff;
    border: 1px solid #c7d7fe;
    border-radius: 999px;
    color: var(--blue);
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px 9px;
    white-space: nowrap;
}

.badge.ok {
    background: #ecfdf3;
    border-color: #b8efd1;
    color: var(--ok);
}

.badge.pending {
    background: #fffaeb;
    border-color: #fedf89;
    color: #b54708;
}

.badge.offline {
    background: #f2f4f7;
    border-color: #d0d5dd;
    color: #475467;
}

.status-detail {
    font-size: 0.82rem;
    margin-left: 6px;
}

.row-actions {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(3, minmax(58px, 1fr));
    min-width: 220px;
    width: 220px;
}

.row-actions form {
    margin: 0;
}

.row-actions .btn {
    justify-content: center;
    min-height: 34px;
    padding-left: 10px;
    padding-right: 10px;
    width: 100%;
}

.row-actions form:last-child {
    grid-column: 1 / -1;
}

.row-action-menu {
    display: none;
    position: relative;
}

.row-action-menu summary {
    cursor: pointer;
    list-style: none;
}

.row-action-menu summary::-webkit-details-marker {
    display: none;
}

.row-action-menu-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
    display: grid;
    gap: 6px;
    min-width: 120px;
    padding: 8px;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 120;
}

.pagination {
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 24px;
}

.btn.disabled {
    opacity: 0.48;
    pointer-events: none;
}

.footer-note {
    color: var(--muted);
    font-size: 0.88rem;
    margin-top: 14px;
}

.connection-card {
    align-items: center;
    display: flex;
    gap: 14px;
}

.connection-card h2 {
    margin-bottom: 2px;
}

.connection-card p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.signal-dot {
    background: #fff;
    border: 8px solid rgba(255, 255, 255, 0.26);
    border-radius: 50%;
    box-shadow: 0 0 0 9px rgba(245, 197, 66, 0.22);
    flex: 0 0 auto;
    height: 38px;
    width: 38px;
}

.hero-side::after {
    background:
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 28px 28px;
    content: "";
    inset: 0;
    opacity: 0.28;
    pointer-events: none;
    position: absolute;
}

.hero-side > * {
    position: relative;
    z-index: 1;
}

.steps {
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    display: grid;
    gap: 10px;
    margin-top: 22px;
    padding-top: 20px;
}

.steps div {
    align-items: center;
    color: rgba(255, 255, 255, 0.88);
    display: flex;
    gap: 10px;
}

.steps .support-step {
    align-items: center;
    display: flex;
}

.steps .support-step .support-text {
    flex: 1 1 auto;
    min-width: 0;
}

.steps span {
    align-items: center;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    display: inline-flex;
    font-weight: 800;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.line-contact {
    align-items: center;
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    gap: 4px;
    margin-left: auto;
    text-decoration: none;
    vertical-align: middle;
    white-space: nowrap;
}

.line-icon {
    align-items: center;
    background: #06c755 !important;
    background-color: #06c755 !important;
    border-radius: 6px !important;
    color: #fff;
    display: inline-flex;
    font-size: 0.58rem;
    font-weight: 800;
    height: 28px;
    justify-content: center;
    line-height: 1;
    width: 28px;
}

.line-contact:hover .line-icon {
    background: #05b84e !important;
    background-color: #05b84e !important;
}

.auth-page .footer-note {
    color: var(--muted);
}

.hero-side .footer-note,
.auth-page .hero-side .footer-note {
    color: rgba(255, 255, 255, 0.72);
}

.compact-page .panel {
    margin-top: 18px;
}

.compact-page .panel .hero-copy {
    min-height: 280px;
}

.compact-page .panel h1 {
    font-size: 2.15rem;
}

.success-shell {
    border: 0;
    box-shadow: 0 24px 64px rgba(23, 78, 166, 0.16);
}

.success-copy {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: auto;
    padding: 34px;
}

.success-mark {
    align-items: center;
    background: linear-gradient(135deg, #0e9384 0%, #14b8a6 100%);
    border-radius: 999px;
    box-shadow: 0 16px 34px rgba(14, 147, 132, 0.18);
    color: #fff;
    display: inline-flex;
    font-size: 2rem;
    font-weight: 800;
    height: 72px;
    justify-content: center;
    width: 72px;
}

.success-mark-error {
    background: linear-gradient(135deg, #c0352b 0%, #ef4444 100%);
    box-shadow: 0 16px 34px rgba(192, 53, 43, 0.18);
}

.success-eyebrow {
    align-self: flex-start;
    margin-bottom: 0;
}

.success-lead {
    font-size: 1.08rem;
    line-height: 1.65;
    margin: 0;
    max-width: 720px;
}

.success-status {
    align-items: center;
    background: #ecfdf3;
    border: 1px solid #abefc6;
    border-radius: 12px;
    color: #067647;
    display: inline-flex;
    gap: 12px;
    padding: 12px 14px;
    width: fit-content;
}

.success-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.success-item {
    background: #f8fbff;
    border: 1px solid #d8e3f1;
    border-radius: 14px;
    display: grid;
    gap: 5px;
    padding: 16px;
}

.success-item span {
    color: var(--muted);
    font-size: 0.95rem;
}

.success-item strong {
    font-size: 1.08rem;
}

.success-actions {
    margin-top: 4px;
}

.reset-shell {
    border: 0;
    box-shadow: 0 24px 64px rgba(23, 78, 166, 0.14);
    display: grid;
    grid-template-columns: 0.88fr 1.12fr;
    overflow: hidden;
}

.reset-copy {
    background:
        linear-gradient(160deg, rgba(8, 31, 68, 0.18), transparent 42%),
        linear-gradient(180deg, #174ea6 0%, #123c80 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 34px;
}

.reset-copy .eyebrow {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
    margin-bottom: 0;
}

.reset-copy h1 {
    margin-bottom: 0;
}

.reset-copy .muted {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    margin: 0;
}

.reset-note {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    display: grid;
    gap: 6px;
    padding: 16px;
}

.reset-note span {
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.55;
}

.auth-page .reset-form-wrap {
    padding: 34px;
}

.reset-footer-note {
    border-top: 1px solid var(--line);
    margin-top: 18px;
    padding-top: 16px;
}

.dashboard-section {
    border-radius: 18px;
}

.admin-dashboard-page section[id] {
    scroll-margin-top: 92px;
}

@media (max-width: 980px) {
    .admin-topbar {
        align-items: center;
        flex-direction: row;
    }

    .admin-topbar .brand span,
    .admin-topbar .brand strong {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .admin-topbar .topbar-actions {
        display: none;
    }

    .admin-topbar .topbar-mobile-menu {
        display: block;
        flex: 0 0 auto;
        margin-left: auto;
    }

    .admin-topbar .mobile-menu-panel {
        max-width: calc(100vw - 32px);
    }
}

@media (max-width: 800px) {
    .page {
        width: min(100% - 20px, 1080px);
        padding: 12px 0;
    }

    .hero,
    .form-grid,
    .admin-summary .status-grid,
    .status-grid,
    .overview-grid,
    .overview-metrics {
        grid-template-columns: 1fr;
    }

    .bar-chart {
        gap: 8px;
        min-height: 220px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .rank-item div {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .hero-copy,
    .hero-side {
        padding: 22px;
    }

    .auth-page .hero-copy {
        padding: 24px;
    }

    .auth-page h1 {
        font-size: 1.8rem;
    }

    .topbar,
    .actions,
    .quick-actions,
    .search-form {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar {
        gap: 12px;
        padding: 10px 0 14px;
    }

    .topbar {
        align-items: center;
        flex-direction: row;
    }

    .admin-mobile-jump {
        background: rgba(255, 255, 255, 0.96);
        border: 1px solid rgba(216, 227, 241, 0.9);
        border-radius: 14px;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
        display: grid;
        gap: 6px;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        margin: 0 0 14px;
        padding: 6px;
        position: relative;
        z-index: 20;
    }

    .admin-mobile-jump a {
        background: #f8fbff;
        border: 1px solid #d8e3f1;
        border-radius: 10px;
        color: var(--blue);
        font-size: 0.86rem;
        font-weight: 800;
        padding: 9px 6px;
        text-align: center;
        text-decoration: none;
        white-space: nowrap;
    }

    .admin-dashboard-page section[id] {
        scroll-margin-top: 78px;
    }

    .page > .topbar:not(.admin-topbar) {
        padding: 12px;
    }

    .brand {
        align-items: center;
        min-width: 0;
    }

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

    .brand strong {
        font-size: 1.08rem;
    }

    .topbar .topbar-actions {
        display: none;
    }

    .topbar .topbar-mobile-menu {
        display: block;
        flex: 0 0 auto;
    }

    .mobile-menu-button {
        background: linear-gradient(135deg, #174ea6, #2f80ed);
        border-color: rgba(255, 255, 255, 0.2);
        box-shadow: 0 10px 22px rgba(23, 78, 166, 0.22);
        height: 44px;
        width: 44px;
    }

    .mobile-menu-button span {
        background: #fff;
        width: 19px;
    }

    .topbar-mobile-menu[open] .mobile-menu-button {
        background: #123c80;
    }

    .mobile-menu-panel {
        border-color: rgba(216, 227, 241, 0.96);
        border-radius: 16px;
        box-shadow: 0 22px 54px rgba(15, 23, 42, 0.2);
        gap: 4px;
        left: auto;
        max-width: calc(100vw - 28px);
        min-width: min(280px, calc(100vw - 28px));
        padding: 8px;
        right: 0;
        top: calc(100% + 10px);
    }

    .mobile-menu-panel a {
        align-items: center;
        background: #f8fbff;
        border: 1px solid #e2ebf7;
        border-radius: 10px;
        display: flex;
        min-height: 44px;
        padding: 11px 12px;
        white-space: normal;
    }

    .mobile-menu-panel a:hover {
        background: #eef6ff;
        border-color: #bfd8ff;
    }

    .mobile-menu-section {
        padding: 10px 8px 4px;
    }

    .auth-page .tabs {
        margin-top: 20px;
    }

    input,
    select,
    textarea {
        font-size: 16px;
        min-height: 58px;
        padding: 15px 16px;
    }

    .auth-page .form-wrap {
        padding-top: 20px;
    }

    .auth-page .form-grid {
        gap: 16px;
    }

    .password-pair-grid {
        gap: 10px;
    }

    .auth-page .field {
        gap: 8px;
    }

    .auth-page label {
        font-size: 1rem;
    }

    .auth-page .field-hint {
        font-size: 0.9rem;
        line-height: 1.45;
    }

    .auth-page .btn {
        min-height: 50px;
        padding: 12px 16px;
        width: 100%;
    }

    .auth-page .btn-primary {
        font-size: 1.14rem;
        min-height: 64px;
        padding: 17px 20px;
    }

    .login-help-strip {
        grid-template-columns: 1fr;
    }

    .login-help-strip button {
        width: 100%;
    }

    .auth-page .tab {
        min-height: 48px;
    }

    .nav-menu-panel {
        box-shadow: none;
        margin-top: 8px;
        position: static;
    }

    .filter-bar {
        grid-template-columns: 1fr;
    }

    .registry-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 0 16px 18px;
    }

    .registry-head {
        align-items: stretch;
        flex-direction: column;
        padding: 20px 16px;
    }

    .registry-total {
        min-width: 0;
        text-align: left;
    }

    .registry-stat {
        padding: 16px;
    }

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

    .admin-topbar {
        padding: 12px;
    }

    .row-actions {
        grid-template-columns: repeat(2, minmax(70px, 1fr));
        min-width: 0;
        width: 152px;
    }

    .row-actions > form {
        display: none;
    }

    .row-action-menu {
        display: block;
    }

    .row-actions > .btn,
    .row-action-menu > summary.btn {
        min-height: 32px;
        padding-left: 8px;
        padding-right: 8px;
    }

    .search-form input,
    .search-form select {
        max-width: none;
    }

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

    .user-cell {
        min-width: 260px;
    }

    .compact-page .panel h1 {
        font-size: 1.7rem;
    }

    .success-copy {
        gap: 14px;
        padding: 24px;
    }

    .success-mark {
        font-size: 1.7rem;
        height: 62px;
        width: 62px;
    }

    .success-lead {
        font-size: 1rem;
    }

    .success-status {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

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

    .reset-shell {
        grid-template-columns: 1fr;
    }

    .reset-copy,
    .auth-page .reset-form-wrap {
        padding: 24px;
    }
}
