:root {
    --bg: #0b0f17;
    --panel: #131924;
    --panel-2: #1c2436;
    --panel-3: #242f45;
    --border: #232c3f;
    --border-light: #2e3a52;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #10b981;
    --accent-hover: #34d399;
    --accent-dim: #059669;
    --accent-glow: rgba(16, 185, 129, 0.15);
    --whatsapp: #25d366;
    --danger: #ef4444;
    --danger-dim: rgba(239, 68, 68, 0.12);
    --warn: #f59e0b;
    --info: #38bdf8;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent-hover); }

/* ---------- Layout Shell ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 50;
}

.brand {
    display: flex;
    align-items: center;
    padding: 20px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.015);
    text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-logo-img {
    height: 44px;
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(16, 185, 129, 0.2));
}

.nav {
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
}
.nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}
.nav a .nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: #64748b;
    transition: color 0.2s;
}
.nav a:hover {
    background: var(--panel-2);
    color: var(--text);
    border-color: var(--border);
    text-decoration: none;
}
.nav a:hover .nav-icon {
    color: var(--accent);
}
.nav a.active {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0.04) 100%);
    color: #ffffff;
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.1);
}
.nav a.active .nav-icon {
    color: var(--accent);
}

.sidebar-foot {
    padding: 16px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: rgba(0, 0, 0, 0.15);
}
.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    color: var(--text-muted);
    overflow: hidden;
    max-width: 170px;
}
.user-icon { font-size: 18px; color: var(--accent); flex-shrink: 0; }
.user-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at 80% 0%, rgba(16, 185, 129, 0.03) 0%, transparent 40%), var(--bg);
}

/* ---------- Topbar ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 32px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.topbar-title-wrap h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
}
.topbar-breadcrumb {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.breadcrumb-sep { font-size: 10px; opacity: 0.6; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.content { padding: 24px 32px 40px; flex: 1; }

.foot {
    padding: 16px 32px;
    color: var(--text-muted);
    font-size: 12.5px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
}
.foot-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: gap; gap: 12px; }
.foot-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 11.5px;
    color: var(--whatsapp);
    font-weight: 600;
}

/* ---------- Stat Cards ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}
.stat {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.stat:hover {
    transform: translateY(-2px);
    border-color: var(--border-light);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.stat .lbl {
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 6px;
}
.stat .num {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #ffffff;
    line-height: 1.1;
}
.stat-sub {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}
.stat-sub i { color: var(--accent); }

.stat-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.packs-gradient {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.3) 100%);
    color: var(--accent);
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.stickers-gradient {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2) 0%, rgba(2, 132, 199, 0.3) 100%);
    color: var(--info);
    border: 1px solid rgba(56, 189, 248, 0.3);
}
.downloads-gradient {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.3) 100%);
    color: var(--warn);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ---------- Cards ---------- */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.card-head-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.card-title-icon {
    font-size: 18px;
    color: var(--accent);
}
.card-head h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: -6px -8px; padding: 6px 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--border); }
th {
    color: var(--text-muted);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.15);
}
tr:last-child td { border-bottom: none; }
tbody tr {
    transition: background 0.15s ease;
}
tbody tr:hover { background: var(--panel-2); }

.thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 10px;
    background: var(--panel-2);
    border: 1px solid var(--border-light);
    display: block;
}
.thumb-sm { width: 38px; height: 38px; border-radius: 8px; }
.thumb-lg { width: 72px; height: 72px; border-radius: 12px; }
.thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.pack-title-link {
    color: #ffffff;
    font-weight: 700;
    display: inline-block;
    font-size: 14.5px;
}
.pack-title-link:hover { color: var(--accent); text-decoration: none; }
.pack-publisher-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--panel-2);
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.sticker-count-badge, .downloads-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.sticker-count-badge i { color: var(--info); font-size: 12px; }
.downloads-badge i { color: var(--warn); font-size: 12px; }

/* ---------- Pills / Status Badges ---------- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    background: var(--panel-2);
    border: 1px solid var(--border);
    margin-right: 4px;
}
.pill.on {
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
}
.pill.off {
    color: var(--text-muted);
    background: rgba(148, 163, 184, 0.08);
}
.pill.featured {
    color: #fde047;
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 16px !important;
}
.empty-icon {
    font-size: 42px;
    color: #475569;
    margin-bottom: 12px;
    display: block;
}
.empty-state p {
    color: var(--text-muted);
    margin: 0 0 16px;
    font-size: 14.5px;
}

/* ---------- Forms & Inputs ---------- */
.field { display: block; margin-bottom: 20px; }
.field > span {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 13px;
    color: #e2e8f0;
}
.field-icon { color: var(--accent); font-size: 13px; }
.field .hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
}
.field .hint i { font-size: 11px; opacity: 0.8; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], select, textarea {
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.15s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: #0d121c;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}
.input-with-icon .input-icon {
    position: absolute;
    left: 14px;
    color: #64748b;
    font-size: 14px;
    pointer-events: none;
    transition: color 0.15s;
}
.input-with-icon input {
    padding-left: 40px;
}
.input-with-icon input:focus ~ .input-icon,
.input-with-icon input:focus + .input-icon {
    color: var(--accent);
}

.file-upload-box {
    position: relative;
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.15);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color 0.2s, background 0.2s;
}
.file-upload-box:hover {
    border-color: var(--accent-dim);
    background: rgba(16, 185, 129, 0.03);
}
.upload-box-icon {
    font-size: 20px;
    color: var(--accent);
    flex-shrink: 0;
}
.file-upload-box input[type="file"] {
    border: none;
    background: transparent;
    padding: 0;
    color: var(--text-muted);
    font-size: 13.5px;
    cursor: pointer;
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13.5px;
    user-select: none;
}
.check input {
    width: 17px;
    height: 17px;
    accent-color: var(--accent);
    cursor: pointer;
}
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 0;
}

/* Toggle Switch */
.switch { position: relative; display: inline-block; width: 48px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; inset: 0; cursor: pointer;
    background: var(--panel-3); border: 1px solid var(--border-light);
    border-radius: 999px; transition: .25s ease;
}
.slider:before {
    content: ""; position: absolute; height: 18px; width: 18px;
    left: 3px; top: 3px; background: #94a3b8; border-radius: 50%; transition: .25s ease;
}
.switch input:checked + .slider {
    background: var(--accent-dim);
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}
.switch input:checked + .slider:before { transform: translateX(22px); background: #ffffff; }

.toggle-group {
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 4px 16px;
    margin-bottom: 20px;
}
.toggle-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row .info { flex: 1; }
.toggle-row .info strong { display: flex; align-items: center; gap: 8px; color: #ffffff; font-size: 14px; }
.toggle-row .info small { color: var(--text-muted); font-size: 12.5px; margin-top: 3px; display: block; }
.toggle-icon { font-size: 14px; color: var(--accent); }

.kill {
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--radius);
    padding: 12px 18px;
    margin-bottom: 22px;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.03) 100%);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.1);
}
.kill-title { color: #fca5a5 !important; font-size: 15px !important; }
.kill-title i { color: #ef4444; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--panel-2);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.btn:hover {
    text-decoration: none;
    background: var(--panel-3);
    border-color: #3b4863;
    transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
    border-color: rgba(16, 185, 129, 0.5);
    color: #ffffff;
    box-shadow: 0 2px 12px rgba(16, 185, 129, 0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
    color: #ffffff;
}

.btn-danger {
    background: var(--danger-dim);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}
.btn-danger:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

.btn-edit {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.3);
    color: var(--info);
}
.btn-edit:hover {
    background: rgba(56, 189, 248, 0.2);
    color: #bae6fd;
}

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text-muted);
}
.btn-ghost:hover {
    background: var(--panel-2);
    color: var(--text);
}

.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 6px; }
.btn-block { width: 100%; }
.inline-form { display: inline; }
.form-actions { display: flex; align-items: center; gap: 12px; }

/* ---------- Alerts ---------- */
.alert {
    padding: 13px 18px;
    border-radius: var(--radius-sm);
    margin: 0 32px 18px;
    font-size: 13.5px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.alert-icon { font-size: 17px; margin-top: 2px; flex-shrink: 0; }
.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #a7f3d0;
}
.alert-success .alert-icon { color: var(--accent); }

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}
.alert-error .alert-icon { color: var(--danger); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Sticker Grid (Edit View) ---------- */
.sticker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
    margin-top: 16px;
}
.sticker-cell {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    text-align: center;
    position: relative;
    transition: transform 0.15s, border-color 0.15s;
}
.sticker-cell:hover {
    border-color: var(--accent-dim);
    transform: translateY(-2px);
}
.sticker-img-wrap {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #182030;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sticker-img-wrap img { width: 100%; height: 100%; object-fit: contain; }
.sticker-meta { margin-top: 6px; }
.emoji-tag {
    font-size: 18px;
    display: inline-block;
    padding: 2px 6px;
}
.btn-del-sticker {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.85);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.btn-del-sticker:hover {
    background: #ef4444;
    transform: scale(1.1);
}

.tray-preview-section {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}
.tray-current { flex-shrink: 0; }
.tray-lbl {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.tray-img-wrap { position: relative; display: inline-block; }
.tray-spec {
    display: block;
    font-size: 10.5px;
    color: var(--accent);
    margin-top: 4px;
    text-align: center;
    font-weight: 700;
}
.flex-1 { flex: 1; }

.whatsapp-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(37, 211, 102, 0.1);
    color: var(--whatsapp);
    border: 1px solid rgba(37, 211, 102, 0.3);
    font-size: 12px;
    font-weight: 600;
}
.badge-count {
    font-size: 12.5px;
    color: var(--text-muted);
    background: var(--panel-2);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.pack-quick-stats { display: flex; gap: 8px; }
.stat-pill {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--panel-2);
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.highlight { color: var(--accent); }

/* ---------- Utilities ---------- */
.muted { color: var(--text-muted); }
.mt { margin-top: 20px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

@media (max-width: 900px) {
    .sidebar { display: none; }
    .topbar { padding: 18px 20px 12px; }
    .content { padding: 16px 20px 32px; }
    .row2 { grid-template-columns: 1fr; }
    .tray-preview-section { flex-direction: column; align-items: flex-start; }
}

/* ---------- Login Page ---------- */
.login-body {
    background: #080c14;
}
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at 50% 30%, #0d281a 0%, #080c14 70%);
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.login-brand-header {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.08);
    border-radius: 22px;
    border: 1px solid rgba(16, 185, 129, 0.25);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
}
.login-logo-img {
    width: 60px;
    height: 60px;
}
.login-brand-header h2 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
}
.login-subtitle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}
.badge-zq {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.05em;
}
.login-badge-dot { opacity: 0.4; }
.login-options { margin-bottom: 20px; }
.login-foot {
    text-align: center;
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-muted);
    padding-top: 18px;
    border-top: 1px solid var(--border);
}
.login-foot i { color: var(--accent); margin-right: 4px; }
.login-card .alert { margin: 0 0 20px; }

/* ---------- Pagination Fix ---------- */
.pagination-wrap { margin-top: 24px; }
.custom-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.custom-pagination .page-numbers {
    display: flex;
    align-items: center;
    gap: 6px;
}
.custom-pagination .page-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.15s ease;
    text-decoration: none;
}
.custom-pagination .page-item:hover {
    background: var(--panel-3);
    border-color: var(--accent);
    color: #ffffff;
    transform: translateY(-1px);
}
.custom-pagination .page-item.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
}
.custom-pagination .page-item.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: transparent;
    border-color: var(--border);
}
.custom-pagination .page-item.dots {
    border: none;
    background: transparent;
    color: var(--text-muted);
}
/* Crucial safety guard against any unconstrained Tailwind SVGs */
nav[role="navigation"] svg,
.pagination-wrap svg,
svg.w-5,
svg.h-5 {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    flex-shrink: 0 !important;
}

/* ---------- Preview Button & Modal ---------- */
.btn-preview {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: var(--accent);
}
.btn-preview:hover {
    background: rgba(16, 185, 129, 0.25);
    color: #ffffff;
}
.thumb-clickable {
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.thumb-clickable:hover {
    transform: scale(1.08);
    border-color: var(--accent);
}

.preview-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(3, 7, 18, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInModal 0.2s ease-out;
}
@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}
.preview-modal-dialog {
    background: var(--panel);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 840px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
}
.preview-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}
.preview-modal-title {
    display: flex;
    align-items: center;
    gap: 14px;
}
.preview-modal-title h3 {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    color: #ffffff;
}
.preview-modal-sub {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.btn-modal-close {
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-modal-close:hover {
    background: var(--danger);
    color: #ffffff;
    border-color: var(--danger);
}
.preview-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 250px;
}
.modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 60px 0;
    color: var(--accent);
    font-size: 15px;
    font-weight: 600;
}
.modal-loading i { font-size: 28px; }
.modal-sticker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 14px;
}
.modal-sticker-cell {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px;
    text-align: center;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.modal-sticker-cell:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
.modal-sticker-img-wrap {
    width: 100%;
    aspect-ratio: 1;
    background: #141c2b;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-sticker-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.modal-sticker-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    padding: 0 4px;
}
.modal-emoji { font-size: 16px; }
.modal-idx { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.preview-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
}
.preview-footer-note {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

