/* ══════════════════════════════════════════════════════════════
   ADMIN PANEL — Publisher Bot  (Redesigned)
   8px grid spacing · glassmorphism · gradient accents
   ══════════════════════════════════════════════════════════════ */

body.admin-body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.admin-sidebar {
    width: 272px;
    min-height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}

.admin-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--spidey-red), var(--accent-blue));
    z-index: 1;
}

.admin-sidebar::-webkit-scrollbar {
    width: 4px;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(226, 54, 54, 0.2);
    border-radius: 4px;
}

.admin-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(226, 54, 54, 0.35);
}

.admin-sidebar-logo {
    padding: 20px 20px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border-color);
    margin-top: 3px;
}

.admin-sidebar-logo .logo-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #E23636, #3B6FD4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(226, 54, 54, 0.25);
    transition: transform 0.3s, box-shadow 0.3s;
}

.admin-sidebar-logo .logo-icon:hover {
    transform: scale(1.05) rotate(-3deg);
    box-shadow: 0 6px 24px rgba(226, 54, 54, 0.35);
}

.admin-sidebar-logo h2 {
    font-size: 16px;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-sidebar-logo p {
    font-size: 11px;
    color: var(--text-muted);
    margin: 3px 0 0;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.sidebar-nav {
    padding: 12px 0;
    flex: 1;
}

.sidebar-group {
    margin-bottom: 2px;
}

.sidebar-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 14px 20px 6px;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.sidebar-group-header:hover {
    color: var(--accent-red);
}

.sidebar-group-header .group-chevron {
    font-size: 9px;
    transition: transform 0.25s cubic-bezier(.4,0,.2,1);
    opacity: 0.6;
}

.sidebar-group.collapsed .group-chevron {
    transform: rotate(-90deg);
}

.sidebar-group-items {
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(.4,0,.2,1);
    max-height: 500px;
}

.sidebar-group.collapsed .sidebar-group-items {
    max-height: 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px 10px 24px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(.4,0,.2,1);
    border-left: 3px solid transparent;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    margin: 1px 8px 1px 0;
    border-radius: 0 8px 8px 0;
}

.sidebar-item:hover {
    background: rgba(226, 54, 54, 0.06);
    color: var(--text-primary);
    border-left-color: rgba(226, 54, 54, 0.3);
}

.sidebar-item.active {
    color: #fff;
    border-left-color: var(--accent-blue);
    background: linear-gradient(90deg, rgba(59, 111, 212, 0.15), rgba(59, 111, 212, 0.05));
    font-weight: 600;
}

.sidebar-item.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-blue);
    border-radius: 3px 0 0 3px;
}

.sidebar-item i {
    width: 20px;
    text-align: center;
    font-size: 14px;
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s;
}

.sidebar-item:hover i,
.sidebar-item.active i {
    opacity: 1;
    transform: scale(1.05);
}

.sidebar-item .item-badge {
    margin-left: auto;
    background: rgba(226, 54, 54, 0.12);
    color: var(--accent-red);
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Sidebar bottom */
.sidebar-bottom-section {
    border-top: 1px solid var(--border-color);
    padding: 14px 12px;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.1));
}

.sidebar-bot-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    margin-bottom: 10px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s;
}

.sidebar-bot-status:hover {
    border-color: rgba(46, 204, 113, 0.3);
}

.sidebar-bot-status .status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent-green);
    flex-shrink: 0;
    animation: pulse-dot 2s infinite;
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.4);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(46, 204, 113, 0.4); }
    50% { opacity: 0.6; box-shadow: 0 0 16px rgba(46, 204, 113, 0.6); }
}

.sidebar-bot-status .status-text {
    flex: 1;
    color: var(--text-secondary);
    font-weight: 500;
}

.sidebar-bot-status .status-ping {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.sidebar-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.sidebar-control-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-control-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: rgba(226, 54, 54, 0.2);
    transform: translateY(-1px);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.sidebar-user-info img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(226, 54, 54, 0.2);
}

.sidebar-user-info .sb-name {
    font-size: 13px;
    font-weight: 600;
}

.sidebar-user-info .sb-tag {
    font-size: 11px;
    color: var(--text-muted);
}

.owner-badge-small {
    margin-left: auto;
    background: linear-gradient(135deg, rgba(226, 54, 54, 0.2), rgba(59, 111, 212, 0.18));
    border: 1px solid rgba(226, 54, 54, 0.3);
    color: #ff8a8a;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

/* ── Hamburger ───────────────────────────────────────────── */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 200;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    transition: all 0.2s;
}

.hamburger-btn:hover {
    background: var(--bg-hover);
    border-color: rgba(226, 54, 54, 0.3);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 99;
}

/* ── Main Content ────────────────────────────────────────── */
.admin-main {
    margin-left: 272px;
    flex: 1;
    padding: 32px 40px;
    min-height: 100vh;
    box-sizing: border-box;
    max-width: 1400px;
}

/* ── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.breadcrumb a {
    color: var(--accent-blue);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s;
}

.breadcrumb a:hover {
    color: var(--spidey-red);
    text-decoration: underline;
}

.breadcrumb .sep {
    font-size: 9px;
    opacity: 0.5;
}

/* ── Page Header ─────────────────────────────────────────── */
.page-header {
    margin-bottom: 28px;
    position: relative;
    padding-left: 18px;
}

.page-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #E23636, #3B6FD4);
    border-radius: 4px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}

.page-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
    font-weight: 400;
}

/* ── Quick Actions Bar ───────────────────────────────────── */
.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(.4,0,.2,1);
}

.quick-action-btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(59, 111, 212, 0.15);
    background: rgba(59, 111, 212, 0.04);
}

.quick-action-btn i {
    font-size: 14px;
}

/* ── Sections ────────────────────────────────────────────── */
.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
    animation: fadeInUp 0.3s cubic-bezier(.4,0,.2,1);
}

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

/* ── Stat Cards (Overview) ───────────────────────────────── */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.ov-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 22px;
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
    position: relative;
    overflow: hidden;
}

.ov-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    transition: opacity 0.3s;
}

.ov-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.ov-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}

.ov-card:hover::before {
    opacity: 1;
}

.ov-card:hover::after {
    opacity: 0.04;
}

.ov-card.card-red::before { background: linear-gradient(90deg, #E23636, #ff6b6b); }
.ov-card.card-red::after { background: radial-gradient(circle, #E23636, transparent 70%); }
.ov-card.card-blue::before { background: linear-gradient(90deg, #3B6FD4, #60a5fa); }
.ov-card.card-blue::after { background: radial-gradient(circle, #3B6FD4, transparent 70%); }
.ov-card.card-green::before { background: linear-gradient(90deg, #2ecc71, #57f287); }
.ov-card.card-green::after { background: radial-gradient(circle, #2ecc71, transparent 70%); }
.ov-card.card-purple::before { background: linear-gradient(90deg, #8B5CF6, #a78bfa); }
.ov-card.card-purple::after { background: radial-gradient(circle, #8B5CF6, transparent 70%); }
.ov-card.card-yellow::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.ov-card.card-yellow::after { background: radial-gradient(circle, #f59e0b, transparent 70%); }
.ov-card.card-cyan::before { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.ov-card.card-cyan::after { background: radial-gradient(circle, #06b6d4, transparent 70%); }

.ov-card .ov-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
}

.ov-card .ov-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: transform 0.3s;
}

.ov-card:hover .ov-icon {
    transform: scale(1.08);
}

.ov-card.card-red .ov-icon { background: linear-gradient(135deg, rgba(226,54,54,0.15), rgba(226,54,54,0.05)); color: #E23636; }
.ov-card.card-blue .ov-icon { background: linear-gradient(135deg, rgba(59,111,212,0.15), rgba(59,111,212,0.05)); color: #3B6FD4; }
.ov-card.card-green .ov-icon { background: linear-gradient(135deg, rgba(46,204,113,0.15), rgba(46,204,113,0.05)); color: #2ecc71; }
.ov-card.card-purple .ov-icon { background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(139,92,246,0.05)); color: #8B5CF6; }
.ov-card.card-yellow .ov-icon { background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(245,158,11,0.05)); color: #f59e0b; }
.ov-card.card-cyan .ov-icon { background: linear-gradient(135deg, rgba(6,182,212,0.15), rgba(6,182,212,0.05)); color: #06b6d4; }

.ov-card .ov-trend {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 8px;
}

.ov-card .ov-trend.up {
    background: rgba(87,242,135,0.12);
    color: #57f287;
}

.ov-card .ov-trend.stable {
    background: rgba(250,166,26,0.12);
    color: #faa61a;
}

.ov-card .ov-val {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.ov-card .ov-lbl {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

.ov-card .ov-updated {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 10px;
    opacity: 0.6;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Panel Card ──────────────────────────────────────────── */
.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 20px;
    transition: border-color 0.2s;
}

.panel-card:hover {
    border-color: rgba(226, 54, 54, 0.12);
}

.panel-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.panel-card h3 i {
    font-size: 16px;
}

/* ── Form helpers ────────────────────────────────────────── */
.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.form-group {
    flex: 1;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.form-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 111, 212, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

select.form-input option {
    background: var(--bg-secondary);
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(.4,0,.2,1);
    white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-hover));
    color: #fff;
    box-shadow: 0 2px 8px rgba(59, 111, 212, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(59, 111, 212, 0.35);
    transform: translateY(-1px);
}

.btn-red {
    background: rgba(237,66,69,0.12);
    color: #ed4245;
    border: 1px solid rgba(237,66,69,0.25);
}

.btn-red:hover {
    background: rgba(237,66,69,0.2);
    border-color: rgba(237,66,69,0.4);
}

.btn-green {
    background: rgba(87,242,135,0.12);
    color: #57f287;
    border: 1px solid rgba(87,242,135,0.25);
}

.btn-green:hover {
    background: rgba(87,242,135,0.2);
    border-color: rgba(87,242,135,0.4);
}

.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 8px; }

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

.btn-outline:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: rgba(59,111,212,0.04);
}

.btn-outline.active {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: rgba(59,111,212,0.1);
}

/* ── Table ───────────────────────────────────────────────── */
.codes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.codes-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.codes-table th {
    padding: 10px 14px;
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    background: var(--bg-card);
    transition: color 0.15s;
}

.codes-table th:hover {
    color: var(--accent-blue);
}

.codes-table th .sort-icon {
    margin-left: 4px;
    font-size: 10px;
    opacity: 0.4;
    transition: opacity 0.15s;
}

.codes-table th:hover .sort-icon {
    opacity: 0.8;
}

.codes-table th.sorted .sort-icon {
    opacity: 1;
    color: var(--accent-blue);
}

.codes-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    transition: background 0.15s;
}

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

.codes-table tbody tr:nth-child(even) td {
    background: rgba(255,255,255,0.01);
}

[data-theme="light"] .codes-table tbody tr:nth-child(even) td {
    background: rgba(0,0,0,0.015);
}

.codes-table tbody tr:hover td {
    background: var(--bg-hover);
}

.code-tag {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: linear-gradient(135deg, rgba(226,54,54,0.08), rgba(59,111,212,0.06));
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    border: 1px solid rgba(226,54,54,0.1);
}

/* ── Badges ──────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.badge-green { background: rgba(87,242,135,0.12); color: #57f287; }
.badge-red { background: rgba(237,66,69,0.12); color: #ed4245; }
.badge-yellow { background: rgba(250,166,26,0.12); color: #faa61a; }
.badge-blue { background: rgba(59,111,212,0.12); color: var(--accent-blue); }
.badge-purple { background: rgba(139,92,246,0.12); color: var(--accent-purple); }

/* ── Pagination ──────────────────────────────────────────── */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0 0;
    border-top: 1px solid var(--border-color);
    margin-top: 14px;
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-info {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    min-width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-blue);
}

.pagination-btn.active {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-hover));
    color: #fff;
    border-color: var(--accent-blue);
    box-shadow: 0 2px 8px rgba(59, 111, 212, 0.25);
}

.pagination-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pagination-per-page {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.pagination-per-page select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 4px 10px;
    font-size: 12px;
}

/* ── Guild Cards ─────────────────────────────────────────── */
.guild-view-toggle {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.guild-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.guild-toolbar .cases-search {
    flex: 1;
    min-width: 200px;
}

.guild-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guild-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.guild-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(.4,0,.2,1);
    cursor: pointer;
    border: 1px solid transparent;
}

.guild-item:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
    border-color: rgba(59,111,212,0.15);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.guild-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 18px;
    transition: all 0.25s cubic-bezier(.4,0,.2,1);
    cursor: pointer;
}

.guild-card:hover {
    border-color: rgba(59,111,212,0.3);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.guild-card .guild-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.guild-card .guild-card-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.guild-card .guild-card-stat {
    font-size: 12px;
    color: var(--text-muted);
}

.guild-card .guild-card-stat strong {
    color: var(--text-primary);
    font-weight: 700;
}

.guild-card .guild-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.guild-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--bg-hover), var(--bg-tertiary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.guild-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.guild-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guild-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Blacklist ───────────────────────────────────────────── */
.bl-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid transparent;
    transition: all 0.15s;
}

.bl-item:hover {
    border-color: rgba(237,66,69,0.15);
    background: var(--bg-hover);
}

.bl-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    flex: 1;
}

.bl-reason {
    font-size: 12px;
    color: var(--text-muted);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Timeline (Recent Cases) ─────────────────────────────── */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--accent-red), var(--accent-blue), transparent);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    padding: 12px 0 12px 18px;
    border-bottom: none;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 18px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.05);
}

.timeline-item.type-ban::before { background: #ed4245; }
.timeline-item.type-kick::before { background: #ff9f43; }
.timeline-item.type-mute::before { background: #b366f9; }
.timeline-item.type-warn::before { background: #faa61a; }
.timeline-item.type-unmute::before, .timeline-item.type-unban::before { background: #57f287; }

.timeline-item .tl-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.timeline-item .tl-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
    font-weight: 500;
}

.timeline-item .tl-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ── Presence Buttons ────────────────────────────────────── */
.presence-btn {
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.presence-btn:hover {
    border-color: rgba(226,54,54,0.35);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.presence-btn.active-presence { border-color: var(--accent-green); color: var(--accent-green); background: rgba(35,209,96,0.08); }
.presence-btn.idle-presence { border-color: var(--accent-yellow); color: var(--accent-yellow); background: rgba(255,221,87,0.08); }
.presence-btn.dnd-presence { border-color: var(--accent-red); color: var(--accent-red); background: rgba(255,56,96,0.08); }
.presence-btn.invisible-presence { border-color: var(--text-muted); color: var(--text-muted); background: rgba(107,110,115,0.08); }

/* ── Toast ───────────────────────────────────────────────── */
.toast-stack {
    position: fixed;
    bottom: 28px;
    right: 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
    pointer-events: none;
}

.toast-item2 {
    pointer-events: all;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    transform: translateX(120px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(.4,0,.2,1);
    position: relative;
    overflow: hidden;
    min-width: 300px;
    backdrop-filter: blur(12px);
}

.toast-item2.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-item2.success { border-left: 3px solid #57f287; }
.toast-item2.error { border-left: 3px solid #ed4245; }
.toast-item2.info { border-left: 3px solid var(--accent-blue); }

.toast-item2 i {
    font-size: 16px;
}

.toast-item2.success i { color: #57f287; }
.toast-item2.error i { color: #ed4245; }
.toast-item2.info i { color: var(--accent-blue); }

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    border-radius: 0 0 0 14px;
    animation: toastProgress 4s linear forwards;
}

.toast-item2.success .toast-progress { background: #57f287; }
.toast-item2.error .toast-progress { background: #ed4245; }
.toast-item2.info .toast-progress { background: var(--accent-blue); }

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.4);
    transform: scale(0.95) translateY(12px);
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}

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

.modal-dialog.modal-lg {
    max-width: 720px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px 18px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(237,66,69,0.15);
    color: #ed4245;
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px 28px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 28px 22px;
    border-top: 1px solid var(--border-color);
}

/* ── Skeleton Loader ─────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    height: 130px;
    border-radius: 16px;
}

.skeleton-line {
    height: 14px;
    margin-bottom: 10px;
    border-radius: 6px;
}

.skeleton-line.w-50 { width: 50%; }
.skeleton-line.w-75 { width: 75%; }
.skeleton-line.w-100 { width: 100%; }

.skeleton-row {
    display: flex;
    gap: 16px;
    margin-bottom: 14px;
    align-items: center;
}

.skeleton-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Log Viewer ──────────────────────────────────────────── */
.log-viewer {
    background: #0d1117;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12px;
    max-height: 500px;
    overflow-y: auto;
}

.log-viewer::-webkit-scrollbar {
    width: 6px;
}

.log-viewer::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.log-line {
    padding: 3px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    display: flex;
    gap: 12px;
    align-items: flex-start;
    transition: background 0.1s;
}

.log-line:hover {
    background: rgba(255,255,255,0.02);
}

.log-line:last-child { border-bottom: none; }
.log-time { color: #6e7681; flex-shrink: 0; font-size: 11px; }
.log-level { flex-shrink: 0; min-width: 48px; font-weight: 700; font-size: 11px; text-transform: uppercase; }
.log-level.error { color: #ed4245; }
.log-level.warn { color: #faa61a; }
.log-level.info { color: #57f287; }
.log-level.log { color: #ff8a8a; }
.log-msg { color: #c9d1d9; flex: 1; word-break: break-all; white-space: pre-wrap; }

/* ── Profile ─────────────────────────────────────────────── */
.profile-card {
    background: var(--bg-tertiary);
    border-radius: 14px;
    padding: 20px;
    margin-top: 16px;
    border: 1px solid var(--border-color);
}

.profile-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.profile-stat {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: border-color 0.15s;
}

.profile-stat:hover {
    border-color: rgba(59,111,212,0.2);
}

.profile-stat .ps-val { font-size: 22px; font-weight: 800; }
.profile-stat .ps-lbl { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Scheduled ───────────────────────────────────────────── */
.sched-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid transparent;
    transition: all 0.15s;
}

.sched-item:hover {
    border-color: var(--border-color);
    background: var(--bg-hover);
}

.sched-title { font-weight: 600; font-size: 13px; flex: 1; }
.sched-time { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }

/* ── Search Input ────────────────────────────────────────── */
.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
    transition: color 0.15s;
}

.search-box:focus-within i {
    color: var(--accent-blue);
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 111, 212, 0.1);
}

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 44px;
    margin-bottom: 16px;
    display: block;
    opacity: 0.3;
    background: linear-gradient(135deg, var(--accent-red), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 13px;
    margin: 0;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

/* ── Guild Detail Panel ──────────────────────────────────── */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.detail-stat {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.detail-stat .ds-val {
    font-size: 20px;
    font-weight: 800;
}

.detail-stat .ds-lbl {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* ── Analytics Grid ──────────────────────────────────────── */
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ── Checkbox styling ────────────────────────────────────── */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}

/* ── Lethe Table Inline Inputs ───────────────────────────── */
.codes-table input.form-input {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 6px;
}

/* ── API Keys Page (shared with apikeys.html) ────────────── */
.apikeys-container {
    min-height: 100vh;
    background: var(--bg-primary);
    padding: 40px 24px;
    font-family: 'Inter', sans-serif;
}

.apikeys-header {
    max-width: 860px;
    margin: 0 auto 32px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.apikeys-header-icon {
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, #E23636, #3B6FD4);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(226, 54, 54, 0.25);
}

.apikeys-header h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.apikeys-header p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 4px 0 0;
}

.apikeys-owner-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(226, 54, 54, 0.15), rgba(59, 111, 212, 0.15));
    border: 1px solid rgba(226, 54, 54, 0.3);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #ff8a8a;
    margin-left: auto;
}

.apikeys-grid {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.apikeys-section-title {
    max-width: 860px;
    margin: 32px auto 14px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.apikeys-info-banner {
    max-width: 860px;
    margin: 0 auto 32px;
    background: linear-gradient(135deg, rgba(226, 54, 54, 0.06), rgba(59, 111, 212, 0.04));
    border: 1px solid rgba(226, 54, 54, 0.15);
    border-radius: 14px;
    padding: 16px 22px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    font-size: 13px;
    color: #ff8a8a;
    line-height: 1.6;
}

.apikeys-info-banner i {
    margin-top: 3px;
    flex-shrink: 0;
    font-size: 16px;
}

.apikeys-back-link {
    max-width: 860px;
    margin: 0 auto 28px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

.apikeys-back-link:hover {
    color: var(--accent-blue);
}

.key-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 22px 26px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.key-card:hover {
    border-color: rgba(226, 54, 54, 0.2);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.key-card.key-set {
    border-left: 4px solid #57f287;
}

.key-card.key-unset {
    border-left: 4px solid rgba(237,66,69,0.4);
}

.key-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.key-name {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    padding: 5px 12px;
    border-radius: 8px;
}

.key-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 10px;
}

.key-status.set {
    background: rgba(87, 242, 135, 0.12);
    color: #57f287;
}

.key-status.unset {
    background: rgba(237, 66, 69, 0.12);
    color: #ed4245;
}

.key-preview {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

.key-description {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.key-input-row {
    display: flex;
    gap: 10px;
}

.key-input-row input {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.key-input-row input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 111, 212, 0.1);
}

.key-input-row input::placeholder {
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    opacity: 0.6;
}

.btn-save {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-hover));
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(59, 111, 212, 0.25);
}

.btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(59, 111, 212, 0.35);
}

.btn-save:active {
    transform: scale(0.97);
}

.btn-clear {
    background: transparent;
    color: #ed4245;
    border: 1px solid rgba(237, 66, 69, 0.3);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear:hover {
    background: rgba(237, 66, 69, 0.1);
    border-color: rgba(237, 66, 69, 0.5);
}

.spinner-inline {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}

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

.toast-admin {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(.4, 0, .2, 1);
    z-index: 9999;
    backdrop-filter: blur(12px);
}

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

.toast-admin.success {
    border-left: 3px solid #57f287;
    color: #57f287;
}

.toast-admin.error {
    border-left: 3px solid #ed4245;
    color: #ed4245;
}

.loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1200px) {
    .admin-main {
        padding: 28px 28px;
    }

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

@media (max-width: 1024px) {
    .overview-grid {
        grid-template-columns: repeat(3, 1fr);
    }

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

@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }

    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 60px rgba(0,0,0,0.5);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .admin-main {
        margin-left: 0;
        padding: 64px 16px 24px;
    }

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

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

    .guild-toolbar {
        flex-direction: column;
    }

    .guild-toolbar .cases-search {
        width: 100%;
    }

    .form-row {
        flex-direction: column;
    }

    .form-group {
        min-width: unset;
    }

    .page-header h1 {
        font-size: 20px;
    }

    .quick-actions {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .quick-action-btn {
        flex-shrink: 0;
    }

    .pagination-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .modal-dialog {
        width: 95%;
        margin: 10px;
        border-radius: 16px;
    }

    .toast-stack {
        bottom: 14px;
        right: 14px;
        left: 14px;
    }

    .toast-item2 {
        min-width: unset;
    }

    .panel-card {
        padding: 20px;
    }

    .key-input-row {
        flex-direction: column;
    }

    .apikeys-header {
        flex-wrap: wrap;
    }

    .apikeys-owner-badge {
        margin-left: 0;
    }

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

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

    .admin-main {
        padding: 60px 12px 16px;
    }

    .ov-card .ov-val {
        font-size: 24px;
    }
}
