.admin-shell {
    width: 100%;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.admin-hero,
.auth-panel,
.dashboard-panel {
    border: 1px solid rgba(191, 219, 254, 0.62);
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.96), rgba(236, 244, 255, 0.92));
    box-shadow: 0 20px 48px rgba(4, 12, 48, 0.18);
    border-radius: 20px;
}

.admin-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 30px;
    overflow: hidden;
}

.eyebrow {
    margin: 0 0 8px;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.admin-hero h1,
.auth-copy h2,
.dashboard-head h2 {
    margin: 0;
    color: #0f2c5a;
    letter-spacing: 0;
}

.admin-hero h1 {
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.08;
}

.hero-text,
#authHint,
#currentUserText {
    margin: 12px 0 0;
    color: #475569;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.hero-status {
    min-width: 170px;
    padding: 12px 16px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1e40af;
    text-align: center;
    font-weight: 800;
}

.auth-panel {
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
    gap: 28px;
    padding: 30px;
}

.auth-form {
    display: grid;
    gap: 12px;
    padding: 22px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(59, 130, 246, 0.14);
}

.setup-token-field {
    display: grid;
    gap: 12px;
}

.setup-token-field[hidden] {
    display: none;
}

.auth-form input {
    min-height: 48px;
    border-radius: 12px;
    border-color: rgba(37, 99, 235, 0.18);
}

.form-actions,
.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.primary-btn,
.ghost-btn {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    font-weight: 800;
}

.ghost-btn {
    background: #eff6ff;
    border: 1px solid rgba(59, 130, 246, 0.22);
    color: #1e3a8a;
}

.form-message {
    min-height: 22px;
    color: #1e40af;
    font-size: 14px;
    line-height: 1.6;
}

.form-message.error {
    color: #b91c1c;
}

.dashboard-panel {
    padding: 26px;
}

.dashboard-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.16);
}

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

.metric-card,
.user-list-panel {
    border-radius: 18px;
    border: 1px solid rgba(59, 130, 246, 0.16);
    background: rgba(255, 255, 255, 0.78);
}

.metric-card {
    position: relative;
    display: grid;
    gap: 7px;
    min-height: 118px;
    padding: 18px 20px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 250, 252, 0.88));
    box-shadow: 0 10px 24px rgba(15, 44, 90, 0.06);
}

.metric-card > * {
    position: relative;
    z-index: 1;
}

.metric-registered {
    border-top-color: rgba(37, 99, 235, 0.52) !important;
}

.metric-online {
    border-top-color: rgba(15, 118, 110, 0.52) !important;
}

.metric-active {
    border-top-color: rgba(124, 58, 237, 0.42) !important;
}

.metric-label,
.metric-note,
#listMeta {
    color: #64748b;
    font-size: 14px;
}

.metric-delta {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(220, 252, 231, 0.82);
    color: #16a34a;
    font-size: 12px;
    font-weight: 900;
}

.metric-delta.down {
    background: rgba(241, 245, 249, 0.9);
    color: #64748b;
}

.metric-card strong {
    color: #0f2c5a;
    font-size: 40px;
    line-height: 1;
    letter-spacing: 0;
}

.insight-grid {
    display: grid;
    grid-template-columns: minmax(560px, 1.65fr) minmax(340px, 0.82fr);
    gap: 16px;
    margin: 0 0 18px;
}

.user-list-panel {
    padding: 18px;
}

.trend-panel,
.member-panel,
.behavior-panel {
    padding: 22px;
    border-radius: 14px;
    border: 1px solid rgba(43, 86, 132, 0.14);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 28px rgba(15, 44, 90, 0.06);
}

.list-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.list-head h3 {
    margin: 0;
    color: #0f2c5a;
    font-size: 19px;
}

.list-head span {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

.activity-chart {
    position: relative;
    min-height: 286px;
    padding: 14px 12px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(250, 253, 255, 0.94), rgba(246, 250, 252, 0.74));
    border: 1px solid rgba(47, 83, 125, 0.12);
    scrollbar-color: rgba(43, 86, 132, 0.32) rgba(226, 232, 240, 0.45);
    scrollbar-width: thin;
}

.activity-chart::-webkit-scrollbar {
    height: 8px;
}

.activity-chart::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.5);
}

.activity-chart::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(43, 86, 132, 0.34);
}

.activity-chart svg {
    width: 100%;
    min-width: 1020px;
    height: 218px;
    overflow: visible;
}

.activity-chart .grid-line {
    stroke: rgba(30, 58, 138, 0.1);
    stroke-width: 1;
}

.activity-event-dot {
    fill: #c2413b;
    stroke: #ffffff;
    stroke-width: 2;
}

.activity-event-pill {
    fill: rgba(255, 247, 237, 0.96);
    stroke: rgba(194, 65, 59, 0.2);
    stroke-width: 1;
}

.activity-event-label {
    fill: #a43a34;
    font-size: 11px;
    font-weight: 900;
}

.activity-line {
    fill: none;
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: opacity 0.18s ease, stroke-width 0.18s ease;
}

.activity-area {
    fill: url("#activityAreaGradient");
    stroke: none;
}

.activity-hit-line {
    fill: none;
    stroke: transparent;
    stroke-width: 18;
    stroke-linecap: round;
    stroke-linejoin: round;
    cursor: pointer;
}

.activity-chart.is-hovering .activity-line,
.activity-chart.is-hovering .activity-dot,
.activity-chart.is-hovering .activity-value {
    opacity: 0.18;
}

.activity-chart.is-hovering .activity-line.is-active {
    opacity: 1;
    stroke-width: 4.2;
}

.activity-chart.is-hovering .activity-dot.is-active,
.activity-chart.is-hovering .activity-value.is-active {
    opacity: 1;
}

.activity-dot {
    fill: #ffffff;
    stroke-width: 2.4;
}

.activity-value {
    font-size: 12px;
    font-weight: 800;
}

.activity-visitor {
    stroke: #7b8da6;
    opacity: 0.78;
}

.activity-normal {
    stroke: #1f4f95;
}

.activity-premium {
    stroke: #2b7c9f;
    opacity: 0.86;
}

.activity-dot.activity-visitor,
.activity-dot.activity-normal,
.activity-dot.activity-premium {
    fill: #ffffff;
}

.activity-legend-dot.activity-visitor {
    background: #7b8da6;
}

.activity-legend-dot.activity-normal {
    background: #1f4f95;
}

.activity-legend-dot.activity-premium {
    background: #2b7c9f;
}

.activity-value-visitor {
    fill: #475569;
}

.activity-value-normal {
    fill: #1f4f95;
}

.activity-value-premium {
    fill: #2b7c9f;
}

.activity-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    min-width: 1020px;
    margin: 0 0 10px;
    color: #31445f;
    font-size: 13px;
    font-weight: 800;
}

.activity-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 24px;
    transition: color 0.18s ease, transform 0.18s ease;
}

.activity-legend-item.is-active {
    color: #0f2c5a;
    transform: translateY(-1px);
}

.activity-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(31, 79, 149, 0.08);
}

.activity-labels {
    display: grid;
    grid-template-columns: repeat(30, minmax(28px, 1fr));
    min-width: 1020px;
    gap: 4px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
    text-align: center;
}

.activity-tooltip {
    position: absolute;
    z-index: 5;
    display: grid;
    gap: 2px;
    min-width: 118px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(15, 44, 90, 0.94);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(15, 44, 90, 0.18);
    pointer-events: none;
}

.activity-tooltip strong {
    font-size: 13px;
}

.activity-tooltip span {
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
}

.behavior-panel {
    margin: 0 0 18px;
}

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

.behavior-card {
    position: relative;
    display: grid;
    gap: 6px;
    min-height: 106px;
    padding: 16px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(250, 253, 255, 0.95), rgba(246, 250, 252, 0.82));
    border: 1px solid rgba(43, 86, 132, 0.12);
    box-shadow: none;
}

.behavior-card::before {
    content: "";
    width: 34px;
    height: 4px;
    border-radius: 999px;
    background: #2563eb;
}

.behavior-ai::before {
    background: #1f4f95;
}

.behavior-preview::before {
    background: #2b7c9f;
}

.behavior-favorite::before {
    background: #315f83;
}

.behavior-device::before {
    background: #475569;
}

.behavior-card span,
.behavior-card em {
    color: #64748b;
    font-size: 13px;
    font-style: normal;
}

.behavior-card strong {
    color: #0f2c5a;
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: 0;
}

.member-pie {
    display: grid;
    grid-template-columns: minmax(112px, 1fr) minmax(108px, 124px);
    gap: 12px;
    align-items: center;
    padding: 6px 0 0;
    overflow: hidden;
}

.member-summary {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.member-summary span {
    color: #334155;
    font-size: 16px;
    font-weight: 900;
}

.member-summary strong {
    color: #111827;
    font-size: 40px;
    line-height: 1;
    letter-spacing: 0;
}

.member-summary em {
    color: #16a34a;
    font-size: 13px;
    font-style: normal;
    font-weight: 900;
}

.member-ring-wrap {
    display: flex;
    justify-content: center;
}

.member-pie svg {
    width: min(124px, 100%);
    height: auto;
    aspect-ratio: 1;
    filter: drop-shadow(0 12px 22px rgba(15, 44, 90, 0.1));
}

.member-pie-bg {
    fill: none;
    stroke: rgba(226, 232, 240, 0.9);
    stroke-width: 22;
}

.member-pie-slice {
    fill: none;
    stroke-width: 22;
    stroke-linecap: butt;
}

.member-pie-center {
    fill: #ffffff;
    stroke: rgba(59, 130, 246, 0.12);
    stroke-width: 1;
}

.member-pie-total {
    fill: #0f2c5a;
    font-size: 22px;
    font-weight: 900;
}

.member-pie-unit {
    fill: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.member-legend {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.member-legend-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
}

.member-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.member-legend-count {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.member-color-visitor {
    background: #94a3b8;
    stroke: #94a3b8;
}

.member-color-normal {
    background: #2563eb;
    stroke: #2563eb;
}

.member-color-premium {
    background: #0f8f82;
    stroke: #0f8f82;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

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

th,
td {
    padding: 13px 12px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.12);
    text-align: left;
    color: #334155;
    font-size: 14px;
}

th {
    color: #1e3a8a;
    background: rgba(219, 234, 254, 0.78);
    font-weight: 900;
}

tbody tr {
    transition: background 0.18s ease;
}

tbody tr:hover {
    background: rgba(239, 246, 255, 0.58);
}

.role-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 900;
}

.role-pill.admin {
    background: #bfdbfe;
    color: #1e3a8a;
}

.member-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.member-pill.visitor {
    background: #e2e8f0;
    color: #475569;
}

.member-pill.normal {
    background: #dbeafe;
    color: #1d4ed8;
}

.member-pill.premium {
    background: #ccfbf1;
    color: #0f766e;
}

.activity-text {
    color: #1f2937;
    font-weight: 700;
}

.online-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0f766e;
    font-size: 13px;
    font-weight: 800;
}

.online-status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #14b8a6;
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.14);
}

.device-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 900;
}

.device-pill.mobile {
    background: #ecfeff;
    color: #0e7490;
}

.refresh-footnote {
    margin-top: 12px;
    color: #64748b;
    font-size: 13px;
}

.empty-cell {
    text-align: center;
    color: #64748b;
}

@media (max-width: 860px) {
    .admin-shell {
        min-height: auto;
    }

    .admin-hero,
    .dashboard-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-panel,
    .dashboard-grid,
    .insight-grid,
    .behavior-grid {
        grid-template-columns: 1fr;
    }

    .admin-hero,
    .auth-panel,
    .dashboard-panel {
        padding: 20px;
    }

    .member-pie {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .member-summary {
        justify-items: center;
        text-align: center;
    }

    .member-legend {
        justify-content: center;
        width: 100%;
    }
}
