/* ==========================================================================
   Karia Dashboard - design system
   ========================================================================== */

:root {
    --bg: #070a12;
    --bg-soft: #0b101c;
    --panel: rgba(15, 21, 36, 0.74);
    --panel-solid: #0f1524;
    --border: rgba(148, 163, 184, 0.13);
    --border-strong: rgba(148, 163, 184, 0.26);
    --text: #e6e9f2;
    --muted: #94a3b8;
    --primary: #8b5cf6;
    --primary-2: #6366f1;
    --accent: #22d3ee;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #fb7185;
    --radius: 18px;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    --font: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
}

body {
    display: flex;
    flex-direction: column;
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(1100px 600px at 8% -12%, rgba(124, 58, 237, 0.2), transparent 62%),
        radial-gradient(900px 500px at 96% 0%, rgba(34, 211, 238, 0.12), transparent 60%),
        var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p {
    margin-top: 0;
}

a {
    color: inherit;
}

code {
    font-family: var(--mono);
    font-size: 0.86em;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(139, 92, 246, 0.12);
    color: #c4b5fd;
}

::selection {
    background: rgba(139, 92, 246, 0.35);
    color: #fff;
}

/* Ambient background ------------------------------------------------------ */
.aurora {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.aurora span {
    position: absolute;
    display: block;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.34;
    animation: float 18s ease-in-out infinite;
}

.aurora span:nth-child(1) {
    width: 520px;
    height: 520px;
    top: -180px;
    left: -120px;
    background: #6d28d9;
}

.aurora span:nth-child(2) {
    width: 440px;
    height: 440px;
    top: 18%;
    right: -180px;
    background: #0e7490;
    animation-delay: -6s;
}

.aurora span:nth-child(3) {
    width: 380px;
    height: 380px;
    bottom: -180px;
    left: 38%;
    background: #4338ca;
    animation-delay: -12s;
}

@keyframes float {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(24px, -28px, 0) scale(1.06); }
}

.site-header,
main,
.site-footer {
    position: relative;
    z-index: 1;
}

main {
    flex: 1 0 auto;
}

/* Layout ------------------------------------------------------------------ */
.container {
    width: min(1180px, calc(100% - 40px));
    margin-inline: auto;
}

/* Header ------------------------------------------------------------------ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(7, 10, 18, 0.72);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: 72px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 1.16rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-weight: 900;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.35);
}

.brand-mark-sm {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 0.82rem;
}

.brand-logo {
    display: block;
    object-fit: cover;
    padding: 0;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-dot {
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-links > a:not(.btn) {
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.18s ease, background 0.18s ease;
}

.nav-links > a:not(.btn):hover,
.nav-links > a.active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    height: 2px;
    margin: 4px 0;
    border-radius: 2px;
    background: var(--text);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 190px;
    padding: 4px 10px 4px 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--panel-solid);
}

.user-name {
    overflow: hidden;
    font-size: 0.8rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-form {
    display: inline-flex;
}

/* Buttons ----------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.34);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 40px rgba(99, 102, 241, 0.44);
}

.btn-ghost {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.035);
    color: var(--text);
}

.btn-ghost:hover {
    border-color: rgba(148, 163, 184, 0.44);
    background: rgba(255, 255, 255, 0.065);
}

.btn-sm {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.84rem;
}

.btn-lg {
    padding: 14px 22px;
    border-radius: 14px;
    font-size: 1rem;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    cursor: pointer;
}

.icon-btn:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

/* Hero -------------------------------------------------------------------- */
.hero {
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    gap: 56px;
    align-items: center;
    padding: 78px 0 42px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #c4b5fd;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5);
    animation: pulse 2.2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hero h1 {
    margin: 18px 0;
    font-size: clamp(2.35rem, 5vw, 4.15rem);
    line-height: 1.04;
    letter-spacing: -0.045em;
}

.gradient-text {
    background: linear-gradient(135deg, #a78bfa, #22d3ee);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-lead {
    max-width: 610px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 1.06rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.hero-actions-center {
    justify-content: center;
}

.hero-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 28px;
    color: var(--muted);
    font-size: 0.82rem;
}

.hero-trust span::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--success);
    vertical-align: middle;
}

.hero-panel {
    position: relative;
    display: flex;
    justify-content: center;
}

.panel-glow {
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.45), rgba(34, 211, 238, 0.2));
    filter: blur(65px);
}

.mini-window {
    position: relative;
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    background: rgba(13, 18, 32, 0.86);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.mini-window-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.mini-window-bar span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #334155;
}

.mini-window-bar span:nth-child(1) { background: #fb7185; }
.mini-window-bar span:nth-child(2) { background: #fbbf24; }
.mini-window-bar span:nth-child(3) { background: #34d399; }

.mini-window-bar small {
    margin-left: auto;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.7rem;
}

.mini-window-body {
    padding: 18px;
}

.mini-guild {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.mini-guild strong {
    display: block;
    font-size: 0.92rem;
}

.mini-guild small {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
}

.mini-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #8b5cf6, #22d3ee);
    color: #fff;
    font-weight: 900;
}

.mini-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.status-pill {
    margin-left: auto;
    padding: 4px 8px;
    border: 1px solid rgba(52, 211, 153, 0.25);
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.12);
    color: var(--success);
    font-size: 0.68rem;
    font-weight: 700;
}

.mini-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.mini-value {
    color: #c4b5fd;
    font-family: var(--mono);
    font-size: 0.76rem;
}

.toggle-on {
    position: relative;
    width: 34px;
    height: 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, #8b5cf6, #22d3ee);
}

.toggle-on::after {
    content: "";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
}

/* Stats ------------------------------------------------------------------- */
.stats-section {
    padding: 28px 0;
}

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

.stat {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel);
    backdrop-filter: blur(12px);
}

.stat span {
    display: block;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stat strong {
    display: block;
    margin-top: 4px;
    font-size: 1.75rem;
    letter-spacing: -0.03em;
}

.stat-grid-sm {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.stat-grid-sm .stat {
    padding: 14px;
}

.stat-grid-sm .stat strong {
    font-size: 1.28rem;
}

.text-success { color: var(--success) !important; }
.text-muted { color: var(--muted) !important; }

/* Sections ---------------------------------------------------------------- */
.features-section {
    padding: 70px 0;
}

.section-head {
    max-width: 660px;
    margin-bottom: 30px;
}

.section-head h2 {
    margin: 10px 0;
    font-size: clamp(1.8rem, 3.4vw, 2.7rem);
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.section-head p {
    margin-bottom: 0;
    color: var(--muted);
}

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

.feature-card {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel);
    backdrop-filter: blur(12px);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-3px);
    border-color: rgba(139, 92, 246, 0.32);
    background: rgba(20, 27, 46, 0.8);
}

.feature-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 16px;
    border: 1px solid rgba(139, 92, 246, 0.26);
    border-radius: 12px;
    background: rgba(139, 92, 246, 0.12);
    color: #c4b5fd;
}

.feature-card h3 {
    margin-bottom: 6px;
    font-size: 1.02rem;
}

.feature-card p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.steps-section {
    padding: 20px 0 70px;
}

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

.step {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(15, 21, 36, 0.55);
}

.step-number {
    display: inline-block;
    margin-bottom: 12px;
    color: #a78bfa;
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.step h3 {
    margin-bottom: 6px;
    font-size: 1rem;
}

.step p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.cta-section {
    padding: 10px 0 80px;
}

.cta-card {
    padding: 52px 24px;
    border: 1px solid rgba(139, 92, 246, 0.26);
    border-radius: 24px;
    background:
        radial-gradient(600px 240px at 50% 0%, rgba(139, 92, 246, 0.2), transparent 70%),
        rgba(15, 21, 36, 0.72);
    text-align: center;
}

.cta-card h2 {
    margin: 12px auto;
    max-width: 720px;
    font-size: clamp(1.7rem, 3.4vw, 2.5rem);
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.cta-card p {
    max-width: 620px;
    margin: 0 auto;
    color: var(--muted);
}

/* Page / cards ------------------------------------------------------------ */
.page {
    padding: 46px 0 80px;
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.page-head h1 {
    margin: 8px 0;
    font-size: clamp(1.8rem, 3.2vw, 2.6rem);
    letter-spacing: -0.035em;
    line-height: 1.12;
}

.page-head p {
    max-width: 660px;
    margin-bottom: 0;
    color: var(--muted);
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(14px);
}

/* Guild grid -------------------------------------------------------------- */
.guild-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.guild-card {
    display: block;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel);
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    animation: fadeUp 0.5s both;
    animation-delay: calc(var(--i, 0) * 45ms);
}

.guild-card:hover {
    transform: translateY(-3px);
    border-color: rgba(139, 92, 246, 0.36);
    background: rgba(20, 27, 46, 0.82);
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.guild-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.guild-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    object-fit: cover;
    background: var(--panel-solid);
}

.guild-fallback {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #8b5cf6, #22d3ee);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 900;
}

.guild-card-title {
    min-width: 0;
}

.guild-card-title h2 {
    overflow: hidden;
    margin-bottom: 2px;
    font-size: 1.02rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guild-card-title p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.card-arrow {
    display: grid;
    place-items: center;
    margin-left: auto;
    color: var(--muted);
    transition: color 0.18s ease, transform 0.18s ease;
}

.guild-card:hover .card-arrow {
    color: #c4b5fd;
    transform: translateX(2px);
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 16px 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 650;
}

.badge-soft {
    border-color: rgba(139, 92, 246, 0.22);
    background: rgba(139, 92, 246, 0.12);
    color: #c4b5fd;
}

.badge-success {
    border-color: rgba(52, 211, 153, 0.2);
    background: rgba(52, 211, 153, 0.1);
    color: #6ee7b7;
}

.badge-muted {
    border-color: var(--border);
    background: rgba(148, 163, 184, 0.08);
    color: var(--muted);
}

.guild-card-footer {
    display: flex;
    align-items: center;
    gap: 7px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.74rem;
}

.status-dot {
    display: inline-block;
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.65);
}

.empty-state {
    padding: 58px 24px;
    text-align: center;
}

.empty-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    border: 1px solid rgba(139, 92, 246, 0.26);
    border-radius: 16px;
    background: rgba(139, 92, 246, 0.12);
    color: #c4b5fd;
}

.empty-state h2 {
    margin-bottom: 8px;
    font-size: 1.3rem;
}

.empty-state p {
    max-width: 560px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 0.92rem;
}

/* Alerts ------------------------------------------------------------------ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    padding: 13px 16px;
    border: 1px solid;
    border-radius: 12px;
    font-size: 0.88rem;
    animation: fadeUp 0.3s both;
}

.alert-icon {
    flex: none;
    width: 8px;
    height: 8px;
    margin-top: 7px;
    border-radius: 50%;
    background: currentColor;
}

.alert-text {
    flex: 1;
    min-width: 0;
}

.alert-close {
    flex: none;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
}

.alert-close:hover { opacity: 1; }

.alert-success {
    border-color: rgba(52, 211, 153, 0.26);
    background: rgba(52, 211, 153, 0.1);
    color: #6ee7b7;
}

.alert-error,
.alert-danger {
    border-color: rgba(251, 113, 133, 0.26);
    background: rgba(251, 113, 133, 0.1);
    color: #fda4af;
}

.alert-warning {
    border-color: rgba(251, 191, 36, 0.26);
    background: rgba(251, 191, 36, 0.1);
    color: #fcd34d;
}

.alert-info {
    border-color: rgba(34, 211, 238, 0.26);
    background: rgba(34, 211, 238, 0.1);
    color: #67e8f9;
}

/* Dashboard --------------------------------------------------------------- */
.dashboard-page {
    padding: 28px 0 70px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 0.8rem;
}

.breadcrumb a {
    color: var(--muted);
    text-decoration: none;
}

.breadcrumb a:hover { color: var(--text); }

.dashboard-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.dashboard-sidebar {
    position: sticky;
    top: 92px;
}

.sidebar-guild {
    padding: 18px;
}

.sidebar-guild-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-guild-head h2 {
    overflow: hidden;
    margin-bottom: 2px;
    font-size: 1rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-guild-head p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.76rem;
}

.sidebar-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 14px 0;
    padding: 9px 10px;
    border: 1px solid rgba(52, 211, 153, 0.14);
    border-radius: 10px;
    background: rgba(52, 211, 153, 0.06);
    color: var(--muted);
    font-size: 0.7rem;
}

.mono {
    font-family: var(--mono);
    font-size: 0.68rem;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 14px 0;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.side-nav a {
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease;
}

.side-nav a:hover,
.side-nav a.active {
    background: rgba(139, 92, 246, 0.12);
    color: #ddd6fe;
}

.sidebar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.sidebar-actions form {
    display: flex;
    flex: 1;
}

.sidebar-actions .btn {
    flex: 1;
    white-space: nowrap;
}

.sidebar-actions form .btn {
    width: 100%;
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.settings-card {
    padding: 24px;
}

.card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.section-kicker {
    color: #a78bfa;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.card-head h2 {
    margin: 4px 0;
    font-size: 1.28rem;
    letter-spacing: -0.025em;
}

.card-head p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.08);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 650;
    white-space: nowrap;
}

.chip-success {
    border-color: rgba(52, 211, 153, 0.2);
    background: rgba(52, 211, 153, 0.09);
    color: #6ee7b7;
}

.chip-danger {
    border-color: rgba(251, 113, 133, 0.2);
    background: rgba(251, 113, 133, 0.09);
    color: #fda4af;
}

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

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

.field label {
    color: #cbd5e1;
    font-size: 0.8rem;
    font-weight: 650;
}

.optional {
    color: var(--muted);
    font-weight: 400;
}

.form-control {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border-strong);
    border-radius: 11px;
    outline: none;
    background: rgba(2, 6, 23, 0.5);
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-control:focus {
    border-color: rgba(139, 92, 246, 0.7);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
}

.form-control option {
    background: var(--panel-solid);
    color: var(--text);
}

.field small {
    color: var(--muted);
    font-size: 0.72rem;
}

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

.switch-row strong {
    display: block;
    font-size: 0.9rem;
}

.switch-row p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.switch {
    position: relative;
    display: inline-flex;
    flex: none;
    cursor: pointer;
}

.switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.switch-track {
    position: relative;
    display: block;
    width: 44px;
    height: 25px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    transition: background 0.18s ease, border-color 0.18s ease;
}

.switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: transform 0.18s ease, background 0.18s ease;
}

.switch input:checked + .switch-track {
    border-color: transparent;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

.switch input:checked + .switch-track .switch-thumb {
    background: #fff;
    transform: translateX(19px);
}

.switch input:focus-visible + .switch-track {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.24);
}

.switch input:disabled + .switch-track {
    opacity: 0.45;
    cursor: not-allowed;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

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

.form-actions .muted {
    font-size: 0.76rem;
}

.subsection-title {
    margin: 22px 0 10px;
    font-size: 0.94rem;
}

.rule-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rule-list li {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.82rem;
}

.rule-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #64748b;
}

.rule-dot.enabled {
    background: var(--success);
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
}

.rule-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.small-note {
    margin: 18px 0 0;
    font-size: 0.76rem;
}

/* Error ------------------------------------------------------------------- */
.error-page {
    display: grid;
    place-items: center;
    min-height: 62vh;
}

.error-card {
    max-width: 560px;
    padding: 46px 30px;
    text-align: center;
}

.error-code {
    display: inline-block;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #a78bfa, #22d3ee);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-family: var(--mono);
    font-size: 3.4rem;
    font-weight: 800;
    line-height: 1;
}

.error-card h1 {
    margin: 8px 0 10px;
    font-size: 1.55rem;
    letter-spacing: -0.03em;
}

.error-card p {
    margin-bottom: 0;
    color: var(--muted);
}

/* Footer ------------------------------------------------------------------ */
.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    background: rgba(7, 10, 18, 0.6);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 26px 0;
}

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

.footer-brand strong {
    display: block;
    font-size: 0.88rem;
}

.footer-brand p {
    margin: 0;
    color: var(--muted);
    font-size: 0.72rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.footer-links a {
    color: var(--muted);
    font-size: 0.78rem;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--text);
}

.footer-copy {
    width: 100%;
    margin: 0;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.72rem;
    text-align: center;
}

/* Responsive -------------------------------------------------------------- */
@media (max-width: 1020px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 38px;
        padding-top: 56px;
    }

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

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

    .dashboard-layout {
        grid-template-columns: 260px minmax(0, 1fr);
    }
}

@media (max-width: 820px) {
    .nav-toggle {
        display: block;
        order: 3;
    }

    .nav-links {
        position: absolute;
        top: 72px;
        right: 20px;
        left: 20px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 12px;
        border: 1px solid var(--border-strong);
        border-radius: 16px;
        background: rgba(11, 16, 28, 0.97);
        box-shadow: var(--shadow);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links > a:not(.btn) {
        padding: 10px 12px;
    }

    .user-chip {
        max-width: none;
        margin-top: 4px;
    }

    .logout-form .btn,
    .nav-links > .btn {
        width: 100%;
    }

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

    .dashboard-sidebar {
        position: static;
    }

    .side-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

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

@media (max-width: 620px) {
    .container {
        width: min(100% - 28px, 1180px);
    }

    .feature-grid,
    .guild-grid,
    .steps,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: clamp(2.1rem, 9vw, 3rem);
    }

    .hero-actions .btn {
        width: 100%;
    }

    .hero-trust {
        flex-direction: column;
        gap: 6px;
    }

    .settings-card,
    .sidebar-guild {
        padding: 18px;
    }

    .switch-row {
        align-items: flex-start;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-copy {
        text-align: left;
    }
}

/* ==========================================================================
   Authenticated app shell
   ========================================================================== */
[hidden] {
    display: none !important;
}

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

.status-dot-off {
    background: #64748b;
    box-shadow: none;
}

.app-page {
    --app-bg: #07080c;
    --app-panel: #0c0e14;
    --app-panel-2: #11141c;
    --app-border: rgba(255, 255, 255, 0.07);
    --app-border-strong: rgba(255, 255, 255, 0.13);
    --app-text: #f4f5f7;
    --app-muted: #8b909c;
    --app-purple: #7c5cff;
    --app-purple-2: #a78bfa;
    background:
        radial-gradient(900px 520px at 100% -10%, rgba(124, 92, 255, 0.1), transparent 60%),
        var(--app-bg);
}

.app-page .aurora {
    opacity: 0.12;
}

.app-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    min-height: 100vh;
}

.app-backdrop {
    display: none;
}

/* Sidebar ----------------------------------------------------------------- */
.app-sidebar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-self: start;
    width: 100%;
    height: 100vh;
    padding: 20px 14px;
    border-right: 1px solid var(--app-border);
    background: rgba(8, 9, 13, 0.94);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 18px;
    color: var(--app-text);
    font-size: 1.16rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-decoration: none;
}

.app-guild-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: var(--app-panel);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.app-guild-card:hover {
    border-color: var(--app-border-strong);
    background: var(--app-panel-2);
}

.app-guild-card .guild-icon,
.app-guild-card .guild-fallback {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 0.78rem;
}

.app-guild-empty-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: none;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: rgba(124, 92, 255, 0.1);
    color: var(--app-purple-2);
}

.app-guild-meta {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.app-guild-meta strong {
    overflow: hidden;
    color: var(--app-text);
    font-size: 0.82rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-guild-meta > span {
    display: flex;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    color: var(--app-muted);
    font-size: 0.66rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-guild-chevron {
    flex: none;
    color: var(--app-muted);
}

.app-sidebar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 8px;
    padding: 8px 10px;
    border: 1px solid var(--app-border);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--app-muted);
}

.app-sidebar-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--app-text);
    font: inherit;
    font-size: 0.8rem;
}

.app-sidebar-search input::placeholder {
    color: #626875;
}

.app-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    padding-right: 2px;
}

.app-nav-section {
    margin: 16px 10px 6px;
    color: #5c6270;
    font-size: 0.61rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--app-muted);
    font-size: 0.81rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.16s ease, color 0.16s ease;
}

.app-nav-link svg {
    flex: none;
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

.app-nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--app-text);
}

.app-nav-link.active {
    background: linear-gradient(90deg, rgba(124, 92, 255, 0.18), rgba(124, 92, 255, 0.04));
    box-shadow: inset 2px 0 0 var(--app-purple);
    color: #fff;
}

.app-nav-link.active svg {
    color: var(--app-purple-2);
    opacity: 1;
}

.app-sidebar-user {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: auto;
    padding: 14px 4px 0;
    border-top: 1px solid var(--app-border);
}

.app-sidebar-user .avatar {
    width: 32px;
    height: 32px;
    flex: none;
}

.app-user-meta {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.app-user-meta strong {
    overflow: hidden;
    color: var(--app-text);
    font-size: 0.79rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-user-meta span {
    color: var(--app-muted);
    font-size: 0.65rem;
}

.app-sidebar-user form {
    display: flex;
    flex: none;
}

/* Topbar ------------------------------------------------------------------ */
.app-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 68px;
    padding: 0 26px;
    border-bottom: 1px solid var(--app-border);
    background: rgba(7, 8, 12, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.app-menu-btn {
    display: none;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 8px;
    border: 1px solid var(--app-border);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.025);
    cursor: pointer;
}

.app-menu-btn span {
    display: block;
    width: 100%;
    height: 2px;
    margin: 3px 0;
    border-radius: 2px;
    background: var(--app-text);
}

.app-breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;
    overflow: hidden;
    color: var(--app-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.app-breadcrumb a {
    color: var(--app-muted);
    text-decoration: none;
}

.app-breadcrumb a:hover {
    color: var(--app-text);
}

.app-breadcrumb strong {
    overflow: hidden;
    color: var(--app-text);
    font-weight: 600;
    text-overflow: ellipsis;
}

.app-topbar-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-left: auto;
}

.app-topbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 230px;
    padding: 8px 10px;
    border: 1px solid var(--app-border);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--app-muted);
}

.app-topbar-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--app-text);
    font: inherit;
    font-size: 0.8rem;
}

.app-topbar-search input::placeholder {
    color: #626875;
}

.app-topbar-search kbd {
    flex: none;
    padding: 2px 5px;
    border: 1px solid var(--app-border);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--app-muted);
    font-family: var(--mono);
    font-size: 0.58rem;
}

.app-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--app-border);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--app-muted);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.16s ease, border-color 0.16s ease;
}

.app-icon-btn:hover {
    border-color: var(--app-border-strong);
    color: var(--app-text);
}

.app-avatar {
    display: inline-flex;
    padding: 2px;
    border: 1px solid var(--app-border);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
}

.app-avatar .avatar {
    width: 30px;
    height: 30px;
}

/* Main -------------------------------------------------------------------- */
.app-main {
    flex: 1;
    width: min(1240px, 100%);
    margin: 0 auto;
    padding: 30px 28px 50px;
}

.app-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: min(1240px, 100%);
    margin: 0 auto;
    padding: 0 28px 24px;
    color: var(--app-muted);
    font-size: 0.68rem;
}

/* Overview ---------------------------------------------------------------- */
.app-overview {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    gap: 20px;
    align-items: stretch;
    margin-bottom: 20px;
}

.app-overview-copy {
    padding: 28px;
    border: 1px solid var(--app-border);
    border-radius: 18px;
    background:
        radial-gradient(700px 300px at 0% 0%, rgba(124, 92, 255, 0.16), transparent 60%),
        var(--app-panel);
}

.app-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--app-purple-2);
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.app-overview h1 {
    margin: 12px 0 8px;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.045em;
    line-height: 1.05;
}

.app-overview-copy p {
    max-width: 620px;
    margin-bottom: 0;
    color: var(--app-muted);
    font-size: 0.92rem;
}

.app-overview-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin-top: 22px;
}

.app-id-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--app-muted);
    font: inherit;
    cursor: pointer;
    transition: color 0.16s ease, border-color 0.16s ease;
}

.app-id-chip:hover {
    border-color: var(--app-border-strong);
    color: var(--app-text);
}

.app-id-chip.copied {
    border-color: rgba(34, 197, 94, 0.35);
    color: #4ade80;
}

.app-id-chip .mono {
    font-size: 0.68rem;
}

.app-overview-status {
    display: flex;
}

.app-status-card {
    width: 100%;
    padding: 22px;
    border: 1px solid var(--app-border);
    border-radius: 18px;
    background: var(--app-panel);
}

.app-status-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--app-border);
}

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

.app-status-list span {
    display: block;
    color: var(--app-muted);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-status-list strong {
    display: block;
    margin-top: 3px;
    font-size: 1.02rem;
    letter-spacing: -0.02em;
}

/* Stat cards -------------------------------------------------------------- */
.app-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 26px;
}

.app-stat-card {
    padding: 18px;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    background: var(--app-panel);
}

.app-stat-card span {
    display: block;
    color: var(--app-muted);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-stat-card strong {
    display: block;
    margin-top: 6px;
    font-size: 1.45rem;
    letter-spacing: -0.03em;
}

.app-stat-card small {
    display: block;
    margin-top: 2px;
    color: var(--app-muted);
    font-size: 0.66rem;
}

/* Sections ---------------------------------------------------------------- */
.app-section {
    margin-top: 30px;
    scroll-margin-top: 92px;
}

.app-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.app-section-head h2 {
    margin: 5px 0 0;
    font-size: 1.35rem;
    letter-spacing: -0.03em;
}

.app-section-head p {
    margin: 4px 0 0;
    color: var(--app-muted);
    font-size: 0.82rem;
}

/* Module cards ------------------------------------------------------------ */
.app-module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.app-module-card {
    display: flex;
    flex-direction: column;
    padding: 18px;
    border: 1px solid var(--app-border);
    border-radius: 16px;
    background: var(--app-panel);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.app-module-card:hover {
    transform: translateY(-2px);
    border-color: rgba(124, 92, 255, 0.28);
    background: var(--app-panel-2);
}

.app-module-head {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--app-border);
}

a.app-module-head-link {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.18s ease;
}

a.app-module-head-link:hover {
    opacity: 0.82;
}

a.app-module-head-link:hover h3 {
    color: #a78bfa;
}

a.app-module-card-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

a.app-module-card-link:hover {
    transform: translateY(-2px);
    border-color: rgba(167, 139, 250, 0.4);
}

a.app-module-card-link .app-module-head {
    border-bottom: none;
    padding-bottom: 0;
}

.app-module-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: none;
    border: 1px solid;
    border-radius: 10px;
}

.app-module-icon-red {
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.app-module-icon-blue {
    border-color: rgba(59, 130, 246, 0.25);
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}

.app-module-icon-purple {
    border-color: rgba(124, 92, 255, 0.3);
    background: rgba(124, 92, 255, 0.12);
    color: #a78bfa;
}

.app-module-icon-cyan {
    border-color: rgba(34, 211, 238, 0.25);
    background: rgba(34, 211, 238, 0.1);
    color: #67e8f9;
}

.app-module-icon-green {
    border-color: rgba(34, 197, 94, 0.25);
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
}

.app-module-icon-amber {
    border-color: rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

.app-module-head > div {
    flex: 1;
    min-width: 0;
}

.app-module-head h3 {
    margin: 0;
    font-size: 0.95rem;
    letter-spacing: -0.015em;
}

.app-module-head p {
    margin: 2px 0 0;
    color: var(--app-muted);
    font-size: 0.71rem;
}

.app-module-badge {
    flex: none;
    padding: 3px 7px;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--app-muted);
    font-size: 0.61rem;
    font-weight: 700;
    white-space: nowrap;
}

.app-module-badge.is-active {
    border-color: rgba(34, 197, 94, 0.2);
    background: rgba(34, 197, 94, 0.08);
    color: #4ade80;
}

.app-module-rows {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 10px;
}

.app-module-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-radius: 7px;
    color: inherit;
    text-decoration: none;
}

.app-module-row + .app-module-row {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.app-module-row > div {
    flex: 1;
    min-width: 0;
}

.app-module-row strong {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
}

.app-module-row span {
    display: block;
    overflow: hidden;
    color: var(--app-muted);
    font-size: 0.67rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-module-row svg {
    flex: none;
    width: 14px;
    height: 14px;
    color: #4b5260;
}

.app-module-row:hover svg {
    color: var(--app-purple-2);
}

.app-module-row-button {
    width: 100%;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.app-module-row-button + .app-module-row {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* Settings inside app shell ---------------------------------------------- */
.app-main .settings-card {
    margin-top: 14px;
    scroll-margin-top: 92px;
}

.app-main .settings-card:first-of-type {
    margin-top: 0;
}

.app-settings-section .alert:first-of-type {
    margin-top: 0;
}

/* Guild selection --------------------------------------------------------- */
.app-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.app-page-head h1 {
    margin: 6px 0;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    letter-spacing: -0.04em;
    line-height: 1.08;
}

.app-page-head p {
    max-width: 660px;
    margin: 0;
    color: var(--app-muted);
}

.app-guild-grid {
    gap: 14px;
}

/* Responsive -------------------------------------------------------------- */
@media (max-width: 1180px) {
    .app-module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (min-width: 1181px) and (max-width: 1279px) {
    .app-module-head {
        min-height: 80px;
    }
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    body.app-sidebar-open {
        overflow: hidden;
    }

    .app-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 280px;
        max-width: 86vw;
        transform: translateX(-100%);
        transition: transform 0.24s ease;
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .app-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 55;
        background: rgba(0, 0, 0, 0.6);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.24s ease;
    }

    .app-backdrop.open {
        opacity: 1;
        pointer-events: auto;
    }

    .app-menu-btn {
        display: inline-grid;
    }

    .app-overview {
        grid-template-columns: 1fr;
    }

    .app-topbar {
        padding: 0 16px;
    }

    .app-main {
        padding: 22px 16px 40px;
    }

    .app-footer {
        padding: 0 16px 20px;
    }
}

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

    .app-module-grid {
        grid-template-columns: 1fr;
    }

    .app-status-list {
        grid-template-columns: 1fr;
    }

    .app-overview-copy {
        padding: 22px;
    }

    .app-overview h1 {
        font-size: 2rem;
    }
}

@media (max-width: 520px) {
    .app-stat-grid {
        grid-template-columns: 1fr;
    }

    .app-breadcrumb {
        max-width: 170px;
    }

    .app-overview-actions .btn,
    .app-id-chip {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ===== Modern global scrollbar ===== */
html {
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.45) transparent;
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.45) transparent;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.38);
    border-radius: 999px;
    border: 1px solid transparent;
    background-clip: padding-box;
    transition: background 0.18s ease;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(167, 139, 250, 0.72);
}

*::-webkit-scrollbar-thumb:active {
    background: rgba(167, 139, 250, 0.9);
}

*::-webkit-scrollbar-corner {
    background: transparent;
}
