/* ─── Reset & Variables ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:           #0b0b0b;
    --surface:      #161616;
    --surface-2:    #1e1e1e;
    --surface-3:    #272727;
    --border:       #2c2c2c;
    --border-hover: #3d3d3d;
    --text:         #e8e8e8;
    --text-muted:   #6e6e6e;
    --text-dim:     #484848;
    --accent:       #c0392b;
    --accent-hover: #e74c3c;
    --accent-dim:   rgba(192,57,43,0.12);
    --green:        #2ecc71;
    --green-dim:    rgba(46,204,113,0.12);
    --yellow:       #f39c12;
    --yellow-dim:   rgba(243,156,18,0.12);
    --blue:         #3498db;
    --blue-dim:     rgba(52,152,219,0.12);
    --gray-dim:     rgba(120,120,120,0.12);
    --note-bg:      rgba(243,156,18,0.06);
    --note-border:  rgba(243,156,18,0.35);
    --note-text:    #c89b3c;
    --radius:       7px;
    --radius-lg:    12px;
    --shadow-sm:    0 1px 4px rgba(0,0,0,0.5);
    --shadow:       0 4px 20px rgba(0,0,0,0.6);
    --shadow-lg:    0 8px 40px rgba(0,0,0,0.7);
    --transition:   0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --font:         'Inter', system-ui, -apple-system, sans-serif;
    --font-mono:    'JetBrains Mono', 'Fira Code', monospace;
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}


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

.page-wrap {
    animation: fadeUp 0.28s var(--transition) both;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ─── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
    background: rgba(22, 22, 22, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255,255,255,0.055);
    padding: 0 2rem;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 0 rgba(255,255,255,0.03), 0 4px 24px rgba(0,0,0,0.6);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-img {
    height: 38px;
    width: 38px;
    object-fit: contain;
    border-radius: 6px;
    background: #000;
    border: 1px solid var(--border);
    padding: 2px;
}

.brand-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 500;
}

.topbar-brand-text {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.02em;
}

.topbar-brand-text span {
    color: var(--accent);
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color var(--transition), background var(--transition);
}

.nav-link:hover {
    color: var(--text);
    background: var(--surface-2);
    text-decoration: none;
}

.nav-link.active {
    color: var(--text);
    background: var(--surface-3);
}

.nav-link.admin-link {
    color: var(--accent);
    border: 1px solid rgba(192,57,43,0.3);
}

.nav-link.admin-link:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-user-link {
    text-decoration: none;
    border-radius: var(--radius);
    padding: 4px 8px 4px 4px;
    border: 1px solid transparent;
    transition: background var(--transition), border-color var(--transition);
}

.topbar-user-link:hover {
    background: var(--surface-2);
    border-color: var(--border);
    text-decoration: none;
}

.topbar-user-link:hover .user-name {
    color: var(--text);
}

.user-name {
    font-size: 0.875rem;
    color: var(--text-muted);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color var(--transition);
}

/* ─── Layout ──────────────────────────────────────────────────────────────── */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.page-wrap {
    flex: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    animation: fadeUp 0.28s var(--transition) both;
}

.page-wrap.wide {
    max-width: 1300px;
}

/* ─── Avatars ─────────────────────────────────────────────────────────────── */
.nav-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.nav-avatar:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(192,57,43,0.2);
}

.nav-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.msg-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition),
                color var(--transition), box-shadow var(--transition),
                transform var(--transition), opacity var(--transition);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}

.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px) !important; }

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 2px 10px rgba(192,57,43,0.3);
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
    box-shadow: 0 4px 16px rgba(231,76,60,0.45);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover {
    background: var(--surface-3);
    border-color: var(--border-hover);
    color: var(--text);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
}
.btn-ghost:hover {
    background: var(--surface-2);
    border-color: var(--border-hover);
    color: var(--text);
    transform: translateY(-1px);
}

.btn-danger {
    background: transparent;
    color: #ef4444;
    border-color: rgba(239,68,68,0.3);
}
.btn-danger:hover {
    background: rgba(239,68,68,0.08);
    border-color: rgba(239,68,68,0.6);
    color: #ef4444;
    transform: translateY(-1px);
}

.btn-steam {
    background: #1b2838;
    color: #c7d5e0;
    border-color: #2a475e;
    font-size: 0.95rem;
    padding: 10px 24px;
}
.btn-steam:hover {
    background: #2a475e;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }

/* ─── Cards ───────────────────────────────────────────────────────────────── */
.card {
    background: linear-gradient(160deg, var(--surface-2) 0%, var(--surface) 60%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

/* ─── Status Badges ───────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-open        { background: var(--green-dim); color: var(--green); }
.badge-inprogress  { background: var(--blue-dim);  color: var(--blue);  }
.badge-waitinguser { background: var(--yellow-dim); color: var(--yellow); }
.badge-closed        { background: var(--gray-dim);  color: var(--text-muted); }
.badge-closedbyuser  { background: var(--yellow-dim); color: var(--yellow); }

.badge-low     { background: var(--gray-dim);   color: var(--text-muted); }
.badge-normal  { background: var(--blue-dim);   color: var(--blue); }
.badge-high    { background: var(--yellow-dim); color: var(--yellow); }
.badge-urgent  { background: var(--accent-dim); color: var(--accent); }

.badge-general        { background: var(--gray-dim);   color: var(--text-muted); }
.badge-payment        { background: var(--green-dim);  color: var(--green); }
.badge-playerreport   { background: var(--yellow-dim); color: var(--yellow); }
.badge-banappeal      { background: var(--accent-dim); color: var(--accent); }

/* ─── Forms ───────────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 9px 13px;
    font-size: 0.9rem;
    font-family: var(--font);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    outline: none;
}

.form-control:hover:not(:focus) {
    border-color: var(--border-hover);
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(192,57,43,0.18);
    background: var(--surface-3);
}

.form-control::placeholder { color: var(--text-dim); }

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ─── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead th {
    background: var(--surface-2);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 16px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }

tbody td {
    padding: 12px 16px;
    color: var(--text);
    vertical-align: middle;
}

.table-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}
.table-link:hover { color: var(--accent); text-decoration: none; }

/* ─── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
    padding: 13px 16px;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    border-left: 3px solid;
    margin-bottom: 1rem;
    line-height: 1.55;
}

.alert-warning {
    background: var(--yellow-dim);
    border-color: var(--yellow);
    color: var(--yellow);
}

.alert-danger {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: #ef4444;
}

.alert-success {
    background: var(--green-dim);
    border-color: var(--green);
    color: var(--green);
}

.alert-info {
    background: var(--blue-dim);
    border-color: var(--blue);
    color: var(--blue);
}

/* ─── Page Headers ────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 2px;
}

/* ─── Server Hero ─────────────────────────────────────────────────────────── */
.server-hero {
    width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
    background: url('/images/kovex-banner.png') center center / 100% auto no-repeat;
    aspect-ratio: 955 / 457;
}

.server-hero-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.server-hero-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.server-hero-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.server-status-pip {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.server-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.server-info-card {
    background: linear-gradient(160deg, var(--surface-2) 0%, var(--surface) 70%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    text-align: center;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.server-info-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.server-info-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.server-info-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}

/* ─── Hero ────────────────────────────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 4rem 1rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.hero-title span {
    color: var(--accent);
}

.hero-sub {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 500px;
    margin: 0 auto 2.5rem;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ─── Feature Grid ────────────────────────────────────────────────────────── */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 3rem;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.feature-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.feature-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ─── Ticket Thread ───────────────────────────────────────────────────────── */
.ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.meta-item label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    margin-bottom: 3px;
}

.meta-item span {
    font-size: 0.875rem;
    color: var(--text);
    font-weight: 500;
}

.message-thread {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.message {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    transition: border-color var(--transition);
}

.message.admin-message {
    border-color: rgba(192,57,43,0.25);
    background: rgba(192,57,43,0.04);
}

.message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.message-author {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.message-author .admin-tag {
    font-size: 0.7rem;
    background: var(--accent-dim);
    color: var(--accent);
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 600;
}

/* ─── Staff Role Tags ─────────────────────────────────────────────────────── */
.role-tag {
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.role-tag-staff { background: var(--accent-dim);  color: var(--accent); }
.role-tag-trial       { background: var(--yellow-dim);           color: var(--yellow); }
.role-tag-admin       { background: var(--blue-dim);              color: var(--blue); }
.role-tag-management  { background: rgba(46,204,113,0.15);        color: #2ecc71; }
.role-tag-owner       { background: rgba(180,120,255,0.15);       color: #b478ff; }

.message-time {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.message-body {
    font-size: 0.9rem;
    color: var(--text);
    word-break: break-word;
}
.message-body p {
    margin: 0 0 0.6rem;
}
.message-body p:last-child {
    margin-bottom: 0;
}

.system-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 0;
    color: var(--text-dim);
    font-size: 0.78rem;
    font-style: italic;
    position: relative;
}
.system-message::before,
.system-message::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.system-message svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.resolve-hint {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 1rem;
    padding: 0.65rem 1rem;
    background: var(--blue-dim);
    border: 1px solid rgba(52,152,219,0.2);
    border-radius: var(--radius);
    font-size: 0.82rem;
    color: var(--text-muted);
}
.resolve-hint svg {
    flex-shrink: 0;
    color: var(--blue);
    opacity: 0.8;
}

.reply-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.reply-box h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Filters ─────────────────────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.filter-btn {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition),
                color var(--transition), box-shadow var(--transition);
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--text);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 10px rgba(192,57,43,0.3);
}

/* ─── Empty State ─────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-dim);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ─── Footer ──────────────────────────────────────────────────────────────── */
.footer {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 1.5rem 2rem;
    background: radial-gradient(ellipse 70% 200% at 50% 100%, rgba(192,57,43,0.13) 0%, transparent 70%);
    position: relative;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    max-width: 1300px;
    margin: 0 auto;
}

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

.footer-logo {
    height: 28px;
    width: 28px;
    object-fit: contain;
    border-radius: 4px;
    mix-blend-mode: screen;
    filter: brightness(1.1) saturate(1.2);
    opacity: 0.85;
}

.footer-brand-text {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.footer-brand-text span {
    color: var(--accent);
}

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-align: center;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-discord {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(88,101,242,0.12);
    border: 1px solid rgba(88,101,242,0.25);
    color: #7289da;
    border-radius: var(--radius);
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition),
                color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.footer-discord:hover {
    background: rgba(88,101,242,0.2);
    border-color: rgba(88,101,242,0.5);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(88,101,242,0.25);
}

@media (max-width: 600px) {
    .footer-inner { justify-content: center; }
    .footer-copy { order: 3; flex-basis: 100%; }
}

/* ─── Divider ─────────────────────────────────────────────────────────────── */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

/* ─── Admin Stats Row ─────────────────────────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background: linear-gradient(160deg, var(--surface-2) 0%, var(--surface) 70%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    text-align: center;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ─── Admin ticket detail sidebar ────────────────────────────────────────── */
.ticket-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 1.5rem;
    align-items: start;
}

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

.sidebar-card {
    background: linear-gradient(160deg, var(--surface-2) 0%, var(--surface) 70%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    position: sticky;
    top: 76px;
}

.sidebar-section {
    margin-bottom: 1.25rem;
}

.sidebar-section:last-child { margin-bottom: 0; }

.sidebar-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.sidebar-value {
    font-size: 0.875rem;
    color: var(--text);
    font-weight: 500;
}

/* ─── Linked Warning ──────────────────────────────────────────────────────── */
.link-warning {
    background: rgba(243,156,18,0.08);
    border: 1px solid rgba(243,156,18,0.3);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    max-width: 480px;
    margin: 3rem auto;
}

.link-warning-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.link-warning h2 {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.link-warning p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

/* ─── Hamburger Button ────────────────────────────────────────────────────── */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: transparent;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.hamburger:hover {
    background: var(--surface-2);
    border-color: var(--border);
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-muted);
    border-radius: 2px;
}

/* ─── Sidebar Overlay ─────────────────────────────────────────────────────── */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

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

/* ─── Nav Sidebar ─────────────────────────────────────────────────────────── */
.nav-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    background: #111111;
    border-right: 1px solid var(--border);
    z-index: 201;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 4px 0 32px rgba(0,0,0,0.5);
}

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

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.sidebar-close {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 6px 8px;
    border-radius: var(--radius);
    transition: background 0.15s, color 0.15s;
}

.sidebar-close:hover {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
}

.sidebar-nav {
    padding: 0.75rem 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-section-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-dim);
    padding: 10px 10px 4px;
    margin-top: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border-radius: var(--radius);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
    position: relative;
    border-left: 2px solid transparent;
}

.sidebar-link:hover {
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
}

.sidebar-link.active {
    background: var(--surface-3);
    color: var(--text);
    border-left-color: var(--accent);
}

.sidebar-link.admin-link {
    color: var(--accent);
}

.sidebar-link.admin-link:hover {
    background: var(--accent-dim);
    color: var(--accent-hover);
}

.sidebar-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.8;
}

.sidebar-badge {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-user {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ─── Discord Button ──────────────────────────────────────────────────────── */
.btn-discord {
    background: #5865f2;
    color: #fff;
    border-color: #5865f2;
}

.btn-discord:hover {
    background: #4752c4;
    border-color: #4752c4;
    color: #fff;
}

/* ─── Verify Steps ────────────────────────────────────────────────────────── */
.verify-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 560px;
    margin: 0 auto;
}

.verify-step {
    display: flex;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.verify-step.step-done {
    border-color: rgba(39, 174, 96, 0.3);
    background: rgba(39, 174, 96, 0.04);
}

.verify-step.step-active {
    border-color: rgba(41, 128, 185, 0.35);
}

.verify-step.step-disabled {
    opacity: 0.45;
}

.step-connector {
    width: 2px;
    height: 20px;
    background: var(--border);
    margin: 0 0 0 calc(1.5rem + 18px);
    flex-shrink: 0;
}

.step-connector.connector-done {
    background: rgba(39, 174, 96, 0.5);
}

.step-indicator {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--surface-2);
}

.step-done .step-indicator {
    border-color: var(--green);
    background: rgba(39, 174, 96, 0.12);
    color: var(--green);
}

.step-active .step-indicator {
    border-color: var(--blue);
    background: rgba(41, 128, 185, 0.12);
    color: var(--blue);
}

.step-body {
    flex: 1;
    min-width: 0;
}

.step-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.step-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.step-account {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.25rem;
}

.step-account-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.step-account-id {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-dim);
}

.verify-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.verify-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-3);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.9rem;
}

.discord-fallback {
    background: rgba(88, 101, 242, 0.15);
    color: #5865f2;
}

/* ─── Store ────────────────────────────────────────────────────────────────── */
.store-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.store-grid-wide {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

@media (max-width: 700px) {
    .store-grid { grid-template-columns: 1fr; }
}

.store-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.store-card:not(.store-card-disabled):hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), var(--shadow);
    transform: translateY(-3px);
}

.store-card-featured {
    border-color: var(--accent);
}

.store-card-disabled {
    opacity: 0.65;
}

.store-featured-label {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 2px 12px;
    border-radius: 0 0 6px 6px;
    white-space: nowrap;
}

.store-card-header {
    padding: 1.5rem 1.25rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 2rem;
}

.store-tier-badge {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    padding: 3px 10px;
    border-radius: 4px;
}

.store-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
}

.store-card-body {
    padding: 0.5rem 1.25rem 1rem;
    flex: 1;
}

.store-perk-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.store-perk {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-left: 1.1rem;
    position: relative;
}

.store-perk::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--green);
    font-weight: 700;
    font-size: 0.8rem;
}

.store-card-footer {
    padding: 0.75rem 1.25rem 1.25rem;
    border-top: 1px solid var(--border);
}

.store-card-footer .btn {
    width: 100%;
    justify-content: center;
}

.store-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.store-item-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.store-item-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    flex: 1;
}

.store-item-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0.25rem 0;
}


/* ─── Store Promo Banner ─────────────────────────────────────────────────── */
.store-promo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    background: linear-gradient(135deg, rgba(192,57,43,0.1) 0%, rgba(192,57,43,0.04) 60%, transparent 100%);
    border: 1px solid rgba(192,57,43,0.25);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.store-promo-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.store-promo-eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
}

.store-promo-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.store-promo-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 1px;
}

/* ─── Ticket Category Picker ─────────────────────────────────────────────── */
.ticket-cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 540px) {
    .ticket-cat-grid { grid-template-columns: 1fr; }
}

.ticket-cat-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
    text-align: left;
}

.ticket-cat-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.ticket-cat-btn:hover {
    border-color: var(--accent);
    color: var(--text);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.ticket-cat-btn:hover svg { opacity: 1; }

.ticket-cat-btn.active {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--text);
    box-shadow: 0 0 0 1px rgba(192,57,43,0.2);
}

.ticket-cat-btn.active svg {
    opacity: 1;
    stroke: var(--accent);
}

/* ─── Internal Notes ────────────────────────────────────────────────────────── */
.internal-note {
    background: var(--note-bg);
    border: 1px dashed var(--note-border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
}

.internal-note-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0;
}

.internal-note-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--note-border);
    color: #000;
    padding: 2px 7px;
    border-radius: 20px;
    margin-left: 4px;
}

/* ─── Activity Log ──────────────────────────────────────────────────────────── */
.activity-action {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.activity-reply    { background: var(--blue-dim);   color: var(--blue);   }
.activity-note     { background: var(--yellow-dim);  color: var(--note-text); }
.activity-status   { background: var(--accent-dim);  color: var(--accent); }
.activity-priority { background: var(--gray-dim);    color: var(--text-muted); }
.activity-role     { background: var(--green-dim);   color: var(--green);  }
.activity-delete   { background: var(--accent-dim);  color: var(--accent); }

/* ─── Profile Page ──────────────────────────────────────────────────────────── */
.profile-header {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--border);
    flex-shrink: 0;
    object-fit: cover;
}

.profile-avatar-fallback {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--surface-3);
    border: 3px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}

.profile-header-info { flex: 1; min-width: 0; }

.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.profile-steam-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    text-decoration: none;
    margin-top: 4px;
    transition: color var(--transition);
}
.profile-steam-link:hover { color: var(--text-muted); }

.profile-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: var(--green-dim);
    color: var(--green);
    padding: 3px 8px;
    border-radius: 20px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1rem;
    align-items: start;
}

@media (max-width: 680px) {
    .profile-grid { grid-template-columns: 1fr; }
    .profile-header { flex-direction: column; align-items: center; text-align: center; }
    .profile-header-info { display: flex; flex-direction: column; align-items: center; }
}

.profile-ticket-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: background var(--transition);
    border-radius: 4px;
    padding-left: 4px;
    padding-right: 4px;
}
.profile-ticket-row:last-child { border-bottom: none; }
.profile-ticket-row:hover { background: var(--surface-2); }

/* ─── Ticket Presence / Viewer Avatars ────────────────────────────────────── */
.viewer-stack {
    display: flex;
    align-items: center;
    gap: -6px;
}
.viewer-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid var(--surface-1);
    background: var(--surface-3);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-left: -6px;
    flex-shrink: 0;
}
.viewer-avatar:first-child { margin-left: 0; }
.viewer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.viewer-overflow {
    background: var(--surface-3);
    font-size: 0.6rem;
    color: var(--text-dim);
}

.viewer-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 10px 4px 8px;
}
.viewer-strip-label {
    font-size: 0.72rem;
    color: var(--text-dim);
    white-space: nowrap;
}

/* ─── Ticket Attachments ────────────────────────────────────────────────────── */
.attachment-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.attachment-thumb {
    width: 140px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    cursor: zoom-in;
    transition: opacity .15s, transform .15s;
    display: block;
}
.attachment-thumb:hover {
    opacity: .85;
    transform: scale(1.02);
}

/* ── Message Delete Button ──────────────────────────────────────────────── */
.btn-delete-msg {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px 5px;
    border-radius: 4px;
    line-height: 1;
    opacity: 0;
    transition: opacity .15s, color .15s, background .15s;
}
.message:hover .btn-delete-msg,
.internal-note:hover .btn-delete-msg {
    opacity: 1;
}
.btn-delete-msg:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.12);
}

/* ── Image Lightbox ─────────────────────────────────────────────────────── */
.img-lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.img-lightbox-overlay.open {
    display: flex;
}
.img-lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    cursor: default;
}
