/* ── Frontline Roleplay Portal — Polished Theme ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --red: #ef4444;
    --red-soft: #f87171;
    --purple: #a855f7;
    --purple-soft: #c084fc;
    --blue: #3b82f6;
    --blue-soft: #60a5fa;
    --blue-deep: #2563eb;

    --bg: #06060b;
    --bg-elevated: #0d0d14;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.055);
    --bg-sidebar: #08080f;
    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.12);

    --text: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --green: #22c55e;
    --yellow: #eab308;

    --radius: 12px;
    --radius-lg: 16px;
    --radius-sm: 8px;
    --sidebar-w: 252px;
    --font: 'Inter', system-ui, -apple-system, sans-serif;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 24px rgba(0,0,0,0.35);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.45);
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: rgba(59, 130, 246, 0.35);
    color: #fff;
}

a { color: var(--blue-soft); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: #93c5fd; }

/* ── Background texture ── */
.bg-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 20%, transparent 70%);
}

.bg-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-glow::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
}

.bg-glow::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    bottom: -100px;
    right: -100px;
    background: radial-gradient(circle, rgba(168,85,247,0.06) 0%, transparent 70%);
}

/* ── Logo ── */
.logo {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: inherit;
}

.logo-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-icon img,
.logo-icon svg { width: 100%; height: 100%; display: block; }

.logo-text strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}

.logo-text span {
    display: block;
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s var(--ease);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-primary:hover {
    background: var(--blue-deep);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(59,130,246,0.35);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-card-hover);
    color: var(--text);
    border-color: var(--border-hover);
}

.btn-discord {
    background: #5865F2;
    color: #fff;
}

.btn-discord:hover {
    background: #4752c4;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(88, 101, 242, 0.35);
}

.btn-sm { padding: 0.5rem 0.85rem; font-size: 0.75rem; }

/* ── Landing ── */
.landing {
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

.landing-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    max-width: 1080px;
    width: 100%;
    margin: 0 auto;
}

.landing-nav { display: flex; gap: 1.75rem; }
.landing-nav a {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
}
.landing-nav a:hover { color: var(--text); }

.landing-hero {
    position: relative;
    z-index: 2;
    flex: 1;
    max-width: 1080px;
    width: 100%;
    margin: 0 auto;
    padding: 4rem 2rem 3rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.staff-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
    backdrop-filter: blur(8px);
}

.staff-pill .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.staff-pill.online .dot {
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.landing-hero h1 {
    font-size: clamp(2.25rem, 5.5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    letter-spacing: -0.03em;
    max-width: 640px;
}

.landing-hero h1 .accent {
    color: var(--blue-soft);
}

.landing-hero .subtitle {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto 2.5rem;
    line-height: 1.65;
    font-weight: 400;
}

.signin-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem 1rem 1rem 1.25rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 3.5rem;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
    max-width: 520px;
    width: 100%;
}

.signin-card .avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, var(--blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.1);
}

.signin-card .signin-text {
    flex: 1;
    text-align: left;
    font-size: 0.8125rem;
    color: var(--text-muted);
    min-width: 0;
}

.signin-card .signin-text strong {
    display: block;
    color: var(--text);
    font-weight: 600;
    font-size: 0.875rem;
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    width: 100%;
    max-width: 900px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    text-align: left;
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.feature-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.feature-card .icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.85rem;
}

.feature-card .icon-wrap svg { width: 18px; height: 18px; }

.feature-card .icon-wrap.blue { background: rgba(59,130,246,0.12); color: var(--blue-soft); }
.feature-card .icon-wrap.purple { background: rgba(168,85,247,0.12); color: var(--purple-soft); }
.feature-card .icon-wrap.green { background: rgba(34,197,94,0.1); color: var(--green); }
.feature-card .icon-wrap.yellow { background: rgba(234,179,8,0.1); color: var(--yellow); }
.feature-card .icon-wrap.red { background: rgba(239,68,68,0.1); color: var(--red-soft); }

.feature-card h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    letter-spacing: -0.01em;
}

.feature-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.landing-footer {
    position: relative;
    z-index: 2;
    max-width: 1080px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.landing-footer nav { display: flex; gap: 1.5rem; }
.landing-footer nav a { color: var(--text-muted); }
.landing-footer nav a:hover { color: var(--text-secondary); }

/* ── Portal ── */
.portal { display: flex; min-height: 100vh; position: relative; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    padding: 1.25rem 0.75rem;
    transition: transform 0.25s var(--ease);
}

.sidebar .logo { padding: 0 0.5rem; margin-bottom: 0.85rem; }

.staff-status {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
}

.staff-status .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-muted);
}

.staff-status.online .dot {
    background: var(--green);
    box-shadow: 0 0 0 2px rgba(34,197,94,0.25);
}
.staff-status.online { color: var(--green); }

.nav-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0 0.65rem;
    margin-bottom: 0.4rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.12s var(--ease);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.65; }

.nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text);
}

.nav-item:hover svg { opacity: 0.9; }

.nav-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue-soft);
}

.nav-item.active svg { opacity: 1; }

a.nav-item.nav-link {
    text-decoration: none;
    color: inherit;
}

.sidebar-footer {
    margin-top: auto;
    padding: 0.75rem 0.5rem 0;
    border-top: 1px solid var(--border);
}

.sidebar-footer a {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.35rem 0;
    display: block;
}
.sidebar-footer a:hover { color: var(--text-secondary); }

.staff-nav-section {
    margin-top: 1.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.nav-item {
    position: relative;
}

.nav-badge {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--red, #ef4444);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.main {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem 2rem;
    gap: 0.6rem;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.3rem 0.75rem 0.3rem 0.35rem;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.user-chip .avatar-sm {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, var(--blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
}

.role-badge {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
}

.role-badge.role-owner {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.role-badge.role-management {
    background: rgba(168, 85, 247, 0.12);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.25);
}

.role-badge.role-admin {
    background: rgba(59, 130, 246, 0.15);
    color: var(--blue-soft);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.role-badge.role-moderator {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.role-badge.role-staff {
    background: rgba(59, 130, 246, 0.15);
    color: var(--blue-soft);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.role-badge.role-member {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s var(--ease);
}

.icon-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text);
    border-color: var(--border-hover);
}

.icon-btn svg { width: 17px; height: 17px; }

.content {
    flex: 1;
    padding: 0 2rem 3rem;
    max-width: 880px;
}

.view {
    display: none;
    animation: fadeIn 0.25s var(--ease);
}

.view.active { display: block; }

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

.page-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.2rem;
}

.page-header .desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ── Dashboard ── */
.greeting h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.3rem;
}

.greeting h1 .name { color: var(--blue-soft); }

.greeting p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.action-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.15rem;
    cursor: pointer;
    transition: all 0.15s var(--ease);
    text-align: left;
    font-family: inherit;
    color: inherit;
    width: 100%;
}

.action-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.action-card .card-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.7rem;
    color: var(--blue-soft);
}

.action-card .card-icon svg { width: 16px; height: 16px; }

.action-card h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    letter-spacing: -0.01em;
}

.action-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
}

.stat-card .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.stat-card .value {
    font-size: 1.375rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.stat-card .value.blue { color: var(--blue-soft); }
.stat-card .value.yellow { color: var(--yellow); }

.recent-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.recent-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
}

.recent-card .recent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
}

.recent-card .recent-header h3 {
    font-size: 0.8125rem;
    font-weight: 600;
}

.recent-card .recent-header a { font-size: 0.7rem; font-weight: 500; }

.recent-empty {
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding: 0.75rem 0;
}

.recent-item {
    font-size: 0.8125rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.recent-item:last-child { border-bottom: none; }

.recent-item strong {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-item .status-text {
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ── Tables ── */
.table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

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

thead th {
    text-align: left;
    padding: 0.7rem 1rem;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
}

tbody td {
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--border);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,0.02); }

.table-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.table-empty-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(59,130,246,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.table-empty-icon svg { width: 20px; height: 20px; }

.table-empty a { font-weight: 600; color: var(--blue-soft); }

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-open { background: rgba(59,130,246,0.12); color: var(--blue-soft); }
.badge-pending { background: rgba(234,179,8,0.1); color: var(--yellow); }
.badge-closed { background: rgba(255,255,255,0.06); color: var(--text-secondary); }
.badge-approved { background: rgba(34,197,94,0.1); color: var(--green); }
.badge-denied { background: rgba(239,68,68,0.1); color: var(--red-soft); }

.priority-high { color: var(--red-soft); font-weight: 500; }
.priority-medium { color: var(--yellow); font-weight: 500; }
.priority-low { color: var(--text-muted); }

/* ── Application Cards ── */
.app-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
}

.app-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    cursor: pointer;
    transition: all 0.15s var(--ease);
    text-align: left;
    font-family: inherit;
    color: inherit;
    width: 100%;
}

.app-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.app-card .app-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.7rem;
}

.app-card .app-icon svg { width: 17px; height: 17px; }

.app-card .app-icon.green { background: rgba(34,197,94,0.1); color: var(--green); }
.app-card .app-icon.blue { background: rgba(59,130,246,0.1); color: var(--blue-soft); }
.app-card .app-icon.yellow { background: rgba(234,179,8,0.1); color: var(--yellow); }
.app-card .app-icon.purple { background: rgba(168,85,247,0.1); color: var(--purple-soft); }

.app-card h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    letter-spacing: -0.01em;
}

.app-card p { font-size: 0.75rem; color: var(--text-muted); line-height: 1.45; }

/* ── Rules ── */
.rules-hero {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
}

.rules-hero-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.rules-hero-intro {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 52rem;
    margin-bottom: 1rem;
}

.rules-hero-intro strong {
    color: var(--text);
}

.rules-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.rules-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.rules-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rules-badge-purple .rules-badge-dot { background: var(--purple-soft); }
.rules-badge-green .rules-badge-dot { background: var(--green); }
.rules-badge-yellow .rules-badge-dot { background: var(--yellow); }
.rules-badge-red .rules-badge-dot { background: var(--red); }

.rules-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1rem;
    align-items: start;
}

.rules-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.1rem;
}

.rules-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.rules-panel-head h3 {
    font-size: 0.95rem;
    font-weight: 700;
}

.rules-tip {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.rules-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rules-section {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

.rules-section-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.rules-section-head::-webkit-details-marker { display: none; }

.rules-section-icon {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.rules-icon-red { background: #ef4444; }
.rules-icon-orange { background: #f97316; }
.rules-icon-blue { background: #3b82f6; }
.rules-icon-green { background: #22c55e; }
.rules-icon-purple { background: #a855f7; }
.rules-icon-yellow { background: #eab308; }
.rules-icon-brown { background: #a16207; }

.rules-section-titles {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.rules-section-titles strong {
    font-size: 0.88rem;
}

.rules-section-titles span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.rules-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform 0.15s;
    flex-shrink: 0;
    margin-top: -3px;
}

.rules-section[open] .rules-chevron {
    transform: rotate(-135deg);
    margin-top: 3px;
}

.rules-section-body {
    padding: 0 1rem 1rem 2.6rem;
    border-top: 1px solid var(--border);
}

.rules-section-body ul {
    margin: 0.75rem 0 0;
    padding-left: 1.1rem;
}

.rules-section-body li {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 0.55rem;
}

.rules-section-body li strong {
    color: var(--text);
    font-weight: 600;
}

.rules-highlight {
    margin-top: 0.85rem;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(234, 179, 8, 0.35);
    background: rgba(234, 179, 8, 0.08);
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.rules-highlight strong {
    color: var(--yellow);
}

.rules-zero li strong {
    color: #fca5a5;
}

.rules-community {
    margin-top: 1rem;
}

.rules-community-intro {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.rules-community-list {
    margin: 0;
    padding-left: 1.1rem;
}

.rules-community-list li {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 0.5rem;
}

.rules-quick-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem;
    margin-bottom: 0.55rem;
    background: rgba(255, 255, 255, 0.02);
}

.rules-quick-card:last-child {
    margin-bottom: 0;
}

.rules-quick-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.rules-quick-title strong {
    font-size: 0.82rem;
}

.rules-quick-card p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.rules-quick-yellow { border-color: rgba(234, 179, 8, 0.25); }
.rules-quick-green { border-color: rgba(34, 197, 94, 0.25); }
.rules-quick-red { border-color: rgba(239, 68, 68, 0.25); }
.rules-quick-purple { border-color: rgba(168, 85, 247, 0.25); }

.rules-footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1.25rem;
}

.rules-category { margin-bottom: 1.5rem; }

.rules-category h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--blue-soft);
    margin-bottom: 0.55rem;
    letter-spacing: -0.01em;
}

.rules-category h2::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 2px;
    background: var(--blue);
}

.rule-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin-bottom: 0.45rem;
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    transition: border-color 0.12s;
}

.rule-item:hover { border-color: var(--border-hover); }

.rule-num {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 1.4rem;
    padding-top: 0.15rem;
    font-variant-numeric: tabular-nums;
}

.rule-item h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
    letter-spacing: -0.01em;
}

.rule-item p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

@media (max-width: 900px) {
    .rules-layout {
        grid-template-columns: 1fr;
    }

    .rules-sidebar {
        order: -1;
    }
}

/* ── Chat Widget ── */
.chat-widget {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.6rem 1rem 0.6rem 0.85rem;
    background: var(--blue);
    border: none;
    border-radius: 999px;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    transition: all 0.15s var(--ease);
}

.chat-widget svg { width: 16px; height: 16px; }

.chat-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(59, 130, 246, 0.45);
    background: var(--blue-deep);
}

.chat-widget .chat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
}

.chat-widget.online .chat-dot { background: var(--green); }

.chat-widget .chat-status {
    font-size: 0.65rem;
    opacity: 0.8;
    font-weight: 500;
}

.chat-widget.panel-open {
    opacity: 0;
    pointer-events: none;
}

/* ── Live Chat Panel ── */
.live-chat-panel {
    position: fixed;
    bottom: 5rem;
    right: 1.25rem;
    z-index: 250;
    width: min(360px, calc(100vw - 2rem));
    max-height: min(520px, calc(100vh - 7rem));
    background: var(--bg-elevated);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.live-chat-panel[hidden] { display: none !important; }

.live-chat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.live-chat-header strong {
    display: block;
    font-size: 0.875rem;
}

.live-chat-sub {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.live-chat-close {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
}

.live-chat-close:hover {
    background: var(--bg-card-hover);
    color: var(--text);
}

.live-chat-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    padding: 1rem;
}

.live-chat-body[hidden] { display: none !important; }

.live-chat-intro {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.85rem;
}

.live-chat-status {
    font-size: 0.75rem;
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.65rem;
    line-height: 1.45;
}

.live-chat-status.waiting {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.25);
    color: #fbbf24;
}

.live-chat-status.active {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: var(--green);
}

.live-chat-status.closed {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.live-chat-messages {
    flex: 1;
    overflow-y: auto;
    min-height: 180px;
    max-height: 280px;
    margin-bottom: 0.65rem;
}

.live-chat-system {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0.35rem 0.5rem;
    margin: 0.35rem 0;
}

.live-chat-input-row {
    display: flex;
    gap: 0.5rem;
}

.live-chat-input-row input {
    flex: 1;
    min-width: 0;
}

.live-chat-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.65rem;
    flex-wrap: wrap;
}

.live-chat-queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.live-chat-queue-item:last-child { border-bottom: none; }

.live-chat-queue-item strong {
    display: block;
    font-size: 0.8125rem;
    margin-bottom: 0.15rem;
}

.live-chat-queue-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.staff-account-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.staff-accounts-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.staff-account-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.staff-account-item strong {
    display: block;
    font-size: 0.8125rem;
}

.staff-account-info {
    min-width: 0;
}

.staff-account-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.staff-account-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 640px) {
    .staff-account-form .form-row {
        grid-template-columns: 1fr;
    }
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s var(--ease);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    transform: translateY(8px) scale(0.98);
    transition: transform 0.2s var(--ease);
    position: relative;
    overflow: hidden;
}

.modal::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--red), var(--purple), var(--blue));
}

.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
}

.modal h2 {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.2rem;
}

.modal .modal-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.form-group { margin-bottom: 0.9rem; }

.form-group label {
    display: block;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.8125rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }

.form-group textarea { resize: vertical; min-height: 96px; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 5rem;
    right: 1.25rem;
    z-index: 400;
    padding: 0.75rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text);
    box-shadow: var(--shadow-lg);
    transform: translateY(12px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s var(--ease);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success { border-left: 3px solid var(--green); }

/* ── Mobile ── */
.menu-toggle {
    display: none;
    position: fixed;
    top: 0.85rem;
    left: 0.85rem;
    z-index: 150;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

@media (max-width: 900px) {
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop.show { display: block; }

    .main { margin-left: 0; }
    .menu-toggle { display: flex; }

    .content { padding: 0 1.25rem 2.5rem; padding-top: 3.25rem; }

    .action-grid,
    .app-grid,
    .recent-grid,
    .stats-row { grid-template-columns: 1fr; }

    .landing-header { padding: 1rem 1.25rem; }
    .landing-hero { padding: 2.5rem 1.25rem 2rem; }

    .signin-card {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem;
    }

    .signin-card .signin-text { text-align: center; }
    .signin-card .btn { width: 100%; }

    .landing-nav { display: none; }
    .feature-grid { grid-template-columns: 1fr; }

    .page-header { flex-direction: column; }
    .user-chip { display: none; }
}

/* ── Auth page ── */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    position: relative;
    z-index: 1;
}

.auth-logo { margin-bottom: 2rem; }

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.auth-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 0.25rem;
}

.auth-tab {
    flex: 1;
    padding: 0.5rem;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.auth-tab.active {
    background: var(--bg-elevated);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.auth-form h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.auth-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.auth-submit { width: 100%; margin-top: 0.5rem; }

.auth-error {
    color: var(--red-soft);
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
    min-height: 1.2em;
}

.auth-footer {
    margin-top: 1.5rem;
    font-size: 0.8125rem;
}

.auth-footer a { color: var(--text-muted); }

.hidden { display: none !important; }

/* ── Ticket thread ── */
.clickable-row { cursor: pointer; }

.ticket-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ticket-meta { display: flex; align-items: center; gap: 0.5rem; }

.ticket-id {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ticket-title {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.ticket-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.ticket-status-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.ticket-status-controls label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.ticket-status-controls select {
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.8125rem;
}

.thread {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.thread-msg {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.thread-msg.staff {
    border-color: rgba(59, 130, 246, 0.25);
    background: rgba(59, 130, 246, 0.06);
}

.thread-msg-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    font-size: 0.8125rem;
}

.thread-msg-header strong { font-weight: 600; }

.staff-tag {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.15);
    color: var(--blue-soft);
}

.thread-time {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.thread-msg-body {
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

.reply-form {
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.ticket-closed-note {
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.staff-chat-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    min-height: 420px;
    max-height: calc(100vh - 220px);
}

.staff-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 280px;
}

.staff-chat-form {
    display: flex;
    gap: 0.65rem;
    align-items: flex-end;
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--border);
}

.staff-chat-form textarea {
    flex: 1;
    resize: none;
    min-height: 44px;
}

.staff-mention-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border);
    background: rgba(59, 130, 246, 0.04);
}

.staff-mention-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.staff-mention-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.mention-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--blue-soft);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.mention-chip img {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.mention-chip:hover {
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.08);
}

.mention {
    color: var(--blue-soft);
    font-weight: 600;
    background: rgba(59, 130, 246, 0.12);
    padding: 0 0.2rem;
    border-radius: 3px;
}

.ticket-conclude-box {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.05);
}

.ticket-conclude-box h3 {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.ticket-conclude-box .desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
}

.ticket-conclude-box textarea {
    width: 100%;
    margin-bottom: 0.65rem;
    min-height: 72px;
}

.ticket-delete-box {
    margin: 0 0 1rem;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: var(--red-soft);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.65rem;
    color: var(--text-secondary);
}

.app-list-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    margin-bottom: 0.5rem;
}

.app-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.app-list-meta {
    display: flex;
    gap: 0.65rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.app-list-details {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.app-list-actions { margin-top: 0.65rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.btn-danger-text {
    color: var(--red);
}

.btn-danger-text:hover {
    color: #fff;
    background: rgba(239, 68, 68, 0.15);
}

.inline-select {
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.75rem;
}

.stat-staff { border-color: rgba(59, 130, 246, 0.2); }

.recent-list .recent-item {
    display: flex;
    text-decoration: none;
    color: inherit;
}

.recent-list a.recent-item:hover strong { color: var(--blue-soft); }

/* ── Discord auth ── */
.btn-discord {
    background: #5865F2;
    color: #fff;
    gap: 0.6rem;
}

.btn-discord:hover {
    background: #4752c4;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(88, 101, 242, 0.35);
}

.discord-avatar-placeholder {
    background: rgba(88, 101, 242, 0.2) !important;
    color: #5865F2;
}

.staff-login {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.staff-login summary {
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.staff-login summary:hover { color: var(--text-secondary); }

.server-warning {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
    text-align: left;
}

.server-warning strong { color: var(--yellow); }

.server-warning code {
    background: var(--bg-card);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.server-warning a { color: var(--blue-soft); }

.auth-not-configured {
    font-size: 0.8125rem;
    color: var(--yellow);
    text-align: center;
    margin-top: 0.75rem;
}

    font-size: 0.8125rem;
    color: var(--yellow);
    text-align: center;
    margin-top: 0.75rem;
}

.avatar-img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.1);
}

.signin-card .avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.1);
}

.thread-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.discord-handle {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ── Shop ── */
.feature-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.landing-nav .active-nav {
    color: var(--text);
}

.shop-page .shop-hero {
    text-align: center;
    padding: 2rem 1.5rem 1rem;
    max-width: 720px;
    margin: 0 auto;
}

.shop-page .shop-hero h1 {
    font-size: clamp(2rem, 5vw, 2.75rem);
    margin: 0.35rem 0 0.75rem;
}

.shop-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

.shop-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.25rem;
}

.shop-filter {
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.shop-filter:hover,
.shop-filter.active {
    border-color: rgba(59, 130, 246, 0.45);
    color: var(--text);
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.shop-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s, transform 0.15s;
}

.shop-card:hover {
    border-color: rgba(59, 130, 246, 0.35);
    transform: translateY(-2px);
}

.shop-card-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.03);
}

.shop-card-placeholder {
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
}

.shop-card-placeholder svg {
    width: 36px;
    height: 36px;
    opacity: 0.45;
}

.shop-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.35rem;
}

.shop-card-category {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--blue-soft);
}

.shop-card h3 {
    font-size: 1rem;
    margin: 0;
}

.shop-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    flex: 1;
    margin: 0;
}

.shop-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.shop-price {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--green);
}

.shop-buy-soon {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.shop-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.shop-empty .btn {
    margin-top: 1rem;
}

.page-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.modal-wide {
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
}

.app-form-fields {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.5rem;
}

.app-form-fields .form-group textarea {
    min-height: 4.5rem;
}

.app-form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0.75rem 0 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1.4;
}

.app-form-check input {
    margin-top: 0.2rem;
    accent-color: var(--blue);
    flex-shrink: 0;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.app-list-item.clickable {
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.app-list-item.clickable:hover {
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(255, 255, 255, 0.02);
}

.open-thread-hint {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--blue);
    opacity: 0.85;
}

.shop-settings-card {
    margin-bottom: 1.5rem;
}

.shop-settings-form .shop-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
}

.shop-toggle input {
    accent-color: var(--blue);
}

.shop-admin-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.shop-admin-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.shop-admin-item.inactive {
    opacity: 0.55;
}

.shop-admin-thumb {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shop-admin-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-admin-no-img {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.shop-admin-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.shop-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

@media (max-width: 768px) {
    .shop-admin-item {
        flex-wrap: wrap;
    }

    .shop-admin-actions {
        width: 100%;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

.staff-hierarchy {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.hierarchy-tier {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.hierarchy-tier strong {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
}

.hierarchy-tier p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.hierarchy-management { border-color: rgba(168, 85, 247, 0.25); }
.hierarchy-admin { border-color: rgba(59, 130, 246, 0.25); }
.hierarchy-moderator { border-color: rgba(34, 197, 94, 0.2); }

.management-chat-panel {
    border-color: rgba(168, 85, 247, 0.2);
}

.staff-tag-moderator { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.staff-tag-admin { background: rgba(59, 130, 246, 0.15); color: var(--blue-soft); }
.staff-tag-management { background: rgba(168, 85, 247, 0.15); color: #d8b4fe; }
.staff-tag-owner { background: rgba(168, 85, 247, 0.2); color: #e9d5ff; }

