/* AdminLTE 3.2 Custom Theme, Smooth Load Animations & Mobile/Desktop Polish */
:root {
    --nc-primary: #6f42c1;
    --nc-primary-dark: #59359a;
    --nc-primary-soft: rgba(111, 66, 193, 0.12);
    --nc-ok: #16a34a;
    --nc-warn: #d97706;
    --nc-err: #dc2626;
    --nc-border: #dee2e6;
    --nc-muted: #6c757d;
    --nc-subtle: #f4f6f9;
    --nc-card: #ffffff;
    --nc-text: #1f2d3d;
}

body.dark-mode {
    --nc-border: #4b545c;
    --nc-muted: #adb5bd;
    --nc-subtle: #2b3035;
    --nc-card: #343a40;
    --nc-text: #f8f9fa;
    --nc-primary-soft: rgba(139, 92, 246, 0.22);
}

.hidden { display: none !important; }

/* Top Indeterminate Loading Bar */
.top-load-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
    background: rgba(111, 66, 193, 0.15);
    overflow: hidden;
}
.top-load-bar.active { opacity: 1; }
.top-load-bar::after {
    content: "";
    position: absolute;
    top: 0;
    left: -40%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, #6f42c1, #a855f7, #38bdf8);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.75);
    animation: ncIndeterminate 1.05s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes ncIndeterminate {
    0% { left: -40%; width: 35%; }
    50% { left: 35%; width: 55%; }
    100% { left: 100%; width: 35%; }
}

/* Animated Splash Preloader */
.nc-preloader {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: linear-gradient(135deg, #1b1f3a 0%, #2d1b54 55%, #16213e 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #fff;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.nc-preloader.done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.nc-preloader-ring {
    width: 62px;
    height: 62px;
    border-radius: 16px;
    background: linear-gradient(135deg, #7c3aed, #38bdf8);
    display: grid;
    place-items: center;
    font-size: 26px;
    font-weight: 900;
    color: #fff;
    box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.65);
    animation: ncPulseGlow 1.5s ease-in-out infinite;
}
@keyframes ncPulseGlow {
    0% { transform: scale(0.96); box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.65); }
    65% { transform: scale(1.05); box-shadow: 0 0 0 18px rgba(124, 58, 237, 0); }
    100% { transform: scale(0.96); box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); }
}

/* Login Screen Animation */
.nc-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at 18% 20%, rgba(124, 58, 237, 0.25), transparent 45%),
                radial-gradient(circle at 82% 80%, rgba(56, 189, 248, 0.2), transparent 45%),
                linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #111827 100%);
}
.nc-login-box {
    width: 100%;
    max-width: 400px;
    animation: ncFadeUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Page Switch & Card Stagger Animations */
@keyframes ncFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes ncPopIn {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.page-pane.page-enter {
    animation: ncFadeUp 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.page-pane.page-enter .small-box,
.page-pane.page-enter .info-box,
.page-pane.page-enter .card {
    animation: ncFadeUp 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.page-pane.page-enter .row > div:nth-child(2) .small-box,
.page-pane.page-enter .row > div:nth-child(2) .info-box,
.page-pane.page-enter .row > div:nth-child(2) .card { animation-delay: 0.03s; }
.page-pane.page-enter .row > div:nth-child(3) .small-box,
.page-pane.page-enter .row > div:nth-child(3) .info-box { animation-delay: 0.06s; }
.page-pane.page-enter .row > div:nth-child(4) .small-box,
.page-pane.page-enter .row > div:nth-child(4) .info-box { animation-delay: 0.09s; }

/* Smooth Interactive Hover States */
.small-box,
.info-box,
.game-tile-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.small-box:hover,
.info-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.card {
    border-radius: 0.65rem;
    transition: box-shadow 0.2s ease;
}
.btn {
    transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.97); }

/* Sidebar Brand & Nav Polish */
.main-sidebar {
    background: linear-gradient(180deg, #1b1e2f 0%, #141726 100%) !important;
}
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active,
.sidebar-dark-indigo .nav-sidebar > .nav-item > .nav-link.active {
    background: linear-gradient(90deg, #6f42c1, #7c3aed) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
}
.brand-mark-badge {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, #7c3aed, #38bdf8);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    margin-right: 8px;
    font-size: 14px;
}

/* Metrics Ribbon (Scrollable on Mobile) */
.metrics-ribbon {
    background: var(--nc-card);
    border-bottom: 1px solid var(--nc-border);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 12px 18px;
    font-size: 12.5px;
    color: var(--nc-muted);
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}
.metrics-ribbon::-webkit-scrollbar { height: 4px; }
.metrics-ribbon::-webkit-scrollbar-thumb { background: rgba(111, 66, 193, 0.3); border-radius: 4px; }
.ribbon-item { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
.ribbon-item strong { color: var(--nc-text); font-weight: 700; }
.ribbon-palace {
    background: var(--nc-primary-soft);
    color: var(--nc-primary);
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 600;
}
.ribbon-link {
    background: none;
    border: 0;
    color: var(--nc-primary);
    font-weight: 700;
    font-size: 11.5px;
    cursor: pointer;
    padding: 0 3px;
}
.ribbon-link:hover { text-decoration: underline; }

/* Charts */
.chart-svg-wrap { width: 100%; height: 195px; }
.chart-svg-wrap.tall { height: 225px; }
.chart-big {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}
.trend-up { font-size: 12.5px; color: var(--nc-ok); font-weight: 700; }
.trend-down { font-size: 12.5px; color: var(--nc-err); font-weight: 700; }

/* Super Admin Wallet Cards */
.sa-big-num {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.sa-stat-mini {
    background: var(--nc-subtle);
    border: 1px solid var(--nc-border);
    border-radius: 8px;
    padding: 8px 10px;
}
.sa-stat-mini-lbl { font-size: 11px; color: var(--nc-muted); }
.sa-stat-mini-val { font-size: 14px; font-weight: 700; margin-top: 2px; }

/* Test Launch Game Visual Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
    gap: 12px;
}
.game-tile-card {
    background: var(--nc-card);
    border: 1px solid var(--nc-border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.game-tile-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 22px rgba(111, 66, 193, 0.18);
    border-color: var(--nc-primary);
}
.game-tile-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.65);
    font-size: 24px;
}
.game-tile-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.game-tile-body {
    padding: 8px 10px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
}
.game-tile-name {
    font-weight: 700;
    font-size: 12.5px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.game-tile-code {
    font-size: 11px;
    color: var(--nc-muted);
    word-break: break-all;
}
.launch-preview-frame {
    width: 100%;
    height: 520px;
    border: 1px solid var(--nc-border);
    border-radius: 10px;
    background: #0b0f19;
}

/* Custom Modals (CSP safe, smooth pop-in) */
.nc-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1060;
}
.nc-modal-box {
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow-y: auto;
    background: var(--nc-card);
    color: var(--nc-text);
    border: 1px solid var(--nc-border);
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    animation: ncPopIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Animated Toast Notification */
.nc-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    max-width: 380px;
    background: #1f2937;
    color: #fff;
    padding: 12px 16px;
    border-radius: 10px;
    border-left: 4px solid #8b5cf6;
    font-size: 13px;
    font-weight: 500;
    z-index: 9990;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
    animation: ncFadeUp 0.25s ease both;
}

/* Tables & Code */
pre {
    background: var(--nc-subtle);
    border: 1px solid var(--nc-border);
    border-radius: 8px;
    padding: 12px;
    font-size: 12px;
    max-height: 280px;
    overflow: auto;
}
.table td, .table th { vertical-align: middle !important; font-size: 13px; }

/* Mobile & Tablet Responsive Refinements */
@media (max-width: 767.98px) {
    .content-header h1 { font-size: 1.35rem; }
    .sa-big-num { font-size: 22px; }
    .chart-big { font-size: 20px; }
    .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .launch-preview-frame { height: 380px; }
    .nc-toast { left: 14px; right: 14px; bottom: 14px; max-width: none; }
    .navbar .nav-link { padding-left: 0.5rem; padding-right: 0.5rem; }
    .hide-xs { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Official Togel 5D/4D/3D/2D Pasaran Cards (Fast & Regular) */
.tg-wrap { background:#4a4a4f; padding:12px; border-radius:8px; font-family:Arial,Helvetica,sans-serif; color:#f1f1f3; }
.tg-sec { display:flex; justify-content:space-between; align-items:center; padding:6px 9px; margin:0 0 8px;
          background:#16161c; border-left:3px solid #3b82f6; border-radius:4px; font-size:11.5px; font-weight:800; text-transform:uppercase; }
.tg-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(175px,1fr)); gap:8px; margin-bottom:14px; }
.tg-card { border-radius:5px; background:#111115; border:1px solid #353844; overflow:hidden; cursor:pointer;
           display:flex; flex-direction:column; text-decoration:none; color:inherit; transition:border-color .15s, transform .15s; }
.tg-card:hover { border-color:#3b82f6; transform:translateY(-2px); }
.tg-top { background:linear-gradient(180deg,#272932 0%,#1d1f26 100%); border-bottom:1px solid #343844;
          padding:6px 8px; display:flex; align-items:center; justify-content:space-between; gap:5px; }
.tg-name { font-size:10.5px; font-weight:800; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tg-badges { display:inline-flex; align-items:center; gap:4px; flex-shrink:0; }
.tg-type { background:#111115; color:#e4e4e7; font-size:9px; font-weight:800; padding:1px 5px; border-radius:2px; border:1px solid #323540; }
.tg-closed-tag { background:#2b1315; color:#f87171; border:1px solid #5c1f24; font-size:9px; font-weight:800; padding:1px 5px; border-radius:2px; }
.tg-hot { position:relative; display:inline-flex; align-items:center; padding-right:7px; }
.tg-hot-pill { background:linear-gradient(180deg,#dc1414,#990707); color:#fff; font-size:8px; font-weight:900; padding:2px 7px 2px 5px; border-radius:999px; line-height:1; }
.tg-hot-flame { position:absolute; right:0; top:50%; transform:translateY(-54%); width:12px; height:14px; }
.tg-mid { padding:12px 6px; text-align:center; background:#0c0c0f; }
.tg-balls { display:inline-flex; gap:4px; align-items:center; justify-content:center; }
.tg-ball { width:26px; height:26px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center;
           box-shadow:inset -2px -3px 5px rgba(0,0,0,.55),inset 1px 1px 3px rgba(255,255,255,.35),0 2px 4px rgba(0,0,0,.65); }
.tg-ball.d0 { background:radial-gradient(circle at 30% 24%,rgba(255,255,255,.92) 0%,rgba(255,255,255,.28) 20%,transparent 40%),radial-gradient(circle at 36% 32%,#f4f4f5 0%,#cbd5e1 56%,#71717a 100%); border:1px solid rgba(255,255,255,.35); }
.tg-ball.d1 { background:radial-gradient(circle at 30% 24%,rgba(255,255,255,.78) 0%,rgba(255,255,255,.18) 18%,transparent 36%),radial-gradient(circle at 36% 32%,#fde047 0%,#eab308 52%,#854d0e 100%); }
.tg-ball.d2 { background:radial-gradient(circle at 30% 24%,rgba(255,255,255,.74) 0%,rgba(255,255,255,.16) 17%,transparent 34%),radial-gradient(circle at 36% 32%,#3b82f6 0%,#1d4ed8 52%,#172554 100%); }
.tg-ball.d3 { background:radial-gradient(circle at 30% 24%,rgba(255,255,255,.74) 0%,rgba(255,255,255,.16) 17%,transparent 34%),radial-gradient(circle at 36% 32%,#f42424 0%,#cc0808 52%,#6e0000 100%); }
.tg-ball.d4 { background:radial-gradient(circle at 30% 24%,rgba(255,255,255,.74) 0%,rgba(255,255,255,.16) 17%,transparent 34%),radial-gradient(circle at 36% 32%,#a855f7 0%,#7e22ce 52%,#3b0764 100%); }
.tg-ball.d5 { background:radial-gradient(circle at 30% 24%,rgba(255,255,255,.74) 0%,rgba(255,255,255,.16) 17%,transparent 34%),radial-gradient(circle at 36% 32%,#fb923c 0%,#ea580c 52%,#7c2d12 100%); }
.tg-ball.d6 { background:radial-gradient(circle at 30% 24%,rgba(255,255,255,.74) 0%,rgba(255,255,255,.16) 17%,transparent 34%),radial-gradient(circle at 36% 32%,#22c55e 0%,#15803d 52%,#052e16 100%); }
.tg-ball.d7 { background:radial-gradient(circle at 30% 24%,rgba(255,255,255,.66) 0%,rgba(255,255,255,.14) 17%,transparent 34%),radial-gradient(circle at 36% 32%,#9f1239 0%,#6b1022 52%,#3b0612 100%); }
.tg-ball.d8 { background:radial-gradient(circle at 30% 24%,rgba(255,255,255,.48) 0%,rgba(255,255,255,.10) 18%,transparent 36%),radial-gradient(circle at 36% 32%,#3f3f46 0%,#18181b 55%,#050507 100%); border:1px solid #52525b; }
.tg-ball.d9 { background:radial-gradient(circle at 30% 24%,rgba(255,255,255,.76) 0%,rgba(255,255,255,.15) 20%,transparent 40%),linear-gradient(180deg,#f4f4f5 0%,#e4e4e7 23%,#ca8a04 24%,#facc15 50%,#a16207 76%,#d4d4d8 77%,#a1a1aa 100%); }
.tg-ball span { width:14px; height:14px; border-radius:50%; background:#fff; color:#09090b; font-size:10px; font-weight:900;
                display:flex; align-items:center; justify-content:center; }
.tg-ball.black { background:radial-gradient(circle at 38% 34%,#1f1f25 0%,#0d0d11 56%,#050507 100%); border:1px solid #26262f; }
.tg-ball.black span { background:#08080b; border:1px solid #1a1a22; color:#08080b; }
.tg-foot { padding:5px 7px 6px; background:#15151a; border-top:1px solid #26262f; display:flex; flex-direction:column; gap:3px; font-size:10px; }
.tg-foot-row { display:flex; justify-content:space-between; align-items:center; gap:4px; }
.tg-per { color:#9ca3af; font-size:9.5px; font-weight:600; }
.tg-date { color:#e4e4e7; font-size:9.5px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tg-time { color:#36d374; font-size:10.5px; font-weight:800; flex-shrink:0; }
.tg-time.closed { color:#ef5350; }
@media (max-width: 767.98px) {
    .tg-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); }
}

/* Catalog Custom Images & Multi-Category Editor */
.cat-thumb {
    width: 46px;
    height: 36px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--nc-border);
    background: var(--nc-subtle);
    display: block;
}
.cat-thumb-empty {
    width: 46px;
    height: 36px;
    border-radius: 6px;
    border: 1px dashed var(--nc-border);
    background: var(--nc-subtle);
    color: var(--nc-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.cat-logo-thumb {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 5px;
    border: 1px solid var(--nc-border);
    background: var(--nc-subtle);
    flex-shrink: 0;
}
.cat-badge-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}
.cat-multi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: 6px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--nc-border);
    background: var(--nc-subtle);
}
.cat-multi-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 4px 7px;
    border-radius: 6px;
    background: var(--nc-card);
    border: 1px solid var(--nc-border);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.cat-multi-item input[type="checkbox"] {
    margin: 0;
    width: auto;
}
.cat-img-preview {
    max-height: 84px;
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid var(--nc-border);
    object-fit: contain;
    background: var(--nc-subtle);
    padding: 3px;
}
