:root {
    --bg: #0b1020;
    --bg-soft: #121a30;
    --text: #e8efff;
    --muted: #9fb2d9;
    --primary: #4f8cff;
    --primary-2: #6ad0ff;
    --card: rgba(22, 32, 58, 0.55);
    --border: rgba(125, 170, 255, 0.25);
    --danger: #ff6b6b;
}

html[data-theme="light"] {
    --bg: #eef4ff;
    --bg-soft: #dde8ff;
    --text: #0f1a33;
    --muted: #506082;
    --primary: #2b67e8;
    --primary-2: #4aa2ff;
    --card: rgba(255, 255, 255, 0.7);
    --border: rgba(57, 92, 170, 0.2);
    --danger: #cf2d2d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    color: var(--text);
    background: linear-gradient(135deg, var(--bg), var(--bg-soft));
    transition: color 1.3s ease;
    position: relative;
    overflow: hidden;
}

.theme-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
    transition: opacity 1.5s ease;
}

.theme-bg-dark {
    background:
        radial-gradient(circle at 10% 20%, rgba(79, 140, 255, 0.24), transparent 40%),
        radial-gradient(circle at 85% 12%, rgba(106, 208, 255, 0.2), transparent 45%),
        linear-gradient(135deg, #0b1020, #121a30);
}

.theme-bg-light {
    background:
        radial-gradient(circle at 10% 20%, rgba(43, 103, 232, 0.2), transparent 42%),
        radial-gradient(circle at 85% 12%, rgba(74, 162, 255, 0.18), transparent 46%),
        linear-gradient(135deg, #eef4ff, #dde8ff);
}

html[data-theme="dark"] .theme-bg-dark {
    opacity: 1;
}

html[data-theme="dark"] .theme-bg-light {
    opacity: 0;
}

html[data-theme="light"] .theme-bg-dark {
    opacity: 0;
}

html[data-theme="light"] .theme-bg-light {
    opacity: 1;
}

.bg-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(circle at center, black 40%, transparent 95%);
    opacity: 0.35;
    transition: opacity 1.5s ease;
}

body.theme-switching .bg-grid {
    opacity: 0.6;
}

.top-actions {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3;
    display: flex;
    gap: 10px;
}

.ghost-btn {
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--card);
    padding: 8px 12px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 1.2s ease, background 1.5s ease, color 1.5s ease;
}

.ghost-btn:hover {
    transform: translateY(-1px);
    border-color: var(--primary-2);
}

.icon-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.icon {
    width: 20px;
    height: 20px;
    line-height: 20px;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 1.5s ease, opacity 1.2s ease;
}

.icon-sun,
.icon-moon {
    position: absolute;
}

.icon-lang {
    position: static;
    font-size: 17px;
}

html[data-theme="dark"] .icon-sun {
    opacity: 0;
    transform: scale(0.6) rotate(-90deg);
}

html[data-theme="dark"] .icon-moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

html[data-theme="light"] .icon-sun {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

html[data-theme="light"] .icon-moon {
    opacity: 0;
    transform: scale(0.6) rotate(90deg);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(circle at 20% 15%, rgba(106, 208, 255, 0.2), transparent 40%);
    opacity: 0;
    transition: opacity 1.5s ease;
}

body.theme-switching::after {
    opacity: 1;
}

body.modal-open {
    overflow: hidden;
}

.login-wrapper,
.dashboard-wrapper {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    position: relative;
    z-index: 2;
}

.login-card,
.dashboard-card {
    width: min(430px, 100%);
    border-radius: 20px;
    padding: 28px;
    border: 1px solid var(--border);
    background: var(--card);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
    transition: background 1.5s ease, border-color 1.3s ease, box-shadow 1.3s ease;
}

.brand h1,
.dashboard-card h1 {
    margin: 0;
    font-size: 30px;
    letter-spacing: 0.4px;
}

.brand p,
.dashboard-card p,
.hint {
    margin-top: 8px;
    color: var(--muted);
}

.field {
    display: block;
    margin-top: 16px;
}

.field span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 14px;
    transition: color 1.2s ease;
}

.field input {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    padding: 12px 14px;
    outline: none;
    transition: border-color 1.2s ease, box-shadow 1.2s ease, background 1.5s ease, color 1.5s ease;
}

html[data-theme="light"] .field input {
    background: rgba(255, 255, 255, 0.9);
}

.field input:focus {
    border-color: var(--primary-2);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.15);
}

.submit-btn {
    margin-top: 22px;
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
}

.submit-btn:hover {
    filter: brightness(1.05);
}

.oauth-btn {
    margin-top: 12px;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 11px 16px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: border-color 1.2s ease, background 1.5s ease, color 1.5s ease, transform 0.2s ease;
}

.oauth-btn:hover {
    border-color: var(--primary-2);
    transform: translateY(-1px);
}

.oauth-icon {
    font-size: 15px;
    line-height: 1;
}

.alert-error {
    margin-top: 16px;
    border-radius: 10px;
    padding: 10px 12px;
    color: #fff;
    background: linear-gradient(135deg, #dc5151, var(--danger));
    font-size: 14px;
}

.profile-meta {
    margin-top: 16px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.06);
    display: grid;
    gap: 8px;
    transition: background 1.5s ease, border-color 1.5s ease;
}

.dashboard-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px 1fr;
    position: relative;
    z-index: 2;
    transition: grid-template-columns 0.35s ease;
}

.dashboard-shell.sidebar-collapsed {
    grid-template-columns: 84px 1fr;
}

.sidebar {
    border-right: 1px solid var(--border);
    background: var(--card);
    backdrop-filter: blur(16px);
    padding: 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    transition: background 1.5s ease, border-color 1.2s ease, width 0.35s ease;
}

.sidebar-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.logo-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.logo-text {
    white-space: nowrap;
}

.sidebar-spacer {
    flex: 1;
}

.sidebar-nav {
    margin-top: 18px;
    display: grid;
    gap: 8px;
}

.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 12px;
    transition: background 1.2s ease, border-color 1.2s ease, color 1.2s ease;
}

.nav-item.active {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.08);
}

.nav-item:hover {
    border-color: var(--primary-2);
}

.nav-icon {
    font-size: 16px;
    line-height: 1;
}

.nav-label {
    white-space: nowrap;
}

.sidebar-footer {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sidebar-footer .ghost-btn {
    flex: 1 1 0;
}

.dashboard-main {
    padding: 24px;
    display: grid;
    align-items: start;
    gap: 16px;
    width: 100%;
}

.dashboard-main .dashboard-card {
    width: 100%;
    max-width: 100%;
}

.home-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.metric-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card);
    backdrop-filter: blur(12px);
    padding: 14px;
    transition: background 1.5s ease, border-color 1.3s ease;
}

.metric-card h3 {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

.metric-card strong {
    display: block;
    margin-top: 10px;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.dashboard-card h2 {
    margin: 0;
    font-size: 20px;
}

.module-list {
    margin: 10px 0 0;
    padding-left: 18px;
    color: var(--muted);
}

.profile-meta.compact {
    margin-top: 14px;
}

.profile-card .profile-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.profile-card .profile-grid div {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    transition: background 1.5s ease, border-color 1.3s ease;
}

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

.profile-card .profile-grid strong {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    word-break: break-all;
}

.dashboard-shell.sidebar-collapsed .logo-text {
    display: none;
}

.dashboard-shell.sidebar-collapsed .nav-label {
    display: none;
}

.dashboard-shell.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 10px 6px;
}

.dashboard-shell.sidebar-collapsed .sidebar-footer .ghost-btn {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 8px;
}

.dashboard-shell.sidebar-collapsed .sidebar-footer {
    gap: 4px;
    justify-content: center;
}

.dashboard-shell.sidebar-collapsed .sidebar-footer .icon {
    width: 14px;
    height: 14px;
    font-size: 14px;
    line-height: 14px;
}

@media (max-width: 900px) {
    .dashboard-shell {
        grid-template-columns: 84px 1fr;
    }
    .logo-text {
        display: none;
    }
    .nav-label {
        display: none;
    }
    .nav-item {
        justify-content: center;
        padding: 10px 6px;
    }
    .home-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .profile-card .profile-grid {
        grid-template-columns: 1fr;
    }
}

body {
    overflow-x: hidden;
    overflow-y: auto;
    background-attachment: fixed;
}

.auth-page,
.dashboard-page,
.error-page {
    min-height: 100vh;
}

.top-actions {
    top: 24px;
    right: 24px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.modern-card {
    border-radius: 28px;
    border: 1px solid var(--border);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)),
        var(--card);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.auth-shell {
    min-height: 100vh;
    width: min(1240px, calc(100% - 48px));
    margin: 0 auto;
    padding: 72px 0 40px;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 460px);
    gap: 28px;
    align-items: center;
    position: relative;
    z-index: 2;
}

.auth-showcase {
    padding: 24px 8px 24px 0;
}

.auth-showcase h1 {
    margin: 18px 0 0;
    font-size: clamp(38px, 5vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    max-width: 760px;
}

.hero-text {
    margin: 18px 0 0;
    max-width: 640px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.75;
}

.showcase-stats {
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 220px));
    gap: 14px;
}

.showcase-stat {
    padding: 18px 20px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(14px);
}

.showcase-stat span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.showcase-stat strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
    letter-spacing: 0.02em;
}

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

.feature-item {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.auth-panel {
    display: flex;
    justify-content: flex-end;
}

.auth-panel .login-card {
    width: 100%;
    max-width: 460px;
    padding: 30px;
}

.brand {
    display: grid;
    gap: 10px;
}

.brand h2,
.error-card h1 {
    margin: 0;
    font-size: clamp(30px, 3vw, 38px);
    line-height: 1.12;
}

.brand-chip {
    display: inline-flex;
    width: fit-content;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(79, 140, 255, 0.16);
    color: #d9e7ff;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

html[data-theme="light"] .brand-chip {
    color: #214796;
    background: rgba(43, 103, 232, 0.12);
}

.auth-form {
    margin-top: 10px;
}

.field input {
    min-height: 50px;
    border-radius: 16px;
    background: rgba(10, 16, 34, 0.32);
}

html[data-theme="light"] .field input {
    background: rgba(255, 255, 255, 0.85);
}

.submit-btn,
.oauth-btn,
.pill-btn,
.exit-link {
    min-height: 48px;
    border-radius: 14px;
    font-weight: 600;
}

.submit-btn {
    box-shadow: 0 14px 30px rgba(64, 122, 255, 0.28);
}

.hint {
    margin-top: 18px;
    font-size: 13px;
}

.app-shell {
    min-height: 100vh;
    grid-template-columns: 290px 1fr;
}

.dashboard-shell.sidebar-collapsed {
    grid-template-columns: 96px 1fr;
}

.app-sidebar {
    padding: 22px 18px;
    gap: 18px;
}

.sidebar-logo {
    align-items: flex-start;
}

.logo-text-wrap {
    display: grid;
    gap: 2px;
}

.logo-text-wrap small {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sidebar-nav {
    margin-top: 8px;
    gap: 10px;
}

.nav-item {
    min-height: 48px;
    border-radius: 16px;
    padding: 12px 14px;
}

.nav-item.active {
    background: rgba(79, 140, 255, 0.14);
}

.stack-footer {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.stack-footer .exit-link {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.dashboard-main {
    padding: 28px;
    gap: 22px;
}

.app-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.app-topbar h1 {
    margin: 14px 0 0;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.08;
}

.app-topbar p {
    margin: 12px 0 0;
    max-width: 760px;
    color: var(--muted);
    line-height: 1.7;
}

.topbar-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    white-space: nowrap;
}

.hero-panel {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    overflow: hidden;
    position: relative;
}

.hero-panel::before {
    content: "";
    position: absolute;
    inset: auto -8% -40% auto;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79, 140, 255, 0.25), transparent 68%);
    pointer-events: none;
}

.hero-panel h2 {
    margin: 14px 0 0;
    font-size: clamp(24px, 3.2vw, 34px);
    max-width: 740px;
}

.hero-panel p {
    margin: 12px 0 0;
    max-width: 720px;
    color: var(--muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.pill-btn {
    padding: 0 16px;
    text-decoration: none;
}

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

.metric-card {
    min-height: 146px;
    padding: 18px;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04)),
        var(--card);
}

.metric-card strong {
    margin-top: 18px;
    font-size: clamp(28px, 3vw, 38px);
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr);
    gap: 18px;
}

.modules-grid {
    align-items: start;
}

.info-card {
    padding: 24px;
    border-radius: 24px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.section-heading h2 {
    margin: 10px 0 0;
}

.section-text {
    margin: 14px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

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

.profile-grid div {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
}

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

.profile-grid strong {
    display: block;
    margin-top: 8px;
    font-size: 15px;
    word-break: break-word;
}

.status-list,
.timeline-list {
    margin-top: 18px;
    display: grid;
    gap: 12px;
}

.status-row,
.timeline-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
}

.status-row span,
.timeline-item span {
    color: var(--muted);
}

.status-card .submit-btn {
    margin-top: 18px;
}

.modern-list {
    margin-top: 18px;
    padding-left: 20px;
    display: grid;
    gap: 12px;
    line-height: 1.7;
}

.error-shell {
    min-height: 100vh;
    width: min(760px, calc(100% - 48px));
    margin: 0 auto;
    padding: 32px 0;
    display: grid;
    place-items: center;
    position: relative;
    z-index: 2;
}

.error-card {
    width: min(680px, 100%);
    padding: 36px;
    text-align: center;
}

.error-card p {
    margin: 18px auto 0;
    max-width: 520px;
    color: var(--muted);
    line-height: 1.8;
}

.error-actions {
    margin-top: 28px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.dashboard-shell.sidebar-collapsed .logo-text-wrap small,
.dashboard-shell.sidebar-collapsed .exit-link {
    display: none;
}

@media (max-width: 1200px) {
    .auth-shell {
        grid-template-columns: 1fr;
        gap: 22px;
        padding-top: 92px;
    }

    .auth-panel {
        justify-content: flex-start;
    }

    .app-shell {
        grid-template-columns: 96px 1fr;
    }

    .logo-text,
    .logo-text-wrap small,
    .nav-label,
    .exit-link {
        display: none;
    }

    .stack-footer {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .top-actions {
        top: 16px;
        right: 16px;
    }

    .auth-shell,
    .error-shell {
        width: min(100% - 24px, 100%);
    }

    .showcase-stats,
    .feature-list,
    .stat-grid,
    .content-grid,
    .modules-grid,
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-main {
        padding: 18px;
    }

    .app-topbar,
    .hero-panel,
    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-meta {
        justify-content: flex-start;
    }
}

.users-main {
    padding-bottom: 56px;
    max-width: min(1360px, 100%);
    margin: 0 auto;
}

.users-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(340px, 0.9fr);
    align-items: start;
    gap: 22px;
    padding: 26px;
}

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

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

.module-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
        var(--card);
    color: var(--text);
    text-decoration: none;
    backdrop-filter: blur(16px);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.module-card:hover {
    transform: translateY(-2px);
    border-color: rgba(106, 208, 255, 0.38);
}

.module-card.is-active {
    border-color: rgba(106, 208, 255, 0.42);
    background:
        linear-gradient(180deg, rgba(79, 140, 255, 0.18), rgba(255, 255, 255, 0.04)),
        var(--card);
    box-shadow: 0 18px 40px rgba(27, 64, 143, 0.18);
}

.module-card-label {
    color: var(--muted);
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.module-card strong {
    font-size: 34px;
    line-height: 1;
}

.module-card small {
    color: var(--muted);
    line-height: 1.6;
}

.management-card {
    padding: 26px 24px;
    border-radius: 28px;
    display: grid;
    gap: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)),
        var(--card);
}

.section-heading-stack {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .section-heading-stack {
    border-bottom-color: rgba(15, 26, 51, 0.08);
}

.section-heading-stack > div {
    flex: 1 1 auto;
    min-width: 0;
}

.toolbar-search {
    width: min(430px, 100%);
    display: flex;
    gap: 10px;
    align-self: end;
}

.toolbar-search input,
.field-select {
    width: 100%;
    min-height: 50px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(10, 16, 34, 0.32);
    color: var(--text);
    padding: 12px 14px;
    outline: none;
    transition: border-color 1.2s ease, box-shadow 1.2s ease, background 1.5s ease, color 1.5s ease;
}

html[data-theme="light"] .toolbar-search input,
html[data-theme="light"] .field-select {
    background: rgba(255, 255, 255, 0.88);
}

.toolbar-search input:focus,
.field-select:focus {
    border-color: var(--primary-2);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.15);
}

.table-meta {
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 14px;
}

html[data-theme="light"] .table-meta {
    border-color: rgba(15, 26, 51, 0.08);
    background: rgba(255, 255, 255, 0.72);
}

.table-shell {
    margin-top: 0;
    border: 1px solid var(--border);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
        var(--card);
    backdrop-filter: blur(18px);
    overflow-x: auto;
    overflow-y: hidden;
}

.data-table {
    width: 100%;
    min-width: 940px;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: middle;
    text-align: left;
}

html[data-theme="light"] .data-table th,
html[data-theme="light"] .data-table td {
    border-bottom-color: rgba(15, 26, 51, 0.08);
}

.data-table th {
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.identity-cell,
.stack-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stack-cell {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.stack-cell strong {
    font-size: 15px;
}

.stack-cell span {
    color: var(--muted);
    line-height: 1.5;
}

.avatar-thumb,
.avatar-large {
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.08);
}

.avatar-thumb {
    width: 46px;
    height: 46px;
}

.avatar-large {
    width: 72px;
    height: 72px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.08);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.is-highlight {
    background: rgba(79, 140, 255, 0.16);
    border-color: rgba(106, 208, 255, 0.34);
}

.action-btn {
    min-height: 42px;
    border-radius: 14px;
    white-space: nowrap;
}

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

.pagination-bar {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-link {
    min-width: 44px;
    justify-content: center;
    text-decoration: none;
}

.pagination-link.is-active {
    background: rgba(79, 140, 255, 0.18);
    border-color: rgba(106, 208, 255, 0.36);
}

.page-jump-form {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.page-jump-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
}

.page-jump-form input {
    width: 110px;
    min-height: 44px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    padding: 0 12px;
}

.alert-inline {
    border-radius: 18px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.user-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.user-tabs-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.user-tabs .pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.user-tabs .pill-btn.is-active {
    background: rgba(79, 140, 255, 0.18);
    border-color: rgba(106, 208, 255, 0.36);
}

.users-stat-grid .metric-card {
    min-height: 118px;
    padding: 16px 18px;
}

.users-stat-grid .metric-card strong {
    margin-top: 12px;
    font-size: 34px;
}

.alert-inline-success {
    border-color: rgba(89, 201, 165, 0.28);
    background: rgba(63, 160, 125, 0.14);
}

.alert-inline-error {
    border-color: rgba(255, 107, 107, 0.28);
    background: rgba(220, 81, 81, 0.14);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(4, 8, 20, 0.58);
    backdrop-filter: blur(10px);
}

.modal-overlay.is-open {
    display: flex;
}

.management-modal {
    width: min(760px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border-radius: 28px;
    border: 1px solid var(--border);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04)),
        var(--card);
    backdrop-filter: blur(22px);
    box-shadow: 0 34px 80px rgba(0, 0, 0, 0.32);
    padding: 24px;
}

.management-modal-wide {
    width: min(1100px, 100%);
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.modal-head h3 {
    margin: 12px 0 0;
    font-size: 28px;
}

.modal-head p {
    margin: 10px 0 0;
    color: var(--muted);
}

.modal-form {
    margin-top: 20px;
}

.profile-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
}

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

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

.solo-time-field.is-hidden {
    display: none;
}

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

.bulk-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.switch-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
}

.switch-copy {
    display: grid;
    gap: 6px;
}

.switch-copy strong {
    font-size: 15px;
}

.switch-copy small {
    color: var(--muted);
    line-height: 1.45;
}

.switch {
    position: relative;
    display: inline-flex;
    width: 58px;
    height: 34px;
    flex: 0 0 auto;
}

.switch input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.switch-slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--border);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.switch-slider::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 8px 14px rgba(0, 0, 0, 0.18);
    transition: transform 0.25s ease;
}

.switch input:checked + .switch-slider {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    border-color: rgba(106, 208, 255, 0.42);
}

.switch input:checked + .switch-slider::after {
    transform: translateX(24px);
}

.simple-switch {
    min-height: 92px;
}

.modal-actions {
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.activity-main {
    max-width: min(1360px, 100%);
    margin: 0 auto;
    padding-bottom: 56px;
}

.activity-hero {
    align-items: center;
    padding: 26px;
}

.activity-hero-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.activity-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
    gap: 18px;
    align-items: start;
}

.activity-form-card,
.activity-side-card {
    width: 100%;
}

.activity-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-textarea {
    width: 100%;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(10, 16, 34, 0.32);
    color: var(--text);
    padding: 12px 14px;
    outline: none;
    min-height: 110px;
    resize: vertical;
    transition: border-color 1.2s ease, box-shadow 1.2s ease, background 1.5s ease, color 1.5s ease;
}

html[data-theme="light"] .field-textarea {
    background: rgba(255, 255, 255, 0.88);
}

.field-textarea:focus {
    border-color: var(--primary-2);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.15);
}

.activity-facilities-head {
    margin-top: 24px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.activity-facilities-head h3 {
    margin: 12px 0 0;
    font-size: 22px;
}

.facility-rows {
    margin-top: 18px;
    display: grid;
    gap: 14px;
}

.facility-row {
    padding: 18px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
}

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

.facility-row-head strong {
    font-size: 18px;
}

.facility-remove-btn {
    white-space: nowrap;
}

.activity-side-note {
    margin-top: 18px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
}

.activity-side-note p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.activity-created-card {
    margin-top: 18px;
    display: grid;
    gap: 8px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(89, 201, 165, 0.3);
    background: rgba(63, 160, 125, 0.14);
}

.activity-created-card strong {
    font-size: 20px;
}

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

    .users-module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .users-hero {
        grid-template-columns: 1fr;
    }

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

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

@media (max-width: 900px) {
    .toolbar-search,
    .table-meta,
    .pagination-bar,
    .profile-preview,
    .modal-head,
    .activity-facilities-head,
    .facility-row-head {
        flex-direction: column;
        align-items: stretch;
    }

    .form-grid,
    .users-stat-grid,
    .users-module-grid {
        grid-template-columns: 1fr;
    }

    .activity-form-grid {
        grid-template-columns: 1fr;
    }

    .data-table {
        min-width: 780px;
    }

    .management-modal,
    .management-modal-wide {
        width: 100%;
        padding: 18px;
    }

    .user-tabs {
        grid-template-columns: 1fr;
    }

    .activity-hero-badges {
        justify-content: flex-start;
    }
}
