/* ════════════════════════════════════════════
   FiveStarsRP GitBook CMS - Custom Styles
   ════════════════════════════════════════════ */

/* ── Variables ── */
:root {
    --sidebar-width: 280px;
    --navbar-height: 60px;
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --sidebar-bg: #f8f9fa;
    --sidebar-border: #e5e7eb;
    --content-bg: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --accent: #8b5cf6;
}

/* ── Global ── */
* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    background: #f3f4f6;
    color: var(--text-primary);
    overflow: hidden;
}

/* ── Scrollbar Custom ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ── Navbar ── */
.navbar {
    height: var(--navbar-height);
    background: #ffffff;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary);
    text-decoration: none;
}

.navbar-brand img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.navbar-brand .star {
    color: #eab308;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Auth Button ── */
.btn-auth {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid var(--sidebar-border);
    background: white;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s;
    text-decoration: none;
}

.btn-auth:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-auth .lock-icon {
    font-size: 1rem;
}

/* ── User Badge ── */
.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 10px;
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
}

.user-badge img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
}

.role-tag {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-admin { background: rgba(239,68,68,0.2); color: #fca5a5; }
.role-staff { background: rgba(34,197,94,0.2); color: #86efac; }

/* ── Layout ── */
.layout {
    display: flex;
    margin-top: var(--navbar-height);
    height: calc(100vh - var(--navbar-height));
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    overflow-y: auto;
    padding: 20px 0;
    transition: transform 0.3s ease;
}

.sidebar-search {
    padding: 0 16px;
    margin-bottom: 16px;
}

.sidebar-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--sidebar-border);
    border-radius: 10px;
    font-size: 0.85rem;
    background: white;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sidebar-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.sidebar-category {
    margin-bottom: 8px;
}

.sidebar-category-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.sidebar-category-title:hover {
    color: var(--primary);
}

.sidebar-category-title .arrow {
    font-size: 0.6rem;
    transition: transform 0.2s;
    margin-left: auto;
}

.sidebar-category.collapsed .arrow {
    transform: rotate(-90deg);
}

.sidebar-category.collapsed .sidebar-links {
    display: none;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px 8px 36px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.sidebar-link:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    border-left-color: rgba(99, 102, 241, 0.3);
}

.sidebar-link.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-link::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.4;
    flex-shrink: 0;
}

.sidebar-link.active::before {
    opacity: 1;
    background: var(--primary);
}

/* ── Content Area ── */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 40px 60px;
    background: var(--content-bg);
}

.content-wrapper {
    max-width: 820px;
    margin: 0 auto;
}

/* ── Page Content Typography ── */
.page-header {
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--sidebar-border);
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.page-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-content {
    line-height: 1.75;
    font-size: 1rem;
}

.page-content h1 { font-size: 1.875rem; font-weight: 800; margin: 2em 0 0.5em; color: var(--text-primary); }
.page-content h2 { font-size: 1.5rem; font-weight: 700; margin: 1.5em 0 0.5em; color: var(--text-primary); border-bottom: 1px solid var(--sidebar-border); padding-bottom: 8px; }
.page-content h3 { font-size: 1.25rem; font-weight: 600; margin: 1.2em 0 0.4em; color: var(--text-primary); }

.page-content p { margin: 0.8em 0; color: #374151; }

.page-content ul, .page-content ol { padding-left: 1.5em; margin: 0.8em 0; }
.page-content li { margin: 0.3em 0; color: #374151; }

.page-content a { color: var(--primary); text-decoration: underline; }
.page-content a:hover { color: var(--primary-dark); }

.page-content code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: #e11d48;
}

.page-content pre {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 16px 20px;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 1em 0;
}

.page-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.page-content blockquote {
    border-left: 4px solid var(--primary);
    background: rgba(99, 102, 241, 0.05);
    padding: 12px 20px;
    margin: 1em 0;
    border-radius: 0 8px 8px 0;
    color: #4b5563;
}

.page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 0.9rem;
}

.page-content th {
    background: #f9fafb;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--sidebar-border);
}

.page-content td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--sidebar-border);
}

.page-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1em 0;
}

/* ── Admin Bar ── */
.admin-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-success {
    background: #22c55e;
    color: white;
}
.btn-success:hover {
    background: #16a34a;
}

.btn-danger {
    background: #ef4444;
    color: white;
}
.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--sidebar-border);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ── Flash Messages ── */
.flash-message {
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

.flash-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.flash-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

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

/* ── Welcome Page ── */
.welcome-hero {
    text-align: center;
    padding: 60px 20px;
}

.welcome-hero .logo {
    font-size: 4rem;
    margin-bottom: 20px;
}

.welcome-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.welcome-hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* ── Loading ── */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-secondary);
    gap: 12px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--sidebar-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ── Mobile Toggle ── */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px;
    color: var(--text-primary);
}

/* ── Modal ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    padding: 28px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    animation: modalIn 0.3s ease;
}

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

.modal h3 {
    margin: 0 0 20px;
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-close {
    float: right;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 6px;
}

.modal-close:hover {
    background: #f3f4f6;
}

/* ── Form Inputs ── */
.form-group {
    margin-bottom: 16px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--sidebar-border);
    border-radius: 10px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        bottom: 0;
        z-index: 90;
        transform: translateX(-100%);
        box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    }

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

    .content-area {
        padding: 24px 20px;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .welcome-hero h1 {
        font-size: 1.8rem;
    }

    .navbar-brand span.full-name {
        display: none;
    }
}

/* ── Sidebar Admin New Page Button ── */
.sidebar-new-page {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 16px 16px;
    padding: 10px 14px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: calc(100% - 32px);
}

.sidebar-new-page:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* ── Page Edit/Delete buttons ── */
.page-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.2s;
}

.sidebar-link:hover .page-actions {
    opacity: 1;
}

.page-action-btn {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.page-action-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.page-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* ── Tooltip ── */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    white-space: nowrap;
    margin-bottom: 6px;
    z-index: 50;
}

/* ════════════════════════════════════════════
   ADMIN PANEL STYLES
   ════════════════════════════════════════════ */

/* ── Admin Body ── */
.admin-body {
    overflow: hidden;
}

/* ── Admin Layout ── */
.admin-layout {
    display: flex;
    margin-top: var(--navbar-height);
    height: calc(100vh - var(--navbar-height));
}

/* ── Admin Sidebar ── */
.admin-sidebar {
    width: 240px;
    min-width: 240px;
    background: #1e1b4b;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.admin-nav {
    flex: 1;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.admin-nav-item:hover {
    color: white;
    background: rgba(255,255,255,0.05);
}

.admin-nav-item.active {
    color: white;
    background: rgba(99, 102, 241, 0.15);
    border-left-color: #818cf8;
}

.admin-nav-item span:first-child {
    font-size: 1.1rem;
}

.admin-sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.admin-sidebar-footer .btn-outline {
    color: rgba(255,255,255,0.6);
    border-color: rgba(255,255,255,0.2);
}

.admin-sidebar-footer .btn-outline:hover {
    color: white;
    border-color: rgba(255,255,255,0.4);
}

/* ── Admin Content ── */
.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px 40px;
    background: #f8f9fa;
}

/* ── Admin Tabs ── */
.admin-tab {
    display: none;
}

.admin-tab.active {
    display: block;
    animation: fadeInTab 0.3s ease;
}

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

/* ── Admin Header ── */
.admin-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
}

.admin-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.admin-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ── Admin Section ── */
.admin-section {
    margin-top: 32px;
}

.admin-section h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px;
}

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: white;
    border-radius: 14px;
    padding: 20px 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

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

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ── Quick Actions ── */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 20px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.quick-action-btn:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99,102,241,0.1);
    transform: translateY(-2px);
}

.quick-action-btn span:first-child {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.quick-action-btn strong {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.quick-action-btn small {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ── Admin Table ── */
.admin-table-wrapper {
    background: white;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    overflow-x: auto;
    overflow-y: visible;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.admin-table thead th {
    padding: 12px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.admin-table tbody td {
    padding: 12px 16px;
    font-size: 0.875rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.admin-table tbody tr {
    transition: background 0.15s, opacity 0.3s, transform 0.3s;
}

.admin-table tbody tr:hover {
    background: #f9fafb;
}

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

/* ── Table Elements ── */
.table-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.table-link:hover {
    text-decoration: underline;
}

.table-actions {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.btn-sm {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-primary-sm {
    background: rgba(99,102,241,0.1);
    color: var(--primary);
}
.btn-primary-sm:hover {
    background: var(--primary);
    color: white;
}

.btn-danger-sm {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
}
.btn-danger-sm:hover {
    background: #ef4444;
    color: white;
}

.btn-outline-sm {
    background: white;
    color: var(--text-secondary);
    border: 1px solid #e5e7eb;
}
.btn-outline-sm:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

.visibility-badge.public {
    background: #ecfdf5;
    color: #065f46;
}

.visibility-badge.restricted {
    background: #fef3c7;
    color: #92400e;
}

.cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 8px;
    background: #f3f4f6;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.count-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    background: #eef2ff;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
}

.slug-code {
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    color: #6b7280;
}

/* ── Role Select Inline ── */
.role-select-inline {
    padding: 4px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.8rem;
    outline: none;
    background: white;
    cursor: pointer;
    min-width: 140px;
    transition: border-color 0.2s;
}

.role-select-inline:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.1);
}

/* ── Role Color Dot ── */
.role-color-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ── Filter Bar ── */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #e5e7eb;
    background: white;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ── Pages Category Group ── */
.pages-category-group {
    margin-bottom: 24px;
}

.pages-category-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pages-category-count {
    background: #eef2ff;
    color: var(--primary);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ── Admin Alert ── */
.admin-alert {
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 0.875rem;
    line-height: 1.5;
}

.admin-alert.info {
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

.admin-alert.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.admin-alert.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* ── Toast Notification ── */
.admin-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 300;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

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

.admin-toast.success {
    background: #065f46;
    color: white;
}

.admin-toast.error {
    background: #991b1b;
    color: white;
}

.admin-toast.info {
    background: #1e40af;
    color: white;
}

/* ── Admin Responsive ── */
@media (max-width: 1024px) {
    .admin-sidebar {
        width: 200px;
        min-width: 200px;
    }

    .admin-content {
        padding: 24px 20px;
    }
}

@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        min-width: auto;
        flex-direction: row;
        padding: 0;
        overflow-x: auto;
    }

    .admin-nav {
        display: flex;
        white-space: nowrap;
    }

    .admin-nav-item {
        padding: 12px 16px;
        border-left: none;
        border-bottom: 3px solid transparent;
        font-size: 0.8rem;
    }

    .admin-nav-item.active {
        border-bottom-color: #818cf8;
        border-left-color: transparent;
    }

    .admin-sidebar-footer {
        display: none;
    }

    .admin-header {
        flex-direction: column;
        gap: 12px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-table-wrapper {
        overflow-x: auto;
    }

    .admin-table {
        min-width: 600px;
    }
}

/* ── Utility ── */
.mt-4 { margin-top: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.flex-1 { flex: 1; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.text-center { text-align: center; }

/* ═══════════════════════════════════════════
   ROLE MEMBERS MODAL
   ═══════════════════════════════════════════ */

.role-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.role-modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
}

.role-modal-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 12px;
    background: #eef2ff;
    color: #6366f1;
    white-space: nowrap;
}

.role-add-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.role-add-section h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 10px;
}

.role-search-row {
    display: flex;
    gap: 8px;
}

.role-search-row .webhook-input {
    flex: 1;
}

.role-search-row .btn {
    white-space: nowrap;
    flex-shrink: 0;
}

.role-search-results-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.role-search-result-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.15s;
}

.role-search-result-card:hover {
    border-color: #c7d2fe;
    background: #fafaff;
}

.role-search-empty {
    text-align: center;
    padding: 16px;
    color: #9ca3af;
    font-size: 0.85rem;
    margin-top: 8px;
}

.role-has-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: #16a34a;
    white-space: nowrap;
    padding: 4px 10px;
    background: #dcfce7;
    border-radius: 8px;
}

.role-modal-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 16px 0;
}

.role-members-list-header {
    margin-bottom: 12px;
}

.role-members-list-header h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #374151;
}

.role-members-list {
    max-height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.1) transparent;
}

.role-member-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.25s;
}

.role-member-card:hover {
    background: #fff;
    border-color: #c7d2fe;
    box-shadow: 0 2px 8px rgba(99,102,241,0.08);
}

.role-member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
    flex-shrink: 0;
}

.role-member-info {
    flex: 1;
    min-width: 0;
}

.role-member-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.role-member-username {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 1px;
}

.role-member-username code {
    font-size: 0.7rem;
    background: #f3f4f6;
    padding: 1px 5px;
    border-radius: 4px;
    color: #6b7280;
}

.role-members-empty {
    text-align: center;
    padding: 32px 16px;
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Clickable role rows */
.role-row-clickable {
    cursor: pointer;
    transition: background 0.15s;
}

.role-row-clickable:hover {
    background: #f0f1ff !important;
}

/* ═══════════════════════════════════════════
   STAFF TRACKING
   ═══════════════════════════════════════════ */

.staff-tracking-layout {
    display: flex;
    gap: 24px;
    align-items: start;
}

/* ── Staff Podium Panel ── */
.staff-podium-panel {
    width: 300px;
    min-width: 300px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.staff-podium-title {
    font-size: 1rem;
    font-weight: 700;
    color: #374151;
    text-align: center;
    margin-bottom: 24px;
}

.staff-podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
    padding-top: 20px;
}

.podium-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.podium-medal {
    font-size: 2rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.podium-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #374151;
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.podium-total {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6366f1;
}

.podium-details {
    font-size: 0.65rem;
    color: #9ca3af;
}

.podium-pillar {
    width: 100%;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
    min-height: 40px;
}

.podium-place {
    font-size: 1.5rem;
    font-weight: 800;
    color: rgba(255,255,255,0.4);
}

.place-1 .podium-medal { transform: scale(1.2); }

/* ── Staff Table Elements ── */
.staff-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.staff-avatar-mini {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
}

.staff-rank {
    font-size: 1.2rem;
}

.staff-rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.8rem;
    font-weight: 700;
}

.staff-stat-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    min-width: 36px;
}

.staff-stat-value.tickets {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.staff-stat-value.bda {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.staff-stat-value.total {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    font-size: 0.95rem;
}

/* ── Progress Bar ── */
.staff-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.staff-bar {
    display: flex;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    background: #f3f4f6;
    flex: 1;
}

.staff-bar-tickets {
    background: linear-gradient(90deg, #6366f1, #818cf8);
    height: 100%;
    min-width: 1px;
    transition: width 0.4s ease;
}

.staff-bar-bda {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    height: 100%;
    min-width: 1px;
    transition: width 0.4s ease;
}

.staff-bar-label {
    font-size: 0.65rem;
    color: #9ca3af;
    white-space: nowrap;
    min-width: 60px;
}

/* ── Staff Row hover ── */
.staff-row {
    transition: background 0.15s, transform 0.15s;
}

.staff-row:hover {
    background: #f0f1ff !important;
}

/* ── Staff Responsive ── */
@media (max-width: 1100px) {
    .staff-tracking-layout {
        flex-direction: column;
    }

    .staff-podium-panel {
        width: 100%;
        min-width: auto;
        order: -1;
    }
}

@media (max-width: 768px) {
    .staff-podium {
        gap: 8px;
    }

    .podium-name {
        font-size: 0.7rem;
        max-width: 60px;
    }

    .staff-bar-wrapper {
        min-width: 80px;
    }

    .staff-bar-label {
        display: none;
    }
}

/* ═══════════════════════════════════════════
   WEBHOOK EMBED BUILDER
   ═══════════════════════════════════════════ */

.webhook-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
    align-items: start;
}

/* ── Form Panel ── */
.webhook-form-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.webhook-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
}

.webhook-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 12px;
}

.webhook-optional {
    font-weight: 400;
    color: #9ca3af;
    font-size: 0.8rem;
}

.webhook-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    background: #fafbfc;
    transition: all 0.2s;
    box-sizing: border-box;
}

.webhook-input:focus {
    outline: none;
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
    background: white;
}

textarea.webhook-input {
    resize: vertical;
    min-height: 60px;
}

.webhook-row {
    display: flex;
    gap: 12px;
}

.webhook-row .form-group {
    margin-bottom: 0;
}

.form-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 4px;
}

/* ── Color Picker ── */
.webhook-color-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.webhook-color-picker {
    width: 44px;
    height: 44px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    padding: 2px;
    background: white;
}

.webhook-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.webhook-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

.webhook-color-presets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.color-preset {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 2px solid rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.15s;
}

.color-preset:hover {
    transform: scale(1.15);
    border-color: rgba(0,0,0,0.2);
}

/* ── Collapsible Sections ── */
.webhook-collapsible {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.webhook-collapsible-header {
    width: 100%;
    padding: 14px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: none;
    text-align: left;
    font-family: 'Inter', sans-serif;
    transition: background 0.15s;
}

.webhook-collapsible-header:hover {
    background: #f9fafb;
}

.webhook-collapsible-header .chevron {
    margin-left: auto;
    font-size: 0.75rem;
    color: #9ca3af;
    transition: transform 0.2s;
}

.webhook-collapsible-header .field-count {
    background: #eef2ff;
    color: #6366f1;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.webhook-collapsible-body {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
}

.webhook-collapsible-body.open {
    padding: 0 20px 20px;
}

/* ── Embed Fields ── */
.wh-field-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.wh-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.wh-field-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wh-field-remove {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: none;
    background: #fee2e2;
    color: #dc2626;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.wh-field-remove:hover {
    background: #dc2626;
    color: white;
}

.wh-field-inline-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 8px;
    cursor: pointer;
}

/* ── Actions ── */
.webhook-actions {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.webhook-actions .btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.webhook-secondary-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.webhook-secondary-actions .btn {
    flex: 1;
    min-width: 120px;
    font-size: 0.8rem;
    justify-content: center;
}

/* ═══════════════════════════════════════════
   DISCORD PREVIEW (right panel)
   ═══════════════════════════════════════════ */

.webhook-preview-panel {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.webhook-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.webhook-preview-header h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #374151;
}

.webhook-preview-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: 10px;
    background: #dcfce7;
    color: #16a34a;
    animation: pulse-live 2s infinite;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.webhook-preview-discord {
    background: #313338;
    border-radius: 12px;
    padding: 16px;
    min-height: 100px;
}

/* ── Discord Message ── */
.discord-message-wrapper {
    display: flex;
    gap: 16px;
}

.discord-avatar {
    flex-shrink: 0;
}

.discord-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

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

.discord-username {
    font-weight: 600;
    font-size: 0.95rem;
    color: #f2f3f5;
    margin-bottom: 4px;
}

.discord-content {
    color: #dbdee1;
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-word;
}

.discord-content strong {
    font-weight: 700;
    color: #f2f3f5;
}

.discord-content em {
    font-style: italic;
}

.discord-content a {
    color: #00a8fc;
    text-decoration: none;
}

.discord-content a:hover {
    text-decoration: underline;
}

/* ── Discord Embed ── */
.discord-embed {
    display: flex;
    margin-top: 8px;
    max-width: 100%;
    border-radius: 4px;
    overflow: hidden;
    background: #2b2d31;
}

.discord-embed-color {
    width: 4px;
    flex-shrink: 0;
    background: #5865F2;
    border-radius: 4px 0 0 4px;
}

.discord-embed-content {
    padding: 12px 16px;
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 16px;
}

.discord-embed-inner {
    flex: 1;
    min-width: 0;
}

.discord-embed-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.discord-embed-author-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.discord-embed-author span {
    font-size: 0.8rem;
    font-weight: 600;
    color: #f2f3f5;
}

.discord-embed-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f2f3f5;
    margin-bottom: 6px;
}

.discord-embed-title a {
    color: #00a8fc;
    text-decoration: none;
}

.discord-embed-title a:hover {
    text-decoration: underline;
}

.discord-embed-description {
    font-size: 0.85rem;
    color: #dbdee1;
    line-height: 1.5;
    word-break: break-word;
    margin-bottom: 8px;
}

.discord-embed-description strong {
    color: #f2f3f5;
}

.discord-embed-description a {
    color: #00a8fc;
}

.discord-code-block {
    display: block;
    background: #1e1f22;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
    margin: 4px 0;
    white-space: pre-wrap;
    color: #dbdee1;
}

.discord-code-inline {
    background: #1e1f22;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
    color: #dbdee1;
}

/* ── Embed Fields ── */
.discord-embed-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.discord-embed-field {
    width: 100%;
}

.discord-embed-field.inline {
    width: calc(33.33% - 6px);
    min-width: 80px;
}

.discord-embed-field-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #f2f3f5;
    margin-bottom: 2px;
}

.discord-embed-field-value {
    font-size: 0.8rem;
    color: #dbdee1;
    line-height: 1.4;
    word-break: break-word;
}

/* ── Embed Image / Thumbnail ── */
.discord-embed-image {
    margin-top: 8px;
}

.discord-embed-image img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
    object-fit: contain;
}

.discord-embed-thumbnail {
    flex-shrink: 0;
    align-self: flex-start;
}

.discord-embed-thumbnail img {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    object-fit: cover;
}

/* ── Embed Footer ── */
.discord-embed-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px 12px;
    font-size: 0.75rem;
    color: #949ba4;
}

.discord-embed-footer-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.discord-embed-footer-sep {
    color: #4e5058;
}

/* ── JSON Preview ── */
.webhook-json-toggle {
    margin-top: 12px;
    text-align: center;
}

.webhook-json-preview {
    background: #1e1f22;
    border-radius: 10px;
    padding: 16px;
    margin-top: 8px;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.webhook-json-preview code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.78rem;
    color: #57F287;
    white-space: pre;
    line-height: 1.5;
}

/* ── Webhook Responsive ── */
@media (max-width: 900px) {
    .webhook-layout {
        grid-template-columns: 1fr;
    }

    .webhook-preview-panel {
        position: static;
        max-height: none;
        order: -1;
    }
}

@media (max-width: 640px) {
    .webhook-row {
        flex-direction: column;
        gap: 8px;
    }

    .webhook-secondary-actions {
        flex-direction: column;
    }

    .webhook-secondary-actions .btn {
        width: 100%;
    }

    .discord-embed-field.inline {
        width: 100%;
    }

    .discord-embed-thumbnail img {
        width: 60px;
        height: 60px;
    }
}

/* ════════════════════════════════════════════
   Discord Mentions
   ════════════════════════════════════════════ */

/* ── Mention tag (in page content) ── */
.discord-mention {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px 1px 4px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9em;
    cursor: default;
    vertical-align: baseline;
    line-height: 1.4;
    transition: filter 0.15s ease;
    text-decoration: none;
}

.discord-mention:hover {
    filter: brightness(1.15);
}

.discord-mention .mention-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ── Mention Autocomplete Dropdown (editor) ── */
.mention-dropdown {
    position: fixed;
    z-index: 100000;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
    min-width: 300px;
    max-width: 380px;
    max-height: 320px;
    overflow-y: auto;
    padding: 6px;
    animation: mentionFadeIn 0.15s ease;
}

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

.mention-dropdown::-webkit-scrollbar {
    width: 6px;
}

.mention-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.mention-dropdown::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s ease;
}

.mention-item:hover,
.mention-item.selected {
    background: #f3f4f6;
}

.mention-item.selected {
    background: #eef2ff;
}

.mention-item-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.mention-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.mention-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mention-item-username {
    font-size: 0.75rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mention-item-role {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 2px 8px;
    border-radius: 10px;
    background: currentColor;
    -webkit-background-clip: text;
    background-clip: text;
    flex-shrink: 0;
    border: 1px solid currentColor;
    opacity: 0.8;
}

.mention-loading,
.mention-empty {
    padding: 16px 12px;
    text-align: center;
    font-size: 0.85rem;
    color: #9ca3af;
}

.mention-loading {
    color: #6366f1;
}

/* ── Mention in page content — ensure it looks good with various themes ── */
.page-content .discord-mention {
    margin: 0 2px;
}
